forked from serenity-bdd/serenity-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
395 lines (345 loc) · 12.9 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
import org.ajoberstar.gradle.git.release.opinion.Strategies
import org.ajoberstar.grgit.Grgit
group = 'net.serenity-bdd'
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.5'
classpath 'org.ajoberstar:gradle-git:1.6.0'
classpath 'org.pegdown:pegdown:1.4.1'
}
}
apply plugin: 'org.ajoberstar.release-opinion'
task wrapper(type: Wrapper) {
gradleVersion = "${gradleVersion}"
}
subprojects {
task allDeps(type: DependencyReportTask) {}
}
ext {
seleniumVersion = '2.53.1'
htmlunitVersion = '2.21'
groovyVersion = '2.4.4'
gradleVersion = '2.10'
junitVersion = '4.12'
hamcrestVersion = '1.3'
springVersion = '4.3.5.RELEASE'
springBootVersion = '1.4.3.RELEASE'
guavaVersion = '20.0'
restAssuredVersion = '2.4.1'
mockitoCoreVersion = '1.10.19'
jbehaveCoreVersion = '4.1'
commonsIoVersion = '2.5'
commonsCollectionsVersion = '3.2.2'
commonsLang3Version = '3.4'
commonsCodecVersion = '1.10'
xstreamVersion = '1.4.9'
jodaTimeVersion = '2.7'
lambdajVersion = '2.3.3'
gsonVersion = '2.6.1'
typesafeConfigVersion = '1.2.1'
freemarkerVersion = '2.3.23'
wiremockCoreVersion = '1.58'
// Bintray configuration
bintrayBaseUrl = 'https://api.bintray.com/maven'
bintrayRepository = 'maven'
bintrayPackage = 'serenity-core'
projectDescription = 'Serenity Core'
if (!project.hasProperty("bintrayUsername")) {
bintrayUsername = 'wakaleo'
}
if (!project.hasProperty("bintrayApiKey")) {
bintrayApiKey = ''
}
}
allprojects {
apply plugin: 'project-report'
configurations.all {
resolutionStrategy {
// fail fast on dependency convergence problems
failOnVersionConflict()
// force versions to fix dependency convergence problems
// when updating this list, update Serenity's declared deps if exists
// TODO make work for generated Maven POM...
// it's working for gradle build, but also had to exclude old transitives for geio.appiumnerated POM
force "com.thoughtworks.xstream:xstream:${xstreamVersion}",
"commons-collections:commons-collections:${commonsCollectionsVersion}",
'commons-logging:commons-logging:1.2',
'xml-apis:xml-apis:1.4.01',
'org.springframework:spring-context:4.3.5.RELEASE'
}
}
}
release {
grgit = Grgit.open()
defaultVersionStrategy Strategies.SNAPSHOT
versionStrategy Strategies.SNAPSHOT
}
subprojects {
apply plugin: 'java'
apply plugin: 'groovy'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.bintray'
sourceCompatibility = 1.7
targetCompatibility = 1.7
repositories {
mavenLocal()
jcenter()
}
ext {
bintrayBaseUrl = 'https://api.bintray.com/maven'
bintrayRepository = 'maven'
bintrayPackage = 'serenity-core'
projectDescription = 'Serenity core libraries'
if (!project.hasProperty("bintrayUsername")) {
bintrayUsername = 'wakaleo'
}
if (!project.hasProperty("bintrayApiKey")) {
bintrayApiKey = ''
}
}
group = 'net.serenity-bdd'
version = rootProject.version
test {
exclude '**/*$*'
exclude '**/integration/**'
exclude '**/samples/**'
exclude '**/*Sample*'
minHeapSize = "128m"
maxHeapSize = "1536m"
if (!JavaVersion.current().isJava8Compatible()) {
jvmArgs += ["-XX:MaxPermSize=256m"]
}
// testLogging {
// events "passed", "skipped", "failed", "standardOut", "standardError"
// }
maxParallelForks = Integer.parseInt(System.getProperty("forks","1"))
}
task integrationTests(type: Test) {
exclude '**/*$*'
exclude '**/samples/**'
exclude '**/*Sample*'
exclude '**/integration/browsers**'
include '**/integration/**'
reports.junitXml.destination = "${buildDir}/reports/integration-tests"
reports.html.destination = "${buildDir}/reports/integration-tests"
minHeapSize = "128m"
maxHeapSize = "1536m"
if (!JavaVersion.current().isJava8Compatible()) {
jvmArgs '-XX:MaxPermSize=256m'
}
}
test {
testLogging {
events "failed"//, "passed", "skipped"
exceptionFormat = 'full'
}
// beforeTest { desc ->
// println "Executing test ${desc.name} [${desc.className}]"
// }
// afterTest { desc ->
// println "Finished test ${desc.name} [${desc.className}]"
// }
}
integrationTests {
testLogging {
events "failed"//, "passed", "skipped"
exceptionFormat = 'full'
}
// beforeTest { desc ->
// println "Executing test ${desc.name} [${desc.className}]"
// }
// afterTest { desc ->
// println "Finished test ${desc.name} [${desc.className}]"
// }
}
task browserTests(type: Test) {
exclude '**/*$*'
exclude '**/samples/**'
exclude '**/*Sample*'
exclude '**/*Base'
include '**/integration/browsers/**'
}
task javadoc(type: Javadoc, overwrite: true) {
source = sourceSets.main.allJava
options.memberLevel = JavadocMemberLevel.PUBLIC
options.addStringOption('views')
options.addStringOption('all')
options.addStringOption('quiet')
options.addStringOption('qualify')
options.addStringOption('Xdoclint:none')
options.encoding = 'UTF-8'
classpath = configurations.compile
}
// integrationTests.dependsOn test
check.dependsOn -= integrationTests
dependencies {
compile "com.google.guava:guava:${guavaVersion}"
compile "com.google.code.findbugs:jsr305:3.0.1"
compile("com.google.inject:guice:3.0") {
exclude group:"org.ow2.asm", module:"asm"
exclude group:"asm", module:"asm"
exclude group:"org.sonatype.sisu.inject", module:"cglib"
}
compile ('cglib:cglib:3.1') {
exclude group:"org.ow2.asm", module:"asm"
}
compile ('org.ow2.asm:asm:5.0.3')
compile "commons-codec:commons-codec:${commonsCodecVersion}"
compile "org.objenesis:objenesis:2.1"
compile "org.slf4j:slf4j-api:1.7.21"
compile "xml-apis:xml-apis:1.4.01"
compile 'info.cukes:cucumber-core:1.2.5'
compile 'commons-logging:commons-logging:1.2'
compile "junit:junit:${junitVersion}"
compile("org.mockito:mockito-core:${mockitoCoreVersion}") {
exclude group: "org.hamcrest", module:"hamcrest-core"
exclude group: "org.objenesis", module:"objenesis"
}
testCompile ("ch.qos.logback:logback-classic:1.1.7") {
exclude group: "org.slf4j", module: 'slf4j-api'
}
testCompile "org.hamcrest:hamcrest-integration:${hamcrestVersion}"
testCompile "org.hamcrest:hamcrest-library:${hamcrestVersion}"
testCompile "org.hamcrest:hamcrest-core:${hamcrestVersion}"
testCompile('org.spockframework:spock-core:1.0-groovy-2.4') {
exclude group: "junit"
exclude group:"org.codehaus.groovy", module: "groovy-all"
}
testCompile("com.github.goldin:spock-extensions:0.1.4") {
exclude group:"org.spockframework", module: "spock-core"
exclude group:"org.slf4j", module: "slf4j-api"
exclude group:"asm", module: "asm"
}
testCompile("org.codehaus.groovy:groovy-all:${groovyVersion}")
testCompile 'org.assertj:assertj-core:1.7.1'
}
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
if (details.requested.name == 'mockito-all') {
details.useTarget group: 'org.mockito', name: 'mockito-core', version: '1.9.5'
}
if (details.requested.name == 'hamcrest-core') {
details.useTarget group: 'org.hamcrest', name: 'hamcrest-core', version: "${hamcrestVersion}"
}
if (details.requested.name == 'hamcrest-all') {
details.useTarget group: 'org.hamcrest', name: 'hamcrest-all', version: "${hamcrestVersion}"
}
if (details.requested.name == 'hamcrest-library') {
details.useTarget group: 'org.hamcrest', name: 'hamcrest-library', version: "${hamcrestVersion}"
}
}
}
jar {
manifest.attributes["Created-By"] =
"${System.getProperty("java.version")} (${System.getProperty("java.specification.vendor")})"
manifest.attributes["Implementation-Title"] = project.name
manifest.attributes["Implementation-Version"] = project.version
from("${rootProject.projectDir}/src/dist") {
include "license.txt"
include "notice.txt"
into "META-INF"
expand(copyright: new Date().format("yyyy"), version: project.version)
}
}
bintray {
user = bintrayUsername //this usually comes form gradle.properties file in ~/.gradle
key = bintrayApiKey //this usually comes form gradle.properties file in ~/.gradle
publications = ['mavenJava'] // see publications closure
pkg {
repo = 'maven'
userOrg = 'serenity'
name = 'serenity-core'
desc = 'Serenity core libraries'
licenses = ['Apache-2.0']
labels = ['serenity', 'bdd']
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourcesJar, javadocJar
}
publishing {
publications {
mavenJava(MavenPublication) {
println "Publishing $project.name:$project.group:$project.version"
from components.java
artifact sourcesJar {
classifier "sources"
}
artifact javadocJar {
classifier "javadoc"
}
pom.withXml {
asNode().children().last() + {
resolveStrategy = Closure.DELEGATE_FIRST
name "$project.name"
description "$projectDescription"
url 'https://github.com/serenity-bdd/serenity-core'
scm {
url 'scm:git:[email protected]:serenity-bdd/serenity-core.git'
connection 'scm:git:[email protected]:serenity-bdd/serenity-core.git'
developerConnection 'scm:git:[email protected]:serenity-bdd/serenity-core.git'
}
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/license/LICENSE-2.0.txt'
distribution 'repo'
}
}
developers {
developer {
id 'johnsmart'
name 'John Ferguson Smart'
email '[email protected]'
}
}
}
// Preserve compile-scope dependencies
asNode().dependencies.'*'.findAll() {
it.scope.text() == 'runtime' && project.configurations.compile.allDependencies.find { dep ->
dep.name == it.artifactId.text()
}
}.each() {
it.scope*.value = 'compile'
}
}
}
}
}
tasks.withType(GroovyCompile) {
options.encoding = "UTF-8" // for Java compilation
groovyOptions.encoding = "UTF-8" // for Groovy compilation
}
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:-options"
options.encoding = 'UTF-8'
}
if (JavaVersion.current().isJava8Compatible()) {
allprojects {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
}
task wrapper(type: Wrapper) {
gradleVersion = "${gradleVersion}"
}
task copyDeps(type: Copy) {
from configurations.runtime + configurations.testCompile
into project.projectDir.path + "/lib"
}
}