-
Notifications
You must be signed in to change notification settings - Fork 13
/
build.gradle
94 lines (80 loc) · 3.58 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
plugins {
id 'java'
id 'groovy'
}
sourceSets {
main {
groovy {
srcDirs = ['src', 'vars']
}
}
test {
groovy {
srcDirs = ['test']
}
}
}
java {
sourceCompatibility = JavaVersion.VERSION_17
}
project.layout.buildDirectory = 'target'
repositories {
mavenCentral()
maven { url "https://repo.jenkins-ci.org/releases" }
maven { url "https://repo.jenkins-ci.org/public" }
}
dependencies {
def withoutIcu = { exclude group: 'com.ibm.icu', module: 'icu4j' }
// mandatory dependencies for using Spock
// note: please use same Groovy version as on Jenkins
implementation "org.codehaus.groovy:groovy-all:2.4.21"
implementation "com.cloudbees:groovy-cps:1.31@jar", withoutIcu
implementation "org.jenkins-ci.main:jenkins-core:2.452", withoutIcu
implementation "org.jenkins-ci.plugins:badge:1.13@jar"
implementation "org.jenkins-ci.plugins:pipeline-maven:3.9.3@jar" // dependency for MavenReport
implementation "org.jenkins-ci.plugins:credentials-binding:1.27.1@jar"
implementation "org.slf4j:jcl-over-slf4j:2.0.13"
testImplementation "org.slf4j:log4j-over-slf4j:2.0.13"
testImplementation "org.slf4j:slf4j-api:2.0.12"
testImplementation "ch.qos.logback:logback-core:1.5.6"
testImplementation "ch.qos.logback:logback-classic:1.5.6"
testImplementation "com.google.guava:guava:33.2.1-jre"
testImplementation "org.codehaus.groovy:groovy-all:3.0.21"
testImplementation "org.spockframework:spock-core:2.3-groovy-3.0@jar"
// Jenkins Pipeline Unit + JUnit 4
testImplementation "com.lesfurets:jenkins-pipeline-unit:1.13"
testImplementation "org.assertj:assertj-core:3.26.0"
// Jenkins related
testImplementation "com.homeaway.devtools.jenkins:jenkins-spock:2.1.5"
testImplementation "javax.servlet:javax.servlet-api:4.0.1"
testImplementation "org.jenkins-ci.main:jenkins-core:2.452", withoutIcu
testImplementation "org.jenkins-ci.plugins.workflow:workflow-api:2.40@jar"
testImplementation "org.jenkins-ci.plugins.workflow:workflow-step-api:2.22@jar"
testImplementation "org.jenkins-ci.plugins.workflow:workflow-cps:2.78@jar"
testImplementation "org.jenkins-ci.plugins.workflow:workflow-durable-task-step:2.35@jar" // provides the sh() pipeline step
testImplementation "org.jenkins-ci.plugins.workflow:workflow-basic-steps:2.20@jar" // provides the echo(), withEnv(), dir() pipeline step
testImplementation "org.jenkins-ci.plugins:durable-task:1.33@jar" // transitive dependency for workflow-durable-task-step
testImplementation "org.jenkins-ci.plugins:pipeline-stage-step:2.3@jar" // provides stage() step
testImplementation "org.jenkins-ci.plugins.workflow:workflow-scm-step:2.11@jar" // provides checkout()
testImplementation "org.jenkins-ci.plugins:credentials-binding:1.20@jar" // provides withCredentials() step
testImplementation "org.jenkins-ci.plugins:script-security:1.68@jar"
testImplementation "com.openshift.jenkins.plugins:openshift-client:1.0.35@jar"
testImplementation "org.jenkins-ci.plugins:ansicolor:0.5.2@jar"
}
// this is needed for spock to find all the source code in the var directory
task copyGlobalLibVars (type: Copy) {
from layout.projectDirectory.dir("vars")
include '**/*.groovy'
into layout.buildDirectory.dir("classes/vars")
}
compileTestGroovy {
options.incremental = true
options.fork = true
options.failOnError = false
}
compileTestGroovy.dependsOn copyGlobalLibVars
task printClasspath {
doLast {
configurations.testRuntimeClasspath.each { println it }
}
}