This repository has been archived by the owner on Nov 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 73
/
build.gradle
226 lines (194 loc) · 6.63 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
import net.serenitybdd.builds.ProjectVersionCounter
buildscript {
repositories {
mavenLocal()
jcenter()
maven {
url 'https://geonet.artifactoryonline.com/geonet/public-releases'
}
}
dependencies {
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
}
}
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.8
targetCompatibility = 1.8
repositories {
mavenLocal()
jcenter()
maven() {
url "http://dl.bintray.com/serenity/maven/"
}
}
ext {
bintrayBaseUrl = 'https://api.bintray.com/maven'
bintrayRepository = 'maven'
bintrayPackage = 'serenity-cucumber'
projectDescription = 'Serenity Cucumber 2.x integration'
if (!project.hasProperty("bintrayUsername")) {
bintrayUsername = 'wakaleo'
}
if (!project.hasProperty("bintrayApiKey")) {
bintrayApiKey = ''
}
versionCounter = new ProjectVersionCounter(isRelease: project.hasProperty("releaseBuild"))
}
group = 'net.serenity-bdd'
version = versionCounter.nextVersion
task createNewVersionTag(type: Exec) {
executable "sh"
args "-c", "git tag -f -a v$version -m'release tag'"
}
task pushVersionTag(type: Exec, dependsOn: 'createNewVersionTag') {
executable "sh"
args "-c", "git push -f origin v$version"
}
task tagNewVersion() {
dependsOn pushVersionTag
}
wrapper {
gradleVersion = '5.3.1'
}
test {
include '**/When*'
exclude '**/*$*'
exclude '**/integration/**'
exclude '**/samples/**'
exclude '**/*Sample*'
maxParallelForks = Runtime.runtime.availableProcessors()
}
configurations.all {
resolutionStrategy {
// fail fast on dependency convergence problems
//failOnVersionConflict()
force "commons-collections:commons-collections:${commonsCollectionsVersion}",
"xml-apis:xml-apis:${xmlApiVersion}",
"commons-codec:commons-codec:${commonsCodecVersion}",
"com.google.code.gson:gson:${gsonVersion}"
}
}
dependencies {
compile ("net.serenity-bdd:serenity-core:${serenityCoreVersion}")
compile ("net.serenity-bdd:serenity-screenplay:${serenityCoreVersion}")
compile ("net.serenity-bdd:serenity-screenplay-webdriver:${serenityCoreVersion}")
compile "io.cucumber:cucumber-java:${cucumberJVMVersion}"
compile("io.cucumber:cucumber-junit:${cucumberJVMVersion}") {
exclude group: "junit"
}
compile("commons-logging:commons-logging:${commonsLoggingVersion}")
compile("org.apache.commons:commons-csv:${commonsCsvVersion}")
compile "junit:junit:${junitVersion}"
compile "com.google.code.gson:gson:${gsonVersion}"
testCompile ("ch.qos.logback:logback-classic:${logbackVersion}") {
exclude module: "slf4j-api"
}
testCompile "org.assertj:assertj-core:${assertjVersion}"
testCompile "org.codehaus.groovy:groovy-all:${groovyVersion}"
testCompile("org.spockframework:spock-core:${spockVersion}") {
exclude group: "junit"
exclude module: "groovy-all"
}
testCompile("com.github.goldin:spock-extensions:${spockExtensionsVersion}") {
exclude module: "spock-core"
exclude module: "slf4j-api"
}
}
jar {
manifest {
attributes("Implementation-Title": "Serenity Cucumber Plugin",
"Implementation-Version": project.version.toString())
}
}
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 'serenity-cucumber'
description 'Serenity Cucumber Integration'
url 'https://github.com/serenity-bdd/serenity-cucumber'
scm {
url 'scm:git:[email protected]:serenity-bdd/serenity-cucumber.git'
connection 'scm:git:[email protected]:serenity-bdd/serenity-cucumber.git'
developerConnection 'scm:git:[email protected]:serenity-bdd/serenity-cucumber.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 'cliviu'
name 'Liviu Carausu'
email '[email protected]'
}
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(JavaCompile) {
options.compilerArgs << "-Xlint:-options"
}
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
publish = true
pkg {
repo = 'maven'
userOrg = 'serenity'
name = 'serenity-cucumber'
desc = 'Serenity Cucumber integration'
licenses = ['Apache-2.0']
labels = ['serenity','bdd','cucumber']
}
}
task copyDeps(type: Copy) {
from configurations.runtime + configurations.testCompile
into project.projectDir.path + "/lib"
}