File tree Expand file tree Collapse file tree 1 file changed +7
-11
lines changed
Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Original file line number Diff line number Diff line change 1+ import com.github.bjornvester.xjc.XjcTask
2+
13plugins {
24 id " com.github.bjornvester.xjc"
35}
@@ -26,14 +28,8 @@ 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+ // XJC plugin adds generated code to main source set, but we need it only for tests
32+ sourceSets. main. java. setSrcDirs([" src/main/java" ])
33+ sourceSets. main. resources. setSrcDirs([" src/main/resources" ])
34+ sourceSets. test. java. srcDir(tasks. named(" xjc" , XjcTask ). flatMap { it. outputJavaDir })
35+ sourceSets. test. resources. srcDir(tasks. named(" xjc" , XjcTask ). flatMap { it. outputResourcesDir })
You can’t perform that action at this time.
0 commit comments