-
Notifications
You must be signed in to change notification settings - Fork 98
/
build.gradle
121 lines (110 loc) · 4.4 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
plugins{
id 'org.jenkins-ci.jpi' version '0.43.0'
id 'groovy'
id 'jacoco'
}
repositories {
mavenCentral()
maven { url "https://repo.jenkins-ci.org/public/" }
maven { url "https://repo.jenkins-ci.org/releases" }
maven { url "http://repo.maven.apache.org/maven2" }
}
version = 4.3
// determine test files
def tests = [ "resources/test" ]
fileTree("libraries").visit{ FileVisitDetails details ->
if(details.file.isDirectory() && details.file.path ==~ ".*libraries/.*/test"){
tests << details.file.path
}
}
project.buildDir = "target"
sourceSets{
main{
groovy{
srcDirs = [ "libraries" ]
}
}
test{
output.resourcesDir("${buildDir}/test-classes")
groovy{
srcDirs = tests
}
resources{
srcDirs = [ "libraries" ]
}
}
}
jenkinsPlugin {
coreVersion = '2.277.4'
}
// don't compile libraries before running tests
compileGroovy.enabled = false
// library dependencies
dependencies {
compile group: 'org.slf4j', name: 'slf4j-api', version:'1.7.25'
runtime group: 'ch.qos.logback', name: 'logback-core', version:'1.2.3'
runtime group: 'ch.qos.logback', name: 'logback-classic', version:'1.2.3'
runtime group: 'org.slf4j', name: 'jcl-over-slf4j', version:'1.7.25'
runtime group: 'org.slf4j', name: 'log4j-over-slf4j', version:'1.7.25'
compile group: 'com.homeaway.devtools.jenkins', name: 'jenkins-spock', version:'2.1.2'
testCompile group: 'javax.servlet', name: 'javax.servlet-api', version:'3.1.0'
testCompile group: 'junit', name: 'junit', version:'4.12'
testCompile group: 'org.jenkins-ci.main', name: 'jenkins-core', version:'2.102', {
exclude group: 'com.ibm.icu', module: 'icu4j'
}
testCompile group: 'org.gitlab4j', name: 'gitlab4j-api', version: '4.15.6'
testCompile group: 'org.jenkins-ci.plugins.workflow', name: 'workflow-step-api', version:'2.10'
runtime group: 'org.jenkins-ci.plugins.workflow', name: 'workflow-step-api', version:'2.10'
testCompile group: 'org.jenkins-ci.plugins.workflow', name: 'workflow-cps', version:'2.36'
testCompile group: 'org.jenkins-ci', name: 'symbol-annotation', version:'1.10'
compile group: 'org.codehaus.groovy', name: 'groovy-all', version:'2.4.11'
testCompile group: 'org.spockframework', name: 'spock-core', version:'1.1-groovy-2.4'
// git library
testImplementation group: 'org.kohsuke', name: 'github-api', version: '1.135'
// our plugin deps
testImplementation group: 'org.jenkins-ci.plugins.workflow', name: 'workflow-step-api', version:'2.10'
testImplementation group: 'org.jenkins-ci.plugins.workflow', name: 'workflow-cps', version:'2.36'
testImplementation group: 'org.jenkins-ci.plugins.workflow', name: 'workflow-scm-step', version:'2.7'
testImplementation group: 'org.jenkins-ci.plugins.workflow', name: 'workflow-durable-task-step', version:'2.21'
testImplementation group: "org.jenkins-ci.plugins.workflow", name: "workflow-basic-steps", version: "2.9"
testImplementation group: 'org.jenkins-ci.plugins', name: 'slack', version:'2.3'
testImplementation group: 'org.jenkins-ci.plugins', name: 'pipeline-stage-step', version:'2.3'
testImplementation group: 'org.jenkins-ci.plugins', name: 'ssh-agent', version:'1.16'
testImplementation group: "org.jenkins-ci.plugins", name: "pipeline-utility-steps", version: "2.1.0"
testImplementation group: "org.jenkins-ci.plugins", name: "credentials-binding", version: "1.16"
testImplementation group: "org.jenkins-ci.plugins", name: "docker-workflow", version: "1.17"
testImplementation group: "org.jenkins-ci.plugins", name: "sonar", version: "2.11"
testCompile group: "org.jenkins-ci.plugins", name: "sonar", version: "2.11"
//our plugin
testImplementation group: 'org.jenkins-ci.plugins', name: "templating-engine", version: "2.3"
}
test{
jacoco{
classDumpDir = file("$buildDir/jacoco/classpathdumps")
}
finalizedBy jacocoTestReport
}
jacocoTestReport{
doFirst{
// delete non-library class files
fileTree("$buildDir/jacoco/classpathdumps").exclude("libraries").visit{ FileVisitDetails deets ->
delete deets.file
}
// delete Test files
fileTree("$buildDir/jacoco/classpathdumps/libraries").visit{ FileVisitDetails deets ->
if(deets.file.name.contains("Spec")){
delete deets.file
}
}
}
additionalSourceDirs files(".")
additionalClassDirs files("$buildDir/jacoco/classpathdumps")
reports{
html.enabled = true
}
}
tasks.register('printVersion'){
doLast{
println version
}
}