Gradle subplugin test
This commit is contained in:
@@ -54,6 +54,12 @@
|
||||
<artifactId>kotlin-gradle-plugin-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-gradle-subplugin-example</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
|
||||
+19
@@ -79,4 +79,23 @@ class SimpleKotlinGradleIT : BaseGradleIT() {
|
||||
assertSuccessful()
|
||||
}
|
||||
}
|
||||
|
||||
Test fun testGradleSubplugin() {
|
||||
val project = Project("kotlinGradleSubplugin", "1.6")
|
||||
|
||||
project.build("compileKotlin", "build") {
|
||||
assertSuccessful()
|
||||
assertContains("/src/main/kotlin/helloWorld.kt")
|
||||
assertContains("ExampleSubplugin loaded")
|
||||
assertContains("Project component registration: exampleValue")
|
||||
assertContains(":compileKotlin")
|
||||
}
|
||||
|
||||
project.build("compileKotlin", "build") {
|
||||
assertSuccessful()
|
||||
assertContains("ExampleSubplugin loaded")
|
||||
assertNotContains("Project component registration: exampleValue")
|
||||
assertContains(":compileKotlin UP-TO-DATE")
|
||||
}
|
||||
}
|
||||
}
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven {
|
||||
url 'file://' + pathToKotlinPlugin
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:0.1-SNAPSHOT"
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-subplugin-example:0.1-SNAPSHOT"
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: "kotlin"
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
url 'file://' + pathToKotlinPlugin
|
||||
}
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile "org.jetbrains.kotlin:kotlin-stdlib:0.1-SNAPSHOT"
|
||||
}
|
||||
|
||||
task show << {
|
||||
buildscript.configurations.classpath.each { println it }
|
||||
}
|
||||
|
||||
|
||||
compileKotlin {
|
||||
kotlinOptions.annotations = "externalAnnotations"
|
||||
}
|
||||
|
||||
|
||||
task wrapper(type: Wrapper) {
|
||||
gradleVersion="1.4"
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package demo
|
||||
|
||||
class HelloWorld {
|
||||
|
||||
fun hello() {
|
||||
println("Hello, world!")
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user