Gradle subplugin test

This commit is contained in:
Yan Zhulanow
2015-02-26 21:57:34 +03:00
parent 9be33338ef
commit 8760beeed1
11 changed files with 281 additions and 0 deletions
@@ -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>
@@ -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")
}
}
}
@@ -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"
}
@@ -0,0 +1,9 @@
package demo
class HelloWorld {
fun hello() {
println("Hello, world!")
}
}