Building, testing and contributing
| This documentation was generated with the assistance of AI. Please report any inaccuracies. |
Repository layout
| Path | Contents |
|---|---|
|
The library module, published to Maven Central as |
|
Sample application that depends on |
|
This Antora documentation site. Code examples in |
|
CI and release workflows. |
Requirements
-
JDK 17.
-
Android SDK with the platform set as
compileSdkinlib/build.gradle.kts. Point to it fromlocal.properties(sdk.dir=…). -
Node.js 20 or later, only to build the documentation.
Building and testing
# build the library and the sample app
./gradlew assembleDebug
# unit tests (Robolectric) and unit test coverage report
./gradlew :lib:testDebugUnitTest :lib:createDebugUnitTestCoverageReport
# instrumented tests (needs a device or emulator)
./gradlew connectedAndroidTest
# Android Lint
./gradlew lint
# API documentation (Dokka), written to lib/build/dokka/html
./gradlew :lib:dokkaGenerate
Building the documentation
cd docs
npm ci
npx antora antora-playbook.yml
npx pagefind --site build/site
The site is written to docs/build/site. Search only works when the site is served over HTTP, for example with
python3 -m http.server 8089 --directory docs/build/site.
Branching and releases
The repository follows gitflow:
-
developis the integration branch. Feature branches (feature/<issue>-<name>) start fromdevelopand are merged back into it with pull requests. -
mainonly receives releases. A release branch is created fromdevelop, merged intomainand tagged with the released version. CI then publishes the library to Maven Central and the documentation to GitHub Pages. -
After a release, an automated pull request brings the release changes and the next version back into
develop.
Contributing
-
Every source and test file starts with the Apache License 2.0 header used across the repository.
-
Every class, method and property has KDoc.
-
When you change a documented example, change the tagged region in
DocumentationExamplesTestand the matching file indocs/modules/ROOT/examplestogether. The test fails when they differ.