Skip to content

Commit 7639233

Browse files
author
Hugo Costa
committed
Set apiVersion and languageVersion to 2.0 to ensure backwards compatibility
1 parent e63f4ba commit 7639233

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,8 @@ subprojects {
189189
tasks.withType<KotlinCompile> {
190190
compilerOptions {
191191
jvmTarget.set(projectJvmTarget)
192+
apiVersion.set(org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0)
193+
languageVersion.set(org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0)
192194
freeCompilerArgs = listOf(
193195
"-Xjvm-default=all",
194196
)

okhttp/api/jvm/okhttp.api

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1240,7 +1240,7 @@ public abstract interface class okhttp3/TrailersSource {
12401240
public static final field Companion Lokhttp3/TrailersSource$Companion;
12411241
public static final field EMPTY Lokhttp3/TrailersSource;
12421242
public abstract fun get ()Lokhttp3/Headers;
1243-
public fun peek ()Lokhttp3/Headers;
1243+
public abstract fun peek ()Lokhttp3/Headers;
12441244
}
12451245

12461246
public final class okhttp3/TrailersSource$Companion {

okhttp/build.gradle.kts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ val generateIdnaMappingTable = tasks.register<JavaExec>("generateIdnaMappingTabl
5050
kotlin {
5151
jvmToolchain(8)
5252

53+
compilerOptions {
54+
apiVersion.set(org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0)
55+
languageVersion.set(org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0)
56+
}
57+
5358
jvm {
5459
}
5560

@@ -284,6 +289,8 @@ afterEvaluate {
284289
// but it's easy enough for us to keep it working. https://github.com/square/okhttp/issues/8826
285290
tasks.withType<KotlinCompile> {
286291
compilerOptions {
292+
apiVersion.set(org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0)
293+
languageVersion.set(org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0)
287294
freeCompilerArgs = listOf("-module-name=okhttp")
288295
}
289296
}

0 commit comments

Comments
 (0)