diff options
Diffstat (limited to 'gradle/integTest.gradle')
-rw-r--r-- | gradle/integTest.gradle | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/gradle/integTest.gradle b/gradle/integTest.gradle new file mode 100644 index 0000000..07b0743 --- /dev/null +++ b/gradle/integTest.gradle @@ -0,0 +1,50 @@ +sourceSets { + integTest { + compileClasspath += main.output + test.output + runtimeClasspath += main.output + test.output + } +} + +configurations { + integTestCompile.extendsFrom testCompile + integTestRuntime.extendsFrom testRuntime +} + +task integTest(type: Test) { + shouldRunAfter 'test' + testClassesDir = sourceSets.integTest.output.classesDir + classpath = sourceSets.integTest.runtimeClasspath + +} +check.dependsOn(integTest) + +plugins.withType(org.gradle.plugins.ide.idea.IdeaPlugin) { + idea { + module { + testSourceDirs += sourceSets.integTest.groovy.srcDirs + testSourceDirs += sourceSets.integTest.resources.srcDirs + scopes.TEST.plus.add(configurations.integTestCompile) + scopes.TEST.plus.add(configurations.integTestRuntime) + } + } +} + + +// START SNIPPET test-logic-classpath +// Write the plugin's classpath to a file to share with the tests +task createClasspathManifest { + def outputDir = file("$buildDir/$name") + + inputs.files sourceSets.main.runtimeClasspath + outputs.dir outputDir + + doLast { + outputDir.mkdirs() + file("$outputDir/plugin-classpath.txt").text = sourceSets.main.runtimeClasspath.join("\n") + } +} + +// Add the classpath file to the test runtime classpath +dependencies { + integTestRuntime files(createClasspathManifest) +}
\ No newline at end of file |