diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/SubpluginsIT.kt b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/SubpluginsIT.kt index f077a4047f8..368201eb8a7 100644 --- a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/SubpluginsIT.kt +++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/SubpluginsIT.kt @@ -122,4 +122,13 @@ class SubpluginsIT : BaseGradleIT() { assertFileExists("${kotlinClassesDir("app", "main")}World_greet.class") } } + + @Test + fun testAllOpenFromNestedBuildscript() { + Project("allOpenFromNestedBuildscript").build("build") { + assertSuccessful() + assertFileExists("${kotlinClassesDir(subproject = "a/b", sourceSet = "main")}MyClass.class") + assertFileExists("${kotlinClassesDir(subproject = "a/b", sourceSet = "test")}MyTestClass.class") + } + } } \ No newline at end of file diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/allOpenFromNestedBuildscript/a/b/build.gradle b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/allOpenFromNestedBuildscript/a/b/build.gradle new file mode 100644 index 00000000000..4676cfddfd8 --- /dev/null +++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/allOpenFromNestedBuildscript/a/b/build.gradle @@ -0,0 +1,15 @@ +apply plugin: "kotlin" +apply plugin: "kotlin-allopen" + +repositories { + mavenLocal() + mavenCentral() +} + +allOpen { + annotation("AllOpen") +} + +dependencies { + compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" +} \ No newline at end of file diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/allOpenFromNestedBuildscript/a/b/src/main/kotlin/MyClass.kt b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/allOpenFromNestedBuildscript/a/b/src/main/kotlin/MyClass.kt new file mode 100644 index 00000000000..8f670a7ac8a --- /dev/null +++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/allOpenFromNestedBuildscript/a/b/src/main/kotlin/MyClass.kt @@ -0,0 +1,9 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +@AllOpen +class MyClass { + fun f() = 0 +} \ No newline at end of file diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/allOpenFromNestedBuildscript/a/b/src/main/kotlin/annotations.kt b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/allOpenFromNestedBuildscript/a/b/src/main/kotlin/annotations.kt new file mode 100644 index 00000000000..f3574cd70a0 --- /dev/null +++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/allOpenFromNestedBuildscript/a/b/src/main/kotlin/annotations.kt @@ -0,0 +1,6 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +annotation class AllOpen \ No newline at end of file diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/allOpenFromNestedBuildscript/a/b/src/test/kotlin/MyTestClass.kt b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/allOpenFromNestedBuildscript/a/b/src/test/kotlin/MyTestClass.kt new file mode 100644 index 00000000000..f55ab2b4d58 --- /dev/null +++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/allOpenFromNestedBuildscript/a/b/src/test/kotlin/MyTestClass.kt @@ -0,0 +1,8 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +class MyTestClass : MyClass() { + override fun f() = 1 +} \ No newline at end of file diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/allOpenFromNestedBuildscript/a/build.gradle b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/allOpenFromNestedBuildscript/a/build.gradle new file mode 100644 index 00000000000..fdcddf269f4 --- /dev/null +++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/allOpenFromNestedBuildscript/a/build.gradle @@ -0,0 +1,9 @@ +buildscript { + repositories { + mavenLocal() + mavenCentral() + } + dependencies { + classpath "org.jetbrains.kotlin:kotlin-allopen:$kotlin_version" + } +} diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/allOpenFromNestedBuildscript/build.gradle b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/allOpenFromNestedBuildscript/build.gradle new file mode 100644 index 00000000000..3d48437609e --- /dev/null +++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/allOpenFromNestedBuildscript/build.gradle @@ -0,0 +1,9 @@ +buildscript { + repositories { + mavenLocal() + mavenCentral() + } + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/allOpenFromNestedBuildscript/settings.gradle b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/allOpenFromNestedBuildscript/settings.gradle new file mode 100644 index 00000000000..7580a1a7432 --- /dev/null +++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/allOpenFromNestedBuildscript/settings.gradle @@ -0,0 +1 @@ +include ':a', ':a:b' \ No newline at end of file