-
Notifications
You must be signed in to change notification settings - Fork 25
/
build.gradle
426 lines (333 loc) · 12.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
import com.github.jk1.license.render.*
buildscript {
repositories {
mavenCentral()
maven {
url "http://repository.activeeon.com/content/groups/proactive/"
}
maven {
url "https://plugins.gradle.org/m2/"
}
}
configurations.maybeCreate("pitest")
dependencies {
classpath 'org.springframework.boot:spring-boot-gradle-plugin:1.5.22.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:1.0.15.RELEASE"
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.6.1"
classpath "info.solidsoft.gradle.pitest:gradle-pitest-plugin:1.3.0"
classpath 'com.github.jk1:gradle-license-report:1.7'
}
dependencies {
delete "gradle/ext"
ant.unjar src: configurations.classpath.find { it.name.startsWith("coding-rules") }, dest: 'gradle/ext'
pitest 'eu.stamp-project:descartes:1.2.4'
}
}
apply plugin: 'project-report'
apply plugin: 'org.springframework.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'
apply plugin: 'info.solidsoft.pitest'
apply plugin: 'com.github.jk1.dependency-license-report'
pitest {
pitestVersion = "1.4.0"
targetClasses = ['org.ow2.proactive.catalog.*']
threads = 2
outputFormats = ['XML', 'HTML', 'METHODS','ISSUES']
timestampedReports = false
testSourceSets = [sourceSets.test]
mainSourceSets = [sourceSets.main]
mutationEngine = "descartes"
}
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")
}
licenseReport {
configurations = ['runtime']
renderers = [new InventoryHtmlReportRenderer()]
}
repositories {
if (project.hasProperty('local')) {
mavenLocal()
}
mavenCentral()
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}"
}
resolutionStrategy {
cacheChangingModulesFor 0, 'seconds'
}
}
dependencies {
antlr 'org.antlr:antlr4:4.7.2'
compile 'org.apache.tika:tika-core:1.28.5'
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 'jakarta.activation:jakarta.activation-api'
compile 'com.querydsl:querydsl-jpa:4.1.4'
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.querydsl:querydsl-apt:4.1.4'
/*
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:1.5.22.RELEASE'
compile('org.hibernate:hibernate-entitymanager')
compile('org.hibernate:hibernate-core')
compile('javax.validation:validation-api:1.1.0.Final')
compile 'org.springframework.boot:spring-boot-starter-log4j2:1.5.22.RELEASE'
compile ('org.springframework.boot:spring-boot-starter-web:1.5.22.RELEASE')
compile ('org.springframework.boot:spring-boot-starter-validation:1.5.22.RELEASE')
compile group: 'org.jasypt', name: 'jasypt', version: '1.9.3'
// when upgrading the following library version, make sure the default encryption settings did not change
// see scheduling/PropertyDecrypter.java for default settings
compile group: 'com.github.ulisesbocchio', name: 'jasypt-spring-boot', version: '1.9'
//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:1.5.22.RELEASE'
providedRuntime 'org.hsqldb:hsqldb:2.7.2:jdk8'
compile 'org.springdoc:springdoc-openapi-ui:1.7.0'
compile 'com.graphql-java:graphql-java:17.6'
compile 'com.graphql-java:graphql-java-extended-scalars:17.1'
compile 'org.projectlombok:lombok'
//dependencies for call graph
compile group: 'org.jgrapht', name: 'jgrapht-core', version: '1.3.0'
compile group: 'org.jgrapht', name: 'jgrapht-ext', version: '1.3.0'
compile 'org.zeroturnaround:zt-zip'
compile 'com.github.ben-manes.caffeine:caffeine'
compile 'org.jsoup:jsoup:1.15.4'
// library to build pdf reports
compile 'com.github.dhorions:boxable:1.7.0'
compile "org.ow2.proactive:microservices-common:$version"
//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
compile ("org.ow2.proactive_grid_cloud_portal:rest-client:$version") {
exclude group: 'org.slf4j', module: 'slf4j-log4j12'
exclude group: 'org.slf4j', module: 'slf4j-reload4j'
exclude group: 'log4j', module: 'log4j'
exclude group: 'ch.qos.reload4j', module: 'reload4j'
}
// scheduler-api for parsing workflows
compile ("org.ow2.proactive:scheduler-api:$version") {
exclude group: 'org.slf4j', module: 'slf4j-log4j12'
exclude group: 'org.slf4j', module: 'slf4j-reload4j'
exclude group: 'log4j', module: 'log4j'
exclude group: 'ch.qos.reload4j', module: 'reload4j'
}
// custom hibernate-hikaricp version to use HikariCP 4.0
runtime('org.hibernate:hibernate-hikaricp') {
exclude group: 'org.javassist', module: 'javassist'
}
testCompile 'com.google.truth:truth'
testCompile 'junit:junit'
testCompile 'nl.jqno.equalsverifier:equalsverifier'
testCompile 'org.mockito:mockito-core'
testRuntime 'ch.qos.reload4j:reload4j:1.2.25'
integrationTestCompile 'com.google.code.gson:gson'
integrationTestCompile 'com.jayway.restassured:rest-assured'
integrationTestCompile 'org.springframework.boot:spring-boot-starter-test:1.5.22.RELEASE'
// custom hibernate-hikaricp version to use HikariCP 4.0
integrationTestRuntime('org.hibernate:hibernate-hikaricp') {
exclude group: 'org.javassist', module: 'javassist'
}
integrationTestRuntime 'ch.qos.reload4j:reload4j:1.2.25'
}
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.querydsl.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/*']);
})
}
}
task updateWar(type: Zip, dependsOn: war) {
def originalWar = file("build/libs/catalog-${version}.war")
archiveName = "catalog-${version}.war"
from(zipTree(originalWar)) {
// Remove the original graphql jar if it exists
exclude("**/WEB-INF/lib/graphql-java-17.6.jar")
}
// Include our own graphql jar
from("$rootDir/lib/graphql-java-17.6.jar") {
into('WEB-INF/lib/')
}
destinationDir file("${buildDir}/distributions")
}
task copyWar(type:Copy, dependsOn: updateWar) {
// copy back the modified war into the libs folder
from "${buildDir}/distributions/catalog-${version}.war"
into "${buildDir}/libs"
}
build.dependsOn copyWar
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
]
}
}