-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
46 lines (39 loc) · 1.29 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
plugins {
id 'org.springframework.boot' version '2.3.4.RELEASE'
id 'io.spring.dependency-management' version '1.0.10.RELEASE'
}
group = 'au.com.dius.pactworkshop'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'
dependencies {
implementation 'org.springframework.boot:spring-boot-starter'
implementation 'org.springframework.boot:spring-boot-starter-web'
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
testImplementation("au.com.dius.pact.provider:junit5:4.1.7")
}
def getGitHash = { ->
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'rev-parse', '--short', 'HEAD'
standardOutput = stdout
}
return stdout.toString().trim()
}
def getGitBranch = { ->
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'rev-parse', '--abbrev-ref', 'HEAD'
standardOutput = stdout
}
return stdout.toString().trim()
}
test {
useJUnitPlatform()
if (System.getProperty('pactPublishResults') == 'true') {
systemProperty 'pact.provider.version', getGitHash()
systemProperty 'pact.provider.tag', getGitBranch()
systemProperty 'pact.verifier.publishResults', 'true'
}
}