From 8a5096f4b95ab215e66fda6261458ed9b66d1850 Mon Sep 17 00:00:00 2001 From: Scott Pollom Date: Tue, 10 Sep 2024 23:05:39 -0700 Subject: [PATCH] Support AGP's built-in Kotlin compilation Previously, the sourceSet-specific KSP configurations (e.g., kspTest) weren't being created when AGP's built-in Kotlin compilation was enabled. This change also increases the AGP version from 7.3.0 to 8.7.0-beta01 in order to test against a version of AGP with the built-in Kotlin support. This change also makes several adjustments to compile and run tests against AGP 8.7.0-beta01 (e.g., increasing Gradle version to 8.9, increasing Java source and target compatibility to 11 for the ":gradle-plugin" module, etc). Bug: b/362279380 Test: GradleCompilationTest --- build.gradle.kts | 6 ++++- gradle-plugin/build.gradle.kts | 22 +++++++++++++++- .../ksp/gradle/AndroidPluginIntegration.kt | 2 +- .../devtools/ksp/gradle/KspConfigurations.kt | 18 ++++++++++--- .../ksp/gradle/GradleCompilationTest.kt | 15 +++++++++++ .../gradle/testing/KspIntegrationTestRule.kt | 25 +++++++++++++----- gradle.properties | 2 +- gradle/wrapper/gradle-wrapper.properties | 2 +- integration-tests/build.gradle.kts | 26 ++++++++++++++----- .../devtools/ksp/test/IncrementalCPIT.kt | 20 ++++++++------ .../devtools/ksp/test/KotlinConstsInJavaIT.kt | 5 ++-- .../com/google/devtools/ksp/test/OnErrorIT.kt | 6 +++-- .../android-view-binding/app/build.gradle.kts | 3 ++- .../app/src/main/AndroidManifest.xml | 3 +-- .../workload/build.gradle.kts | 4 +-- .../workload/build.gradle.kts | 4 +-- .../workload/build.gradle.kts | 4 +-- .../application/build.gradle.kts | 7 ++--- .../application/src/main/AndroidManifest.xml | 3 +-- .../workload/build.gradle.kts | 6 ++--- .../workload/src/main/AndroidManifest.xml | 3 +-- .../workload/build.gradle.kts | 7 ++--- .../workload/src/main/AndroidManifest.xml | 3 +-- 23 files changed, 137 insertions(+), 59 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 0b162f118f..15612f9adf 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -123,6 +123,10 @@ subprojects { } tasks.withType().configureEach { - compilerOptions.freeCompilerArgs.add("-Xskip-prerelease-check") + compilerOptions { + freeCompilerArgs.add("-Xskip-prerelease-check") + // This should match JavaCompile's targetCompatibility (above) + jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_1_8) + } } } diff --git a/gradle-plugin/build.gradle.kts b/gradle-plugin/build.gradle.kts index 2536b64e6f..440412c295 100644 --- a/gradle-plugin/build.gradle.kts +++ b/gradle-plugin/build.gradle.kts @@ -10,7 +10,11 @@ val signingKey: String? by project val signingPassword: String? by project tasks.withType { - compilerOptions.freeCompilerArgs.add("-Xjvm-default=all-compatibility") + compilerOptions { + freeCompilerArgs.add("-Xjvm-default=all-compatibility") + // AGP dependency requires JVM_11 here + jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11) + } } plugins { @@ -179,3 +183,19 @@ kotlin { } } } + +tasks.withType().configureEach { + // AGP dependency requires VERSION_11 + sourceCompatibility = JavaVersion.VERSION_11.toString() + targetCompatibility = JavaVersion.VERSION_11.toString() +} + +tasks.withType().configureEach { + // Java 17 is required to run tests with AGP + javaLauncher.set( + javaToolchains.launcherFor { + languageVersion.set(JavaLanguageVersion.of(17)) + } + ) +} + diff --git a/gradle-plugin/src/main/kotlin/com/google/devtools/ksp/gradle/AndroidPluginIntegration.kt b/gradle-plugin/src/main/kotlin/com/google/devtools/ksp/gradle/AndroidPluginIntegration.kt index 8c7a006c53..9647ce6eaa 100644 --- a/gradle-plugin/src/main/kotlin/com/google/devtools/ksp/gradle/AndroidPluginIntegration.kt +++ b/gradle-plugin/src/main/kotlin/com/google/devtools/ksp/gradle/AndroidPluginIntegration.kt @@ -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 { diff --git a/gradle-plugin/src/main/kotlin/com/google/devtools/ksp/gradle/KspConfigurations.kt b/gradle-plugin/src/main/kotlin/com/google/devtools/ksp/gradle/KspConfigurations.kt index 2d437af511..accae7409e 100644 --- a/gradle-plugin/src/main/kotlin/com/google/devtools/ksp/gradle/KspConfigurations.kt +++ b/gradle-plugin/src/main/kotlin/com/google/devtools/ksp/gradle/KspConfigurations.kt @@ -48,14 +48,14 @@ class KspConfigurations(private val project: Project) { } } - private fun getAndroidConfigurationName(target: KotlinTarget, sourceSet: String): String { + private fun getAndroidConfigurationName(kotlinTargetName: String, sourceSet: String): String { val isMain = sourceSet.endsWith("main", ignoreCase = true) val nameWithoutMain = when { isMain -> sourceSet.substring(0, sourceSet.length - 4) else -> sourceSet } // Note: on single-platform, target name is conveniently set to "". - return configurationNameOf(PREFIX, target.name, nameWithoutMain) + return configurationNameOf(PREFIX, kotlinTargetName, nameWithoutMain) } private fun getKotlinConfigurationName(compilation: KotlinCompilation<*>, sourceSet: KotlinSourceSet): String { @@ -86,6 +86,16 @@ class KspConfigurations(private val project: Project) { // 1.6.0: decorateKotlinProject(project.kotlinExtension)? decorateKotlinProject(project.extensions.getByName("kotlin") as KotlinProjectExtension, project) } + // Create sourceSet-specific KSP configurations for the case when the KotlinBaseApiPlugin is applied instead + // of the KotlinBasePluginWrapper (e.g., when AGP's built-in Kotlin support is enabled). + project.plugins.withType(KotlinBaseApiPlugin::class.java) { + AndroidPluginIntegration.forEachAndroidSourceSet(project) { sourceSet -> + createConfiguration( + name = getAndroidConfigurationName(kotlinTargetName = "", sourceSet), + readableSetName = "$sourceSet (Android)" + ) + } + } } private fun decorateKotlinProject(kotlin: KotlinProjectExtension, project: Project) { @@ -127,7 +137,7 @@ class KspConfigurations(private val project: Project) { if (target.platformType == KotlinPlatformType.androidJvm) { AndroidPluginIntegration.forEachAndroidSourceSet(target.project) { sourceSet -> createConfiguration( - name = getAndroidConfigurationName(target, sourceSet), + name = getAndroidConfigurationName(target.name, sourceSet), readableSetName = "$sourceSet (Android)" ) } @@ -164,7 +174,7 @@ class KspConfigurations(private val project: Project) { if (compilation.platformType == KotlinPlatformType.androidJvm) { compilation as KotlinJvmAndroidCompilation AndroidPluginIntegration.getCompilationSourceSets(compilation).mapTo(results) { - getAndroidConfigurationName(compilation.target, it) + getAndroidConfigurationName(compilation.target.name, it) } } diff --git a/gradle-plugin/src/test/kotlin/com/google/devtools/ksp/gradle/GradleCompilationTest.kt b/gradle-plugin/src/test/kotlin/com/google/devtools/ksp/gradle/GradleCompilationTest.kt index 30639f95cd..915e2d3574 100644 --- a/gradle-plugin/src/test/kotlin/com/google/devtools/ksp/gradle/GradleCompilationTest.kt +++ b/gradle-plugin/src/test/kotlin/com/google/devtools/ksp/gradle/GradleCompilationTest.kt @@ -387,4 +387,19 @@ class GradleCompilationTest { assertThat(result.output).contains("HAS LIBRARY: ") assertThat(result.output).doesNotContain("app/build/generated/ksp/main/classes") } + + /** + * Regression test for b/362279380 + */ + @Test + fun androidGradlePluginBuiltInKotlin() { + testRule.setupAppAsAndroidApp(enableAgpBuiltInKotlinSupport = true) + testRule.appModule.dependencies.addAll( + listOf( + artifact(configuration = "ksp", "androidx.room:room-compiler:2.4.2"), + artifact(configuration = "kspTest", "androidx.room:room-compiler:2.4.2") + ) + ) + testRule.runner().withDebug(true).withArguments(":app:assembleDebug").build() + } } diff --git a/gradle-plugin/src/test/kotlin/com/google/devtools/ksp/gradle/testing/KspIntegrationTestRule.kt b/gradle-plugin/src/test/kotlin/com/google/devtools/ksp/gradle/testing/KspIntegrationTestRule.kt index 088fa89b36..01d32ccbf8 100644 --- a/gradle-plugin/src/test/kotlin/com/google/devtools/ksp/gradle/testing/KspIntegrationTestRule.kt +++ b/gradle-plugin/src/test/kotlin/com/google/devtools/ksp/gradle/testing/KspIntegrationTestRule.kt @@ -92,16 +92,23 @@ class KspIntegrationTestRule( /** * Sets up the app module as an android app, adding necessary plugin dependencies, a manifest - * file and necessary gradle configuration. + * file and necessary gradle configuration. If [enableAgpBuiltInKotlinSupport] is true, enable AGP's built-in Kotlin + * support instead of applying the Kotlin Android Gradle plugin. */ - fun setupAppAsAndroidApp() { + fun setupAppAsAndroidApp(enableAgpBuiltInKotlinSupport: Boolean = false) { testProject.appModule.plugins.addAll( listOf( PluginDeclaration.id("com.android.application", testConfig.androidBaseVersion), - PluginDeclaration.kotlin("android", testConfig.kotlinBaseVersion), PluginDeclaration.id("com.google.devtools.ksp", testConfig.kspVersion) ) ) + if (enableAgpBuiltInKotlinSupport) { + testProject.appModule + .plugins + .add(PluginDeclaration.id("com.android.experimental.built-in-kotlin", testConfig.androidBaseVersion)) + } else { + testProject.appModule.plugins.add(PluginDeclaration.kotlin("android", testConfig.kotlinBaseVersion)) + } addAndroidBoilerplate() } @@ -125,11 +132,16 @@ class KspIntegrationTestRule( testProject.appModule.buildFileAdditions.add( """ android { - compileSdkVersion(31) + namespace = "com.example.kspandroidtestapp" + compileSdk = 31 defaultConfig { - minSdkVersion(24) + minSdk = 24 } } + + dependencies { + implementation("org.jetbrains.kotlin:kotlin-stdlib:${testConfig.kotlinBaseVersion}") + } """.trimIndent() ) testProject.appModule.moduleRoot.resolve("src/main/AndroidManifest.xml") @@ -138,8 +150,7 @@ class KspIntegrationTestRule( }.writeText( """ - + """.trimIndent() ) diff --git a/gradle.properties b/gradle.properties index 13514fbe97..8ab252c3cc 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,7 +2,7 @@ org.gradle.jvmargs=-Duser.country=US -Dkotlin.daemon.jvm.options=-Xmx4096m -Dfile.encoding=UTF-8 kotlinBaseVersion=2.1.0-dev-5441 -agpBaseVersion=7.3.1 +agpBaseVersion=8.7.0-beta01 intellijVersion=233.13135.103 junitVersion=4.13.1 junit5Version=5.8.2 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 068cdb2dc2..19cfad969b 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/integration-tests/build.gradle.kts b/integration-tests/build.gradle.kts index c549826c9e..87e29a5230 100644 --- a/integration-tests/build.gradle.kts +++ b/integration-tests/build.gradle.kts @@ -1,4 +1,5 @@ import com.google.devtools.ksp.RelativizingInternalPathProvider +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile import kotlin.math.max val junitVersion: String by project @@ -20,7 +21,7 @@ dependencies { testImplementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.3") } -tasks.withType { +tasks.withType().configureEach { maxParallelForks = max(1, Runtime.getRuntime().availableProcessors() / 2) systemProperty("kotlinVersion", kotlinBaseVersion) systemProperty("kspVersion", version) @@ -33,12 +34,23 @@ tasks.withType { dependsOn(":symbol-processing-cmdline:publishAllPublicationsToTestRepository") dependsOn(":symbol-processing-aa-embeddable:publishAllPublicationsToTestRepository") - // JDK_9 environment property is required. - // To add a custom location (if not detected automatically) follow https://docs.gradle.org/current/userguide/toolchains.html#sec:custom_loc - if (System.getenv("JDK_9") == null) { - val launcher9 = javaToolchains.launcherFor { - languageVersion.set(JavaLanguageVersion.of(9)) + // Java 17 is required to run tests with AGP + javaLauncher.set( + javaToolchains.launcherFor { + languageVersion.set(JavaLanguageVersion.of(17)) } - environment["JDK_9"] = launcher9.map { it.metadata.installationPath } + ) +} + +tasks.withType().configureEach { + // ":gradle-plugin" dependency requires VERSION_11 + sourceCompatibility = JavaVersion.VERSION_11.toString() + targetCompatibility = JavaVersion.VERSION_11.toString() +} + +tasks.withType { + compilerOptions { + // ":gradle-plugin" dependency requires JVM_11 here + jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11) } } diff --git a/integration-tests/src/test/kotlin/com/google/devtools/ksp/test/IncrementalCPIT.kt b/integration-tests/src/test/kotlin/com/google/devtools/ksp/test/IncrementalCPIT.kt index 4044d5f38e..f68f267bd5 100644 --- a/integration-tests/src/test/kotlin/com/google/devtools/ksp/test/IncrementalCPIT.kt +++ b/integration-tests/src/test/kotlin/com/google/devtools/ksp/test/IncrementalCPIT.kt @@ -3,6 +3,7 @@ package com.google.devtools.ksp.test import org.gradle.testkit.runner.GradleRunner import org.gradle.testkit.runner.TaskOutcome import org.junit.Assert +import org.junit.Ignore import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith @@ -87,14 +88,15 @@ class IncrementalCPIT(val useKSP2: Boolean) { fun testCPChangesForFunctions() { val gradleRunner = GradleRunner.create().withProjectDir(project.root) - gradleRunner.withArguments("clean", "assemble").build().let { result -> + // Disabling configuration cache. See https://github.com/google/ksp/issues/299 for details + gradleRunner.withArguments("clean", "assemble", "--no-configuration-cache").build().let { result -> Assert.assertEquals(TaskOutcome.SUCCESS, result.task(":workload:assemble")?.outcome) } // Dummy changes func2Dirty.forEach { (src, _) -> File(project.root, src).appendText("\n\n") - gradleRunner.withArguments("assemble").build().let { result -> + gradleRunner.withArguments("assemble", "--no-configuration-cache").build().let { result -> // Trivial changes should not result in re-processing. Assert.assertEquals(TaskOutcome.UP_TO_DATE, result.task(":workload:kspKotlin")?.outcome) } @@ -103,7 +105,7 @@ class IncrementalCPIT(val useKSP2: Boolean) { // Value changes func2Dirty.forEach { (src, _) -> File(project.root, src).writeText("package p1\n\nfun MyTopFunc1(): Int = 1") - gradleRunner.withArguments("assemble").withDebug(true).build().let { result -> + gradleRunner.withArguments("assemble", "--no-configuration-cache").withDebug(true).build().let { result -> // Value changes should not result in re-processing. Assert.assertEquals(TaskOutcome.SUCCESS, result.task(":workload:kspKotlin")?.outcome) val dirties = result.output.lines().filter { it.startsWith("w: [ksp]") }.toSet() @@ -115,7 +117,7 @@ class IncrementalCPIT(val useKSP2: Boolean) { // Signature changes func2Dirty.forEach { (src, expectedDirties) -> File(project.root, src).writeText("package p1\n\nfun MyTopFunc1(): Double = 1.0") - gradleRunner.withArguments("assemble").build().let { result -> + gradleRunner.withArguments("assemble", "--no-configuration-cache").build().let { result -> Assert.assertEquals(TaskOutcome.SUCCESS, result.task(":workload:kspKotlin")?.outcome) val dirties = result.output.lines().filter { it.startsWith("w: [ksp]") }.toSet() Assert.assertEquals(expectedDirties, dirties) @@ -133,14 +135,15 @@ class IncrementalCPIT(val useKSP2: Boolean) { fun testCPChangesForProperties() { val gradleRunner = GradleRunner.create().withProjectDir(project.root) - gradleRunner.withArguments("clean", "assemble").build().let { result -> + // Disabling configuration cache. See https://github.com/google/ksp/issues/299 for details + gradleRunner.withArguments("clean", "assemble", "--no-configuration-cache").build().let { result -> Assert.assertEquals(TaskOutcome.SUCCESS, result.task(":workload:assemble")?.outcome) } // Dummy changes prop2Dirty.forEach { (src, _) -> File(project.root, src).appendText("\n\n") - gradleRunner.withArguments("assemble").build().let { result -> + gradleRunner.withArguments("assemble", "--no-configuration-cache").build().let { result -> // Trivial changes should not result in re-processing. Assert.assertEquals(TaskOutcome.UP_TO_DATE, result.task(":workload:kspKotlin")?.outcome) } @@ -149,7 +152,7 @@ class IncrementalCPIT(val useKSP2: Boolean) { // Value changes prop2Dirty.forEach { (src, _) -> File(project.root, src).writeText("package p1\n\nval MyTopProp1: Int = 1") - gradleRunner.withArguments("assemble").withDebug(true).build().let { result -> + gradleRunner.withArguments("assemble", "--no-configuration-cache").withDebug(true).build().let { result -> // Value changes should not result in re-processing. Assert.assertEquals(TaskOutcome.SUCCESS, result.task(":workload:kspKotlin")?.outcome) val dirties = result.output.lines().filter { it.startsWith("w: [ksp]") }.toSet() @@ -161,7 +164,7 @@ class IncrementalCPIT(val useKSP2: Boolean) { // Signature changes prop2Dirty.forEach { (src, expectedDirties) -> File(project.root, src).writeText("package p1\n\nval MyTopProp1: Double = 1.0") - gradleRunner.withArguments("assemble").build().let { result -> + gradleRunner.withArguments("assemble", "--no-configuration-cache").build().let { result -> Assert.assertEquals(TaskOutcome.SUCCESS, result.task(":workload:kspKotlin")?.outcome) val dirties = result.output.lines().filter { it.startsWith("w: [ksp]") }.toSet() Assert.assertEquals(expectedDirties, dirties) @@ -218,6 +221,7 @@ class IncrementalCPIT(val useKSP2: Boolean) { toggleFlags("--no-configuration-cache") } + @Ignore("https://github.com/google/ksp/issues/299") @Test fun toggleIncrementalFlagsWithConfigurationCache() { toggleFlags("--configuration-cache") diff --git a/integration-tests/src/test/kotlin/com/google/devtools/ksp/test/KotlinConstsInJavaIT.kt b/integration-tests/src/test/kotlin/com/google/devtools/ksp/test/KotlinConstsInJavaIT.kt index 1b406d6530..d6d39392ad 100644 --- a/integration-tests/src/test/kotlin/com/google/devtools/ksp/test/KotlinConstsInJavaIT.kt +++ b/integration-tests/src/test/kotlin/com/google/devtools/ksp/test/KotlinConstsInJavaIT.kt @@ -37,10 +37,11 @@ class KotlinConstsInJavaIT(useKSP2: Boolean) { // FIXME: `clean` fails to delete files on windows. Assume.assumeFalse(System.getProperty("os.name").startsWith("Windows", ignoreCase = true)) val gradleRunner = GradleRunner.create().withProjectDir(project.root).withDebug(true) - gradleRunner.buildAndCheck(":workload:kspKotlin") + // Disabling configuration cache. See https://github.com/google/ksp/issues/299 for details + gradleRunner.buildAndCheck(":workload:kspKotlin", "--no-configuration-cache") File(project.root, "workload/src/main/java/com/example/JavaClass.java").appendText("\n") - gradleRunner.buildAndCheck(":workload:kspKotlin") + gradleRunner.buildAndCheck(":workload:kspKotlin", "--no-configuration-cache") } companion object { diff --git a/integration-tests/src/test/kotlin/com/google/devtools/ksp/test/OnErrorIT.kt b/integration-tests/src/test/kotlin/com/google/devtools/ksp/test/OnErrorIT.kt index d71f39fe34..d774f36f26 100644 --- a/integration-tests/src/test/kotlin/com/google/devtools/ksp/test/OnErrorIT.kt +++ b/integration-tests/src/test/kotlin/com/google/devtools/ksp/test/OnErrorIT.kt @@ -80,7 +80,8 @@ class OnErrorIT(useKSP2: Boolean) { val gradleRunner = GradleRunner.create().withProjectDir(project.root).withDebug(true) File(project.root, "workload/build.gradle.kts").appendText("\nksp { arg(\"exception\", \"createTwice\") }\n") - gradleRunner.withArguments("clean", "assemble").buildAndFail().let { result -> + // Disabling configuration cache. See https://github.com/google/ksp/issues/299 for details + gradleRunner.withArguments("clean", "assemble", "--no-configuration-cache").buildAndFail().let { result -> val errors = result.output.lines().filter { it.startsWith("e: [ksp]") } Assert.assertTrue( @@ -100,7 +101,8 @@ class OnErrorIT(useKSP2: Boolean) { File(project.root, "workload/build.gradle.kts").appendText("\nksp { arg(\"exception\", \"createTwice\") }\n") File(project.root, "gradle.properties").appendText("\nksp.return.ok.on.error=false") - gradleRunner.withArguments("clean", "assemble").buildAndFail().let { result -> + // Disabling configuration cache. See https://github.com/google/ksp/issues/299 for details + gradleRunner.withArguments("clean", "assemble", "--no-configuration-cache").buildAndFail().let { result -> val errors = result.output.lines().filter { it.startsWith("e: [ksp]") } Assert.assertTrue( diff --git a/integration-tests/src/test/resources/android-view-binding/app/build.gradle.kts b/integration-tests/src/test/resources/android-view-binding/app/build.gradle.kts index 63d60babed..c3c6cd4f35 100644 --- a/integration-tests/src/test/resources/android-view-binding/app/build.gradle.kts +++ b/integration-tests/src/test/resources/android-view-binding/app/build.gradle.kts @@ -10,8 +10,9 @@ dependencies { implementation("androidx.appcompat:appcompat:1.6.1") } android { + namespace = "com.example.kspandroidtestapp" defaultConfig { - minSdkVersion(24) + minSdk = 24 } compileSdk = 34 buildFeatures { diff --git a/integration-tests/src/test/resources/android-view-binding/app/src/main/AndroidManifest.xml b/integration-tests/src/test/resources/android-view-binding/app/src/main/AndroidManifest.xml index 831aa9affb..69fc412909 100644 --- a/integration-tests/src/test/resources/android-view-binding/app/src/main/AndroidManifest.xml +++ b/integration-tests/src/test/resources/android-view-binding/app/src/main/AndroidManifest.xml @@ -1,4 +1,3 @@ - + \ No newline at end of file diff --git a/integration-tests/src/test/resources/incremental-multi-chain/workload/build.gradle.kts b/integration-tests/src/test/resources/incremental-multi-chain/workload/build.gradle.kts index 2f6a0fc5e0..e05d7fc9b0 100644 --- a/integration-tests/src/test/resources/incremental-multi-chain/workload/build.gradle.kts +++ b/integration-tests/src/test/resources/incremental-multi-chain/workload/build.gradle.kts @@ -19,6 +19,6 @@ dependencies { ksp(project(":processors")) } -application { - mainClassName = "MainKt" +tasks.named("run") { + mainClass.set("MainKt") } diff --git a/integration-tests/src/test/resources/incremental-removal/workload/build.gradle.kts b/integration-tests/src/test/resources/incremental-removal/workload/build.gradle.kts index caa2c8c2e0..fd3568d200 100644 --- a/integration-tests/src/test/resources/incremental-removal/workload/build.gradle.kts +++ b/integration-tests/src/test/resources/incremental-removal/workload/build.gradle.kts @@ -22,6 +22,6 @@ dependencies { kspTest(project(":validator")) } -application { - mainClassName = "p1.MainKt" +tasks.named("run") { + mainClass.set("p1.MainKt") } diff --git a/integration-tests/src/test/resources/incremental-removal2/workload/build.gradle.kts b/integration-tests/src/test/resources/incremental-removal2/workload/build.gradle.kts index caa2c8c2e0..fd3568d200 100644 --- a/integration-tests/src/test/resources/incremental-removal2/workload/build.gradle.kts +++ b/integration-tests/src/test/resources/incremental-removal2/workload/build.gradle.kts @@ -22,6 +22,6 @@ dependencies { kspTest(project(":validator")) } -application { - mainClassName = "p1.MainKt" +tasks.named("run") { + mainClass.set("p1.MainKt") } diff --git a/integration-tests/src/test/resources/playground-android-multi/application/build.gradle.kts b/integration-tests/src/test/resources/playground-android-multi/application/build.gradle.kts index dfde8c6c5d..3db13abd95 100644 --- a/integration-tests/src/test/resources/playground-android-multi/application/build.gradle.kts +++ b/integration-tests/src/test/resources/playground-android-multi/application/build.gradle.kts @@ -19,11 +19,12 @@ dependencies { } android { - compileSdkVersion(34) + namespace = "com.example.myapplication" + compileSdk = 34 defaultConfig { applicationId = "org.gradle.kotlin.dsl.samples.androidstudio" - minSdkVersion(34) - targetSdkVersion(34) + minSdk = 34 + targetSdk = 34 versionCode = 1 versionName = "1.0" } diff --git a/integration-tests/src/test/resources/playground-android-multi/application/src/main/AndroidManifest.xml b/integration-tests/src/test/resources/playground-android-multi/application/src/main/AndroidManifest.xml index 81a4ba30d7..69fc412909 100644 --- a/integration-tests/src/test/resources/playground-android-multi/application/src/main/AndroidManifest.xml +++ b/integration-tests/src/test/resources/playground-android-multi/application/src/main/AndroidManifest.xml @@ -1,4 +1,3 @@ - + \ No newline at end of file diff --git a/integration-tests/src/test/resources/playground-android-multi/workload/build.gradle.kts b/integration-tests/src/test/resources/playground-android-multi/workload/build.gradle.kts index e6c0980213..f4d41f7198 100644 --- a/integration-tests/src/test/resources/playground-android-multi/workload/build.gradle.kts +++ b/integration-tests/src/test/resources/playground-android-multi/workload/build.gradle.kts @@ -22,10 +22,10 @@ dependencies { } android { - compileSdkVersion(34) + namespace = "com.example.mylibrary" + compileSdk = 34 defaultConfig { - minSdkVersion(34) - targetSdkVersion(34) + minSdk = 34 } } diff --git a/integration-tests/src/test/resources/playground-android-multi/workload/src/main/AndroidManifest.xml b/integration-tests/src/test/resources/playground-android-multi/workload/src/main/AndroidManifest.xml index 522bce61b2..69fc412909 100644 --- a/integration-tests/src/test/resources/playground-android-multi/workload/src/main/AndroidManifest.xml +++ b/integration-tests/src/test/resources/playground-android-multi/workload/src/main/AndroidManifest.xml @@ -1,4 +1,3 @@ - + \ No newline at end of file diff --git a/integration-tests/src/test/resources/playground-android/workload/build.gradle.kts b/integration-tests/src/test/resources/playground-android/workload/build.gradle.kts index 1a44d31299..f6874ac1e3 100644 --- a/integration-tests/src/test/resources/playground-android/workload/build.gradle.kts +++ b/integration-tests/src/test/resources/playground-android/workload/build.gradle.kts @@ -22,11 +22,12 @@ dependencies { } android { - compileSdkVersion(34) + namespace = "com.example.myapplication" + compileSdk = 34 defaultConfig { applicationId = "org.gradle.kotlin.dsl.samples.androidstudio" - minSdkVersion(34) - targetSdkVersion(34) + minSdk = 34 + targetSdk = 34 versionCode = 1 versionName = "1.0" } diff --git a/integration-tests/src/test/resources/playground-android/workload/src/main/AndroidManifest.xml b/integration-tests/src/test/resources/playground-android/workload/src/main/AndroidManifest.xml index 81a4ba30d7..69fc412909 100644 --- a/integration-tests/src/test/resources/playground-android/workload/src/main/AndroidManifest.xml +++ b/integration-tests/src/test/resources/playground-android/workload/src/main/AndroidManifest.xml @@ -1,4 +1,3 @@ - + \ No newline at end of file