-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbuild.gradle
More file actions
278 lines (226 loc) · 7.41 KB
/
build.gradle
File metadata and controls
278 lines (226 loc) · 7.41 KB
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
ext {
slf4jVersion = '1.7.13'
messageTrackVersion = '3.0.303'
powerMockVersion = '1.6.4'
quickfixVersion = '1.6.3'
etaVersion = '3.0.2.L1.all'
frameworkVersion = '1.1.1-RC5'
sysoutOverSlf4jVersion='1.0.2'
gsonVersion='1.7.2'
guavaVersion='21.0'
logbackVersion='1.2.3'
jsonVersion='20090211'
commonsVersion='1.2'
jodaVersion='2.3'
}
repositories {
mavenCentral()
flatDir {
dirs './libs'
}
}
defaultTasks 'clean', 'build', 'makeDist'
buildscript {
repositories {
mavenCentral()
jcenter()
flatDir {
dirs './libs'
}
}
dependencies {
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4+"
classpath 'com.kenshoo:gradle-fpm:0.5'
}
}
allprojects {
apply plugin: 'java'
apply plugin: 'fpm-packaging'
apply plugin: 'com.jfrog.artifactory'
group 'com.thomsonreuters'
version '1.0.0-SNAPSHOT'
sourceCompatibility = 1.8
targetCompatibility = 1.8
if (project.version == 'unspecified') {
project.version = versionBase
project.ext["implBuild"] = "Dev"
} else {
// pull out build number in manifest assume major.minor.buildNbr
def versionParts = project.version.tokenize('.')
project.ext["implBuild"] = versionParts[versionParts.size() - 1]
}
if (!project.hasProperty("profile")) {
ext.profile = 'default'
}
if (!project.hasProperty("instanceId")) {
ext.instanceId = 'DEFAULT'
}
}
artifactory {
sourceSets {
main {
java {
srcDir 'src/main/java'
}
resources {
srcDir 'src/main/resources'
}
}
test {
java {
srcDir 'src/test/java'
}
resources {
srcDir 'src/test/resources'
}
}
}
configurations {
tests
}
task testJar(type: Jar, dependsOn: testClasses) {
baseName = "test-${project.archivesBaseName}"
from sourceSets.test.output
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.java, sourceSets.main.resources
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
jar {
dependsOn sourcesJar
}
artifacts {
archives sourcesJar
archives javadocJar
tests testJar
}
dependencies {
compile (group: 'com.thomsonreuters.upa', name: 'fdm', version: frameworkVersion) {
exclude group: 'com.squareup.retrofit2'
exclude group: 'com.squareup.okhttp3'
exclude group: 'org.apache.geronimo.specs'
exclude group: 'org.jetbrains'
exclude group: 'javax'
exclude group: 'com.tibco'
}
compile (group: 'com.thomsonreuters.upa', name: 'framework', version: frameworkVersion) {
exclude group: 'com.squareup.retrofit2'
exclude group: 'com.squareup.okhttp3'
exclude group: 'org.apache.geronimo.specs'
exclude group: 'org.jetbrains'
exclude group: 'javax'
exclude group: 'com.tibco'
}
compile (group: 'org.quickfixj', name: 'quickfixj-all', version: quickfixVersion) {
exclude group: 'org.apache.maven'
}
compile group: 'ch.qos.logback', name: 'logback-classic', version: logbackVersion
compile group: 'uk.org.lidalia', name: 'sysout-over-slf4j', version: sysoutOverSlf4jVersion
compile group: 'com.google.code.gson', name: 'gson', version: gsonVersion
compile group: 'com.google.guava', name: 'guava', version: guavaVersion
compile group: 'org.json', name: 'json', version: jsonVersion
compile group: 'commons-cli', name: 'commons-cli', version: commonsVersion
compile group: 'com.thomsonreuters', name: 'eta', version: etaVersion
compile group: 'com.thomsonreuters', name: 'etaValueAdd', version: etaVersion
testCompile group: 'org.easymock', name: 'easymock', version: '3.3.1'
testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile group: 'org.glassfish', name: 'javax.json', version: '1.0.4'
testCompile group: 'org.hamcrest', name: 'hamcrest-library', version: '1.3'
testCompile group: 'org.powermock', name: 'powermock-api-easymock', version: powerMockVersion
testCompile group: 'org.powermock', name: 'powermock-module-junit4', version: powerMockVersion
testCompile group: 'org.powermock', name: 'powermock-module-junit4-rule-agent', version: powerMockVersion
testCompile group: 'joda-time', name: 'joda-time', version: jodaVersion
}
}
jar {
baseName = componentName
manifest {
attributes 'Implementation-Title': 'APAGateway', 'Implementation-Version': "${version}-${buildNumber}"
}
}
sourceSets {
main {
resources {
exclude '*'
}
}
}
clean.doFirst {
delete 'target'
}
configurations {
compile {
description = 'compile classpath'
transitive = true
}
runtime {
extendsFrom compile
}
}
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
}
task cleanDeps(dependsOn: build, type: Delete) {
delete rootProject.rootDir.getAbsolutePath() + "/package/app/APAGateway/libs/"
}
task copyDeps(dependsOn: cleanDeps, type: Copy) {
from(configurations.compile) {
include "*.jar"
}
from('build/libs') {
exclude "*-sources.jar"
}
from('libs') {
include "*.jar"
}
into rootProject.rootDir.getAbsolutePath() + "/package/app/APAGateway/libs"
}
task copyOMMToClient(dependsOn: copyDeps, type: Copy) {
from rootProject.rootDir.getAbsolutePath() + "/package/etc/APAGateway/omm"
into rootProject.rootDir.getAbsolutePath() + "/package/client/omm"
}
task copyScripts(dependsOn: copyOMMToClient, type: Copy) {
from (rootProject.rootDir.getAbsolutePath() + "/scripts") {
include "gateway.sh"
include "utils.sh"
}
into rootProject.rootDir.getAbsolutePath() + "/package"
}
task copyRules(dependsOn: copyScripts, type: Copy) {
from (rootProject.rootDir.getAbsolutePath() + "/clienthome/rules") {
include "rules.json"
}
into rootProject.rootDir.getAbsolutePath() + "/package/rules"
}
task copyJarToDist(dependsOn: copyRules, type: Copy) {
from jar
into rootProject.rootDir.getAbsolutePath() + "/package/app/APAGateway/libs"
}
copyDeps {}.finalizedBy copyJarToDist
task makeDist(dependsOn: copyJarToDist, type: Tar) {
with copySpec {
from (rootProject.rootDir.getAbsolutePath()) {
fileMode=0744
include('/package/app/APAGateway/config/**')
include('/package/app/APAGateway/libs/**')
include('/package/app/APAGateway/trep/**')
include('/package/client/omm/**')
}
from (rootProject.rootDir.getAbsolutePath()) {
fileMode=0755
include('/package/app/APAGateway/bin/**')
include('/package/gateway.sh')
include('/package/utils.sh')
include('/package/rules/rules.json')
}
}
archiveName = "apagateway_dist.tar.gz"
destinationDir(rootProject.rootDir)
compression = Compression.GZIP
}