Building, testing and contributing

This documentation was generated with the assistance of AI. Please report any inaccuracies.

Project structure

Path Contents

lib/

The library: CubeTextureView, CubeRenderer and the GLSL shaders in src/main/res/raw.

app/

Sample app, see Sample app.

docs/

This Antora documentation site.

.github/workflows/

GitHub Actions workflows for CI, releases, version sync and security scans.

Requirements

  • JDK 21 or later to run the unit tests, the same as CI. The library still targets JVM 17, but some of its transitive dependencies (pulled in by irurueta-android-glutils) are compiled for Java 21, so a JDK 17 runtime fails the tests with UnsupportedClassVersionError.

  • Android SDK with platform 36 (set sdk.dir in local.properties or the ANDROID_HOME environment variable).

  • An emulator or device for instrumented tests.

Building

./gradlew assembleDebug        # build library and sample app
./gradlew :lib:assembleRelease # build the release AAR

Testing

./gradlew test                 # JVM unit tests (Robolectric)
./gradlew connectedAndroidTest # instrumented tests, requires a device or emulator
./gradlew lint                 # Android Lint

Unit test coverage is collected because enableUnitTestCoverage is enabled for debug builds. CI converts it to a JaCoCo XML report and sends it to SonarCloud.

API documentation

./gradlew :lib:dokkaGenerate

The KDoc HTML is generated in lib/build/dokka/html and published under /api/ on GitHub Pages.

Documentation site

This site is built with Antora (Node.js 20 or later):

cd docs
npm ci
npx antora antora-playbook.yml
npx pagefind --site build/site

The result is in docs/build/site. Search only works when it is served over HTTP, for instance with python3 -m http.server 8090 --directory docs/build/site.

Branching model

The repository follows gitflow:

  • develop is the integration branch. It carries a -SNAPSHOT version, and every push builds, tests, publishes a snapshot to Maven Central and deploys the documentation.

  • main only receives releases. Publishing a GitHub release from main builds and publishes the release to Maven Central, deploys the documentation, and opens a pull request that merges main back into develop with the next -SNAPSHOT version.

  • Features are developed in feature/<issue>-<name> branches created from develop, and hotfixes in hotfix/…​ branches created from main.

Contributing

  1. Create an issue describing the change.

  2. Create a feature/<issue>-<name> branch from develop.

  3. Make sure ./gradlew test lint pass and keep unit test coverage high.

  4. Open a pull request against develop.

All source files carry the Apache License 2.0 header.