Add test for subplugin in nested buildscript

KT-24653
This commit is contained in:
Alexey Tsvetkov
2018-05-30 03:12:16 +03:00
parent f720501612
commit 6eebcf7f18
8 changed files with 66 additions and 0 deletions
@@ -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")
}
}
}
@@ -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"
}
@@ -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
}
@@ -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
@@ -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
}
@@ -0,0 +1,9 @@
buildscript {
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-allopen:$kotlin_version"
}
}
@@ -0,0 +1,9 @@
buildscript {
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}