-
Notifications
You must be signed in to change notification settings - Fork 9
/
build.gradle
83 lines (70 loc) · 1.91 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
plugins{
id 'groovy'
}
repositories {
mavenCentral()
maven {
url 'https://repo.jenkins-ci.org/public/'
}
}
dependencies {
// main dependencies
implementation group: 'com.cloudbees', name: 'groovy-cps', version: '3903.v48a_8836749e9'
implementation group: 'org.jenkins-ci.main', name: 'jenkins-core', version: '2.452.2'
implementation group: 'io.jenkins.plugins', name: 'snakeyaml-api', version: '2.2-111.vc6598e30cc65'
compileOnly group: 'javax.servlet', name: 'javax.servlet-api', version: '4.0.1'
// @grab dependencies
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.9'
// test dependencies
testImplementation group: 'junit', name: 'junit', version: '4.13.2'
testImplementation group: 'com.lesfurets', name: 'jenkins-pipeline-unit', version: '1.20'
}
task cleanDist(type: Delete) {
delete 'dist'
}
task copyDist(type: Copy) {
from('./') {
include 'resources/**/*'
include 'test-vars/**/*'
}
into 'dist/jenkins-shared-library@master'
doLast {
file('dist/jenkins-shared-library@master/test-vars')
.renameTo(file('dist/jenkins-shared-library@master/vars'))
}
}
test {
dependsOn cleanDist
dependsOn copyDist
systemProperty 'groovy.grape.enable', 'false'
testLogging.showStandardStreams = true
beforeTest { descriptor ->
logger.lifecycle("Running test: " + descriptor)
}
}
test.outputs.upToDateWhen {
false
}
compileGroovy {
groovyOptions.forkOptions.jvmArgs = ['-Dgroovy.grape.enable=false']
}
compileTestGroovy {
groovyOptions.forkOptions.jvmArgs = ['-Dgroovy.grape.enable=false']
}
sourceSets {
main {
groovy {
srcDirs = ['src']
}
}
test {
groovy {
srcDirs = ['test']
}
}
resources {
groovy {
srcDirs = ['resources', 'test-resources']
}
}
}