-
-
Notifications
You must be signed in to change notification settings - Fork 83
/
build.gradle
311 lines (252 loc) · 11.1 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
plugins {
id("io.github.gradle-nexus.publish-plugin") version "1.3.0"
id("biz.aQute.bnd.builder") version "6.3.1"
}
apply plugin: 'maven-publish'
apply plugin: 'signing'
apply plugin: 'java'
version = '2.15.1'
group = 'de.undercouch'
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
repositories {
mavenCentral()
}
tasks.withType(JavaCompile).configureEach {
options.compilerArgs << "-Xlint"
}
configurations {
integrationTestBase
integrationTest21 { extendsFrom integrationTestBase }
integrationTest22 { extendsFrom integrationTestBase }
integrationTest23 { extendsFrom integrationTestBase }
integrationTest24 { extendsFrom integrationTestBase }
integrationTest25 { extendsFrom integrationTestBase }
integrationTest26 { extendsFrom integrationTestBase }
integrationTest27 { extendsFrom integrationTestBase }
integrationTest28 { extendsFrom integrationTestBase }
integrationTest29 { extendsFrom integrationTestBase }
integrationTest210 { extendsFrom integrationTestBase }
integrationTest211 { extendsFrom integrationTestBase }
integrationTest212 { extendsFrom integrationTestBase }
integrationTest213 { extendsFrom integrationTestBase }
integrationTest214 { extendsFrom integrationTestBase }
integrationTest215 { extendsFrom integrationTestBase }
}
String jacksonCore = 'com.fasterxml.jackson.core:jackson-core:'
String jacksonAnnotations = 'com.fasterxml.jackson.core:jackson-annotations:'
String jacksonDatabind = 'com.fasterxml.jackson.core:jackson-databind:'
String junit = 'junit:junit:4.13.2'
String mongoDbJavaDriver = 'org.mongodb:mongo-java-driver:3.12.14'
dependencies {
implementation jacksonCore + '2.15.2'
implementation jacksonAnnotations + '2.15.2'
implementation jacksonDatabind + '2.15.2'
testImplementation junit
testImplementation mongoDbJavaDriver
integrationTestBase junit
integrationTestBase mongoDbJavaDriver
integrationTest21 jacksonCore + '2.1.0'
integrationTest21 jacksonAnnotations + '2.1.0'
integrationTest21 jacksonDatabind + '2.1.0'
integrationTest22 jacksonCore + '2.2.0'
integrationTest22 jacksonAnnotations + '2.2.0'
integrationTest22 jacksonDatabind + '2.2.0'
integrationTest23 jacksonCore + '2.3.0'
integrationTest23 jacksonAnnotations + '2.3.0'
integrationTest23 jacksonDatabind + '2.3.0'
integrationTest24 jacksonCore + '2.4.0'
integrationTest24 jacksonAnnotations + '2.4.0'
integrationTest24 jacksonDatabind + '2.4.0'
integrationTest25 jacksonCore + '2.5.0'
integrationTest25 jacksonAnnotations + '2.5.0'
integrationTest25 jacksonDatabind + '2.5.0'
integrationTest26 jacksonCore + '2.6.4'
integrationTest26 jacksonAnnotations + '2.6.4'
integrationTest26 jacksonDatabind + '2.6.4'
integrationTest27 jacksonCore + '2.7.0'
integrationTest27 jacksonAnnotations + '2.7.0'
integrationTest27 jacksonDatabind + '2.7.0'
integrationTest28 jacksonCore + '2.8.0'
integrationTest28 jacksonAnnotations + '2.8.0'
integrationTest28 jacksonDatabind + '2.8.0'
integrationTest29 jacksonCore + '2.9.3'
integrationTest29 jacksonAnnotations + '2.9.3'
integrationTest29 jacksonDatabind + '2.9.3'
integrationTest210 jacksonCore + '2.10.5'
integrationTest210 jacksonAnnotations + '2.10.5'
integrationTest210 jacksonDatabind + '2.10.5'
integrationTest211 jacksonCore + '2.11.1'
integrationTest211 jacksonAnnotations + '2.11.1'
integrationTest211 jacksonDatabind + '2.11.1'
integrationTest212 jacksonCore + '2.12.5'
integrationTest212 jacksonAnnotations + '2.12.5'
integrationTest212 jacksonDatabind + '2.12.5'
integrationTest213 jacksonCore + '2.13.0'
integrationTest213 jacksonAnnotations + '2.13.0'
integrationTest213 jacksonDatabind + '2.13.0'
integrationTest214 jacksonCore + '2.14.3'
integrationTest214 jacksonAnnotations + '2.14.3'
integrationTest214 jacksonDatabind + '2.14.3'
integrationTest215 jacksonCore + '2.15.2'
integrationTest215 jacksonAnnotations + '2.15.2'
integrationTest215 jacksonDatabind + '2.15.2'
}
tasks.named("jar") {
// define OSGi bundle manifest
bundle {
bnd(
"Bundle-Name": "bson4jackson",
"Bundle-SymbolicName": "de.undercouch.bson4jackson",
"Bundle-Vendor": "Michel Kraemer",
'-exportcontents': "de.undercouch.*;version=${version}"
)
}
}
tasks.register('doIntegrationTest21', Test) {
useJUnit {
excludeCategories 'de.undercouch.bson4jackson.RequiresJackson_v2_3'
excludeCategories 'de.undercouch.bson4jackson.RequiresJackson_v2_5'
excludeCategories 'de.undercouch.bson4jackson.RequiresJackson_v2_7'
}
testClassesDirs = testing.suites.test.sources.output.classesDirs
classpath = sourceSets.test.output + sourceSets.main.output + configurations.integrationTest21
}
tasks.register('doIntegrationTest22', Test) {
useJUnit {
excludeCategories 'de.undercouch.bson4jackson.RequiresJackson_v2_3'
excludeCategories 'de.undercouch.bson4jackson.RequiresJackson_v2_5'
excludeCategories 'de.undercouch.bson4jackson.RequiresJackson_v2_7'
}
testClassesDirs = testing.suites.test.sources.output.classesDirs
classpath = sourceSets.test.output + sourceSets.main.output + configurations.integrationTest22
}
tasks.register('doIntegrationTest23', Test) {
useJUnit {
excludeCategories 'de.undercouch.bson4jackson.RequiresJackson_v2_5'
excludeCategories 'de.undercouch.bson4jackson.RequiresJackson_v2_7'
}
testClassesDirs = testing.suites.test.sources.output.classesDirs
classpath = sourceSets.test.output + sourceSets.main.output + configurations.integrationTest23
}
tasks.register('doIntegrationTest24', Test) {
useJUnit {
excludeCategories 'de.undercouch.bson4jackson.RequiresJackson_v2_5'
excludeCategories 'de.undercouch.bson4jackson.RequiresJackson_v2_7'
}
testClassesDirs = testing.suites.test.sources.output.classesDirs
classpath = sourceSets.test.output + sourceSets.main.output + configurations.integrationTest24
}
tasks.register('doIntegrationTest25', Test) {
useJUnit {
excludeCategories 'de.undercouch.bson4jackson.RequiresJackson_v2_7'
}
testClassesDirs = testing.suites.test.sources.output.classesDirs
classpath = sourceSets.test.output + sourceSets.main.output + configurations.integrationTest25
}
tasks.register('doIntegrationTest26', Test) {
useJUnit {
excludeCategories 'de.undercouch.bson4jackson.RequiresJackson_v2_7'
}
testClassesDirs = testing.suites.test.sources.output.classesDirs
classpath = sourceSets.test.output + sourceSets.main.output + configurations.integrationTest26
}
tasks.register('doIntegrationTest27', Test) {
testClassesDirs = testing.suites.test.sources.output.classesDirs
classpath = sourceSets.test.output + sourceSets.main.output + configurations.integrationTest27
}
tasks.register('doIntegrationTest28', Test) {
testClassesDirs = testing.suites.test.sources.output.classesDirs
classpath = sourceSets.test.output + sourceSets.main.output + configurations.integrationTest28
}
tasks.register('doIntegrationTest29', Test) {
testClassesDirs = testing.suites.test.sources.output.classesDirs
classpath = sourceSets.test.output + sourceSets.main.output + configurations.integrationTest29
}
tasks.register('doIntegrationTest210', Test) {
testClassesDirs = testing.suites.test.sources.output.classesDirs
classpath = sourceSets.test.output + sourceSets.main.output + configurations.integrationTest210
}
tasks.register('doIntegrationTest211', Test) {
testClassesDirs = testing.suites.test.sources.output.classesDirs
classpath = sourceSets.test.output + sourceSets.main.output + configurations.integrationTest211
}
tasks.register('doIntegrationTest212', Test) {
testClassesDirs = testing.suites.test.sources.output.classesDirs
classpath = sourceSets.test.output + sourceSets.main.output + configurations.integrationTest212
}
tasks.register('doIntegrationTest213', Test) {
testClassesDirs = testing.suites.test.sources.output.classesDirs
classpath = sourceSets.test.output + sourceSets.main.output + configurations.integrationTest213
}
tasks.register('doIntegrationTest214', Test) {
testClassesDirs = testing.suites.test.sources.output.classesDirs
classpath = sourceSets.test.output + sourceSets.main.output + configurations.integrationTest214
}
tasks.register('doIntegrationTest215', Test) {
testClassesDirs = testing.suites.test.sources.output.classesDirs
classpath = sourceSets.test.output + sourceSets.main.output + configurations.integrationTest215
}
tasks.register('integrationTest') {
dependsOn([doIntegrationTest21, doIntegrationTest22,
doIntegrationTest23, doIntegrationTest24, doIntegrationTest25,
doIntegrationTest26, doIntegrationTest27, doIntegrationTest28,
doIntegrationTest29, doIntegrationTest210, doIntegrationTest211,
doIntegrationTest212, doIntegrationTest213, doIntegrationTest214,
doIntegrationTest215])
}
check.dependsOn integrationTest
java {
withJavadocJar()
withSourcesJar()
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
pom {
name = 'bson4jackson'
packaging = 'jar'
description = 'A pluggable BSON generator and parser for Jackson JSON processor.'
url = 'https://michelkraemer.com'
scm {
url = 'scm:git:git://github.com/michel-kraemer/bson4jackson.git'
connection = 'scm:git:git://github.com/michel-kraemer/bson4jackson.git'
developerConnection = 'scm:git:git://github.com/michel-kraemer/bson4jackson.git'
}
licenses {
license {
name = 'The Apache Software License, Version 2.0'
url = 'https://www.apache.org/licenses/LICENSE-2.0.txt'
distribution = 'repo'
}
}
developers {
developer {
id = 'michel-kraemer'
name = 'Michel Kraemer'
email = '[email protected]'
url = 'https://michelkraemer.com'
}
}
}
}
}
}
// sign all artifacts
signing {
useGpgCmd()
sign publishing.publications.mavenJava
}
tasks.withType(Sign).configureEach {
// only sign release artifacts and not snapshots
onlyIf { isReleaseVersion }
}
nexusPublishing {
repositories {
sonatype()
}
}