- Install Java
brew install openjdk
- Clone repo
git clone git@github.com:momentohq/client-sdk-java.git
- Run gradle build
./gradlew clean build
- To run integration tests:
- Generate API keys using the Momento Console
V1_API_KEY=<api key> MOMENTO_API_KEY=<cache id> MOMENTO_ENDPOINT=<endpoint> ./gradlew integrationTestV1_API_KEY- required - v1 api keyMOMENTO_API_KEY- required - v2 api keyMOMENTO_ENDPOINT- required - Momento service endpoint
google-java-format is used for code formatting.
If you use IntelliJ, follow [instructions] https://github.com/google/google-java-format#intellij-android-studio-and-other-jetbrains-ides
If the Java code isn't formatted correctly, then your build will fail.
To fix the formatting either reformat the code using the IDE based plugin or run:
./gradlew :momento-sdk:spotlessApply
The example code can be found in the examples directory. If you would like to run the examples against your local copy of the SDK source code, uncomment the includeBuild stanza in the examples/settings.gradle.kts file. This will allow you to test the example code against local changes that you have made to the SDK.