@@ -13,23 +13,23 @@ tasks.withType(JavaCompile) {
13
13
// have to declare parameter names with @JsonCreator
14
14
options. compilerArgs << " -parameters"
15
15
16
- // Eclipse code formatting removes extraneous parenthesis which errorprone complains about
16
+ // Eclipse code formatting removes extraneous parenthesis which errorprone complains about
17
17
if (project. plugins. hasPlugin(' net.ltgt.errorprone' )) {
18
- options. compilerArgs << ' -Xep:OperatorPrecedence:OFF'
18
+ options. compilerArgs << ' -Xep:OperatorPrecedence:OFF'
19
19
}
20
20
}
21
21
22
22
ext {
23
23
// list of dependencies that we want to replace with Eclipse project refs;
24
- // we automatically add all Gradle projects that are sibling directories to this project.
24
+ // we automatically add all Gradle projects that are sibling directories to this project.
25
25
// NOTE: dependencies list here that end with a hyphen match modules that starting with that prefix.
26
26
use_eclipse_project_refs = []
27
-
27
+
28
28
// useful shortcuts
29
29
buildAliases = [
30
30
' all' : [' clean' , ' classpath' , ' build' , ' install' ],
31
- ' deploy' : [' upload' , ' closeAndPromoteRepository ' ]
32
- ]
31
+ ' deploy' : [' upload' , ' closeRepository ' ]
32
+ ]
33
33
}
34
34
35
35
task javadocJar (type : Jar , dependsOn :classes) {
@@ -38,19 +38,19 @@ task javadocJar(type: Jar, dependsOn:classes) {
38
38
}
39
39
40
40
task sourcesJar (type :Jar , dependsOn :classes) {
41
- classifier = ' sources'
42
- from sourceSets. main. allSource
41
+ classifier = ' sources'
42
+ from sourceSets. main. allSource
43
43
}
44
44
45
45
task testJar (type :Jar , dependsOn :testClasses) {
46
- classifier = ' tests'
47
- from sourceSets. test. output
46
+ classifier = ' tests'
47
+ from sourceSets. test. output
48
48
}
49
49
50
50
artifacts {
51
- archives javadocJar
52
- archives sourcesJar
53
- archives testJar
51
+ archives javadocJar
52
+ archives sourcesJar
53
+ archives testJar
54
54
}
55
55
56
56
repositories {
@@ -114,22 +114,22 @@ eclipse {
114
114
// closure executed after .classpath content is loaded from existing file
115
115
// and after gradle build information is merged
116
116
whenMerged { classpath ->
117
-
117
+
118
118
// build list of dependencies that we want to replace with Eclipse project refs
119
- println ' Finding local projects'
120
- def use_eclipse_project_refs = []
121
- new File (" ${ projectDir} /.." ). eachDir {
122
- if (new File (" ${ it} /build.gradle" ). exists()) {
123
- use_eclipse_project_refs + = it. name
124
- }
125
- }
126
-
127
- println ' Generating Eclipse .classpath file'
128
- def kindOrder = [ ' src' :1 , ' con' :2 , ' lib' :3 , ' output' :0 ];
129
- classpath. entries. sort(true , { a ,b ->
130
- def order = kindOrder[a. kind] <=> kindOrder[b. kind]
131
- order != 0 ? order : a. path <=> b. path
132
- } as Comparator ). each { entry ->
119
+ println ' Finding local projects'
120
+ def use_eclipse_project_refs = []
121
+ new File (" ${ projectDir} /.." ). eachDir {
122
+ if (new File (" ${ it} /build.gradle" ). exists()) {
123
+ use_eclipse_project_refs + = it. name
124
+ }
125
+ }
126
+
127
+ println ' Generating Eclipse .classpath file'
128
+ def kindOrder = [ ' src' :1 , ' con' :2 , ' lib' :3 , ' output' :0 ];
129
+ classpath. entries. sort(true , { a ,b ->
130
+ def order = kindOrder[a. kind] <=> kindOrder[b. kind]
131
+ order != 0 ? order : a. path <=> b. path
132
+ } as Comparator ). each { entry ->
133
133
if (entry. kind. equals(' lib' )) {
134
134
use_eclipse_project_refs. each { name ->
135
135
def regex = ' /(' + ( name. endsWith(' -' ) ?
@@ -166,76 +166,76 @@ task classpath(dependsOn: ['cleanEclipseClasspath', 'eclipseClasspath', 'eclipse
166
166
}
167
167
168
168
task generateGitProperties {
169
- doLast {
170
- def branch = ' git rev-parse --abbrev-ref HEAD' . execute(). text. trim()
171
- def revision = ' git rev-list --max-count 1 --timestamp --abbrev-commit HEAD' . execute(). text. trim()
172
- def commitHash = revision. split(' ' ). last()
173
- def timestamp = revision ? new java.util.Date (java.util.concurrent.TimeUnit . SECONDS . toMillis(revision. split(' ' ). first() as long )). format(" yyyy-MM-dd'T'HH:mm:ssZ" ) : null
174
-
175
- File resourcesDir = new File (project. getBuildDir(), ' resources/main' )
176
- File propertiesFile = new File (resourcesDir, ' git.properties' )
177
- if (! propertiesFile. exists()) {
178
- resourcesDir. mkdirs()
179
- propertiesFile. createNewFile()
180
- }
181
-
182
- def newline = System . getProperty(' line.separator' )
183
- propertiesFile. text = " git.branch=${ branch}${ newline} " +
184
- " git.commit.id=${ commitHash}${ newline} " +
185
- " git.commit.time=${ timestamp}${ newline} " +
186
- " api.version=${ project.version}${ newline} "
187
- }
169
+ doLast {
170
+ def branch = ' git rev-parse --abbrev-ref HEAD' . execute(). text. trim()
171
+ def revision = ' git rev-list --max-count 1 --timestamp --abbrev-commit HEAD' . execute(). text. trim()
172
+ def commitHash = revision. split(' ' ). last()
173
+ def timestamp = revision ? new java.util.Date (java.util.concurrent.TimeUnit . SECONDS . toMillis(revision. split(' ' ). first() as long )). format(" yyyy-MM-dd'T'HH:mm:ssZ" ) : null
174
+
175
+ File resourcesDir = new File (project. getBuildDir(), ' resources/main' )
176
+ File propertiesFile = new File (resourcesDir, ' git.properties' )
177
+ if (! propertiesFile. exists()) {
178
+ resourcesDir. mkdirs()
179
+ propertiesFile. createNewFile()
180
+ }
181
+
182
+ def newline = System . getProperty(' line.separator' )
183
+ propertiesFile. text = " git.branch=${ branch}${ newline} " +
184
+ " git.commit.id=${ commitHash}${ newline} " +
185
+ " git.commit.time=${ timestamp}${ newline} " +
186
+ " api.version=${ project.version}${ newline} "
187
+ }
188
188
}
189
189
190
190
if (project. hasProperty(' nexusUsername' )) {
191
- signing {
192
- sign configurations. archives
193
- }
194
-
195
- uploadArchives {
196
- repositories {
197
- // see: http://central.sonatype.org/pages/gradle.html
198
- mavenDeployer {
199
- beforeDeployment {
200
- MavenDeployment deployment -> signing. signPom(deployment)
201
- }
202
-
203
- repository(url : " https://oss.sonatype.org/service/local/staging/deploy/maven2/" ) {
204
- authentication(userName : nexusUsername, password : nexusPassword)
205
- }
206
-
207
- snapshotRepository(url : " https://oss.sonatype.org/content/repositories/snapshots/" ) {
208
- authentication(userName : nexusUsername, password : nexusPassword)
209
- }
210
-
211
- pom. project {
212
- name project. name
213
- packaging ' jar'
214
- description project. description
215
-
216
- licenses {
217
- license {
218
- name ' Apache License 2.0'
219
- url ' https://www.apache.org/licenses/LICENSE-2.0'
220
- distribution ' repo'
221
- }
222
- }
223
-
224
- developers {
225
- developer {
226
- id = ' arakelian'
227
- name = ' Greg Arakelian'
228
-
229
- }
230
- }
231
- }
232
- }
233
- }
234
- }
235
- }
236
-
237
-
238
- // This code allows us to define aliases, such as "all", so that when we do "gradle all",
191
+ signing {
192
+ sign configurations. archives
193
+ }
194
+
195
+ uploadArchives {
196
+ repositories {
197
+ // see: http://central.sonatype.org/pages/gradle.html
198
+ mavenDeployer {
199
+ beforeDeployment {
200
+ MavenDeployment deployment -> signing. signPom(deployment)
201
+ }
202
+
203
+ repository(url : " https://oss.sonatype.org/service/local/staging/deploy/maven2/" ) {
204
+ authentication(userName : nexusUsername, password : nexusPassword)
205
+ }
206
+
207
+ snapshotRepository(url : " https://oss.sonatype.org/content/repositories/snapshots/" ) {
208
+ authentication(userName : nexusUsername, password : nexusPassword)
209
+ }
210
+
211
+ pom. project {
212
+ name project. name
213
+ packaging ' jar'
214
+ description project. description
215
+
216
+ licenses {
217
+ license {
218
+ name ' Apache License 2.0'
219
+ url ' https://www.apache.org/licenses/LICENSE-2.0'
220
+ distribution ' repo'
221
+ }
222
+ }
223
+
224
+ developers {
225
+ developer {
226
+ id = ' arakelian'
227
+ name = ' Greg Arakelian'
228
+
229
+ }
230
+ }
231
+ }
232
+ }
233
+ }
234
+ }
235
+ }
236
+
237
+
238
+ // This code allows us to define aliases, such as "all", so that when we do "gradle all",
239
239
// we can substitute in a series of other gradle tasks
240
240
//
241
241
// see: https://caffeineinduced.wordpress.com/2015/01/25/run-a-list-of-gradle-tasks-in-specific-order/
0 commit comments