Table of Contents
- Preliminary steps
- Install plugins
- Import project
- Setting up build configurations
- While working on Protobuf stuff
- Dropbox integration testing
The project is developed using Intelliji Idea. Community Edition should work fine. All further steps assume you have it already installed.
- Make sure you have Java 8 installed (the JDK version is as an example, Oracle JDK will do either):
> java -version openjdk version "1.8.0_252" OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_252-b09) OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.252-b09, mixed mode)
- Clone repository
git clone email@example.com:WaveBeans/wavebeans.git
- Make your first build and wait test to pass. No special requirements here.
A few extra plugins you need to make sure you have installed.
To import the project just open via
File > Open in IDE the
build.gradle.kts file in the root directory of the project, select
Open as project. Select to use gradle wrapper.
A few basic configurations are handy to create. Especially for running tests. As by the time of writing this there was no way found to run all tests at once, as well as using Spek plugin. So you need to cre JUnit runner and repeat steps for all projects (
- Create configuration, then select
- Name configuration, for example
Test kind: All in package.
Search for tests: In single module.
Use classpath or module: io.wavebeans.lib.test(or corresponding to the project).
- Add additional VM option
-DSPEK_TIMEOUT=0as some tests are taking more than default 10 seconds timeout and failing weirdly.
IDE doesn’t currently build automatically proto-files, but all source folders are configured correctly. Every time you change them (or cleaned the project) regenerate them by running gradle command:
./gradlew clean generateProto
When running all tests or testing DropBox related stuff, you may need to specify dropbox integration parameters. They are specified via environment variables
DBX_TEST_ACCESS_TOKEN. On GitHub they are stored in project secrets and are being provided during build time, though on your local environment you may create your own.
First of all follow the docs to fetch required values. And then:
- To run via gradle, use
exportif you’re on zsh-like shell or store commands directly into you
export DBX_TEST_CLIENT_ID=test-client-id export DBX_TEST_ACCESS_TOKEN=access-token
- To conveniently run in Intelliji IDEA and a default parameter into and Spek runners:
Run/Debug configurations > Templates > Spek 2 - JVM
- Add both values under environment variables.