forked from exercism/java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
41 lines (36 loc) · 1.23 KB
/
build.gradle
File metadata and controls
41 lines (36 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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") ? "" : line
}
}
test.dependsOn(copyTestsFilteringIgnores)
}