Last active
August 16, 2016 05:07
-
-
Save childnode/b8ae38d4962e3a77c3a2b233d63cf732 to your computer and use it in GitHub Desktop.
How do I add a new sourceset to Gradle? http://stackoverflow.com/a/37882006/529977
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'java' | |
// apply the runtimeClasspath from "test" sourceSet to the new one | |
// to include any needed assets: test, main, test-dependencies and main-dependencies | |
sourceSets { | |
integrationTest { | |
compileClasspath += sourceSets.test.runtimeClasspath | |
// somehow this redeclaration is needed, but should be irrelevant | |
// since runtimeClasspath always expands compileClasspath | |
runtimeClasspath += sourceSets.test.runtimeClasspath | |
} | |
} | |
// define custom test task for running integration tests | |
task integrationTest(type: Test) { | |
testClassesDir = sourceSets.integrationTest.output.classesDir | |
classpath = sourceSets.integrationTest.runtimeClasspath | |
} | |
integrationTest.dependsOn test |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
open for testing and analysis, as found in https://github.com/bmuschko/gradle-docker-plugin/blob/master/gradle/integration-test.gradle
The latter block reads like "enabling IntelliJ Idea handling integrationTest sourceSet as test module"
see also: https://gist.github.com/childnode/6df6d14c6b3aa47a327bb73ffd731444