-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
92 lines (78 loc) · 2.25 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
import com.github.rahulsom.svgbuilder.Converter
import com.github.rahulsom.svgbuilder.GroovyNewifyBuilder
plugins {
id("java")
id("groovy")
id("org.jetbrains.kotlin.jvm").version("2.1.0")
id("org.unbroken-dome.xjc").version("2.0.0")
id("com.github.rahulsom.waena.root").version("0.6.1")
id("com.github.rahulsom.waena.published").version("0.6.1")
}
contacts {
validateEmails = true
addPerson("[email protected]") {
moniker("Rahul Somasunderam")
roles("owner")
github("https://github.com/rahulsom")
}
}
group = "com.github.rahulsom"
description = "A library for building SVG diagrams"
repositories {
mavenCentral()
}
sourceSets {
main {
groovy.srcDir("build/groovysupport/generated-sources")
kotlin.srcDir("build/generated/sources/xjc/java/main")
xjcSchema.srcDir("build/schemas")
xjcBinding.srcDir("src/main/jaxb")
}
}
dependencies {
xjcClasspath("org.jvnet.jaxb2_commons:jaxb2-fluent-api:3.0")
xjcClasspath("org.jvnet.jaxb2_commons:jaxb2-basics-annotate:1.1.0")
compileOnly("org.codehaus.groovy:groovy-all:3.0.23")
implementation("javax.xml.bind:jaxb-api:2.3.1")
implementation("org.glassfish.jaxb:jaxb-runtime:2.3.9")
implementation("com.sun.xml.bind:jaxb-core:4.0.5")
testImplementation("org.spockframework:spock-core:2.3-groovy-4.0")
testImplementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
compileOnly("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
}
xjcGenerate {
extraArgs = ["-Xfluent-api", "-Xannotate"]
}
tasks.register("download") {
doFirst {
if (!file("build/schemas/svg.dtd").exists()) {
file("$buildDir/schemas").mkdirs()
file("build/schemas/svg.dtd").text =
new URL("https://www.w3.org/Graphics/SVG/1.1/DTD/svg11-flat-20030114.dtd").text
}
new Converter().convert(buildDir)
}
}
xjcGenerate.dependsOn("download")
xjcGenerate.doLast {
new GroovyNewifyBuilder().createFile(buildDir)
}
compileJava.dependsOn("xjcGenerate")
compileKotlin.dependsOn("xjcGenerate")
compileTestGroovy.doFirst {
copy {
from("build/classes/kotlin/test")
into("build/classes/java/test")
}
}
javadoc {
options.addStringOption("Xdoclint:none", "-quiet")
}
test {
useJUnitPlatform()
}
kotlin {
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}