| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- subprojects { project ->
- apply plugin: "java"
-
- sourceSets {
- // Verify that the tests are working by running them against the example code.
- // By replacing the "main" sourceSet with the example code we avoid any collisions
- // with solution code that may have been included as a "starter" (e.g. etl).
- main {
- java.srcDirs = ["src/example/java"]
- }
- project["compileJava"].doFirst { compileTask ->
- println " (source = " + compileTask.source.asPath + ")"
- }
-
- starterSource {
- java.srcDirs = ["src/main/java"]
- }
- project["compileStarterSourceJava"].doFirst { compileTask ->
- println " (source = " + compileTask.source.asPath + ")"
- }
-
- // In lieu of being able to disable @Ignore in JUnit tests, we filter
- // those annotations, placing the edited tests in the path named here.
- test {
- java.srcDirs = ["build/gen/test/java"]
- }
- project["compileTestJava"].doFirst { compileTask ->
- println " (source = " + compileTask.source.asPath + ")"
- }
- }
-
- task copyTestsFilteringIgnores(type: Copy) {
- from "src/test/java"
- into "build/gen/test/java"
- filter { line ->
- line.contains("@Ignore") ? null : line
- }
- }
-
- test.dependsOn(copyTestsFilteringIgnores)
- }
|