-
-
Notifications
You must be signed in to change notification settings - Fork 37
/
build.gradle
177 lines (149 loc) · 3.92 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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
buildscript {
repositories {
maven {
url 'https://plugins.gradle.org/m2/'
}
}
dependencies {
classpath 'com.diffplug.gradle.spotless:spotless:1.3.1'
classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.5.3'
classpath 'org.ajoberstar:gradle-git:1.3.2'
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'maven'
apply plugin: 'signing'
apply plugin: 'com.diffplug.gradle.spotless'
description = 'Open Test Alliance for the JVM'
repositories {
mavenCentral()
}
compileJava {
sourceCompatibility = 1.6
targetCompatibility = 1.6
}
compileTestJava {
sourceCompatibility = 1.6
targetCompatibility = 1.6
}
dependencies {
testCompile("junit:junit:${junit4Version}")
}
javadoc {
options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
options.author = true
options.header = 'Open Test Alliance for the JVM'
options.addStringOption('Xdoclint:none', '-quiet')
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}
artifacts {
archives sourcesJar
archives javadocJar
}
spotless {
java {
target project.fileTree(project.rootDir) {
include '**/*.java'
exclude '**/package-info.java'
exclude '**/apache-license-2.0.java'
exclude '.gradle/**/*.java'
}
licenseHeaderFile rootProject.file('etc/spotless/apache-license-2.0.java')
importOrder(['java', 'javax', 'com', 'org'])
eclipseFormatFile rootProject.file('etc/eclipse/eclipse-formatter-settings.xml')
trimTrailingWhitespace()
endWithNewline()
custom 'Lambda fix', { it.replace('} )', '})').replace('} ,', '},') }
}
}
def signArtifacts = !project.version.contains('SNAPSHOT')
if (signArtifacts) {
signing {
sign configurations.archives
}
}
uploadArchives {
dependsOn check
repositories {
mavenDeployer {
if (signArtifacts) {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
}
def ossrhUsername = rootProject.hasProperty('ossrhUsername') ? rootProject.ossrhUsername : ''
def ossrhPassword = rootProject.hasProperty('ossrhPassword') ? rootProject.ossrhPassword : ''
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
pom.project {
name "${project.group}:${project.name}"
packaging 'jar'
description "Open Test Alliance for the JVM"
url 'https://github.com/ota4j-team/opentest4j'
scm {
connection 'scm:git:git://github.com/ota4j-team/opentest4j.git'
developerConnection 'scm:git:git://github.com/ota4j-team/opentest4j.git'
url 'https://github.com/ota4j-team/opentest4j'
}
licenses {
license {
name 'The Apache License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id 'bechte'
name 'Stefan Bechtold'
email 'stefan.bechtold@me.com'
}
developer {
id 'jlink'
name 'Johannes Link'
email 'business@johanneslink.net'
}
developer {
id 'marcphilipp'
name 'Marc Philipp'
email 'mail@marcphilipp.de'
}
developer {
id 'mmerdes'
name 'Matthias Merdes'
email 'Matthias.Merdes@heidelberg-mobil.com'
}
developer {
id 'sbrannen'
name 'Sam Brannen'
email 'sam@sambrannen.com'
}
}
}
}
}
}
spotless {
format 'misc', {
target project.fileTree(project.rootDir) {
include '**/*.gradle', '**/*.md', '**/*.gitignore'
exclude '.gradle/**/*.*'
}
indentWithTabs()
trimTrailingWhitespace()
endWithNewline()
}
}
task wrapper(type: Wrapper) {
distributionUrl = 'https://services.gradle.org/distributions/gradle-2.9-all.zip'
}