Skip to content

Commit a2eaa94

Browse files
committed
Fix spring-xml when configuration-cache is enabled
Signed-off-by: Clayton Walker <[email protected]>
1 parent c05ea84 commit a2eaa94

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

spring-oxm/spring-oxm.gradle

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import com.github.bjornvester.xjc.XjcTask
2+
13
plugins {
24
id "com.github.bjornvester.xjc"
35
}
@@ -26,14 +28,7 @@ dependencies {
2628
testRuntimeOnly("com.sun.xml.bind:jaxb-impl")
2729
}
2830

29-
tasks.named("xjc").configure { xjc ->
30-
// XJC plugin only works against main sources, so we have to "move" them to test sources.
31-
sourceSets.main.java.exclude {
32-
it.file.absolutePath.startsWith(outputJavaDir.get().asFile.absolutePath)
33-
}
34-
sourceSets.main.resources.exclude {
35-
it.file.absolutePath.startsWith(outputResourcesDir.get().asFile.absolutePath)
36-
}
37-
sourceSets.test.java.srcDir(xjc.outputJavaDir)
38-
sourceSets.test.resources.srcDir(xjc.outputResourcesDir)
39-
}
31+
sourceSets.main.java.setSrcDirs(["src/main/java"])
32+
sourceSets.main.resources.setSrcDirs(["src/main/resources"])
33+
sourceSets.test.java.srcDir(tasks.named("xjc", XjcTask).flatMap { it.outputJavaDir })
34+
sourceSets.test.resources.srcDir(tasks.named("xjc", XjcTask).flatMap { it.outputResourcesDir })

0 commit comments

Comments
 (0)