1
1
buildscript {
2
2
dependencies {
3
- classpath " gradle.plugin.org.jruyi.gradle:thrift-gradle-plugin:0.4.0 "
3
+ classpath " gradle.plugin.org.jruyi.gradle:thrift-gradle-plugin:0.4.1 "
4
4
}
5
5
}
6
6
7
7
plugins {
8
- id ' net.minecrell.licenser' version ' 0.3'
9
- id " com.github.sherter.google-java-format" version " 0.6"
10
- id " net.ltgt.errorprone" version " 0.6"
8
+ id ' net.minecrell.licenser' version ' 0.4.1'
9
+ id ' com.github.sherter.google-java-format' version ' 0.8'
10
+ id ' net.ltgt.errorprone' version ' 1.1.1'
11
+ id ' java-library'
11
12
}
12
13
13
14
repositories {
14
15
maven {
15
- url " https://plugins.gradle.org/m2/"
16
+ url ' https://plugins.gradle.org/m2/'
16
17
}
17
18
mavenCentral()
18
19
}
19
20
20
- apply plugin : ' java'
21
21
apply plugin : ' maven'
22
- apply plugin : " org.jruyi.thrift"
22
+ apply plugin : ' org.jruyi.thrift'
23
23
apply plugin : ' maven-publish'
24
24
apply plugin : ' com.github.sherter.google-java-format'
25
25
26
- if (hasProperty(" signing.keyId" )) {
26
+ if (hasProperty(' signing.keyId' )) {
27
27
apply plugin : ' signing'
28
28
signing {
29
29
sign configurations. archives
@@ -39,21 +39,26 @@ googleJavaFormat {
39
39
group = ' com.uber.cadence'
40
40
version = ' 2.6.3'
41
41
42
- description = """ Uber Cadence Java Client"""
42
+ description = ''' Uber Cadence Java Client'''
43
43
44
- sourceCompatibility = 1.8
45
- targetCompatibility = 1.8
44
+ java {
45
+ sourceCompatibility = JavaVersion . VERSION_1_8
46
+ targetCompatibility = JavaVersion . VERSION_1_8
47
+ }
46
48
47
49
dependencies {
48
- errorproneJavac(" com.google.errorprone:javac:9+181-r4173-1" )
49
- errorprone(" com.google.errorprone:error_prone_core:2.3.1" )
50
+ errorproneJavac(' com.google.errorprone:javac:9+181-r4173-1' )
51
+ errorprone(' com.google.errorprone:error_prone_core:2.3.3' )
52
+
50
53
compile group : ' com.uber.tchannel' , name : ' tchannel-core' , version : ' 0.8.5'
51
54
compile group : ' org.slf4j' , name : ' slf4j-api' , version : ' 1.7.25'
52
55
compile group : ' org.apache.thrift' , name : ' libthrift' , version : ' 0.9.3'
53
- compile group : ' com.google.code.gson' , name : ' gson' , version : ' 2.8.5'
54
- compile group : ' com.uber.m3' , name : ' tally-core' , version : ' 0.2.3'
55
- compile group : ' com.google.guava' , name : ' guava' , version : ' 27.0.1-jre'
56
- compile group : ' com.cronutils' , name : ' cron-utils' , version : ' 8.0.0'
56
+ compile group : ' com.google.code.gson' , name : ' gson' , version : ' 2.8.6'
57
+ compile group : ' com.uber.m3' , name : ' tally-core' , version : ' 0.4.0'
58
+ compile group : ' com.google.guava' , name : ' guava' , version : ' 28.1-jre'
59
+ compile group : ' com.cronutils' , name : ' cron-utils' , version : ' 9.0.0'
60
+ compile group : ' io.micrometer' , name : ' micrometer-core' , version : ' 1.1.2'
61
+
57
62
testCompile group : ' junit' , name : ' junit' , version : ' 4.12'
58
63
testCompile group : ' com.googlecode.junit-toolbox' , name : ' junit-toolbox' , version : ' 2.4'
59
64
testCompile group : ' ch.qos.logback' , name : ' logback-classic' , version : ' 1.2.3'
@@ -64,21 +69,33 @@ license {
64
69
exclude ' com/uber/cadence/*.java' // generated code
65
70
}
66
71
72
+ compileThrift {
73
+ sourceItems " src/main/idls/thrift/cadence.thrift" ," src/main/idls/thrift/shared.thrift"
74
+
75
+ nowarn true
76
+ }
77
+
67
78
compileJava {
68
79
dependsOn ' googleJavaFormat'
69
80
options. encoding = ' UTF-8'
70
- options. compilerArgs << " -Xlint:unchecked" << " -Xlint:deprecation" << " -Werror"
71
- options. errorprone. errorproneArgs << " -XepExcludedPaths:.*/generated-sources/.*"
81
+ options. compilerArgs << ' -Xlint:none' << ' -Xlint:deprecation' << ' -Werror'
82
+ options. errorprone. excludedPaths = ' .*/generated-sources/.*'
83
+ }
84
+
85
+ compileTestJava {
86
+ options. encoding = ' UTF-8'
87
+ options. compilerArgs << ' -Xlint:none' << ' -Xlint:deprecation' << ' -Werror'
88
+ options. errorprone. excludedPaths = ' .*/generated-sources/.*'
72
89
}
73
90
74
91
// Generation version.properties for value to be included into the request header
75
92
task createProperties (dependsOn : processResources) {
76
93
doLast {
77
- def subdir = new File (" $buildDir /resources/main/com/uber/cadence/" )
94
+ def subdir = new File (' $buildDir/resources/main/com/uber/cadence/' )
78
95
if ( ! subdir. exists() ) {
79
96
subdir. mkdirs()
80
97
}
81
- new File (" $buildDir /resources/main/com/uber/cadence/version.properties" ). withWriter { w ->
98
+ new File (' $buildDir/resources/main/com/uber/cadence/version.properties' ). withWriter { w ->
82
99
Properties p = new Properties ()
83
100
p[' cadence-client-version' ] = project. version. toString()
84
101
p. store w, null
@@ -90,12 +107,6 @@ classes {
90
107
dependsOn createProperties
91
108
}
92
109
93
- compileTestJava {
94
- options. encoding = ' UTF-8'
95
- options. compilerArgs << " -Xlint:unchecked" << " -Xlint:deprecation" << " -Werror"
96
- options. errorprone. errorproneArgs << " -XepExcludedPaths:.*/generated-sources/.*"
97
- }
98
-
99
110
if (JavaVersion . current(). isJava8Compatible()) {
100
111
allprojects {
101
112
tasks. withType(Javadoc ) {
@@ -109,60 +120,56 @@ javadoc {
109
120
}
110
121
111
122
task javadocJar (type : Jar ) {
112
- classifier = ' javadoc'
113
123
from javadoc
114
124
}
115
125
116
126
task sourcesJar (type : Jar , dependsOn : classes) {
117
- classifier = ' sources'
118
127
from sourceSets. main. allSource
119
128
}
120
129
121
130
artifacts {
122
131
archives javadocJar, sourcesJar
123
132
}
124
133
125
- def ossrhUsername = hasProperty(' ossrhUsername' ) ? property(' ossrhUsername' ) : " "
126
- def ossrhPassword = hasProperty(' ossrhPassword' ) ? property(' ossrhPassword' ) : " "
134
+ def ossrhUsername = hasProperty(' ossrhUsername' ) ? property(' ossrhUsername' ) : ' '
135
+ def ossrhPassword = hasProperty(' ossrhPassword' ) ? property(' ossrhPassword' ) : ' '
127
136
128
137
publishing {
129
- // Uncomment the following when we can use maven-publish to sign artifacts
130
- // https://github.com/gradle/gradle/issues/4943
131
-
132
- // mavenCustom(MavenPublication) {
133
- // pom.withXml {
134
- // asNode().with {
135
- // appendNode('packaging', 'jar')
136
- // appendNode('name', 'cadence-client')
137
- // appendNode('description', description)
138
- // appendNode('url', 'https://github.com/uber-java/cadence-client')
139
- // appendNode('scm').with {
140
- // appendNode('url', 'https://github.com/uber-java/cadence-client')
141
- // appendNode('connection', '[email protected] :uber-java/cadence-client.git')
142
- // }
143
- // appendNode('licenses').with {
144
- // appendNode('license').with {
145
- // appendNode('name', 'The Apache License, Version 2.0')
146
- // appendNode('url', 'http://www.apache.org/licenses/LICENSE-2.0.txt')
147
- // }
148
- // }
149
- // appendNode('developers').with {
150
- // appendNode('maxim').with {
151
- // appendNode('id', 'maxim')
152
- // appendNode('name', 'Maxim Fateev')
153
- // appendNode('email', '[email protected] ')
154
- // }
155
- // appendNode('developer').with {
156
- // appendNode('id', 'meiliang')
157
- // appendNode('name', 'Liang Mei')
158
- // appendNode('email', '[email protected] ')
159
- // }
160
- // }
161
- // }
162
- // }
163
- // }
164
138
165
139
publications {
140
+ maven(MavenPublication ) {
141
+ pom. withXml {
142
+ asNode(). with {
143
+ appendNode(' packaging' , ' jar' )
144
+ appendNode(' name' , ' cadence-client' )
145
+ appendNode(' description' , description)
146
+ appendNode(' url' , ' https://github.com/uber-java/cadence-client' )
147
+ appendNode(' scm' ). with {
148
+ appendNode(' url' , ' https://github.com/uber-java/cadence-client' )
149
+ appendNode(
' connection' ,
' [email protected] :uber-java/cadence-client.git' )
150
+ }
151
+ appendNode(' licenses' ). with {
152
+ appendNode(' license' ). with {
153
+ appendNode(' name' , ' The Apache License, Version 2.0' )
154
+ appendNode(' url' , ' http://www.apache.org/licenses/LICENSE-2.0.txt' )
155
+ }
156
+ }
157
+ appendNode(' developers' ). with {
158
+ appendNode(' maxim' ). with {
159
+ appendNode(' id' , ' maxim' )
160
+ appendNode(' name' , ' Maxim Fateev' )
161
+ appendNode(
' email' ,
' [email protected] ' )
162
+ }
163
+ appendNode(' developer' ). with {
164
+ appendNode(' id' , ' meiliang' )
165
+ appendNode(' name' , ' Liang Mei' )
166
+ appendNode(
' email' ,
' [email protected] ' )
167
+ }
168
+ }
169
+ }
170
+ }
171
+ }
172
+
166
173
mavenJava(MavenPublication ) {
167
174
from components. java
168
175
artifact javadocJar
@@ -176,9 +183,9 @@ publishing {
176
183
password ossrhPassword
177
184
}
178
185
if (project. version. endsWith(' -SNAPSHOT' )) {
179
- url " https://oss.sonatype.org/content/repositories/snapshots/"
186
+ url ' https://oss.sonatype.org/content/repositories/snapshots/'
180
187
} else {
181
- url " https://oss.sonatype.org/service/local/staging/deploy/maven2/"
188
+ url ' https://oss.sonatype.org/service/local/staging/deploy/maven2/'
182
189
}
183
190
}
184
191
}
@@ -193,8 +200,8 @@ test {
193
200
dependsOn ' registerDomain'
194
201
dependsOn ' checkLicenseMain'
195
202
testLogging {
196
- events " passed" , " skipped" , " failed"
197
- exceptionFormat " full"
203
+ events ' passed' , ' skipped' , ' failed'
204
+ exceptionFormat ' full'
198
205
// Uncomment the following line if you want to see test logs in gradlew run.
199
206
showStandardStreams true
200
207
}
@@ -205,11 +212,11 @@ uploadArchives {
205
212
mavenDeployer {
206
213
beforeDeployment { MavenDeployment deployment -> signing. signPom(deployment) }
207
214
208
- repository(url : " https://oss.sonatype.org/service/local/staging/deploy/maven2/" ) {
215
+ repository(url : ' https://oss.sonatype.org/service/local/staging/deploy/maven2/' ) {
209
216
authentication(userName : ossrhUsername, password : ossrhPassword)
210
217
}
211
218
212
- snapshotRepository(url : " https://oss.sonatype.org/content/repositories/snapshots/" ) {
219
+ snapshotRepository(url : ' https://oss.sonatype.org/content/repositories/snapshots/' ) {
213
220
authentication(userName : ossrhUsername, password : ossrhPassword)
214
221
}
215
222
0 commit comments