forked from boxboat/dockhand-jenkins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
81 lines (68 loc) · 1.81 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
apply plugin: 'groovy'
repositories {
jcenter()
maven {
url 'https://repo.jenkins-ci.org/public/'
}
}
dependencies {
// main dependencies
compile group: 'org.codehaus.groovy', name: 'groovy-all', version: '2.4.6'
compile group: 'com.cloudbees', name: 'groovy-cps', version: '1.24'
compile group: 'org.jenkins-ci.main', name: 'jenkins-core', version: '2.102'
// @grab dependencies
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.8.1'
compile group: 'org.yaml', name: 'snakeyaml', version: '1.23'
// test dependencies
testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile group: 'com.lesfurets', name: 'jenkins-pipeline-unit', version: '1.1'
}
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']
}
}
}