-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.gradle
142 lines (102 loc) · 4.68 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
import com.github.jengelman.gradle.plugins.shadow.transformers.*
apply plugin: 'java'
//plugin-shadow for building fat-jar see : https://plugins.gradle.org/plugin/com.github.johnrengelman.shadow
// intestingly, repositories {jcenter()} cannot work - from http://imperceptiblethoughts.com/shadow/
buildscript {
repositories {
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath "com.github.jengelman.gradle.plugins:shadow:2.0.1"
}
}
apply plugin: "com.github.johnrengelman.shadow"
repositories {
mavenCentral()
maven { url "https://jcenter.bintray.com" } //add for btrace - https://github.com/btraceio/btrace-maven
}
dependencies {
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25' //https://mvnrepository.com/artifact/org.slf4j/slf4j-api/1.7.25
compile group: 'com.google.guava', name: 'guava', version: '23.0' //https://mvnrepository.com/artifact/com.google.guava/guava/23.0
compile group: 'com.google.code.gson', name: 'gson', version: '2.8.2'
//compile group: 'com.lmax', name: 'disruptor', version: '3.3.7' //http://mvnrepository.com/artifact/com.lmax/disruptor/3.3.7
//http://projects.spring.io/spring-boot/
compile("org.springframework.boot:spring-boot-starter-web:1.5.9.RELEASE"){
//exclude spring logack here, and log4j2 outside
//https://stackoverflow.com/questions/25683210/spring-boot-logging-with-log4j2
//https://discuss.gradle.org/t/how-to-exclude-transitive-dependency/2119
exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging'
}
compile("org.springframework.boot:spring-boot-starter-log4j2:+")
compile("org.quickfixj:quickfixj-core:2.0.0")
compile group: 'com.beust', name: 'jcommander', version: '1.72' //http://jcommander.org/ https://mvnrepository.com/artifact/com.beust/jcommander/1.72
compile 'io.vertx:vertx-core:3.5.0'
//TODO i am not very clear with the diff between btrace-agent and btrace-maven
testCompile 'com.sun.tools.btrace:btrace-agent:1.3.10.1' //https://bintray.com/btraceio/maven/btrace, https://github.com/btraceio/btrace-maven, https://bintray.com/btraceio/maven/btrace-maven
testCompile 'junit:junit:4.8.2'
}
task taskA{
println "i am task A, and do nothing but print this line"
}
//https://docs.gradle.org/current/javadoc/org/gradle/api/tasks/testing/Test.html
test {
println "i am in test task"
// enable TestNG support (default is JUnit)
//useTestNG()
// set a system property for the test JVM(s)
systemProperty 'some.prop', 'value'
// explicitly include or exclude tests
//include 'org/foo/**'
//exclude 'org/boo/**'
// show standard out and standard error of the test JVM(s) on the console
testLogging.showStandardStreams = true
// set heap size for the test JVM(s)
minHeapSize = "128m"
maxHeapSize = "512m"
// set JVM arguments for the test JVM(s)
jvmArgs '-XX:MaxPermSize=256m'
// listen to events in the test execution lifecycle
beforeTest { descriptor ->
logger.lifecycle("Running test: " + descriptor)
}
// listen to standard out and standard error of the test JVM(s)
onOutput { descriptor, event ->
logger.lifecycle("Test: " + descriptor + " produced standard out/err: " + event.message )
}
}
version = 'v1.1_'+new Date().format('yyyy-MM-dd_HHmmss.S')
jar {
manifest {
attributes 'Implementation-Title': 'Baoying OrderBook/MatchingEngine'
attributes 'Implementation-Version': version
attributes "Main-Class": "baoying.orderbook.app.MatchingEngineApp"
}
}
//add buildscript and apply related plugin - see the header part
shadowJar {
archiveName = 'BaoyingOrderBookFat.jar'
// Required for Spring -- https://github.com/spring-projects/spring-boot/issues/1828
//add import com.github.jengelman.gradle.plugins.shadow.transformers.* at header
mergeServiceFiles()
append 'META-INF/spring.handlers'
append 'META-INF/spring.schemas'
append 'META-INF/spring.tooling'
transform(PropertiesFileTransformer) {
paths = ['META-INF/spring.factories' ]
mergeStrategy = "append"
}
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
options.compilerArgs << '-Xlint:unchecked' << '-Xlint:deprecation'
}
task buildPackage(group: 'build', type: Zip, dependsOn: shadowJar) {
baseName = 'BaoyingOrderBookFat'
ext.publishMe = true
ext.zipDistribution = true
into('jars') { from shadowJar }
into('scripts'){from ('src/main/bash/') { include('**/*') } }
into('test_scripts'){from ('src/test/bash/') { include('**/*') } }
into('test_scripts'){from ('src/test/python/') { include('**/*') } }
into('test_scripts/btrace'){from ('src/test/java/') { include('baoying/orderbook/BTrace*') } }
}