-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathbuild.gradle
141 lines (122 loc) · 4.56 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
apply plugin: 'groovy'
apply plugin: 'java'
apply plugin: 'codenarc'
defaultTasks 'clean', 'libs'
sourceSets {
jobs {
groovy {
srcDir 'sample/jobs'
}
}
src {
groovy {
srcDir 'src/main/groovy'
}
}
test {
groovy {
srcDir 'src/test/groovy'
}
}
}
repositories {
jcenter() {
artifactUrls 'https://repo.jenkins-ci.org/public/'
}
maven {
url 'https://repo.jenkins-ci.org/public/'
}
mavenCentral()
}
configurations {
libs
testPlugins
}
dependencies {
libs 'org.yaml:snakeyaml:1.17'
compile 'org.yaml:snakeyaml:1.17'
compile 'org.codehaus.groovy:groovy-all:2.4.11'
compile "org.jenkins-ci.plugins:job-dsl-core:${jobDslVersion}"
compile "org.jenkins-ci.main:jenkins-war:${jenkinsVersion}"
testCompile 'org.codehaus.groovy:groovy:2.4.11'
testCompile 'org.spockframework:spock-core:1.0-groovy-2.4'
// Needed for mocking in tests
testCompile 'cglib:cglib:3.1'
// Jenkins test harness dependencies
testCompile 'org.jenkins-ci.main:jenkins-test-harness:2.44'
testCompile "org.jenkins-ci.main:jenkins-war:${jenkinsVersion}"
// Jenkins plugins needed for tests
testCompile "org.jenkins-ci.plugins:job-dsl:${jobDslVersion}"
testCompile "org.jenkins-ci.plugins:job-dsl:${jobDslVersion}@jar"
testCompile 'org.jenkins-ci.plugins:structs:1.14@jar'
testCompile 'org.jgrapht:jgrapht-jdk1.5:0.7.3'
testCompile 'org.jenkins-ci.plugins:cloudbees-folder:5.18@jar'
// Plugins to install in test instance
testPlugins 'org.jenkins-ci.plugins:aws-credentials:1.24'
testPlugins 'org.jenkins-ci.plugins:build-user-vars-plugin:1.5'
testPlugins 'org.jenkins-ci.plugins:build-timeout:1.19'
testPlugins 'org.jenkins-ci.plugins:cobertura:1.12.1'
testPlugins 'org.jenkins-ci.plugins:copyartifact:1.39'
testPlugins 'org.jenkins-ci.plugins:credentials:2.1.19'
testPlugins 'org.jenkins-ci.plugins:junit:1.26'
testPlugins 'org.jenkins-ci.plugins:matrix-auth:1.5'
testPlugins 'org.jenkins-ci.plugins:multiple-scms:0.6'
testPlugins 'org.jenkins-ci.plugins.workflow:workflow-job:2.11'
testPlugins 'org.jenkins-ci.plugins.workflow:workflow-aggregator:2.5'
testPlugins 'org.jenkins-ci.plugins.workflow:workflow-cps:2.46'
testPlugins 'org.jenkins-ci.plugins:ws-cleanup:0.34'
testPlugins 'org.jenkins-ci.plugins:xunit:1.93'
testPlugins 'org.jenkins-ci.plugins:ansicolor:0.5.2'
testPlugins 'org.jenkins-ci.plugins:parameterized-trigger:2.35.2'
testPlugins 'org.jenkins-ci.plugins:slack:2.2'
testPlugins 'org.jenkins-ci.plugins:ssh-agent:1.17'
testPlugins 'org.jenkins-ci.plugins:timestamper:1.8.9'
testPlugins 'org.jenkins-ci.plugins:token-macro:2.3'
testPlugins 'org.jenkins-ci.plugins:build-name-setter:1.3'
testPlugins 'org.jenkins-ci.plugins:email-ext:2.62'
testPlugins 'org.jenkins-ci.plugins:envinject:2.1.5'
testPlugins 'org.jenkins-ci.plugins:flexible-publish:0.15.2'
testPlugins 'org.jenkins-ci.plugins:git:3.9.1'
testPlugins 'com.coravy.hudson.plugins.github:github:1.29.2'
testPlugins 'org.jenkins-ci.plugins:htmlpublisher:1.16'
testPlugins 'org.jenkins-ci.plugins:nodelabelparameter:1.7.2'
testPlugins 'org.jenkins-ci.plugins:shiningpanda:0.23'
testPlugins 'org.jenkins-ci.plugins:text-finder:1.10'
}
codenarc {
toolVersion = '1.0'
configFile = file('config/codenarc/codenarcRules.groovy')
maxPriority2Violations = 100
maxPriority3Violations = 140
// Display codenarc violations in the console for travis builds
// otherwise, default to creating an html report
if (System.getenv('CI_SYSTEM') == 'travis') {
reportFormat = 'console'
}
}
task libs(type: Copy) {
into 'lib'
from configurations.libs
}
task resolveTestPlugins(type: Copy) {
from configurations.testPlugins
into new File(sourceSets.test.output.resourcesDir, 'test-dependencies')
include '*.hpi'
include '*.jpi'
def mapping = [:]
doFirst {
configurations.testPlugins.resolvedConfiguration.resolvedArtifacts.each {
mapping[it.file.name] = "${it.name}.${it.extension}"
}
}
rename { mapping[it] }
doLast {
List<String> baseNames = source*.name.collect { mapping[it] }.collect { it[0..it.lastIndexOf('.') - 1] }
new File(destinationDir, 'index').setText(baseNames.join('\n'), 'UTF-8')
}
}
test {
dependsOn tasks.resolveTestPlugins
inputs.files sourceSets.jobs.groovy.srcDirs
systemProperty 'buildDirectory', project.buildDir.absolutePath
}