jruby-gradle-plugin/gradle/integration-tests.gradle

46 lines
1.5 KiB
Groovy

// This is based upon what Rob Fletcher has done at
// https://raw.githubusercontent.com/robfletcher/gradle-compass/master/gradle/integration-tests.gradle
configurations {
integrationTestCompile {
extendsFrom testCompile
}
integrationTestRuntime {
extendsFrom integrationTestCompile, testRuntime
}
integrationTestGems
}
dependencies {
integrationTestCompile gradleTestKit()
/* We want to cache jruby-complete at this alternative version which we use
* in many places
*/
integrationTestGems "org.jruby:jruby-complete:${olderJRubyVersion}"
}
sourceSets {
integrationTest {
java.srcDir file("src/integTest/java")
groovy.srcDir file("src/integTest/groovy")
resources.srcDir file("src/integTest/resources")
compileClasspath = sourceSets.main.output + configurations.integrationTestCompile
runtimeClasspath = output + compileClasspath + configurations.integrationTestRuntime
}
}
task copyIntegrationTestGems (type:Copy) {
from ({configurations.integrationTestGems.files})
into new File(buildDir,'tmp/integrationTest/flatRepo')
}
task integrationTest(type: Test, dependsOn: jar) {
testClassesDirs = sourceSets.integrationTest.output.classesDirs
classpath = sourceSets.integrationTest.runtimeClasspath
dependsOn copyIntegrationTestGems
mustRunAfter test
systemProperties TMP_FOLDER : file('build/tmp/integrationTestTempFolder').absolutePath
}
check.dependsOn integrationTest