File tree Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change 1
1
// Copyright 2021 The Terasology Foundation
2
2
// SPDX-License-Identifier: Apache-2.0
3
- apply(from : " $rootDir /gradle/common.gradle.kts" )
3
+ apply (from = " $rootDir /gradle/common.gradle.kts" )
4
+
5
+ plugins {
6
+ `java- library`
7
+ }
4
8
5
9
// Primary dependencies definition
6
10
dependencies {
@@ -20,11 +24,11 @@ dependencies {
20
24
testImplementation(libs.mockito)
21
25
}
22
26
23
- compileJava {
24
- inputs . files sourceSets . main . resources . srcDirs
25
- options . compilerArgs = [ " -Aresource= ${ sourceSets. main.resources.srcDirs.join(File.pathSeparator) } " ]
26
- }
27
- compileTestJava {
28
- inputs . files sourceSets . test . resources . srcDirs
29
- options . compilerArgs = [ " -Aresource= ${ sourceSets.test.resources.srcDirs.join(File.pathSeparator) } " ]
30
- }
27
+ // include resource dirs from main or test, depending if is test compile or not
28
+ tasks.withType< JavaCompile >().configureEach {
29
+ val resourceDirs = sourceSets[ if (name == " compileTestJava " ) " test " else " main" ] .resources.srcDirs
30
+ inputs.files(resourceDirs)
31
+ options.compilerArgs.addAll(
32
+ listOf ( " -Aresource= ${resourceDirs.joinToString( File .pathSeparator)} " )
33
+ )
34
+ }
You can’t perform that action at this time.
0 commit comments