forked from s2lomon/jenkins-as-a-pipeline
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
129 lines (103 loc) · 3.28 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
apply plugin: 'groovy'
sourceSets {
jobs {
groovy {
srcDirs 'jobs'
}
}
examples {
groovy {
srcDirs 'examples'
compileClasspath = compileGroovy.classpath
}
}
}
configurations {
jenkins
compile.extendsFrom(jenkins)
lib
compile.extendsFrom(lib)
jenkinsPlugins
}
configurations.all {
resolutionStrategy {
force 'xml-apis:xml-apis:1.4.01'
}
}
apply from: 'plugins.gradle'
repositories {
mavenLocal()
flatDir {
dirs "$projectDir/missing-libs"
}
maven { url 'http://repo.jenkins-ci.org/releases/' }
maven { url 'https://repo.jenkins-ci.org/public/' }
jcenter()
mavenCentral()
}
dependencies {
lib 'io.fourfinanceit.pipeline:jenkins-pipeline-core:0.5.0'
lib 'io.fourfinanceit.pipeline:jenkins-job-components:0.5.0'
jenkins "org.jenkins-ci.main:jenkins-core:${project.ext.jenkinsVersion}"
compile 'org.codehaus.groovy:groovy-all:2.4.4'
compile 'com.google.guava:guava:14.0'
lib "org.jenkins-ci.plugins:job-dsl:${project.ext.jobDslVersion}@jar"
lib "org.jenkins-ci.plugins:job-dsl-core:${project.ext.jobDslVersion}"
testCompile('org.spockframework:spock-core:1.0-groovy-2.4') {
exclude module: 'groovy-all'
}
testCompile ('org.jenkins-ci.main:jenkins-test-harness:2.31') {
exclude group: 'org.netbeans.modules', module: 'org-netbeans-insane' //org-netbeans-insane is excluded, because it's not resolvable from the remote repository
}
/*
* org-netbeans-insane here is added (look 2 lines above) to the classpath from local sources
* that are taken from the repository, where they were released as a source jar (not jar)
* */
testCompile ':org-netbeans-insane:RELEASE72'
testCompile 'io.fourfinanceit.pipeline:jenkins-pipeline-test-utils:0.5.0'
testCompile 'xmlunit:xmlunit:1.6'
testCompile "org.jenkins-ci.main:jenkins-war:${project.ext.jenkinsVersion}"
testCompile "org.jenkins-ci.main:jenkins-war:${project.ext.jenkinsVersion}:war-for-test@jar"
testCompile 'org.jenkins-ci.plugins:structs:1.2@jar'
testCompile configurations.jenkinsPlugins
jobsCompile sourceSets.main.output
jobsCompile configurations.compile
jobsRuntime configurations.runtime
}
task resolveTestPlugins(type: Copy) {
from configurations.jenkinsPlugins
into new File(sourceSets.test.output.resourcesDir, 'test-dependencies')
include '*.hpi'
include '*.jpi'
doLast {
def baseNames = source.collect { it.name[0..it.name.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
testLogging {
exceptionFormat = 'full'
}
jvmArgs(project.ext.properties.collect {k, v -> "-D$k=$v"})
}
task cleanLibs(type: Delete) {
delete 'lib'
}
tasks.clean.dependsOn 'cleanLibs'
task libs(type: Copy) {
into 'lib'
from configurations.lib
}
apply plugin: 'idea'
idea {
module {
excludeDirs += file('lib')
}
}
task wrapper(type: Wrapper) {
gradleVersion = '2.7'
}