Skip to content

Commit 6924727

Browse files
authored
Merge pull request #1 from uber/master
Updating master from upstream
2 parents cbe3706 + 854d161 commit 6924727

40 files changed

+613
-2645
lines changed

.buildkite/pipeline.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ steps:
33
agents:
44
queue: "workers"
55
docker: "*"
6-
command: "./gradlew test"
6+
command: "./gradlew --no-daemon test"
77
plugins:
88
- docker-compose#v3.0.0:
99
run: unit-test-test-service
@@ -13,7 +13,7 @@ steps:
1313
agents:
1414
queue: "workers"
1515
docker: "*"
16-
command: "./gradlew test"
16+
command: "./gradlew --no-daemon test"
1717
plugins:
1818
- docker-compose#v3.0.0:
1919
run: unit-test-docker-sticky-on
@@ -23,7 +23,7 @@ steps:
2323
agents:
2424
queue: "workers"
2525
docker: "*"
26-
command: "./gradlew test"
26+
command: "./gradlew --no-daemon test"
2727
plugins:
2828
- docker-compose#v3.0.0:
2929
run: unit-test-docker-sticky-off

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ target
77
.gradle
88
/build
99
/out
10-
dummy
10+
dummy
11+
$buildDir

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[submodule "src/main/idls"]
2+
path = src/main/idls
3+
url = [email protected]:uber/cadence-idl.git
4+
branch = master

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ before_install:
1010
- wget https://www-us.apache.org/dist/thrift/0.9.3/thrift-0.9.3.tar.gz
1111
- tar xfz thrift-0.9.3.tar.gz
1212
- cd thrift-0.9.3
13-
- ./configure --enable-libs=no --enable-tests=no --enable-tutorial=no --with-cpp=no --with-c_glib=no --with-java=yes --with-ruby=no --with-erlang=no --with-go=no --with-nodejs=no
13+
- ./configure --enable-libs=no --enable-tests=no --enable-tutorial=no --with-cpp=no --with-c_glib=no --with-java=yes --with-ruby=no --with-erlang=no --with-go=no --with-nodejs=no --with-python=no
1414
- make -j2 && sudo make install
1515
- popd

build.gradle

Lines changed: 79 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
buildscript {
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

77
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'
1112
}
1213

1314
repositories {
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'
2121
apply plugin: 'maven'
22-
apply plugin: "org.jruyi.thrift"
22+
apply plugin: 'org.jruyi.thrift'
2323
apply plugin: 'maven-publish'
2424
apply 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 {
3939
group = 'com.uber.cadence'
4040
version = '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

4749
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+
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+
6778
compileJava {
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
7592
task 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-
99110
if (JavaVersion.current().isJava8Compatible()) {
100111
allprojects {
101112
tasks.withType(Javadoc) {
@@ -109,60 +120,56 @@ javadoc {
109120
}
110121

111122
task javadocJar(type: Jar) {
112-
classifier = 'javadoc'
113123
from javadoc
114124
}
115125

116126
task sourcesJar(type: Jar, dependsOn: classes) {
117-
classifier = 'sources'
118127
from sourceSets.main.allSource
119128
}
120129

121130
artifacts {
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

128137
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-
// }
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', '[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+
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

docker/buildkite/Dockerfile

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
1-
FROM openjdk:8
1+
FROM openjdk:8-alpine
22

3+
# Apache Thrift version
34
ENV APACHE_THRIFT_VERSION=0.9.3
45

5-
RUN apt-get update && apt-get -y install build-essential && apt-get install -y wget
6+
# Install dependencies using apk
7+
RUN apk update && apk add --virtual wget ca-certificates wget && apk add --virtual build-dependencies build-base gcc
68

9+
# Compile source
710
RUN set -ex ;\
811
wget http://www-us.apache.org/dist/thrift/${APACHE_THRIFT_VERSION}/thrift-${APACHE_THRIFT_VERSION}.tar.gz ;\
912
tar -xvf thrift-${APACHE_THRIFT_VERSION}.tar.gz ;\
1013
rm thrift-${APACHE_THRIFT_VERSION}.tar.gz ;\
1114
cd thrift-${APACHE_THRIFT_VERSION}/ ;\
12-
./configure --without-python --without-cpp ;\
15+
./configure --enable-libs=no --enable-tests=no --enable-tutorial=no --with-cpp=no --with-c_glib=no --with-java=yes --with-ruby=no --with-erlang=no --with-go=no --with-nodejs=no --with-python=no ;\
1316
make -j2 && make install ;\
1417
cd .. && rm -rf thrift-${APACHE_THRIFT_VERSION}
1518

19+
# Cleanup packages and remove cache
20+
RUN apk del build-dependencies wget && rm -rf /var/cache/apk/*
21+
1622
RUN mkdir /cadence-java-client
1723
WORKDIR /cadence-java-client

docker/buildkite/Dockerfile-local

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
1-
FROM openjdk:8
1+
FROM openjdk:8-alpine
22

3-
COPY --from=thrift:0.9.3 /usr/local/bin/thrift /usr/local/bin/thrift
3+
# Apache Thrift version
4+
ENV APACHE_THRIFT_VERSION=0.9.3
5+
6+
# Install dependencies using apk
7+
RUN apk update && apk add --virtual build-dependencies build-base gcc
8+
9+
# Compile source
10+
COPY --from=thrift:${APACHE_THRIFT_VERSION} /usr/local/bin/thrift /usr/local/bin/thrift
11+
12+
# Cleanup packages and remove cache
13+
RUN apk del build-dependencies wget && rm -rf /var/cache/apk/*
414

515
RUN mkdir /cadence-java-client
616
WORKDIR /cadence-java-client

docker/buildkite/docker-compose-local.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ services:
4444
build:
4545
context: ../../
4646
dockerfile: ./docker/buildkite/Dockerfile-local
47-
command: "./gradlew test"
47+
command: "./gradlew --no-daemon test"
4848
environment:
4949
- "USER=unittest"
5050
- "CADENCE_SEEDS=cadence"
@@ -63,7 +63,7 @@ services:
6363
build:
6464
context: ../../
6565
dockerfile: ./docker/buildkite/Dockerfile-local
66-
command: "./gradlew test"
66+
command: "./gradlew --no-daemon test"
6767
environment:
6868
- "USER=unittest"
6969
- "CADENCE_SEEDS=cadence"
@@ -82,7 +82,7 @@ services:
8282
build:
8383
context: ../../
8484
dockerfile: ./docker/buildkite/Dockerfile-local
85-
command: "./gradlew test"
85+
command: "./gradlew --no-daemon test"
8686
environment:
8787
- "USER=unittest"
8888
- "USE_DOCKER_SERVICE=false"

0 commit comments

Comments
 (0)