forked from vmware-archive/springtrader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
498 lines (426 loc) · 14.8 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
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
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
description = 'Spring Nanotrader'
apply plugin: 'base'
apply plugin: 'idea'
buildscript {
repositories {
maven { url 'http://repo.springsource.org/plugins-release' }
}
dependencies {
classpath 'org.springframework.build.gradle:docbook-reference-plugin:0.1.5'
}
}
allprojects {
group = 'org.springframework.nanotrader'
repositories {
flatDir dirs: ["${gradle.gradleHomeDir}/lib"]
maven { url 'http://repo.springsource.org' }
maven { url 'http://maven.springframework.org/release' }
maven { url 'http://repo.springsource.org/libs-milestone' }
maven { url 'http://spring-roo-repository.springsource.org/release' }
mavenCentral()
maven { url 'http://maven.springframework.org/snapshot' }
}
}
subprojects { subproject ->
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin:'eclipse-wtp'
// ensure JDK 6 compatibility (GRADLE-18; INT-1578)
sourceCompatibility=1.6
targetCompatibility=1.6
ext.aspectjVersion = '1.6.12.M2'
ext.cglibVersion = '2.2'
ext.commonsNetVersion = '3.0.1'
ext.commonsLangVersion = '3.0.1'
ext.easymockVersion = '2.3'
ext.groovyVersion = '1.8.5'
ext.jacksonVersion = '1.9.2'
ext.javaxActivationVersion = '1.1.1'
ext.junitVersion = '4.8.2'
ext.log4jVersion = '1.2.12'
ext.mockitoVersion = '1.9.0'
ext.springVersion = '3.1.2.RELEASE'
ext.springAmqpVersion = '1.0.0.RELEASE'
ext.springDataMongoVersion = '1.0.0.RELEASE'
ext.springDataRedisVersion = '1.0.0.RELEASE'
ext.springGemfireVersion = '1.1.0.RELEASE'
ext.springSecurityVersion = '3.1.0.RELEASE'
ext.springSocialTwitterVersion = '1.0.1.RELEASE'
ext.springWsVersion = '2.0.3.RELEASE'
ext.springIntegrationVersion = '2.1.0.RELEASE'
ext.springRooVersion = '1.2.0.RELEASE'
ext.javaxInjectVersion = '1'
ext.servletApiVersion = '2.5'
ext.dozerVersion='5.3.2'
ext.h2Version="1.3.166"
ext.webAppDirName = 'src/main/webapp'
// add the natures and builders to your project
eclipse.project {
natures 'org.eclipse.wst.common.project.facet.core.nature', 'org.eclipse.wst.common.modulecore.ModuleCoreNature'
natures += 'org.springframework.ide.eclipse.core.springnature'
buildCommand 'org.eclipse.wst.common.project.facet.core.builder'
buildCommand 'org.eclipse.wst.validation.validationbuilder'
}
sourceSets {
test {
resources {
srcDirs = [
'src/test/resources',
'src/test/java'
]
}
}
}
// See http://www.gradle.org/docs/current/userguide/dependency_management.html#sub:configurations
// and http://www.gradle.org/docs/current/dsl/org.gradle.api.artifacts.ConfigurationContainer.html
configurations { jacoco //Configuration Group used by Sonar to provide Code Coverage using JaCoCo
}
// dependencies that are common across all java projects
dependencies {
compile "org.slf4j:slf4j-log4j12:1.6.4"
testCompile "cglib:cglib-nodep:$cglibVersion"
testCompile "junit:junit-dep:$junitVersion"
testCompile "log4j:log4j:$log4jVersion"
testCompile "org.easymock:easymock:$easymockVersion"
testCompile "org.easymock:easymockclassextension:$easymockVersion"
testCompile "org.mockito:mockito-all:$mockitoVersion"
testCompile "org.springframework:spring-test:$springVersion"
jacoco group: "org.jacoco", name: "org.jacoco.agent", version: "0.5.3.201107060350", classifier: "runtime"
}
// enable all compiler warnings; individual projects may customize further
ext.xLintArg = '-Xlint:all'
[compileJava, compileTestJava]*.options*.compilerArgs = [xLintArg]
test {
// suppress all console output during testing unless running `gradle -i`
logging.captureStandardOutput(LogLevel.INFO)
jvmArgs "-javaagent:${configurations.jacoco.asPath}=destfile=${buildDir}/jacoco.exec,includes=org.springframework.nanotrader.*"
// jvmArgs '-Xdebug', '-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000'
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allJava
}
task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}
artifacts {
archives sourcesJar
archives javadocJar
}
install {
repositories.mavenInstaller { customizePom(pom, subproject) }
}
}
task cleanDist(type: Delete) {
description "Deletes $rootDir/dist directory"
delete file("$rootDir/dist")
}
project('spring-nanotrader-chaos') {
description = 'Spring Nanotrader Chaos Utilities'
}
project('spring-nanotrader-service-support') {
description = 'Spring Nanotrader Data Service Support'
dependencies {
compile project(":spring-nanotrader-data")
compile "org.springframework.integration:spring-integration-amqp:$springIntegrationVersion"
compile "net.sf.dozer:dozer:$dozerVersion"
compile "org.codehaus.jackson:jackson-mapper-asl:$jacksonVersion"
compile "joda-time:joda-time:1.6"
compile "com.gemstone.gemfire:gemfire:6.6.3"
compile "org.springframework.data:spring-data-gemfire:1.1.1.RELEASE"
compile "net.schmizz:sshj:0.8.1"
}
}
project('spring-nanotrader-data') {
description = 'Spring Nanotrader Data'
dependencies {
compile "org.springframework:spring-tx:$springVersion"
compile "org.aspectj:aspectjrt:$aspectjVersion"
compile "org.springframework:spring-aspects:$springVersion"
compile "org.springframework.integration:spring-integration-amqp:$springIntegrationVersion"
compile "org.hibernate.javax.persistence:hibernate-jpa-2.0-api:1.0.1.Final"
compile "org.springframework.data:spring-data-jpa:1.0.3.RELEASE"
compile "org.apache.commons:commons-lang3:$commonsLangVersion"
compile "javax.validation:validation-api:1.0.0.GA"
compile "org.hibernate:hibernate-validator:4.2.0.Final"
compile "commons-dbcp:commons-dbcp:1.3"
compile "org.hibernate:hibernate-core:3.6.8.Final"
compile "org.hibernate:hibernate-entitymanager:3.6.8.Final"
compile "postgresql:postgresql:9.0-801.jdbc3"
compile files("../lib/sqlfireclient-1.0.3.jar")
compile "org.codehaus.jackson:jackson-mapper-asl:$jacksonVersion"
compile "com.h2database:h2:$h2Version"
}
}
project('tools') {
apply plugin: 'groovy'
repositories {
mavenCentral()
}
configurations {
compile
}
jar {
archiveName 'DataGenerator.zip'
fileMode 0755
into('libs') {
from configurations.compile
}
}
task release(idependsOn: assemble) << {
copy {
description "Copy artifacts to $rootDir/dist"
from file("build/libs")
into file("$rootDir/dist")
include '*.zip'
}
}
dependencies {
groovy localGroovy()
compile 'org.apache.commons:commons-lang3:3.1'
compile 'commons-beanutils:commons-beanutils-core:1.8.3'
compile 'commons-codec:commons-codec:1.4'
compile 'commons-collections:commons-collections:3.2.1'
compile 'commons-logging:commons-logging:1.1.1'
compile 'net.sf.ezmorph:ezmorph:1.0.6'
compile 'org.codehaus.groovy.modules.http-builder:http-builder:0.5.2'
compile 'org.apache.httpcomponents:httpclient:4.1.3'
compile 'org.apache.httpcomponents:httpcore:4.1.4'
compile 'net.sf.json-lib:json-lib:2.3:jdk15@jar'
compile 'net.sourceforge.nekohtml:nekohtml:1.9.15'
compile 'xerces:xercesImpl:2.10.0'
compile 'net.sf.opencsv:opencsv:2.0'
compile 'postgresql:postgresql:9.1-901.jdbc4'
compile 'org.apache.ant:ant:1.8.3'
compile files("../lib/sqlfireclient-1.0.3.jar")
}
}
project('spring-nanotrader-services') {
apply plugin: 'war'
description = 'Spring Nanotrader Services'
dependencies {
compile project(":spring-nanotrader-service-support")
compile project(":spring-nanotrader-chaos")
compile "org.springframework:spring-webmvc:$springVersion"
providedCompile ("javax.servlet:servlet-api:$servletApiVersion")
compile "com.jayway.jsonpath:json-path:0.8.1"
compile "cglib:cglib-nodep:$cglibVersion"
compile "org.springframework.security:spring-security-web:$springSecurityVersion"
compile "org.springframework.security:spring-security-config:$springSecurityVersion"
compile "org.codehaus.jackson:jackson-mapper-asl:1.8.5"
compile "javax.inject:javax.inject:$javaxInjectVersion"
compile "net.sf.dozer:dozer:$dozerVersion"
testCompile "org.springframework:spring-test-mvc:1.0.0.BUILD-SNAPSHOT"
testCompile "org.hamcrest:hamcrest-all:1.1"
compile "org.aspectj:aspectjweaver:$aspectjVersion"
}
task release(dependsOn: assemble) << {
copy {
description "Copy artifacts to $rootDir/dist"
from war.archivePath
into file("$rootDir/dist")
}
}
}
project('spring-nanotrader-web') {
apply plugin: 'war'
description = 'Spring Nanotrader Web'
task tar(type: Tar) {
from 'src/main/webapp'
compression = Compression.GZIP
destinationDir = file("build/libs")
}
artifacts {
archives tar
}
task release(dependsOn: assemble) << {
copy {
description "Copy artifacts to $rootDir/dist"
from war.archivePath
from tar.archivePath
into file("$rootDir/dist")
}
}
}
project('spring-nanotrader-asynch-services') {
apply plugin: 'war'
description = 'Spring Nanotrader Asynch Services'
dependencies {
compile project(":spring-nanotrader-data")
compile project(":spring-nanotrader-service-support")
compile "org.springframework:spring-webmvc:$springVersion"
providedCompile ("javax.servlet:servlet-api:$servletApiVersion")
compile "com.jayway.jsonpath:json-path:0.8.1"
compile "cglib:cglib-nodep:$cglibVersion"
compile "org.codehaus.jackson:jackson-mapper-asl:1.8.5"
compile "javax.inject:javax.inject:$javaxInjectVersion"
compile "net.sf.dozer:dozer:$dozerVersion"
testCompile "org.springframework:spring-test-mvc:1.0.0.BUILD-SNAPSHOT"
compile "org.aspectj:aspectjweaver:$aspectjVersion"
}
task release(dependsOn: assemble) << {
copy {
description "Copy artifacts to $rootDir/dist"
from war.archivePath
into file("$rootDir/dist")
}
}
}
apply plugin: 'docbook-reference'
reference { ext.sourceDir = file('src/reference/docbook') }
apply plugin: 'sonar'
sonar {
if (rootProject.hasProperty('sonarHostUrl')) {
server.url = rootProject.sonarHostUrl
}
database {
if (rootProject.hasProperty('sonarJdbcUrl')) {
url = rootProject.sonarJdbcUrl
}
if (rootProject.hasProperty('sonarJdbcDriver')) {
driverClassName = rootProject.sonarJdbcDriver
}
if (rootProject.hasProperty('sonarJdbcUsername')) {
username = rootProject.sonarJdbcUsername
}
if (rootProject.hasProperty('sonarJdbcPassword')) {
password = rootProject.sonarJdbcPassword
}
}
project {
dynamicAnalysis = "reuseReports"
withProjectProperties { props ->
props["sonar.core.codeCoveragePlugin"] = "jacoco"
props["sonar.jacoco.reportPath"] = "${buildDirName}/jacoco.exec"
}
}
logger.info("Sonar parameters used: server.url='${server.url}'; database.url='${database.url}'; database.driverClassName='${database.driverClassName}'; database.username='${database.username}'")
}
task api(type: Javadoc) {
group = 'Documentation'
description = 'Generates aggregated Javadoc API documentation.'
title = "${rootProject.description} ${version} API"
options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
options.author = true
options.header = rootProject.description
options.overview = 'src/api/overview.html'
source subprojects.collect { project ->
project.sourceSets.main.allJava
}
destinationDir = new File(buildDir, "api")
classpath = files(subprojects.collect { project ->
project.sourceSets.main.compileClasspath
})
}
task docsZip(type: Zip) {
group = 'Distribution'
classifier = 'docs'
description = "Builds -${classifier} archive containing api and reference " +
"for deployment at static.springframework.org/spring-integration/docs."
from('src/dist') { include 'changelog.txt' }
from (api) { into 'api' }
from (reference) { into 'reference' }
}
task distZip(type: Zip, dependsOn: [docsZip]) {
group = 'Distribution'
classifier = 'dist'
description = "Builds -${classifier} archive, containing all jars and docs, " +
"suitable for community download page."
ext.baseDir = "${project.name}-${project.version}";
from('src/dist') {
include 'readme.txt'
include 'license.txt'
include 'notice.txt'
into "${baseDir}"
}
from(zipTree(docsZip.archivePath)) { into "${baseDir}/docs" }
subprojects.each { subproject ->
into ("${baseDir}/libs") {
from subproject.jar
from subproject.sourcesJar
from subproject.javadocJar
}
}
}
artifacts {
archives distZip
archives docsZip
}
task dist(dependsOn: assemble) {
group = 'Distribution'
description = 'Builds -dist, -docs distribution archives.'
}
task wrapper(type: Wrapper) {
description = 'Generates gradlew[.bat] scripts'
gradleVersion = '1.0-rc-1-20120409112701+0200'
distributionUrl = 'http://services.gradle.org/distributions-snapshots/gradle-1.0-rc-1-20120409112701+0200-bin.zip'
jarFile = '.wrapper/gradle-wrapper.jar'
}
def customizePom(def pom, def gradleProject) {
pom.whenConfigured { generatedPom ->
// respect 'optional' and 'provided' dependencies
def deps = gradleProject.configurations.runtime.allDependencies
def optionalDeps = deps.findAll { dep ->
dep.asDynamicObject.hasProperty('optional') && dep.optional
}
def providedDeps = deps.findAll { dep ->
dep.asDynamicObject.hasProperty('provided') && dep.provided
}
generatedPom.dependencies.each { mavenDep ->
mavenDep.optional = optionalDeps.any { optionalDep ->
optionalDep.group == mavenDep.groupId &&
optionalDep.name == mavenDep.artifactId &&
optionalDep.version == mavenDep.version
}
boolean isProvided = providedDeps.any { providedDep ->
providedDep.group == mavenDep.groupId &&
providedDep.name == mavenDep.artifactId &&
providedDep.version == mavenDep.version
}
if (isProvided) {
mavenDep.scope = 'provided'
}
}
// eliminate test-scoped dependencies (no need in maven central poms)
generatedPom.dependencies.removeAll { dep ->
dep.scope == 'test'
}
// add all items necessary for maven central publication
generatedPom.project {
name = gradleProject.description
description = gradleProject.description
url = 'https://github.com/SpringSource/spring-nanotrader'
organization {
name = 'SpringSource'
url = 'http://springsource.org'
}
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}
scm {
url = 'https://github.com/SpringSource/nanotrader'
connection = 'scm:git:git://github.com/SpringSource/nanotrader'
developerConnection = 'scm:git:git://github.com/SpringSource/nanotrader'
}
developers {
developer {
id = 'dussab'
name = 'Brian Dussault'
email = '[email protected]'
}
developer {
id = 'garyrussell'
name = 'Gary Russell'
email = '[email protected]'
}
}
}
}
}