-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
102 lines (89 loc) · 2.46 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
apply plugin: 'java'
apply plugin: 'maven'
group = 'com.xebialabs.deployit'
version = '1.1-SNAPSHOT'
overthereVersion = '1.0.16'
sourceCompatibility = 1.6
sourceEncoding = 'UTF-8'
dependencies {
compile("com.xebialabs.overthere:overthere:${overthereVersion}") {
// the 2.6.1 version contains a corrupt class file
exclude group: 'com.ibm.icu', module: 'icu4j'
}
compile 'com.ibm.icu:icu4j:3.4.4'
compile 'commons-lang:commons-lang:2.5'
compile 'args4j:args4j:2.0.16'
compile 'ch.qos.logback:logback-classic:0.9.24'
testCompile 'junit:junit:4.8.2'
}
repositories {
mavenLocal()
}
task distribution(type: Zip, dependsOn: jar) {
packageDir = 'src/main/package'
logbackConfigFile = 'logback.xml'
into("${baseName}-${version}") {
from(packageDir) {
exclude 'bin/*.sh'
}
into('bin') {
from("${packageDir}/bin") {
include '*.sh'
fileMode = 0755;
}
}
into('lib') {
from configurations.runtime
// include main artifact - see http://issues.gradle.org/browse/GRADLE-732
from "${jar.archivePath}"
}
into('conf') {
from(sourceSets.main.output.resourcesDir) {
include logbackConfigFile
}
rename logbackConfigFile, "${logbackConfigFile}.off"
}
}
}
artifacts {
archives distribution
}
afterEvaluate { eachProject ->
Set testTasks = eachProject.tasks.withType(Test).all
testTasks.each { testTask ->
testTask.onlyIf { !project.hasProperty('skipTests') }
testTask.afterSuite { descriptor, result ->
if (descriptor.className != null) {
println "${descriptor.className}: ${result.testCount} tests; failed: ${result.failedTestCount}; skipped: ${result.skippedTestCount}"
} else if (descriptor.className == null && descriptor.parent == null) {
println "Total: ${result.testCount} tests; failed: ${result.failedTestCount}; skipped: ${result.skippedTestCount}"
}
}
}
}
task generatePom << {
pom {
project {
build {
plugins {
plugin {
artifactId 'maven-compiler-plugin'
version '2.3'
configuration {
encoding = sourceEncoding
source = "${sourceCompatibility}".toString()
target = "${sourceCompatibility}".toString()
}
}
plugin {
artifactId 'maven-resources-plugin'
version '2.3'
configuration {
encoding = sourceEncoding
}
}
}
}
}
}.writeTo('pom.xml')
}