diff options
author | Mattia Iavarone <mat.iavarone@gmail.com> | 2021-09-24 12:52:51 +0200 |
---|---|---|
committer | laszio <ting-yuan@users.noreply.github.com> | 2021-10-01 16:27:38 -0700 |
commit | c7a829366c1d8f970dd03a75564f5f198699f160 (patch) | |
tree | 689fa7793287071fdeb40f165e4937f69c6549b2 /gradle-plugin | |
parent | d1e2aae20ce1127bb7cacde40ccbe2db509d80fa (diff) | |
download | ksp-c7a829366c1d8f970dd03a75564f5f198699f160.tar.gz |
Pass single string to setupAppAsMultiplatformApp
Diffstat (limited to 'gradle-plugin')
2 files changed, 11 insertions, 15 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 5ca7d779..9fe2b2c7 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 @@ -74,13 +74,15 @@ class SourceSetConfigurationsTest { @Test fun configurationsForMultiplatformApp() { - testRule.setupAppAsMultiplatformApp( - "jvm { }", - "android(name = \"foo\") { }", - "js { browser() }", - "androidNativeX86 { }", - "androidNativeX64(name = \"bar\") { }", - ) + 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") 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 68d75d11..fdc64d57 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 @@ -108,7 +108,7 @@ class KspIntegrationTestRule( /** * Sets up the app module as a multiplatform app with the specified [targets], wrapped in a kotlin { } block. */ - fun setupAppAsMultiplatformApp(vararg targets: String) { + fun setupAppAsMultiplatformApp(targets: String) { testProject.appModule.plugins.addAll( listOf( PluginDeclaration.id("com.android.application", testConfig.androidBaseVersion), @@ -116,13 +116,7 @@ class KspIntegrationTestRule( PluginDeclaration.id("com.google.devtools.ksp", testConfig.kspVersion) ) ) - testProject.appModule.buildFileAdditions.add( - """ - kotlin { - ${targets.joinToString(separator = "\n") { it.trimIndent() } } - } - """.trimIndent() - ) + testProject.appModule.buildFileAdditions.add(targets) addAndroidBoilerplate() } |