-
Notifications
You must be signed in to change notification settings - Fork 13
/
build.gradle
321 lines (295 loc) · 11.6 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
import com.github.jengelman.gradle.plugins.shadow.transformers.ServiceFileTransformer
import org.apache.tools.ant.filters.ReplaceTokens
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots'
}
maven {
url 'https://oss.sonatype.org/content/repositories/releases'
}
maven { url 'http://repo.spring.io/plugins-release' }
mavenCentral()
mavenLocal()
}
dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:4.0.2'
classpath 'com.matthewcasperson:build:0.+'
}
}
plugins {
id 'com.github.ben-manes.versions' version '0.20.0'
}
apply plugin: 'java'
apply plugin: 'jacoco'
apply plugin: 'application'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'com.matthewcasperson.build.iridium'
mainClassName = "au.com.agic.apptesting.Main"
def alias = hasProperty("KeystoreAlias") ? getProperty("KeystoreAlias") : System.getenv("KeystoreAlias")
def keystore = hasProperty("KeystoreName") ? getProperty("KeystoreName") : System.getenv("KeystoreName")
def storepass = hasProperty("KeystoreStorePass") ? getProperty("KeystoreStorePass") : System.getenv("KeystoreStorePass")
def keypass = hasProperty("KeystorePass") ? getProperty("KeystorePass") : System.getenv("KeystorePass")
jacocoTestReport {
reports {
xml.enabled = true
}
afterEvaluate {
classDirectories = files(classDirectories.files.collect {
fileTree(dir: it, includes: ['au/com/agic/apptesting/**'])
})
}
}
check.dependsOn jacocoTestReport
task signJar(dependsOn: shadowJar) {
doLast {
ant.delete(dir: 'build/signed')
ant.mkdir(dir: 'build/signed')
ant.signjar(
jar: jar.archivePath,
destDir: 'build/signed',
alias: alias,
keystore: keystore,
storepass: storepass,
keypass: keypass)
}
}
jar {
manifest {
attributes(
"Permissions": "all-permissions",
/*
ZAP makes some assumptions about the availability of these settings. We copy them
from the ZAP MAINIFEST.MF file.
*/
"Create-Date": "2018-01-04",
"Implementation-Version": "2.7.0"
)
}
}
shadowJar {
classifier = ''
transform(ServiceFileTransformer) {
path = 'META-INF/spring.*'
include 'spring.*'
}
}
/*
Save the current date and time in the properties file
*/
processResources {
filesMatching('**/build.properties') {
filter ReplaceTokens, tokens: [
"Build": new Date().format("yyyyMMddHHmmss")
]
}
}
repositories {
mavenCentral()
mavenLocal()
}
def slimBuild = hasProperty('slimBuild') && 'true'.equalsIgnoreCase(getProperty('slimBuild').toString())
if (slimBuild) {
System.out.println("Slim Build Enabled")
}
/*
This removes the distributions from the maven upload.
See https://discuss.gradle.org/t/how-to-exclude-zip-only-from-archives-for-maven-repo-upload/13354/2
*/
//configurations.archives.with {
// artifacts.remove artifacts.find { it.archiveTask.is distZip }
// artifacts.remove artifacts.find { it.archiveTask.is distTar }
//}
/*
A slim build has no divers and does not include ZAP
*/
sourceSets {
main {
resources {
srcDir(slimBuild ? 'src/main/resources-slim' : 'src/main/resources-full')
}
}
}
def mysqlDriverVersion = '5.1.45'
def guavaVersion = '27.0.1-jre'
def seleniumVersion = '3.141.59'
def htmlUnitDriverVersion = '2.33.3'
def validationVersion = '2.0.1.Final'
def cucumberVersion = '1.2.5'
def logbackVersion = '1.2.3'
def slf4jVersion = '1.7.25'
def threadPoolVersion = '20030513.073905'
def commonsIoVersion = '2.6'
def commonsLangVersion = '3.8.1'
def commonsExecVersion = '1.3'
def operaDriverVersion = '1.5'
def phantomJsDriverVersion = '1.4.4' // https://github.com/detro/ghostdriver/issues/397
def cucumberHtmlFormatterVersion = '0.2.6'
def monteRepackVersion = '1.0.1'
def vavrVersion = '0.9.2'
def zapAPIVersion = '1.5.0'
def browsermobVersion = '2.1.5'
def compressCommonsVersion = '1.18'
def xmlApisVersion = '1.4.01'
def sysoutOverSLF4JVersion = '1.0.2'
def cucumberSpringVersion = '1.2.5'
def springFrameworkVersion = '5.1.4.RELEASE'
def aspectJVersion = '1.9.2'
def springRetryVersion = '1.2.4.RELEASE'
def cgLibVersion = '3.2.10'
configurations.all {
resolutionStrategy {
//force 'com.google.guava:guava:' + guavaVersion
}
}
dependencies {
compile 'org.springframework:spring-core:' + springFrameworkVersion
compile 'org.springframework:spring-test:' + springFrameworkVersion
compile 'org.springframework:spring-beans:' + springFrameworkVersion
compile 'org.springframework:spring-context:' + springFrameworkVersion
compile 'org.springframework:spring-context-support:' + springFrameworkVersion
compile 'org.springframework:spring-tx:' + springFrameworkVersion
compile 'org.springframework:spring-aop:' + springFrameworkVersion
compile 'org.aspectj:aspectjweaver:' + aspectJVersion
compile 'org.aspectj:aspectjrt:' + aspectJVersion
compile 'info.cukes:cucumber-spring:' + cucumberSpringVersion
compile 'info.cukes:cucumber-java:' + cucumberVersion
compile 'info.cukes:cucumber-html:' + cucumberHtmlFormatterVersion
compile 'mysql:mysql-connector-java:' + mysqlDriverVersion
compile 'com.google.guava:guava:' + guavaVersion
compile 'org.seleniumhq.selenium:selenium-java:' + seleniumVersion
compile 'org.seleniumhq.selenium:selenium-api:' + seleniumVersion
compile 'javax.validation:validation-api:' + validationVersion
compile 'ch.qos.logback:logback-classic:' + logbackVersion
compile 'ch.qos.logback:logback-core:' + logbackVersion
compile 'org.slf4j:jul-to-slf4j:' + slf4jVersion
compile 'commons-threadpool:commons-threadpool:' + threadPoolVersion
compile 'commons-io:commons-io:' + commonsIoVersion
compile 'org.apache.commons:commons-exec:' + commonsExecVersion
compile 'org.apache.commons:commons-lang3:' + commonsLangVersion
compile 'org.seleniumhq.selenium:htmlunit-driver:' + htmlUnitDriverVersion
compile 'org.seleniumhq.selenium:selenium-remote-driver:' + seleniumVersion
compile 'org.seleniumhq.selenium:selenium-chrome-driver:' + seleniumVersion
compile 'org.seleniumhq.selenium:selenium-firefox-driver:' + seleniumVersion
compile 'org.seleniumhq.selenium:selenium-safari-driver:' + seleniumVersion
compile 'com.codeborne:phantomjsdriver:' + phantomJsDriverVersion
compile 'com.opera:operadriver:' + operaDriverVersion
compile 'org.seleniumhq.selenium:selenium-ie-driver:' + seleniumVersion
compile 'com.pojosontheweb:monte-repack:' + monteRepackVersion
compile group: 'io.vavr', name: 'vavr', version: vavrVersion
compile 'org.zaproxy:zap-clientapi:' + zapAPIVersion
compile files("lib/zap-2.7.0.jar", "lib/cucumber-core-1.2.5-AG-SNAPSHOT.jar")
compile 'net.lightbody.bmp:browsermob-core:' + browsermobVersion
//compile 'com.matthewcasperson:browsermob-core:' + browsermobVersion
// use a snapshot build to work around guava incompatibilities until 2.1.5 is officially released
compile files('lib/something_local.jar')
compile group: 'org.apache.commons', name: 'commons-compress', version: compressCommonsVersion
compile group: 'xml-apis', name: 'xml-apis', version: xmlApisVersion
compile group: 'uk.org.lidalia', name: 'sysout-over-slf4j', version: sysoutOverSLF4JVersion
compile group: 'org.springframework.retry', name: 'spring-retry', version: springRetryVersion
compile group: 'org.apache.httpcomponents', name: 'fluent-hc', version: '4.5.7'
compile group: 'org.json', name: 'json', version: '20180813'
compile group: 'cglib', name: 'cglib', version: cgLibVersion
compile group: 'com.amazonaws', name: 'aws-lambda-java-core', version: '1.2.0'
// Fixes an issue in java 9 where these classes are no longer included
compile group: 'javax.xml.bind', name: 'jaxb-api', version: '2.3.0'
compile group: 'com.google.code.gson', name: 'gson', version: '2.8.5'
/*
The following are dependencies required by ZAP
*/
compile group: 'commons-httpclient', name: 'commons-httpclient', version: '3.1.0.redhat-8'
compile group: 'edu.stanford.ejalbert', name: 'BrowserLauncher2', version: '1.3'
compile group: 'org.owasp.jbrofuzz', name: 'jbrofuzz', version: '2.5.1'
compile group: 'org.owasp.jbrofuzz', name: 'jbrofuzz-encoder', version: '2.5.1'
compile group: 'org.apache.ant', name: 'ant', version: '1.10.5'
compile group: 'org.bouncycastle', name: 'bcmail-jdk15on', version: '1.60.0.redhat-00001'
compile group: 'org.bouncycastle', name: 'bcprov-jdk15on', version: '1.60.0.redhat-00001'
compile group: 'org.bouncycastle', name: 'bcpkix-jdk15on', version: '1.60.0.redhat-00001'
compile group: 'commons-beanutils', name: 'commons-beanutils', version: '1.9.3'
compile group: 'commons-codec', name: 'commons-codec', version: '1.11'
compile group: 'commons-collections', name: 'commons-collections', version: '3.2.2'
compile group: 'commons-configuration', name: 'commons-configuration', version: '1.10.0.redhat-1'
compile group: 'org.apache.commons', name: 'commons-csv', version: '1.6'
compile group: 'commons-jxpath', name: 'commons-jxpath', version: '1.3'
compile group: 'commons-lang', name: 'commons-lang', version: '2.6.0.redhat-7'
compile group: 'commons-logging', name: 'commons-logging', version: '1.2.0.redhat-3'
compile group: 'commons-logging', name: 'commons-logging-api', version: '1.1'
compile group: 'com.googlecode.java-diff-utils', name: 'diffutils', version: '1.3.0'
compile group: 'net.sf.ezmorph', name: 'ezmorph', version: '1.0.6'
compile group: 'edu.umass.cs.benchlab', name: 'harlib', version: '1.1.2'
compile group: 'org.hsqldb', name: 'hsqldb', version: '2.4.1'
compile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.7'
compile group: 'org.apache.httpcomponents', name: 'httpcore', version: '4.4.11'
compile group: 'com.github.zafarkhaja', name: 'java-semver', version: '0.9.0'
compile group: 'org.jdom', name: 'jdom', version: '1.1.3'
compile group: 'net.htmlparser.jericho', name: 'jericho-html', version: '3.4'
compile group: 'org.jfree', name: 'jfreechart', version: '1.5.0'
compile group: 'org.jgrapht', name: 'jgrapht-core', version: '0.9.2'
compile group: 'com.sun.woodstock.dependlibs', name: 'jh', version: '2.0'
compile group: 'net.sf.json-lib', name: 'json-lib', version: '2.4', classifier: 'jdk15'
compile group: 'com.yuvimasory', name: 'orange-extensions', version: '1.3.0'
compile group: 'com.fifesoft', name: 'rsyntaxtextarea', version: '2.6.1'
compile group: 'org.xerial', name: 'sqlite-jdbc', version: '3.25.2'
compile group: 'org.swinglabs', name: 'swingx', version: '1.6.1'
compile group: 'com.io7m.xom', name: 'xom', version: '1.2.10'
compile group: 'log4j', name: 'log4j', version: '1.2.17'
compile 'junit:junit:4.12.0.redhat-003'
}
/*
System properties need to be passed into the JVM running the tests
*/
def passThroughProperties = [
"browserStackUsername",
"browserStackAccessToken",
"webdriver.chrome.driver",
"webdriver.ie.driver",
"webdriver.opera.driver",
"opera.binary",
"phantomjs.binary.path",
"testDestination",
"testSource",
"groupName",
"featureGroupName",
"configuration",
"leaveWindowsOpen",
"localBrowser",
"appURLOverride",
"numberDataSets",
"numberOfThreads",
"tagsOverride",
"dataset",
"openReportFile",
"saveReportsInHomeDir",
"importBaseUrl",
"numberURLs",
"enableVideoCapture",
"enableScenarioScreenshots",
"startInternalProxy",
"externalProxyHost",
"externalProxyPort",
"externalProxyUsername",
"externalProxyPassword",
"externalProxyRealm",
"newBrowserPerScenario",
"failAllAfterFirstScenarioError",
"phantomJSUserAgent",
"testBrowsers",
"testRetryCount",
"dryRun",
"monochromeOutput",
"disableInterop"
]
test {
testLogging.showStandardStreams = true
for (p in passThroughProperties) {
systemProperty p, System.properties[p]
}
}
run {
for (p in passThroughProperties) {
systemProperty p, System.properties[p]
}
}