-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
88 lines (68 loc) · 2.87 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
apply plugin: 'java'
group 'org.ringingmaster'
version '1.0.0'
compileJava {
sourceCompatibility = 12
targetCompatibility = 12
}
repositories {
mavenCentral()
}
configurations {
jaxb
}
dependencies {
// Internal
compile 'org.ringingmaster:ringingmaster-persist:1.0.0'
compile 'org.ringingmaster:ringingmaster-engine:1.0.0'
jaxb 'org.glassfish.jaxb:jaxb-xjc:2.2.11'
jaxb 'org.glassfish.jaxb:jaxb-runtime:2.2.11'
jaxb 'javax.activation:activation:1.1.1'
compile 'javax.activation:activation:1.1.1'
compile 'javax.xml.bind:jaxb-api:2.2.11'
compile 'com.sun.xml.bind:jaxb-impl:2.2.11'
compile 'com.sun.xml.bind:jaxb-core:2.2.11'
// // TEST: General
testCompile 'junit:junit:4.12'
//
// // TEST: Logging
testRuntime 'org.apache.logging.log4j:log4j-core:2.8.2'
testRuntime 'org.apache.logging.log4j:log4j-slf4j-impl:2.8.2'
}
def generatedCCBRMethodLibraryModelSchemaDir = "${projectDir}/src/main/ccResources"
def generatedCCBRMethodLibraryModelClassesDir = "${buildDir}/classes/generated/jaxb"
def generatedCCBRMethodLibraryModelGeneratedDir = "${projectDir}/src/generated/java"
// Add generated code into source set.
sourceSets.main.java.srcDir generatedCCBRMethodLibraryModelGeneratedDir
sourceSets.main.resources.srcDir generatedCCBRMethodLibraryModelSchemaDir
task generateCCBRMethodLibraryJaxbJavaFiles (group: 'ringingmaster') {
// Drive the UP-TO-DATE mechanism
inputs.dir generatedCCBRMethodLibraryModelSchemaDir
outputs.dir generatedCCBRMethodLibraryModelClassesDir
doFirst() {
project.ant {
taskdef name: "xjc", classname: "com.sun.tools.xjc.XJCTask",
classpath: configurations.jaxb.asPath
mkdir(dir: generatedCCBRMethodLibraryModelGeneratedDir)
mkdir(dir: generatedCCBRMethodLibraryModelClassesDir)
xjc(destdir: generatedCCBRMethodLibraryModelGeneratedDir) {
schema(dir: generatedCCBRMethodLibraryModelSchemaDir, includes: "**/*.xsd")
arg(value: "-nv")
produces(dir: generatedCCBRMethodLibraryModelGeneratedDir, includes: "**/*.java")
}
}
}
}
// Ensure the generated files are in the compiled source, along with forcing the generation process
compileJava.source generateCCBRMethodLibraryJaxbJavaFiles.outputs.files, sourceSets.main.java
clean{
delete generatedCCBRMethodLibraryModelGeneratedDir
}
def artifactsDir = "${buildDir}/artifacts"
task generateMethodLibrary (group: 'ringingmaster', dependsOn: ['generateCCBRMethodLibraryJaxbJavaFiles', 'classes'], type: JavaExec) {
project.ant.mkdir(dir: artifactsDir)
main = 'org.ringingmaster.extract.NotationLibraryBuilder'
classpath(sourceSets.main.runtimeClasspath)
classpath(sourceSets.test.runtimeClasspath) //To get the logging libs
args '/allmeths.xml', "${artifactsDir}/notationlibrary.xml"
}