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 11 installed (the JDK version is as an example, Oracle JDK will do either), for some of the tests
kotlincshould be also available:
> java -version
openjdk version "11.0.16.1" 2022-08-12
OpenJDK Runtime Environment Homebrew (build 11.0.16.1+0)
OpenJDK 64-Bit Server VM Homebrew (build 11.0.16.1+0, mixed mode)
> kotlinc -version
info: kotlinc-jvm 1.7.10 (JRE 19)
You can use sdkman to install it, from project root:
sdk env install- Clone repository
git clone git@github.com:WaveBeans/wavebeans.git- Make your first build and wait test to pass. No special requirements here.
./gradlew buildA few extra plugins you need to make sure you have installed.
- To run tests using IDE: Kotest plugin
- For protobuf support: Protobuf support plugin
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 in IDE using the Kotest plugin. Repeat steps for all projects as needed (lib, exe, cli, http).
- Create configuration, then select
Kotest. - Name configuration, for example
LIB tests. - Select
Test kind: All in package(or chooseSpec/Tagsas needed). - Select
Search for tests: In single module. - Select
Use classpath or module: io.wavebeans.lib.test(or corresponding to the project).
Alternatively, you can run all tests via Gradle:
./gradlew testIDE 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 generateProtoWhen running all tests or testing DropBox related stuff, you may need to specify dropbox integration parameters. They are specified via environment variables DBX_TEST_CLIENT_ID and 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.zshrc:export DBX_TEST_CLIENT_ID=test-client-id export DBX_TEST_ACCESS_TOKEN=access-token
- To conveniently run in Intelliji IDEA and set default parameters for Kotest runs:
Run/Debug configurations > Templates > Kotest- Add both values under environment variables.