-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
47 lines (46 loc) · 1.58 KB
/
build.gradle
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
42
43
44
45
46
47
defaultTasks 'build'
subprojects {
apply plugin: 'java'
sourceCompatibility = 10
targetCompatibility = 10
repositories {
jcenter()
}
afterEvaluate {
compileJava {
inputs.property("moduleName", moduleName)
doFirst {
options.compilerArgs = [
'--module-path', classpath.asPath,
]
classpath = files()
}
}
compileTestJava {
inputs.property("moduleName", moduleName)
doFirst {
options.compilerArgs = [
'--module-path', classpath.asPath,
'--add-modules', 'junit',
'--add-reads', "$moduleName=junit",
'--patch-module', "$moduleName=" + files(sourceSets.test.java.srcDirs).asPath,
]
classpath = files()
}
}
// this apparently enables the module system things for unit tests runtime
// not really needed unless playing around with reflection?
// test {
// inputs.property("moduleName", moduleName)
// doFirst {
// jvmArgs = [
// '--module-path', classpath.asPath,
// '--add-modules', 'ALL-MODULE-PATH',
// '--add-reads', "$moduleName=junit",
// '--patch-module', "$moduleName=" + files(sourceSets.test.java.outputDir).asPath,
// ]
// classpath = files()
// }
// }
}
}