This repository has been archived by the owner on Sep 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
156 lines (139 loc) · 6.61 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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
apply plugin: 'groovy'
sourceSets {
jobs {
groovy {
srcDirs 'src/jobs'
compileClasspath += main.compileClasspath
}
compileClasspath += sourceSets.main.output
runtimeClasspath += sourceSets.main.output
}
}
repositories {
mavenCentral()
maven { url 'https://repo.jenkins-ci.org/releases/' }
maven { url 'https://repo.jenkins-ci.org/public/' }
}
configurations {
testPlugins { }
}
// Exclude buggy Xalan dependency this way the JRE default TransformerFactory is used
// The xalan pulled in by htmlunit does not properly deal with spaces folder / job names
configurations.all*.exclude group: 'xalan'
dependencies {
implementation 'org.codehaus.groovy:groovy-all:2.4.11'
// implementation "org.jenkins-ci.plugins:job-dsl-core:${jobDslVersion}"
implementation "org.jenkins-ci.plugins:job-dsl:${jobDslVersion}"
/* for the rest task
compile('org.codehaus.groovy.modules.http-builder:http-builder:0.7.2') {
exclude(module: 'groovy')
}
*/
implementation 'org.apache.ant:ant:1.9.7'
testImplementation 'org.spockframework:spock-core:1.0-groovy-2.4'
testImplementation 'cglib:cglib-nodep:2.2.2' // used by Spock
// Jenkins test harness dependencies
testImplementation('org.jenkins-ci.main:jenkins-test-harness:2.33') {
// https://github.com/sheehan/job-dsl-gradle-example/issues/90
exclude group: 'org.netbeans.modules', module: 'org-netbeans-insane'
}
testImplementation("org.jenkins-ci.main:jenkins-war:${jenkinsVersion}") {
// https://github.com/sheehan/job-dsl-gradle-example/issues/87
exclude group: 'org.jenkins-ci.ui', module: 'bootstrap'
}
// Job DSL plugin including plugin dependencies
testImplementation "org.jenkins-ci.plugins:job-dsl:${jobDslVersion}"
testImplementation "org.jenkins-ci.plugins:job-dsl:${jobDslVersion}@jar"
testImplementation 'org.jenkins-ci.plugins:cloudbees-folder:6.736.v5f554b_b_a_52b_3@jar'
testImplementation 'org.jenkins-ci.plugins:command-launcher:84.v4a_97f2027398@jar'
testImplementation 'org.jenkins-ci.plugins:script-security:1175.v4b_d517d6db_f0@jar'
testImplementation 'org.jenkins-ci.plugins:structs:324.va_f5d6774f3a_d@jar'
testImplementation 'org.jenkins-ci.plugins:branch-api:2.1046.v0ca_37783ecc5@jar'
testImplementation 'org.jenkins-ci.plugins:scm-api:616.ve67136f6c77d@jar'
// Run the following script in the Script Console of your Jenkins instance to generate
// the above testPlugins list. (adapted from https://git.io/fjpUs)
// note that I did not install all of these, I merely run './gradlew --info test' and only install the ones that
// are used for the tests or throw a traceback.
/*
Jenkins.instance.pluginManager.plugins
.findAll { !(it.shortName in ['job-dsl', 'structs']) }
.collect { "testPlugins '${it.manifest.mainAttributes.getValue("Group-Id")}:${it.shortName}:${it.version}'" }
.sort()
.each { println it }
*/
// plugins to install in test instance
testPlugins 'com.coravy.hudson.plugins.github:github:1.34.3.1'
testPlugins 'io.jenkins.plugins:pipeline-groovy-lib:598.vcd66b_a_336510'
testPlugins 'org.jenkins-ci.main:maven-plugin:3.19'
testPlugins 'org.jenkins-ci.plugins:ansible:1.1'
testPlugins 'org.jenkins-ci.plugins:ansicolor:1.0.2'
testPlugins 'org.jenkins-ci.plugins:any-buildstep:0.1'
testPlugins 'org.jenkins-ci.plugins:branch-api:2.1046.v0ca_37783ecc5'
testPlugins 'org.jenkins-ci.plugins:build-blocker-plugin:1.7.8'
testPlugins 'org.jenkins-ci.plugins:cloudbees-folder:6.736.v5f554b_b_a_52b_3'
testPlugins 'org.jenkins-ci.plugins:conditional-buildstep:1.4.2'
testPlugins 'org.jenkins-ci.plugins:credentials:1139.veb_9579fca_33b_'
testPlugins 'org.jenkins-ci.plugins:cvs:2.19.1'
testPlugins 'org.jenkins-ci.plugins:email-ext:2.91'
testPlugins 'org.jenkins-ci.plugins:envinject:2.866.v5c0403e3d4df'
testPlugins 'org.jenkins-ci.plugins:flexible-publish:0.16.1'
testPlugins 'org.jenkins-ci.plugins:ghprb:1.42.2'
testPlugins 'org.jenkins-ci.plugins:git:4.11.4'
testPlugins 'org.jenkins-ci.plugins:github-api:1.303-400.v35c2d8258028'
testPlugins 'org.jenkins-ci.plugins:github-branch-source:1677.v731f745ea_0cf'
testPlugins 'org.jenkins-ci.plugins:gradle:1.39.4'
testPlugins 'org.jenkins-ci.plugins:groovy:442.v817e6d937d6c'
testPlugins 'org.jenkins-ci.plugins:htmlpublisher:1.30'
testPlugins 'org.jenkins-ci.plugins:jms-messaging:1.1.27'
testPlugins 'org.jenkins-ci.plugins:mailer:435.v79ef3972b_5c7'
testPlugins 'org.jenkins-ci.plugins:matrix-project:772.v494f19991984'
testPlugins 'org.jenkins-ci.plugins:nodelabelparameter:1.11.0'
testPlugins 'org.jenkins-ci.plugins:parameterized-trigger:2.45'
testPlugins 'org.jenkins-ci.plugins:progress-bar-column-plugin:1.0'
testPlugins 'org.jenkins-ci.plugins:ssh-agent:295.v9ca_a_1c7cc3a_a_'
testPlugins 'org.jenkins-ci.plugins:testng-plugin:555.va0d5f66521e3'
testPlugins 'org.jenkins-ci.plugins:timestamper:1.18'
testPlugins 'org.jenkins-ci.plugins:token-macro:308.v4f2b_ed62b_b_16'
testPlugins 'org.jenkins-ci.plugins:view-job-filters:2.3'
testPlugins 'org.jenkins-ci.plugins:ws-cleanup:0.42'
testPlugins 'org.jenkins-ci.plugins.workflow:workflow-aggregator:590.v6a_d052e5a_a_b_5'
testPlugins 'org.jenkins-ci.plugins.workflow:workflow-api:1188.v0016b_4f29881'
testPlugins 'org.jenkins-ci.plugins.workflow:workflow-cps-global-lib:588.v576c103a_ff86'
testPlugins 'org.jenkins-ci.plugins.workflow:workflow-cps:2729.vea_17b_79ed57a_'
testPlugins 'org.jenkins-ci.plugins.workflow:workflow-job:1189.va_d37a_e9e4eda_'
testPlugins 'org.jenkins-ci.plugins.workflow:workflow-step-api:639.v6eca_cd8c04a_a_'
// TODO: figure out version 2.44 deps
testPlugins 'org.jvnet.hudson.plugins:ircbot:2.42'
}
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
// set build directory for Jenkins test harness, JENKINS-26331
systemProperty 'buildDirectory', project.buildDir.absolutePath
}
/*
task rest(dependsOn: 'classes', type: JavaExec) {
main = 'com.dslexample.rest.RestApiScriptRunner'
classpath = sourceSets.main.runtimeClasspath
systemProperties System.getProperties()
}
*/