Skip to content
Open
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
8 changes: 8 additions & 0 deletions okio/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ kotlin {
optIn("kotlin.contracts.ExperimentalContracts")
}
}
// Some sourceSets do not end with Test, easier to use the negative
matching { !it.name.endsWith("Test") }.all {
// Setting these to allow for backwards compatibility
languageSettings {
apiVersion = "2.0"
languageVersion = "2.0"
}
}
Comment on lines +66 to +73
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// Some sourceSets do not end with Test, easier to use the negative
matching { !it.name.endsWith("Test") }.all {
// Setting these to allow for backwards compatibility
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
}
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

This caused some issues committing to the OkHttp PR

square/okhttp#9040

matching { it.name.endsWith("Test") }.all {
languageSettings {
optIn("kotlin.time.ExperimentalTime")
Expand Down
Loading