forked from thehyve/transmart-batch
-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
210 lines (170 loc) · 6.52 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
plugins {
id 'us.kirchmeier.capsule' version '0.9.0'
}
apply plugin: 'jacoco'
apply plugin: 'groovy'
apply plugin: 'application'
apply plugin: 'codenarc'
apply plugin: 'maven'
group 'org.transmartproject'
version '16.2-SNAPSHOT'
repositories {
mavenCentral()
maven { url 'https://repo.thehyve.nl/content/groups/public/' }
}
compileGroovy {
options.incremental = true
}
dependencies {
final SPRING_VERSION = '4.1.0.RELEASE'
final BATCH_VERSION = '3.0.1.RELEASE'
final LOGBACK_VERSION = '1.0.13'
final SLF4J_VERSION = '1.7.5'
final GUAVA_VERSION = '18.0'
final JUNIT_VERSION = '4.11'
final GMOCK_VERSION = '0.8.3'
final POSTGRESQL_VERSION = '9.3-1102-jdbc41'
final ORACLE_VERSION = '11.2.0.3.0'
final H2_VERSION = '1.4.185'
final HIBERNATE_VALIDATOR_VERSION = '5.2.2.Final'
compile 'org.codehaus.groovy:groovy-all:2.3.6'
compile group: 'org.springframework.batch', name: 'spring-batch-core', version: BATCH_VERSION
compile group: 'org.springframework', name: 'spring-context', version: SPRING_VERSION
compile group: 'org.springframework', name: 'spring-tx', version: SPRING_VERSION
compile group: 'org.springframework', name: 'spring-jdbc', version: SPRING_VERSION
// compile group: 'org.springframework', name: 'spring-orm', version: SPRING_VERSION
// compile group: 'org.springframework', name: 'spring-oxm', version: SPRING_VERSION
compile group: 'com.jolbox', name: 'bonecp-spring', version: '0.8.0.RELEASE'
compile group: 'com.google.guava', name: 'guava', version: GUAVA_VERSION
compile group: 'commons-cli', name: 'commons-cli', version: '1.2'
compile group: 'org.hibernate', name: 'hibernate-validator', version: HIBERNATE_VALIDATOR_VERSION
compile group: 'ch.qos.logback', name: 'logback-classic', version: LOGBACK_VERSION
compile group: 'org.slf4j', name: 'jcl-over-slf4j', version: SLF4J_VERSION
runtime group: 'org.postgresql', name: 'postgresql', version: POSTGRESQL_VERSION
runtime group: 'com.oracle', name: 'ojdbc6', version: ORACLE_VERSION
testCompile group: 'org.springframework.batch', name: 'spring-batch-test', version: BATCH_VERSION
testCompile group: 'org.springframework', name: 'spring-test', version: SPRING_VERSION
testCompile group: 'junit', name: 'junit', version: JUNIT_VERSION
testCompile group: 'org.gmock', name: 'gmock', version: GMOCK_VERSION
testCompile group: 'uk.co.modular-it', name: 'hamcrest-date', version: '0.9.5'
testCompile group: 'com.h2database', name: 'h2', version: H2_VERSION
}
def mainClass = 'org.transmartproject.batch.startup.RunJob'
run {
mainClassName = mainClass
maxHeapSize = '4g'
if (project.hasProperty('args')) {
def collectedArgs = []
def matcher = project.args =~ '''(?x)
(?:
([^'"]\\S*) | #unquoted parameter
(?:'([^']*)') |
(?:"([^"]*)")
)
(?:\\s+|$)'''
while (matcher.find()) {
collectedArgs << matcher.group(1) ?: matcher.group(2) ?: matcher.group(3)
}
args collectedArgs
}
}
task capsule(type: ThinCapsule) {
description = 'Creates the capsule jar.'
group = 'build'
applicationClass mainClass
reallyExecutable { trampoline() }
capsuleManifest {
extractCapsule = false
repositories = ['central', 'https://repo.thehyve.nl/content/groups/public/']
}
}
sourceSets {
functionalTest {
java.srcDir 'src/test-func/java'
groovy.srcDir 'src/test-func/groovy'
resources.srcDir 'src/test-func/resources'
compileClasspath += sourceSets.main.compileClasspath
compileClasspath += sourceSets.test.compileClasspath
}
}
task functionalTestPrepare(type: JavaExec) {
description = 'Prepares the database for functional testing.'
group = 'verification'
main = 'org.springframework.batch.core.launch.support.CommandLineJobRunner'
args 'org.transmartproject.batch.preparation.TestDatabasePrepareConfiguration',
'testDatabasePrepareJob'
maxHeapSize = '2g'
classpath += sourceSets.test.runtimeClasspath
classpath += sourceSets.functionalTest.runtimeClasspath
}
task functionalTest(type: Test) {
description = 'Runs the functional tests.'
group = 'verification'
systemProperties = ['user.timezone': 'GMT']
maxHeapSize = '2g'
testClassesDir = sourceSets.functionalTest.output.classesDir
classpath += sourceSets.test.runtimeClasspath
classpath += sourceSets.functionalTest.runtimeClasspath
useJUnit()
outputs.upToDateWhen { false }
reports {
html.destination = file("$reports.html.destination/functional")
junitXml.destination = file("$reports.junitXml.destination/functional")
}
}
task wrapper(type: Wrapper) {
gradleVersion = '2.5'
}
def getPomConfiguration() {
return {
name 'transmart-batch'
packaging 'jar'
description 'tranSMART pipeline alternative to Kettle + stored procedures, using Spring Batch.'
inceptionYear '2014'
url 'https://github.com/thehyve/transmart-batch'
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}
}
}
codenarc {
configFile = new File("${project.projectDir.absolutePath}/gradle/codenarc/ruleset.groovy")
reportFormat = 'html'
}
jacocoTestReport {
reports {
xml.enabled true
csv.enabled false
//html.destination "${buildDir}/jacocoHtml"
}
}
jacocoTestReport.executionData functionalTest
task setupSchema(type: JavaExec) {
description = 'Creates the ts_batch schema.'
main = 'org.transmartproject.batch.db.BatchSchemaPopulator'
classpath = sourceSets.main.runtimeClasspath
}
configurations.archives.artifacts.clear() //remove jar
artifacts {
archives capsule
}
uploadArchives {
repositories {
mavenDeployer {
def credentials = [
// put these in ~/.gradle/gradle.properties
userName: project.ext.properties['mavenTheHyveUser'] ?: '',
password: project.ext.properties['mavenTheHyvePassword'] ?: '',
]
repository url: 'https://repo.thehyve.nl/content/repositories/releases/',
authentication: credentials
snapshotRepository url: 'https://repo.thehyve.nl/content/repositories/snapshots/',
authentication: credentials
pom.project pomConfiguration
}
}
}