From d81084f66f6c2a4a8264735f329c7bf40eea4018 Mon Sep 17 00:00:00 2001 From: Pavel Punegov Date: Thu, 1 Jun 2023 12:41:36 +0200 Subject: [PATCH] [K/N][test] Add test for ^KT-58537 --- .../kotlin/gradle/native/GeneralNativeIT.kt | 11 ++++++++++ .../build.gradle.kts | 10 +++++++++ .../gradle.properties | 0 .../module1/build.gradle.kts | 21 +++++++++++++++++++ .../module1/src/commonMain/kotlin/Module1.kt | 8 +++++++ .../module2/build.gradle.kts | 11 ++++++++++ .../module2/src/commonMain/kotlin/Module2.kt | 8 +++++++ .../settings.gradle.kts | 3 +++ 8 files changed, 72 insertions(+) create mode 100644 libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/native-root-project-name-with-space/build.gradle.kts create mode 100644 libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/native-root-project-name-with-space/gradle.properties create mode 100644 libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/native-root-project-name-with-space/module1/build.gradle.kts create mode 100644 libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/native-root-project-name-with-space/module1/src/commonMain/kotlin/Module1.kt create mode 100644 libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/native-root-project-name-with-space/module2/build.gradle.kts create mode 100644 libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/native-root-project-name-with-space/module2/src/commonMain/kotlin/Module2.kt create mode 100644 libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/native-root-project-name-with-space/settings.gradle.kts diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/native/GeneralNativeIT.kt b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/native/GeneralNativeIT.kt index f01edc5c26d..50f61ac3d88 100644 --- a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/native/GeneralNativeIT.kt +++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/native/GeneralNativeIT.kt @@ -1189,6 +1189,17 @@ class GeneralNativeIT : BaseGradleIT() { } } + + // KT-58537 + @Test + @Ignore("Requires update to the newer version with changes") + fun testProjectNameWithSpaces() = with(transformNativeTestProjectWithPluginDsl("native-root-project-name-with-space")) { + build("assemble") { + assertNotContains("Could not find \"Contains\" in") + assertSuccessful() + } + } + companion object { fun List.containsSequentially(vararg elements: String): Boolean { check(elements.isNotEmpty()) diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/native-root-project-name-with-space/build.gradle.kts b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/native-root-project-name-with-space/build.gradle.kts new file mode 100644 index 00000000000..f20fa808430 --- /dev/null +++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/native-root-project-name-with-space/build.gradle.kts @@ -0,0 +1,10 @@ +plugins { + kotlin("multiplatform").version("").apply(false) +} + +allprojects { + repositories { + mavenCentral() + mavenLocal() + } +} diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/native-root-project-name-with-space/gradle.properties b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/native-root-project-name-with-space/gradle.properties new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/native-root-project-name-with-space/module1/build.gradle.kts b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/native-root-project-name-with-space/module1/build.gradle.kts new file mode 100644 index 00000000000..6777d40ae2f --- /dev/null +++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/native-root-project-name-with-space/module1/build.gradle.kts @@ -0,0 +1,21 @@ +plugins { + kotlin("multiplatform") +} + +kotlin { + ("host") { + binaries { + sharedLib { + baseName = "shared" + } + } + } + + sourceSets { + val commonMain by getting { + dependencies { + implementation(project(":module2")) + } + } + } +} \ No newline at end of file diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/native-root-project-name-with-space/module1/src/commonMain/kotlin/Module1.kt b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/native-root-project-name-with-space/module1/src/commonMain/kotlin/Module1.kt new file mode 100644 index 00000000000..c91b6052507 --- /dev/null +++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/native-root-project-name-with-space/module1/src/commonMain/kotlin/Module1.kt @@ -0,0 +1,8 @@ +/* + * Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +fun module1() { + +} diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/native-root-project-name-with-space/module2/build.gradle.kts b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/native-root-project-name-with-space/module2/build.gradle.kts new file mode 100644 index 00000000000..8979fe7462c --- /dev/null +++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/native-root-project-name-with-space/module2/build.gradle.kts @@ -0,0 +1,11 @@ +plugins { + kotlin("multiplatform") +} + +kotlin { + ("host") + + sourceSets { + val commonMain by getting + } +} diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/native-root-project-name-with-space/module2/src/commonMain/kotlin/Module2.kt b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/native-root-project-name-with-space/module2/src/commonMain/kotlin/Module2.kt new file mode 100644 index 00000000000..2ddabc30a6d --- /dev/null +++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/native-root-project-name-with-space/module2/src/commonMain/kotlin/Module2.kt @@ -0,0 +1,8 @@ +/* + * Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +fun module2() { + println("module2/src/commonMain/kotlin/Module2.kt") +} diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/native-root-project-name-with-space/settings.gradle.kts b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/native-root-project-name-with-space/settings.gradle.kts new file mode 100644 index 00000000000..002b5d5972a --- /dev/null +++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/native-root-project-name-with-space/settings.gradle.kts @@ -0,0 +1,3 @@ +rootProject.name = "Contains Space" +include(":module1") +include(":module2")