-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
Copy pathbuild.gradle
234 lines (192 loc) · 5.75 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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
buildscript {
repositories {
maven { url 'https://plugins.gradle.org/m2/' }
}
dependencies {
classpath 'com.diffplug.gradle.spotless:spotless:1.3.2'
classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.5.3'
classpath 'org.ajoberstar:gradle-git:1.3.2'
}
}
subprojects {
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'maven'
apply plugin: 'signing'
apply plugin: 'com.diffplug.gradle.spotless'
repositories {
mavenCentral()
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
}
compileJava {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
compileTestJava {
sourceCompatibility = 1.8
targetCompatibility = 1.8
options.compilerArgs += '-parameters'
}
dependencies {
}
eclipse {
classpath {
containers.remove('org.eclipse.jdt.launching.JRE_CONTAINER')
containers 'org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8'
}
}
test {
description = 'Runs JUnit tests.'
useJUnit()
systemProperty 'java.util.logging.manager', 'org.apache.logging.log4j.jul.LogManager'
systemProperty 'org.apache.logging.log4j.level', 'ERROR'
systemProperty 'org.apache.logging.log4j.simplelog.StatusLogger.level', 'OFF'
scanForTestClasses = false
include(['**/*Tests.class', '**/*Test.class'])
// Since we set scanForTestClasses to false, we need to filter out inner
// classes with the "$" pattern; otherwise, using -Dtest.single=MyTests to
// run MyTests by itself will fail if MyTests contains any inner classes.
exclude(['**/*$*'])
}
javadoc {
options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
options.author = true
options.header = project.name
options.addStringOption('Xdoclint:none', '-quiet')
exclude '**/com/example/**'
}
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 {
licenseHeaderFile rootProject.file('src/spotless/eclipse-public-license-1.0.java')
importOrder(['java', 'javax', 'com', 'org'])
eclipseFormatFile rootProject.file('src/eclipse/junit-lambda-eclipse-formatter-settings.xml')
trimTrailingWhitespace()
// endWithNewline()
custom 'Lambda fix', { it.replace('} )', '})').replace('} ,', '},') }
}
format 'groovy', {
target '**/*.groovy'
licenseHeaderFile rootProject.file('src/spotless/eclipse-public-license-1.0.java'), "package "
}
}
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 "Module \"${project.name}\" of the prototype for the next generation of JUnit, codenamed \"JUnit Lambda\"."
url 'http://junit.org/junit-lambda.html'
scm {
connection 'scm:git:git://github.com/junit-team/junit-lambda.git'
developerConnection 'scm:git:git://github.com/junit-team/junit-lambda.git'
url 'https://github.com/junit-team/junit-lambda'
}
licenses {
license {
name 'Eclipse Public License v1.0'
url 'http://www.eclipse.org/legal/epl-v10.html'
}
}
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'
}
}
}
}
}
}
}
configure(rootProject) {
description = 'JUnit Lambda'
apply plugin: 'com.diffplug.gradle.spotless'
task aggregateJavadocs(type: Javadoc) {
group = "Documentation"
description = "Generates aggregated Javadocs"
title = "${rootProject.description} ${version} API"
dependsOn {
subprojects.collect {
it.tasks.getByName("jar")
}
}
options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
options.author = true
options.header = rootProject.description
options.splitIndex = true
options.addStringOption('Xdoclint:none', '-quiet')
exclude '**/com/example/**'
source subprojects.collect { project ->
project.sourceSets.main.allJava
}
maxMemory = "1024m"
destinationDir = new File(buildDir, "docs/javadoc")
doFirst {
classpath = files(subprojects.collect { it.sourceSets.main.compileClasspath })
}
}
spotless {
format 'misc', {
target '**/*.gradle', '**/*.md', '**/*.gitignore'
indentWithTabs()
trimTrailingWhitespace()
endWithNewline()
}
}
task wrapper(type: Wrapper) {
distributionUrl = 'https://services.gradle.org/distributions/gradle-2.9-all.zip'
}
}