aboutsummaryrefslogtreecommitdiff
path: root/gradle-plugin/src/test/kotlin/com/google/devtools/ksp/gradle/SourceSetConfigurationsTest.kt
diff options
context:
space:
mode:
Diffstat (limited to 'gradle-plugin/src/test/kotlin/com/google/devtools/ksp/gradle/SourceSetConfigurationsTest.kt')
-rw-r--r--gradle-plugin/src/test/kotlin/com/google/devtools/ksp/gradle/SourceSetConfigurationsTest.kt70
1 files changed, 38 insertions, 32 deletions
diff --git a/gradle-plugin/src/test/kotlin/com/google/devtools/ksp/gradle/SourceSetConfigurationsTest.kt b/gradle-plugin/src/test/kotlin/com/google/devtools/ksp/gradle/SourceSetConfigurationsTest.kt
index b7549301..6ed6dc49 100644
--- a/gradle-plugin/src/test/kotlin/com/google/devtools/ksp/gradle/SourceSetConfigurationsTest.kt
+++ b/gradle-plugin/src/test/kotlin/com/google/devtools/ksp/gradle/SourceSetConfigurationsTest.kt
@@ -76,15 +76,17 @@ class SourceSetConfigurationsTest {
@Test
fun configurationsForMultiplatformApp() {
- testRule.setupAppAsMultiplatformApp("""
- kotlin {
- jvm { }
- android(name = "foo") { }
- js { browser() }
- androidNativeX86 { }
- androidNativeX64(name = "bar") { }
- }
- """.trimIndent())
+ testRule.setupAppAsMultiplatformApp(
+ """
+ kotlin {
+ jvm { }
+ android(name = "foo") { }
+ js { browser() }
+ androidNativeX86 { }
+ androidNativeX64(name = "bar") { }
+ }
+ """.trimIndent()
+ )
testRule.appModule.addMultiplatformSource("commonMain", "Foo.kt", "class Foo")
val result = testRule.runner()
.withArguments(":app:dependencies")
@@ -122,32 +124,36 @@ class SourceSetConfigurationsTest {
// Adding a ksp dependency on jvmParent should not leak into jvmChild compilation,
// even if the source sets depend on each other. This works because we use
// KotlinCompilation.kotlinSourceSets instead of KotlinCompilation.allKotlinSourceSets
- testRule.setupAppAsMultiplatformApp("""
- kotlin {
- jvm("jvmParent") { }
- jvm("jvmChild") { }
- }
- """.trimIndent())
+ testRule.setupAppAsMultiplatformApp(
+ """
+ kotlin {
+ jvm("jvmParent") { }
+ jvm("jvmChild") { }
+ }
+ """.trimIndent()
+ )
testRule.appModule.addMultiplatformSource("commonMain", "Foo.kt", "class Foo")
- testRule.appModule.buildFileAdditions.add("""
- kotlin {
- sourceSets {
- this["jvmChildMain"].dependsOn(this["jvmParentMain"])
+ testRule.appModule.buildFileAdditions.add(
+ """
+ kotlin {
+ sourceSets {
+ this["jvmChildMain"].dependsOn(this["jvmParentMain"])
+ }
}
- }
- dependencies {
- add("kspJvmParent", "androidx.room:room-compiler:2.3.0")
- }
- tasks.register("checkConfigurations") {
- doLast {
- // child has no dependencies, so task is not created.
- val parent = tasks.findByName("kspKotlinJvmParent")
- val child = tasks.findByName("kspKotlinJvmChild")
- require(parent != null)
- require(child == null)
+ dependencies {
+ add("kspJvmParent", "androidx.room:room-compiler:2.3.0")
}
- }
- """.trimIndent())
+ tasks.register("checkConfigurations") {
+ doLast {
+ // child has no dependencies, so task is not created.
+ val parent = tasks.findByName("kspKotlinJvmParent")
+ val child = tasks.findByName("kspKotlinJvmChild")
+ require(parent != null)
+ require(child == null)
+ }
+ }
+ """.trimIndent()
+ )
testRule.runner()
.withArguments(":app:checkConfigurations")
.build()