-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
149 lines (131 loc) · 4.26 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
apply plugin: 'groovy'
apply plugin: 'cobertura'
apply plugin: 'com.github.kt3k.coveralls'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'com.github.ben-manes.versions'
sourceCompatibility = 1.8
targetCompatibility = 1.8
version = '0.2-SNAPSHOT'
group = 'ch.silviowangler'
repositories {
jcenter()
}
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'net.saliman:gradle-cobertura-plugin:2.5.2'
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.8.2'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.0'
classpath 'com.github.ben-manes:gradle-versions-plugin:0.17.0'
}
}
dependencies {
testCompile('org.spockframework:spock-core:1.1-groovy-2.4') {
exclude group: 'org.codehaus.groovy', module: 'groovy-all'
}
compile 'org.codehaus.groovy:groovy-all:2.4.13'
}
cobertura.coverageFormats = ['html', 'xml'] // coveralls plugin depends on xml format report
cobertura.coverageSourceDirs = sourceSets.main.groovy.srcDirs
jar {
manifest {
attributes(
'Built-By': "Gradle ${gradle.gradleVersion}",
'Implementation-Title': "SwissESR-${project.name}",
'Implementation-Version': project.version,
'Implementation-Vendor': 'Silvio Wangler',
'Specification-Vendor': 'Silvio Wangler',
'Specification-Title': "SwissESR-${project.name}",
'Specification-Version': project.version
)
}
from("${rootProject.projectDir}") {
include "LICENSE.txt"
into "META-INF"
expand(dateOfYear: new Date().format('yyyy'))
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allJava
from("${rootProject.projectDir}") {
include "LICENSE.txt"
into "META-INF"
expand(dateOfYear: new Date().format('yyyy'))
}
}
artifacts {
archives sourcesJar
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar {
classifier "sources"
}
}
}
}
install {
repositories.mavenInstaller {
customizePom(pom, project)
}
}
bintray {
user = bintrayUser //this usually comes form gradle.properties file in ~/.gradle
key = bintrayKey //this usually comes form gradle.properties file in ~/.gradle
publications = ['mavenJava'] // see publications closure
pkg { //package will be created if does not exist
repo = 'releases'
name = 'swissesr'
desc = 'Package created from SwissESR'
licenses = ['Apache-2.0']
labels = ['ESR', 'java', 'PostFinance']
}
}
def customizePom(pom, gradleProject) {
pom.whenConfigured { generatedPom ->
// eliminate test-scoped dependencies (no need in maven central poms)
generatedPom.dependencies.removeAll { dep ->
dep.scope == 'test'
}
// add all items necessary for maven central publication
generatedPom.project {
name = gradleProject.description
description = gradleProject.description
url = 'https://github.com/saw303/SwissESR'
organization {
name = 'Wangler Software Development'
url = 'http://saw303.github.io/SwissESR/'
}
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}
scm {
url = 'https://github.com/saw303/SwissESR'
connection = 'scm:git:git://github.com/saw303/SwissESR'
developerConnection = 'scm:git:git://github.com/saw303/SwissESR'
}
developers {
developer {
id = 'saw303'
name = 'Silvio Wangler'
email = '[email protected]'
}
}
issueManagement {
system = 'Github'
url = 'https://github.com/saw303/SwissESR/issues'
}
}
}
}