-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathbuild.gradle
103 lines (82 loc) · 2.08 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
93
94
95
96
97
98
99
100
101
102
103
apply plugin: 'java'
apply plugin: 'application'
apply plugin: 'eclipse'
def generateSourceDir = new File("${project.buildDir}/gen-src/main/java")
version = '2.1-SNAPSHOT'
sourceCompatibility = 1.7
targetCompatibility = 1.7
mainClassName = "com.jramoyo.qfixmessenger.QFixMessenger"
repositories {
mavenCentral()
}
configurations {
xjc
}
dependencies {
xjc 'com.sun.xml.bind:jaxb-xjc:2.2.7'
compile 'com.sun.xml.bind:jaxb-impl:2.2.7'
compile 'jdom:jdom:1.1'
compile 'log4j:log4j:1.2.17'
compile 'org.apache.mina:mina-core:1.1.7'
compile 'org.slf4j:slf4j-api:1.7.7'
compile 'org.slf4j:slf4j-log4j12:1.7.7'
testCompile 'junit:junit:4.11'
testCompile 'org.hamcrest:hamcrest-core:1.3'
compile fileTree(dir: 'lib/compile', include: '*.jar')
}
sourceSets {
main {
java {
srcDir generateSourceDir
}
}
}
task createDirs () {
generateSourceDir.mkdirs();
}
task xjc(dependsOn: createDirs) {
ant.taskdef(
name: 'xjc',
classname: 'com.sun.tools.xjc.XJCTask',
classpath: configurations.xjc.asPath
)
ant.xjc(
destdir: generateSourceDir,
extension: true,
readonly: true,
) {
schema(
dir: 'src/main/xsd',
includes: '*.xsd'
)
}
}
task generateSource (dependsOn: xjc) {
}
clean.doLast {
ant.delete(dir: 'log')
ant.delete(dir: 'data')
}
cleanEclipse.doLast {
ant.delete(dir: 'bin')
}
compileJava.dependsOn generateSource
jar {
manifest {
attributes 'Implementation-Title': 'QuickFIX Messenger', 'Implementation-Version': version
}
}
applicationDistribution.from('src/main/cfg') {
into 'cfg'
}
applicationDistribution.from('src/main/cfg/log4j.properties') {
into 'lib/log4j'
}
applicationDistribution.from('src/main/dictionary') {
into 'lib/dictionary'
}
applicationDistribution.from('src/main/scripts') {
into '.'
}
startScripts.classpath.add(files('$APP_HOME/dictionary'))
startScripts.classpath.add(files('$APP_HOME/log4j'))