11buildscript {
22 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 "
44 }
55}
66
77plugins {
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'
1112}
1213
1314repositories {
1415 maven {
15- url " https://plugins.gradle.org/m2/"
16+ url ' https://plugins.gradle.org/m2/'
1617 }
1718 mavenCentral()
1819}
1920
20- apply plugin : ' java'
2121apply plugin : ' maven'
22- apply plugin : " org.jruyi.thrift"
22+ apply plugin : ' org.jruyi.thrift'
2323apply plugin : ' maven-publish'
2424apply plugin : ' com.github.sherter.google-java-format'
2525
26- if (hasProperty(" signing.keyId" )) {
26+ if (hasProperty(' signing.keyId' )) {
2727 apply plugin : ' signing'
2828 signing {
2929 sign configurations. archives
@@ -39,21 +39,26 @@ googleJavaFormat {
3939group = ' com.uber.cadence'
4040version = ' 2.6.3'
4141
42- description = """ Uber Cadence Java Client"""
42+ description = ''' Uber Cadence Java Client'''
4343
44- sourceCompatibility = 1.8
45- targetCompatibility = 1.8
44+ java {
45+ sourceCompatibility = JavaVersion . VERSION_1_8
46+ targetCompatibility = JavaVersion . VERSION_1_8
47+ }
4648
4749dependencies {
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+
5053 compile group : ' com.uber.tchannel' , name : ' tchannel-core' , version : ' 0.8.5'
5154 compile group : ' org.slf4j' , name : ' slf4j-api' , version : ' 1.7.25'
5255 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+
5762 testCompile group : ' junit' , name : ' junit' , version : ' 4.12'
5863 testCompile group : ' com.googlecode.junit-toolbox' , name : ' junit-toolbox' , version : ' 2.4'
5964 testCompile group : ' ch.qos.logback' , name : ' logback-classic' , version : ' 1.2.3'
@@ -64,21 +69,33 @@ license {
6469 exclude ' com/uber/cadence/*.java' // generated code
6570}
6671
72+ compileThrift {
73+ sourceItems " src/main/idls/thrift/cadence.thrift" ," src/main/idls/thrift/shared.thrift"
74+
75+ nowarn true
76+ }
77+
6778compileJava {
6879 dependsOn ' googleJavaFormat'
6980 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/.*'
7289}
7390
7491// Generation version.properties for value to be included into the request header
7592task createProperties (dependsOn : processResources) {
7693 doLast {
77- def subdir = new File (" $buildDir /resources/main/com/uber/cadence/" )
94+ def subdir = new File (' $buildDir/resources/main/com/uber/cadence/' )
7895 if ( ! subdir. exists() ) {
7996 subdir. mkdirs()
8097 }
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 ->
8299 Properties p = new Properties ()
83100 p[' cadence-client-version' ] = project. version. toString()
84101 p. store w, null
@@ -90,12 +107,6 @@ classes {
90107 dependsOn createProperties
91108}
92109
93- compileTestJava {
94- options. encoding = ' UTF-8'
95- options. compilerArgs << " -Xlint:unchecked" << " -Xlint:deprecation" << " -Werror"
96- options. errorprone. errorproneArgs << " -XepExcludedPaths:.*/generated-sources/.*"
97- }
98-
99110if (JavaVersion . current(). isJava8Compatible()) {
100111 allprojects {
101112 tasks. withType(Javadoc ) {
@@ -109,60 +120,56 @@ javadoc {
109120}
110121
111122task javadocJar (type : Jar ) {
112- classifier = ' javadoc'
113123 from javadoc
114124}
115125
116126task sourcesJar (type : Jar , dependsOn : classes) {
117- classifier = ' sources'
118127 from sourceSets. main. allSource
119128}
120129
121130artifacts {
122131 archives javadocJar, sourcesJar
123132}
124133
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' ) : ' '
127136
128137publishing {
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', 'git@github.com: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', 'maxim@uber.com')
154- // }
155- // appendNode('developer').with {
156- // appendNode('id', 'meiliang')
157- // appendNode('name', 'Liang Mei')
158- // appendNode('email', 'meiliang@uber.com')
159- // }
160- // }
161- // }
162- // }
163- // }
164138
165139 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' , ' git@github.com: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' , ' maxim@uber.com' )
162+ }
163+ appendNode(' developer' ). with {
164+ appendNode(' id' , ' meiliang' )
165+ appendNode(' name' , ' Liang Mei' )
166+ appendNode(' email' , ' meiliang@uber.com' )
167+ }
168+ }
169+ }
170+ }
171+ }
172+
166173 mavenJava(MavenPublication ) {
167174 from components. java
168175 artifact javadocJar
@@ -176,9 +183,9 @@ publishing {
176183 password ossrhPassword
177184 }
178185 if (project. version. endsWith(' -SNAPSHOT' )) {
179- url " https://oss.sonatype.org/content/repositories/snapshots/"
186+ url ' https://oss.sonatype.org/content/repositories/snapshots/'
180187 } else {
181- url " https://oss.sonatype.org/service/local/staging/deploy/maven2/"
188+ url ' https://oss.sonatype.org/service/local/staging/deploy/maven2/'
182189 }
183190 }
184191 }
@@ -193,8 +200,8 @@ test {
193200 dependsOn ' registerDomain'
194201 dependsOn ' checkLicenseMain'
195202 testLogging {
196- events " passed" , " skipped" , " failed"
197- exceptionFormat " full"
203+ events ' passed' , ' skipped' , ' failed'
204+ exceptionFormat ' full'
198205 // Uncomment the following line if you want to see test logs in gradlew run.
199206 showStandardStreams true
200207 }
@@ -205,11 +212,11 @@ uploadArchives {
205212 mavenDeployer {
206213 beforeDeployment { MavenDeployment deployment -> signing. signPom(deployment) }
207214
208- repository(url : " https://oss.sonatype.org/service/local/staging/deploy/maven2/" ) {
215+ repository(url : ' https://oss.sonatype.org/service/local/staging/deploy/maven2/' ) {
209216 authentication(userName : ossrhUsername, password : ossrhPassword)
210217 }
211218
212- snapshotRepository(url : " https://oss.sonatype.org/content/repositories/snapshots/" ) {
219+ snapshotRepository(url : ' https://oss.sonatype.org/content/repositories/snapshots/' ) {
213220 authentication(userName : ossrhUsername, password : ossrhPassword)
214221 }
215222
0 commit comments