Skip to content

Commit 348a951

Browse files
authored
Support codespaces (#8347)
* Create devcontainer.json * vs code extensions * simplify * Switch to java image * Check for android * Check for android
1 parent 2b1100e commit 348a951

File tree

3 files changed

+33
-1
lines changed

3 files changed

+33
-1
lines changed

.devcontainer/devcontainer.json

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"image": "mcr.microsoft.com/devcontainers/java:17-bookworm",
3+
"features": {
4+
"ghcr.io/devcontainers/features/java:1": {
5+
"version": "17"
6+
}
7+
},
8+
"customizations": {
9+
"vscode": {
10+
"settings": {
11+
"java.server.launchMode": "Standard"
12+
},
13+
"extensions": [
14+
"vscjava.vscode-java-pack",
15+
"vscjava.vscode-gradle"
16+
]
17+
}
18+
}
19+
}

.vscode/settings.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"java.compile.nullAnalysis.mode": "automatic"
3+
}

settings.gradle.kts

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import java.util.Properties
2+
13
rootProject.name = "okhttp-parent"
24

35
plugins {
@@ -51,7 +53,15 @@ include(":container-tests")
5153

5254
project(":okhttp-logging-interceptor").name = "logging-interceptor"
5355

54-
if (!isKnownBrokenIntelliJ()) {
56+
val androidHome = System.getenv("ANDROID_HOME")
57+
val localProperties = Properties().apply {
58+
val file = File("local.properties")
59+
if (file.exists()) {
60+
load(file.inputStream())
61+
}
62+
}
63+
val sdkDir = localProperties.getProperty("sdk.dir")
64+
if ((androidHome != null || sdkDir != null) && !isKnownBrokenIntelliJ()) {
5565
include(":okhttp-android")
5666
include(":android-test")
5767
include(":android-test-app")

0 commit comments

Comments
 (0)