Skip to content

Latest commit

 

History

History
64 lines (45 loc) · 2.14 KB

File metadata and controls

64 lines (45 loc) · 2.14 KB

Modifying/Adding code

Most of the SDK is generated code. Modifications to code will be persisted between generations, but may result in merge conflicts between manual patches and changes from the generator. The generator will never modify the contents of the arcade-java/lib/ and arcade-java-examples/ directories.

Adding and running examples

Set the following environment variables:

ENV Var Description
ARCADE_USER_ID Arcade user Id or email address
ARCADE_API_KEY Arcade API key
ARCADE_BASE_URL Arcade URL, defaults to: https://api.arcade.dev

Use ./gradlew :arcade-java-example:run -Pexample=<Name> to run <Name>Example

For example, if you have the potify.ResumePlayback tool configured, you can run:

export ARCADE_API_KEY='your-api-key'
export ARCADE_USER_ID='your-arcade-user'
./gradlew :arcade-java-example:run -Pexample=PlaySpotify

Building the repository from source

If you’d like to use the repository from source, you can build and install it from git:

git clone git@github.com/ArcadeAI/arcade-java.git
SKIP_MOCK_TESTS=true ./gradlew build publishToMavenLocal # This will skip the integration tests, see below on info on how to run them.

Running tests

Most tests require you to run a mock server against the OpenAPI spec to run the tests.

# you will need npm installed
./scripts/mock --daemon

The mock serer will run in the background allowing you to run tests from the command line ./gradlew test or from your IDE.

To stop the mock server run:

pkill -f prism

Linting and formatting

This repository uses Spotless to lint and format the code in the repository.

To lint:

$ ./scripts/lint

To format and fix all issues automatically:

$ ./scripts/format