forked from neoteric-eu/jenkins-build-per-gitflow-branch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
53 lines (45 loc) · 1.71 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
apply plugin: 'groovy'
apply plugin: 'eclipse'
version=0.1
repositories {
mavenCentral()
}
dependencies {
compile 'org.codehaus.groovy:groovy-all:2.3.3'
compile 'org.apache.ivy:ivy:2.2.0'
compile 'commons-cli:commons-cli:1.2' // should be part of groovy, but not available when running for some reason
compile 'org.jooq:joox:1.2.0'
testCompile 'junit:junit:4.11'
testCompile 'org.assertj:assertj-core:1.7.0'
testCompile 'com.github.stefanbirkner:system-rules:1.7.0'
compile 'org.codehaus.groovy.modules.http-builder:http-builder:0.7.1'
}
task createSourceDirs(description : 'Create empty source directories for all defined sourceSets') << {
sourceSets*.allSource.srcDirs.flatten().each { File sourceDirectory ->
if (!sourceDirectory.exists()) {
println "Making $sourceDirectory"
sourceDirectory.mkdirs()
}
}
}
task syncWithRepo(dependsOn: 'classes', type: JavaExec) {
main = 'com.neoteric.jenkins.Main'
classpath = sourceSets.main.runtimeClasspath
// pass through specified system properties to the call to main
['help', 'jenkinsUrl', 'jenkinsUser', 'jenkinsPassword', 'gitUrl', 'jobPrefix', 'templateJob', 'dryRun', 'createJobInView', 'noDelete', 'noFeatureDeploy'].each {
if (System.getProperty(it)) systemProperty it, System.getProperty(it)
}
}
//create a single Jar with all dependencies
task fatJar(type: Jar) {
manifest {
attributes 'Implementation-Version': version,
'Main-Class': 'com.neoteric.jenkins.Main'
}
baseName = project.name + '-all'
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}
task wrapper(type: Wrapper) {
gradleVersion = '2.9'
}