-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.gradle
173 lines (144 loc) · 4.35 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
buildscript {
repositories {
mavenCentral()
}
}
plugins {
id 'com.github.ben-manes.versions' version '0.15.0'
id 'com.github.hierynomus.license' version '0.16.1'
id 'net.researchgate.release' version '2.6.0'
id 'com.github.kt3k.coveralls' version '2.8.1'
id 'org.sonarqube' version '2.5'
}
ext {
commonsCodecVersion = '1.11'
commonsCollectionVersion = '4.4'
commonsIoVersion = '2.11.0'
commonsLangVersion = '3.12.0'
commonsRdfVersion = '0.5.0'
imageMetadataVersion = '0.2.0-SNAPSHOT'
iiifVocabularyVersion = '0.1.1'
logbackVersion = '1.2.10'
lombokVersion = '1.18.22'
metadataExtractorVersion = '2.11.0'
xbeamVersion = '1.4.20'
jacksonVersion = '2.13.1'
picocliVersion = '4.6.2'
snakeYamlVersion = '1.30'
/* Testing */
junitVersion = "5.8.2"
mockitoVersion = '4.2.0'
slf4jVersion = '1.7.32'
systemStubsVersion = '2.0.1'
jacocoVersion = '0.8.7'
checkstyleVersion = '8.8'
jacocoTestProjects = [
'producer',
'model',
'xml-doc',
]
}
configure(allprojects) { project ->
group 'de.ubleipzig'
apply plugin: 'maven-publish'
apply plugin: 'java'
apply plugin: 'java-library'
apply plugin: 'idea'
apply plugin: 'checkstyle'
apply plugin: 'com.github.hierynomus.license'
apply plugin: 'jacoco'
idea {
module {
outputDir file('build/classes/main')
testOutputDir file('build/classes/test')
}
}
sourceCompatibility = 1.11
targetCompatibility = 1.11
ext {
moduleName = "de.ubleipzig.iiifproducer"
vendor = 'UB Leipzig'
license = 'Apache 2'
}
repositories {
mavenCentral()
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots'
}
}
dependencies {
testImplementation(platform("org.junit:junit-bom:$junitVersion"))
testImplementation('org.junit.jupiter:junit-jupiter')
}
}
subprojects { subproj ->
afterEvaluate {
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs.add("-Xlint:unchecked")
options.compilerArgs.add("-Xlint:deprecation")
}
}
compileTestJava {
doFirst {
options.compilerArgs = [
'-Xlint:deprecation'
]
}
}
}
checkstyle {
configFile = rootProject.file('buildtools/src/main/resources/checkstyle/checkstyle.xml')
configProperties.checkstyleConfigDir = rootProject.file('buildtools/src/main/resources/checkstyle/')
toolVersion = checkstyleVersion
}
license {
include "**/*.java"
header rootProject.file('buildtools/src/main/resources/license/HEADER.txt')
strictCheck true
mapping {
java = 'SLASHSTAR_STYLE'
}
}
jacoco {
toolVersion = jacocoVersion
}
afterEvaluate {
if (subproj.name in jacocoTestProjects) {
jacoco {
applyTo subproj.tasks.matching { it.name == 'junitPlatformTest' }
}
}
}
tasks.withType(Test).configureEach {
useJUnitPlatform()
systemProperty 'java.util.logging.config.file', "${subproj.buildDir}/resources/test/logging-test.properties"
forkEvery = 1
testLogging {
showStandardStreams = true
}
}
}
configure(rootProject) {
task jacocoMerge(type: JacocoMerge) {
subprojects.findAll { it.name in jacocoTestProjects }
.each { subproj ->
executionData fileTree(dir: "${subproj.buildDir}/jacoco", include: '*.exec')
dependsOn subproj.tasks.withType(Test)
}
}
task jacocoRootReport(type: JacocoReport, dependsOn: jacocoMerge) {
sourceDirectories.from = files(subprojects
.findAll { it.name in jacocoTestProjects }
.sourceSets.main.allSource.srcDirs)
classDirectories.from = files(subprojects
.findAll { it.name in jacocoTestProjects }
.sourceSets.main.output)
executionData jacocoMerge.destinationFile
reports {
html.required = true
xml.required = true
csv.required = false
}
}
}