Skip to content
Merged
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
1 change: 1 addition & 0 deletions build-logic/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ dependencies {
implementation(libs.gradlePlugin.graalvm)
implementation(libs.gradlePlugin.ksp)
implementation(libs.gradlePlugin.mrjar)
implementation(libs.gradlePlugin.tapmoc)
implementation(libs.androidx.lint.gradle)
implementation(libs.kotlin.gradle.plugin.api)
}
16 changes: 13 additions & 3 deletions build-logic/src/main/kotlin/okhttp.jvm-conventions.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import kotlinx.validation.ApiValidationExtension
import org.gradle.api.artifacts.VersionCatalogsExtension
import okhttp3.buildsupport.testJavaVersion
import tapmoc.TapmocExtension
import tapmoc.configureKotlinCompatibility

plugins {
id("okhttp.base-conventions")
id("com.gradleup.tapmoc")
}

val libs = extensions.getByType<VersionCatalogsExtension>().named("libs")
Expand All @@ -21,6 +21,11 @@ extensions.configure<JavaPluginExtension> {
}
}

// Introduce in a separate change
//configureJavaCompatibility(javaVersion = 8)

configureKotlinCompatibility(version = version("kotlinCoreLibrariesVersion"))

tasks.withType<JavaCompile> {
options.encoding = Charsets.UTF_8.toString()
if (name.contains("Java9")) {
Expand All @@ -41,3 +46,8 @@ tasks.withType<KotlinCompile> {
)
}
}

extensions.configure<TapmocExtension> {
// Fail the build if any api dependency exposes incompatible Kotlin metadata, Kotlin stdlib, or Java bytecode version.
checkDependencies()
}
5 changes: 5 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ startup-runtime = "1.2.0"
testcontainers = "1.21.4"
zstd-kmp-okio = "0.4.0"

# Set to lower version than KGP version to maximize compatibility
# Default to matching okio
kotlinCoreLibrariesVersion = "2.1.21"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is there a reason to define this here rather than at the sole usage site?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Consistency of versions and copying okio setup?


[libraries]
amazon-corretto = { module = "software.amazon.cryptools:AmazonCorrettoCryptoProvider", version.ref = "amazon-corretto" }
androidx-activity = { module = "androidx.activity:activity-ktx", version.ref = "androidx-activity" }
Expand Down Expand Up @@ -151,6 +155,7 @@ gradlePlugin-mavenPublish = { module = "com.vanniktech:gradle-maven-publish-plug
gradlePlugin-mrjar = { module = "me.champeau.mrjar:me.champeau.mrjar.gradle.plugin", version.ref = "mrjar" }
gradlePlugin-shadow = { module = "com.gradleup.shadow:shadow-gradle-plugin", version.ref = "shadow-plugin" }
gradlePlugin-spotless = { module = "com.diffplug.spotless:spotless-plugin-gradle", version.ref = "spotless-plugin" }
gradlePlugin-tapmoc = { module = "com.gradleup.tapmoc:com.gradleup.tapmoc.gradle.plugin", version = "0.4.0"}

[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }
Expand Down
Loading