-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
50 lines (39 loc) · 1.48 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
import groovy.util.slurpersupport.GPathResult
import groovy.xml.XmlUtil
apply plugin: "groovy"
repositories {
mavenCentral()
}
dependencies {
testCompile 'org.codehaus.groovy:groovy-all:2.4.10'
def gebVersion = "2.1"
def seleniumVersion = "3.9.1"
// If using JUnit, need to depend on geb-junit (3 or 4)
testCompile "org.gebish:geb-junit4:${gebVersion}"
testCompile "junit:junit:4.12"
// Need a driver implementation
testCompile "org.seleniumhq.selenium:selenium-chrome-driver:${seleniumVersion}"
testRuntime "org.seleniumhq.selenium:selenium-support:${seleniumVersion}"
testCompile "org.codehaus.groovy.modules.http-builder:http-builder:0.7.1"
}
test {
testLogging.exceptionFormat = 'full'
systemProperties "geb.build.reportsDir": "$reportsDir/geb"
systemProperties "geb.build.baseUrl": "http://localhost:8080/"
// override via system properties
systemProperties System.properties
}
task prepareTest {
doLast {
def stagemonitorBuildProperties = new Properties()
stagemonitorBuildProperties.load(new File("stagemonitor/gradle.properties").newReader())
stagemonitorBuildProperties.getProperty("version")
def petclinicPomFile = new File("spring-petclinic/pom.xml")
def petclinicPomSlurper = new XmlSlurper(false, false).parse(petclinicPomFile)
petclinicPomSlurper.properties."stagemonitor.version" = stagemonitorBuildProperties.getProperty("version")
def newContent = XmlUtil.serialize(petclinicPomSlurper)
petclinicPomFile.newWriter().withWriter {
it << newContent
}
}
}