Commit 8eab6c9 1 parent 104f68b commit 8eab6c9 Copy full SHA for 8eab6c9
File tree 1 file changed +30
-11
lines changed
1 file changed +30
-11
lines changed Original file line number Diff line number Diff line change 3
3
4
4
plugins {
5
5
java
6
- id(" org.unbroken-dome.xjc" ) version " 2.0.0"
7
6
}
8
7
9
- repositories {
10
- mavenCentral( )
8
+ configurations {
9
+ create( " jaxb " )
11
10
}
12
11
13
12
dependencies {
14
- implementation(platform(project(" :evaka-bom" )))
15
- implementation(" jakarta.xml.bind:jakarta.xml.bind-api" )
16
- xjcTool(" com.sun.xml.bind:jaxb-xjc:3.0.2" )
17
- xjcTool(" com.sun.xml.bind:jaxb-impl:3.0.2" )
13
+ " jaxb" (" com.sun.xml.bind:jaxb-xjc:4.0.5" )
14
+ " jaxb" (" com.sun.xml.bind:jaxb-impl:4.0.5" )
15
+ implementation(" jakarta.xml.bind:jakarta.xml.bind-api:4.0.2" )
18
16
}
19
17
20
- sourceSets {
21
- main {
22
- xjcTargetPackage.set(" fi.espoo.evaka.sarma.model" )
18
+ tasks.register(" generateJaxb" ) {
19
+ val outputDir = layout.buildDirectory.dir(" generated-sources/jaxb" )
20
+ val schemaDir = project.file(" src/main/schema" )
21
+
22
+ inputs.dir(schemaDir)
23
+ outputs.dir(outputDir)
24
+
25
+ doLast {
26
+ outputDir.get().asFile.mkdirs()
27
+
28
+ ant.withGroovyBuilder {
29
+ " taskdef" (
30
+ " name" to " xjc" ,
31
+ " classname" to " com.sun.tools.xjc.XJCTask" ,
32
+ " classpath" to configurations[" jaxb" ].asPath
33
+ )
34
+ " xjc" (
35
+ " destdir" to outputDir.get().asFile,
36
+ " package" to " fi.espoo.evaka.sarma.model"
37
+ ) {
38
+ " schema" (" dir" to schemaDir, " includes" to " **/*.xsd" )
39
+ }
40
+ }
23
41
}
24
42
}
25
43
26
44
tasks.named(" compileJava" ) {
27
- dependsOn(" xjcGenerate" )
45
+ dependsOn(" generateJaxb" )
46
+ sourceSets.main.get().java.srcDir(layout.buildDirectory.dir(" generated-sources/jaxb" ))
28
47
}
You can’t perform that action at this time.
0 commit comments