Skip to content

Commit

Permalink
Set JVM target back to Java 8.
Browse files Browse the repository at this point in the history
Newer AGP is only available with Java 11 variants. Therefore:
* KSP is compiled with older AGP and targeting Java 8.
* Gradle tests and integration tests run with newer AGP.
  • Loading branch information
ting-yuan committed Oct 24, 2024
1 parent c4c9c42 commit 579c9da
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,12 @@ subprojects {
pluginManager.withPlugin("org.jetbrains.kotlin.jvm") {
configure<JavaPluginExtension> {
toolchain.languageVersion.set(compileJavaVersion)
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
configure<KotlinJvmProjectExtension> {
compilerOptions {
jvmTarget = JvmTarget.JVM_11
jvmTarget = JvmTarget.JVM_1_8
languageVersion.set(KotlinVersion.KOTLIN_1_9)
apiVersion.set(languageVersion)
}
Expand Down
1 change: 0 additions & 1 deletion common-deps/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ description = "Kotlin Symbol Processor"
val kotlinBaseVersion: String by project
val junitVersion: String by project
val googleTruthVersion: String by project
val agpBaseVersion: String by project
val signingKey: String? by project
val signingPassword: String? by project

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ object AndroidPluginIntegration {
private fun decorateAndroidExtension(project: Project, onSourceSet: (String) -> Unit) {
val sourceSets = when (val androidExt = project.extensions.getByName("android")) {
is BaseExtension -> androidExt.sourceSets
is CommonExtension<*, *, *, *, *, *> -> androidExt.sourceSets
is CommonExtension<*, *, *, *> -> androidExt.sourceSets
else -> throw RuntimeException("Unsupported Android Gradle plugin version.")
}
sourceSets.all {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ data class TestConfig(
}

val androidBaseVersion by lazy {
kspProjectProperties["agpBaseVersion"] as String
kspProjectProperties["agpTestVersion"] as String
}

val mavenRepoPath = mavenRepoDir.path.replace(File.separatorChar, '/')
Expand Down
3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
org.gradle.jvmargs=-Duser.country=US -Dkotlin.daemon.jvm.options=-Xmx4096m -Dfile.encoding=UTF-8

kotlinBaseVersion=2.1.20-dev-201
agpBaseVersion=8.7.0
agpBaseVersion=7.3.1
agpTestVersion=8.7.1
intellijVersion=233.13135.128
junitVersion=4.13.1
junit5Version=5.8.2
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import kotlin.math.max

val junitVersion: String by project
val kotlinBaseVersion: String by project
val agpBaseVersion: String by project
val agpTestVersion: String by project

plugins {
kotlin("jvm")
Expand All @@ -23,7 +23,7 @@ dependencies {
fun Test.configureCommonSettings() {
systemProperty("kotlinVersion", kotlinBaseVersion)
systemProperty("kspVersion", version)
systemProperty("agpVersion", agpBaseVersion)
systemProperty("agpVersion", agpTestVersion)
jvmArgumentProviders.add(
RelativizingInternalPathProvider(
"testRepo",
Expand Down

0 comments on commit 579c9da

Please sign in to comment.