This doc is intended for contributors to cadence-java-client
(hopefully that's you!)
Note: All contributors also need to fill out the Uber Contributor License Agreement before we can merge in any of your changes
- Java 11 (currently, we use Java 11 to compile Java 8 code).
- Thrift 0.9.3 (use homebrew or distribution). Alternatively you can install with
scripts/install-thrift-locally-osx.sh
. - Gradle build tool 6.x
- Docker
error: package org.apache.thrift.annotation does not exist
- Make sure you set the gradle path with the right version (currently 6.x)
This project is Open Source Software, and requires a header at the beginning of all source files. To verify that all files contain the header execute:
./gradlew licenseCheck
To generate licence headers execute
./gradlew licenseFormat
Overcommit adds some requirements to your commit messages. At Uber, we follow the Chris Beams guide to writing git commit messages. Read it, follow it, learn it, love it.
Build with:
./gradlew build
To test locally, you can publish to MavenLocal
-
Change
build.gradle
: Comment out the first section inpublications
( line 160 to line 191 in this commit) -
Change the version to add a
local
suffix. E.g.
version = '3.3.0'
to
version = '3.3.0-local'
Then run the command
./gradlew publishToMavenLocal
Now you have the local cadence-java-client in your machine using veriosn 3.3.0-local
- To test with Cadence Java Samples, change
mavenCentral()
tomavenLocal()
and also change the version with your suffix.
Then ./gradlew build
and refer to the sample repo for how to run the code(it needs to run with a Cadence server).
version.properties
creation task, you can comment the task out. It's okay for local testing.
The property file is being used by Version classto report the library version for logging/metrics.
Then run all the tests with:
./gradlew test
The test by default will run with TestEnvironment without Cadence service. If you want to run with Cadence serivce:
USE_DOCKER_SERVICE=true ./gradlew test
And sometimes it's important to test the non-sticky mode
STICKY_OFF=true USE_DOCKER_SERVICE=true ./gradlew test
Also, if there is any Buildkite test failure that you cannot reproduce locally, follow buildkite docker-compose instructions to run the tests.