-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle
75 lines (60 loc) · 2.12 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
apply plugin: 'groovy'
sourceSets {
jobs {
groovy {
srcDirs 'jobs'
compileClasspath += main.compileClasspath
}
compileClasspath += sourceSets.main.output
runtimeClasspath += sourceSets.main.output
}
}
repositories {
mavenCentral()
jcenter()
maven { url 'http://repo.jenkins-ci.org/releases/' }
}
configurations {
testPlugins {}
}
dependencies {
compile 'org.codehaus.groovy:groovy-all:2.4.7'
compile "org.jenkins-ci.plugins:job-dsl-core:${jobDslVersion}"
testCompile 'org.spockframework:spock-core:1.0-groovy-2.4'
testCompile 'cglib:cglib-nodep:2.2.2' // used by Spock
// Jenkins test harness dependencies
testCompile 'org.jenkins-ci.main:jenkins-test-harness:2.8'
testCompile "org.jenkins-ci.main:jenkins-war:${jenkinsVersion}"
testCompile "org.jenkins-ci.main:jenkins-war:${jenkinsVersion}:war-for-test@jar"
// Job DSL plugin including plugin dependencies
testCompile "org.jenkins-ci.plugins:job-dsl:${jobDslVersion}"
testCompile "org.jenkins-ci.plugins:job-dsl:${jobDslVersion}@jar"
testCompile 'org.jenkins-ci.plugins:structs:1.2@jar'
testCompile 'org.jenkins-ci.plugins:cloudbees-folder:5.0@jar'
// plugins to install in test instance
testPlugins 'org.jenkins-ci.plugins:ghprb:1.31.4'
testPlugins 'com.coravy.hudson.plugins.github:github:1.19.0'
}
task resolveTestPlugins(type: Copy) {
from configurations.testPlugins
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
exclude '**/XmlOutput.class'
// set build directory for Jenkins test harness, JENKINS-26331
systemProperty 'buildDirectory', project.buildDir.absolutePath
}
task sayHello {
doLast { println 'Hello from gradle' }
}
task wrapper(type: Wrapper) {
gradleVersion = '3.1'
}