forked from ow2-proactive/catalog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
331 lines (259 loc) · 9.49 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
buildscript {
repositories {
jcenter()
maven {
url "http://repository.activeeon.com/content/groups/proactive/"
}
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'org.springframework.boot:spring-boot-gradle-plugin:1.3.5.RELEASE'
classpath 'com.diffplug.gradle.spotless:spotless:2.4.0'
classpath 'org.ow2.proactive:coding-rules:1.0.0'
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.5.0'
classpath "io.spring.gradle:dependency-management-plugin:0.3.0.RELEASE"
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.6.1"
}
dependencies {
delete "gradle/ext"
ant.unjar src: configurations.classpath.find { it.name.startsWith("coding-rules") }, dest: 'gradle/ext'
}
}
apply plugin: 'project-report'
apply plugin: 'spring-boot'
apply plugin: 'com.github.kt3k.coveralls'
apply from: "$rootDir/gradle/ext/coding-format.gradle"
apply plugin: "io.spring.dependency-management"
apply plugin: 'antlr'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'jacoco'
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'war'
apply plugin: 'org.sonarqube'
group = 'org.ow2.proactive'
bootRepackage {
enabled = false
}
configurations {
// The following module is excluded to avoid clashes when embedded inside the ProActive Scheduler
all*.exclude module: 'spring-boot-starter-logging'
integrationTestCompile.extendsFrom testCompile
integrationTestRuntime.extendsFrom testRuntime
querydsl
jacksonCoreLibs
}
compileJava {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
coveralls {
sourceDirs = allprojects.sourceSets.main.allSource.srcDirs.flatten()
jacocoReportPath = "${buildDir}/reports/jacoco/test/jacocoTestReport.xml"
}
ext {
generatedSrcDir = "$projectDir/src/generated/java"
}
generateGrammarSource {
arguments += ["-visitor", "-long-messages"]
maxHeapSize = "64m"
outputDirectory = file("$generatedSrcDir/org/ow2/proactive/catalog/rest/query/parser")
}
repositories {
if (project.hasProperty('local')) {
mavenLocal()
}
jcenter()
maven {
url "http://repository.activeeon.com/content/groups/proactive/"
}
}
uploadArchives {
repositories {
mavenDeployer {
snapshotRepository(url: "http://repository.activeeon.com/content/repositories/snapshots/") {
authentication(userName: "${System.getProperty('nexusUsername')}",
password: "${System.getProperty('nexusPassword')}")
}
repository(url: "http://repository.activeeon.com/content/repositories/releases/") {
authentication(userName: "${System.getProperty('nexusUsername')}",
password: "${System.getProperty('nexusPassword')}")
}
}
}
}
sourceSets {
generated {
java {
srcDirs += generatedSrcDir
}
}
main {
java {
srcDirs += generatedSrcDir
}
}
integrationTest {
java.srcDir file('src/integration-test/java')
resources.srcDir file('src/integration-test/resources')
compileClasspath = sourceSets.main.output + configurations.integrationTestCompile
runtimeClasspath = output + compileClasspath + configurations.integrationTestRuntime
}
}
springBoot {
mainClass = 'org.ow2.proactive.catalog.Application'
}
war {
baseName = "catalog"
version = version
classpath configurations.jacksonCoreLibs
}
dependencyManagement {
imports {
mavenBom "org.ow2.proactive:parent-bom:${version}"
}
}
dependencies {
antlr 'org.antlr:antlr4'
compile 'org.apache.tika:tika-core:1.18'
compile 'commons-fileupload:commons-fileupload'
compile 'org.apache.commons:commons-lang3'
compile 'com.fasterxml.jackson.core:jackson-databind'
compile 'com.fasterxml.jackson.core:jackson-core'
compile 'com.fasterxml.jackson.core:jackson-annotations'
compile 'com.fasterxml.jackson.datatype:jackson-datatype-joda'
compile 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310'
compile 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8'
compile 'com.fasterxml.jackson.jaxrs:jackson-jaxrs-base'
compile 'com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider'
compile 'com.fasterxml.jackson.module:jackson-module-jaxb-annotations'
compile 'com.fasterxml.jackson.dataformat:jackson-dataformat-cbor'
compile 'com.mysema.querydsl:querydsl-jpa'
jacksonCoreLibs 'com.fasterxml.jackson.core:jackson-databind'
jacksonCoreLibs 'com.fasterxml.jackson.core:jackson-core'
jacksonCoreLibs 'com.fasterxml.jackson.core:jackson-annotations'
jacksonCoreLibs 'com.fasterxml.jackson.dataformat:jackson-dataformat-cbor'
querydsl 'com.mysema.querydsl:querydsl-apt'
/*
Spring boot 1.3.X relies on hibernate 4 which is not compatible
with the version that is used with Scheduling project
*/
compile 'org.springframework.boot:spring-boot-starter-data-jpa'
compile('org.hibernate:hibernate-entitymanager')
compile('org.hibernate:hibernate-core')
compile 'org.springframework.boot:spring-boot-starter-log4j2'
compile 'org.springframework.boot:spring-boot-starter-web'
//logger
compile "org.apache.logging.log4j:log4j-web"
compile 'org.springframework.hateoas:spring-hateoas'
compile 'org.eclipse.jetty:jetty-servlets'
providedCompile 'org.springframework.boot:spring-boot-starter-tomcat'
providedRuntime 'org.hsqldb:hsqldb'
compile 'io.springfox:springfox-spring-web'
compile 'io.springfox:springfox-swagger2'
compile 'io.springfox:springfox-swagger-ui'
compile 'com.graphql-java:graphql-java'
compile 'org.projectlombok:lombok'
compile 'org.zeroturnaround:zt-zip'
compile 'com.github.ben-manes.caffeine:caffeine'
// library to build pdf reports
compile 'com.github.dhorions:boxable'
//support for Oracle DB version 12.1.0.2
//testCompile group: 'com.oracle', name: 'ojdbc7', version: '12.1.0.2'
//support for MySQL DB
testCompile group: 'mysql', name: 'mysql-connector-java', version: '8.0.13'
//support for PostgreSQL DB
testCompile group: 'org.postgresql', name: 'postgresql', version: '42.0.0'
//support for SqlServer DB
testCompile group: 'com.microsoft.sqlserver', name: 'mssql-jdbc', version: '7.1.2.jre8-preview'
// Using the Scheduler Rest client as authentication service
providedCompile "org.ow2.proactive_grid_cloud_portal:rest-client:$version"
// scheduler-api for parsing workflows
providedCompile "org.ow2.proactive:scheduler-api:$version"
testCompile 'com.google.truth:truth'
testCompile 'junit:junit'
testCompile 'nl.jqno.equalsverifier:equalsverifier'
testCompile 'org.mockito:mockito-core'
integrationTestCompile 'com.google.code.gson:gson'
integrationTestCompile 'com.jayway.restassured:rest-assured'
integrationTestCompile 'org.springframework.boot:spring-boot-starter-test'
}
test {
jacoco {
destinationFile = file("$buildDir/jacoco/jacocoTest.exec")
}
}
task integrationTest(type: Test) {
testClassesDir = sourceSets.integrationTest.output.classesDir
classpath = sourceSets.integrationTest.runtimeClasspath
classpath += sourceSets.test.runtimeClasspath
jacoco {
destinationFile = file("$buildDir/jacoco/jacocoIntegrationTest.exec")
}
testLogging {
events "passed", "skipped", "failed"
}
}
task generateQueryDSL(type: JavaCompile, group: 'build', description: 'Generates the QueryDSL query types') {
// place the output of the QueryDSL predicate processor in a new location.
def outputDir = file("$generatedSrcDir")
outputs.dir outputDir
doFirst {
// make sure the directory exists.
outputDir.exists() || outputDir.mkdirs()
}
source = sourceSets.main.java
classpath = configurations.compile + configurations.querydsl
options.compilerArgs = [
"-proc:only",
"-processor", "com.mysema.query.apt.jpa.JPAAnnotationProcessor"
]
// generated code goes into the generated code directory.
destinationDir = outputDir
dependencyCacheDir = compileJava.dependencyCacheDir
}
compileJava.dependsOn generateQueryDSL
compileJava.source generateQueryDSL.outputs.files, sourceSets.main.java
jacocoTestReport {
executionData test, integrationTest
sourceSets project.sourceSets.main
reports {
html.enabled = true
xml.enabled = true
}
// remove auto-generated classes from report
afterEvaluate {
classDirectories = files(classDirectories.files.collect {
fileTree(dir: it, excludes: [
'org/ow2/proactive/catalog/rest/entity/Q*',
'org/ow2/proactive/catalog/rest/query/parser/*']);
})
}
}
clean {
sourceSets.generated.java.srcDirs.each {
srcDir -> delete srcDir
}
}
task wrapper(type: Wrapper) {
gradleVersion = '2.10'
}
check.dependsOn integrationTest
jacocoTestReport.dependsOn check
tasks.coveralls.dependsOn jacocoTestReport
tasks.withType(Test) {
reports.html.destination = file("${reporting.baseDir}/${name}")
}
idea {
module {
testSourceDirs += file('src/integration-test/java')
testSourceDirs += file('src/integration-test/resources')
scopes.TEST.plus += [
configurations.integrationTestCompile,
configurations.integrationTestRuntime
]
}
}