forked from boozallen/sdp-libraries
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
106 lines (98 loc) · 4.29 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
/*
org.jenkins-ci.jpi allows plugin dependency resolution
when specifying jenkins plugin dependencies
*/
plugins{
id 'org.jenkins-ci.jpi' version '0.29.0'
id 'groovy'
}
repositories {
mavenCentral()
maven { url "https://repo.jenkins-ci.org/public/" }
maven { url "https://repo.jenkins-ci.org/releases" }
maven { url "http://repo.maven.apache.org/maven2" }
}
/*
Jenkins-Spock requires that there be a target directory
so it can find compiled test classes so realigning
project build directory.
*/
project.buildDir = "target"
sourceSets{
main{
groovy{
/*
source directory for tests is each library directory
besides their unit-tests
*/
//srcDirs = getLibraries()
exclude "**/unit-tests"
}
}
test{
/*
moving the compiled test classes so that Jenkins-Spock
can find them.
*/
output.resourcesDir("${buildDir}/test-classes")
groovy{
/*
The location of the unit tests are the "unit-tests"
directory within each library directory
*/
srcDirs = getLibraries().collect{ "${it}/unit-tests" }
}
/*
need to be able to access actual steps as test resources
but dont want to copy in $buildDir directory.
*/
resources{
srcDirs = [ "." ]
filter.setIncludes(getLibraries().collect{ it + "/**"})
}
}
}
/*
Find all of the library directories that have unit tests to execute.
*/
ArrayList getLibraries(){
File workspace = new File(".")
def collection = layout.files { workspace.listFiles() }
def libraries = collection.findAll{
it.listFiles().find{ it.name.equals("unit-tests") }
}.collect{ it.getName() }
return libraries
}
dependencies {
compile group: 'org.slf4j', name: 'slf4j-api', version:'1.7.25'
runtime group: 'ch.qos.logback', name: 'logback-core', version:'1.2.3'
runtime group: 'ch.qos.logback', name: 'logback-classic', version:'1.2.3'
runtime group: 'org.slf4j', name: 'jcl-over-slf4j', version:'1.7.25'
runtime group: 'org.slf4j', name: 'log4j-over-slf4j', version:'1.7.25'
testCompile group: 'com.homeaway.devtools.jenkins', name: 'jenkins-spock', version:'2.0.0'
testCompile group: 'javax.servlet', name: 'javax.servlet-api', version:'3.1.0'
testCompile group: 'junit', name: 'junit', version:'4.12'
testCompile group: 'org.jenkins-ci.main', name: 'jenkins-core', version:'2.102', {
exclude group: 'com.ibm.icu', module: 'icu4j'
}
testCompile group: 'org.jenkins-ci.plugins.workflow', name: 'workflow-step-api', version:'2.10'
runtime group: 'org.jenkins-ci.plugins.workflow', name: 'workflow-step-api', version:'2.10'
testCompile group: 'org.jenkins-ci.plugins.workflow', name: 'workflow-cps', version:'2.36'
testCompile group: 'org.jenkins-ci', name: 'symbol-annotation', version:'1.10'
compile group: 'org.codehaus.groovy', name: 'groovy-all', version:'2.4.11'
testCompile group: 'org.spockframework', name: 'spock-core', version:'1.1-groovy-2.4'
// our plugin deps
jenkinsTest group: 'org.jenkins-ci.plugins.workflow', name: 'workflow-step-api', version:'2.10'
jenkinsTest group: 'org.jenkins-ci.plugins.workflow', name: 'workflow-cps', version:'2.36'
jenkinsTest group: 'org.jenkins-ci.plugins.workflow', name: 'workflow-scm-step', version:'2.7'
jenkinsTest group: 'org.jenkins-ci.plugins.workflow', name: 'workflow-durable-task-step', version:'2.21'
jenkinsTest group: "org.jenkins-ci.plugins.workflow", name: "workflow-basic-steps", version: "2.9"
jenkinsTest group: 'org.jenkins-ci.plugins', name: 'slack', version:'2.3'
jenkinsTest group: 'org.jenkins-ci.plugins', name: 'pipeline-stage-step', version:'2.3'
jenkinsTest group: 'org.jenkins-ci.plugins', name: 'ssh-agent', version:'1.16'
jenkinsTest group: "org.jenkins-ci.plugins", name: "pipeline-utility-steps", version: "2.1.0"
jenkinsTest group: "org.jenkins-ci.plugins", name: "credentials-binding", version: "1.16"
jenkinsTest group: "org.jenkins-ci.plugins", name: "docker-workflow", version: "1.17"
//our plugin
jenkinsTest group: 'org.jenkins-ci.plugins', name: "templating-engine", version: "1.1.1"
}