Skip to content

Latest commit

 

History

History
29 lines (21 loc) · 1.39 KB

File metadata and controls

29 lines (21 loc) · 1.39 KB

Development

  1. Install Java
    • brew install openjdk
  2. Clone repo
    • git clone git@github.com:momentohq/client-sdk-java.git
  3. Run gradle build
    • ./gradlew clean build
  4. 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 integrationTest
      • V1_API_KEY - required - v1 api key
      • MOMENTO_API_KEY - required - v2 api key
      • MOMENTO_ENDPOINT - required - Momento service endpoint

Code Formatting

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

Examples

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.