Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,19 @@ subprojects {
}
}

// Configure all projects' source sets (jvm and kmp)
plugins.matching { it.javaClass.name.startsWith("org.jetbrains.kotlin") }.configureEach {
kotlinExtension.sourceSets {
// Exclude all test source sets (containing Test)
matching { !it.name.contains("Test", ignoreCase = true) }.all {
languageSettings {
apiVersion = "2.0"
languageVersion = "2.0"
}
}
}
}
Comment on lines +198 to +209
Copy link
Contributor

@Goooler Goooler Sep 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Configure all projects' source sets (jvm and kmp)
plugins.matching { it.javaClass.name.startsWith("org.jetbrains.kotlin") }.configureEach {
kotlinExtension.sourceSets {
// Exclude all test source sets (containing Test)
matching { !it.name.contains("Test", ignoreCase = true) }.all {
languageSettings {
apiVersion = "2.0"
languageVersion = "2.0"
}
}
}
}
tasks.withType<KotlinCompile>().configureEach {
if (name.contains("test")) return@configureEach // Skip test source sets.
compilerOptions {
// Pin language level to 2.0 to ensure compatibility with older Gradle versions and other libraries that depend on okhttp.
// https://docs.gradle.org/current/userguide/compatibility.html#kotlin
languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0
apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0
}
}


val platform = System.getProperty("okhttp.platform", "jdk9")
val testJavaVersion = System.getProperty("test.java.version", "21").toInt()

Expand Down
2 changes: 1 addition & 1 deletion okhttp/api/android/okhttp.api
Original file line number Diff line number Diff line change
Expand Up @@ -1241,7 +1241,7 @@ public abstract interface class okhttp3/TrailersSource {
public static final field Companion Lokhttp3/TrailersSource$Companion;
public static final field EMPTY Lokhttp3/TrailersSource;
public abstract fun get ()Lokhttp3/Headers;
public fun peek ()Lokhttp3/Headers;
public abstract fun peek ()Lokhttp3/Headers;
}

public final class okhttp3/TrailersSource$Companion {
Expand Down
2 changes: 1 addition & 1 deletion okhttp/api/jvm/okhttp.api
Original file line number Diff line number Diff line change
Expand Up @@ -1240,7 +1240,7 @@ public abstract interface class okhttp3/TrailersSource {
public static final field Companion Lokhttp3/TrailersSource$Companion;
public static final field EMPTY Lokhttp3/TrailersSource;
public abstract fun get ()Lokhttp3/Headers;
public fun peek ()Lokhttp3/Headers;
public abstract fun peek ()Lokhttp3/Headers;
}

public final class okhttp3/TrailersSource$Companion {
Expand Down
Loading