Skip to content

Commit d0924f8

Browse files
committed
Adding the source set to add the unit tests back to the build
1 parent e6c63a7 commit d0924f8

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

build.gradle

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,35 @@ tasks.withType(JavaCompile).configureEach {
1919
options.encoding = 'UTF-8'
2020
}
2121

22+
sourceSets {
23+
main {
24+
java {
25+
srcDirs = ['src/main/java']
26+
}
27+
resources {
28+
srcDirs = ['src/main/resources']
29+
}
30+
output.classesDirs = files("$buildDir/classes/java/main")
31+
output.resourcesDir = file("$buildDir/resources/main")
32+
}
33+
34+
test {
35+
java {
36+
srcDirs = ['test/java/src/']
37+
}
38+
resources {
39+
srcDirs = ['test/resources']
40+
}
41+
output.classesDirs = files("$buildDir/classes/java/test")
42+
output.resourcesDir = file("$buildDir/resources/test")
43+
44+
// Test compile classpath includes main output
45+
compileClasspath += main.output
46+
// Test runtime classpath includes main output
47+
runtimeClasspath += main.output
48+
}
49+
}
50+
2251
//java {
2352
// toolchain {
2453
// languageVersion = JavaLanguageVersion.of(17)

0 commit comments

Comments
 (0)