forked from technolo-g/modern-jenkins
-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle
62 lines (53 loc) · 2.2 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
// This build file allows Groovy scripts easy code integration with Jenkins source code
// Inspired by https://github.com/tdongsi/jenkins-config
apply plugin: 'groovy'
apply plugin: 'java'
apply plugin: 'idea'
idea {
module {
downloadJavadoc = true
downloadSources = true
}
}
repositories {
jcenter()
maven { url 'https://repo.jenkins-ci.org/releases/'}
maven { url 'https://repo.jenkins-ci.org/public/'}
mavenCentral()
}
sourceSets {
// Additional source set for the init scripts embedded within the plugins image (TODO: Move to its own image?)
initScripts {
groovy {
srcDirs 'images/jenkins-plugins/files/init.groovy.d'
compileClasspath += main.compileClasspath
}
}
jobs {
groovy {
srcDirs 'jobs'
compileClasspath += main.compileClasspath
}
}
}
dependencies {
// The basics - Groovy, Jenkins, etc
compile group: 'org.codehaus.groovy', name: 'groovy-all', version: '2.4.8'
compile group: 'org.jenkins-ci.main', name: 'jenkins-core', version: '2.138.2'
compile group: 'javax.servlet', name: 'javax.servlet-api', version: '3.1.0'
testCompile group: 'junit', name: 'junit', version: '4.12'
// General Jenkins plugins - TODO: Parse out of plugins.txt transitively somehow and translate to Maven style deps
compile group: 'org.jenkins-ci.plugins', name: 'credentials', version: '2.1.13', ext: 'jar'
// Job DSL and plugins used in examples
compile group: 'org.jenkins-ci.plugins', name: 'job-dsl', version: '1.70', ext: 'jar'
compile group: 'org.jenkins-ci.plugins', name: 'cloudbees-folder', version: '6.7', ext: 'jar'
compile group: 'org.jenkins-ci.plugins', name: 'gradle', version: '1.29', ext: 'jar'
compile group: 'org.jenkins-ci.plugins', name: 'email-ext', version: '2.63', ext: 'jar'
// Optional: Place non-hosted plugins in the lib dir to have them recognized within the IDE
compile fileTree(dir: 'lib', include: ['*.jar'])
}
// A way to test run a Groovy script within this context with the dependencies on the classpath
task runScript (dependsOn: 'classes', type: JavaExec) {
main = 'Temp'
classpath = sourceSets.main.runtimeClasspath
}