-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
141 lines (120 loc) · 4.38 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
plugins {
id 'java'
id 'application'
id 'com.github.johnrengelman.shadow' version '4.0.4'
// ide
id 'idea'
id 'eclipse'
// test coverage
id 'jacoco'
// quality
id 'org.sonarqube' version '2.7'
// docker build & push
id 'maven-publish'
id 'com.palantir.docker' version '0.21.0'
// integration tests
id 'org.unbroken-dome.test-sets' version '2.1.1'
// xenon --version reads version from this file
id 'de.fuerstenau.buildconfig' version '1.1.8'
}
description = 'Perform files and jobs operations with Xenon library from command line'
version = '3.0.5'
group = 'nl.esciencecenter.xenon.cli'
mainClassName = 'nl.esciencecenter.xenon.cli.Main'
applicationName = 'xenon'
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
repositories {
mavenLocal()
mavenCentral()
jcenter()
}
testSets {
integrationTest
}
ext.xenonLibVersion = '3.1.0'
ext.xenonCloudLibVersion = '3.0.2'
dependencies {
// runtime group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3'
implementation 'com.google.code.gson:gson:2.5'
implementation 'net.sourceforge.argparse4j:argparse4j:0.8.1'
implementation group: 'nl.esciencecenter.xenon', name: 'xenon', version: xenonLibVersion
// implementation group: 'nl.esciencecenter.xenon', name: 'xenon-all', version: xenonLibVersion
implementation group: 'nl.esciencecenter.xenon.adaptors', name: 'xenon-adaptors-cloud', version: xenonCloudLibVersion
// implementation group: 'nl.esciencecenter.xenon.adaptors', name: 'xenon-adaptors-hadoop', version: xenonLibVersion
// implementation group: 'nl.esciencecenter.xenon.adaptors', name: 'xenon-adaptors-grid', version: xenonLibVersion
implementation 'org.slf4j:slf4j-api:1.7.26'
testImplementation 'junit:junit:4.12'
testImplementation 'com.github.stefanbirkner:system-rules:1.18.0'
testImplementation 'org.mockito:mockito-core:2.25.1'
// integrationTestCompile 'org.apache.hadoop:hadoop-client:3.0.0'
integrationTestImplementation 'org.testcontainers:testcontainers:1.10.7'
}
docker {
name 'xenonmiddleware/xenon-cli'
dependsOn tasks.installShadowDist
files tasks.installShadowDist.outputs
}
dockerfileZip.enabled = false
// use shadow dists everywhere
distZip.enabled = false
distTar.enabled = false
assemble.dependsOn shadowDistTar
assemble.dependsOn shadowDistZip
jacocoTestReport {
description 'Generate coverage report of unit tests'
group 'Code coverage reporting'
reports {
xml.enabled true
}
}
jacocoTestReport.dependsOn test
check.dependsOn integrationTest
integrationTest.mustRunAfter test
task jacocoIntegrationTestReport(type: JacocoReport) {
description 'Generate coverage report of integration tests'
group 'Code coverage reporting'
executionData integrationTest
sourceSets sourceSets.main
}
task jacocoMerge(type: JacocoMerge) {
executionData test, integrationTest
}
task jacocoIntegrationAndUnitTestReport(type: JacocoReport) {
description 'Generate coverage report of integration and unit tests'
group 'Code coverage reporting'
dependsOn jacocoMerge
executionData jacocoMerge.destinationFile
sourceSets sourceSets.main
}
// See progress of tests
tasks.withType(Test) {
// only verbose logging on when CI environment var is set, because on CI we can't look at html test reports
if (System.getenv("CI")) {
testLogging {
events 'started', 'passed', 'skipped', 'failed'
exceptionFormat 'full'
showStackTraces true
}
}
}
sonarqube {
properties {
property 'sonar.projectKey', 'xenon-middleware_xenon-cli'
property 'sonar.host.url', 'https://sonarcloud.io'
property 'sonar.organization', "xenon-middleware"
property 'sonar.language', 'java'
property 'sonar.links.homepage', 'https://github.com/xenon-middleware/xenon-cli'
properties["sonar.tests"] += sourceSets.integrationTest.allSource.srcDirs
property 'sonar.jacoco.reportPaths', [jacocoTestReport.executionData, jacocoIntegrationTestReport.executionData]
}
}
project.tasks["sonarqube"].dependsOn "check"
buildConfig {
appName = project.applicationName
buildConfigField 'String', 'XENON_LIB_VERSION', "${xenonLibVersion}"
buildConfigField 'String', 'XENON_CLOUD_LIB_VERSION', "${xenonCloudLibVersion}"
}
shadowJar {
mergeServiceFiles()
}