Thank you for considering contributing to the Shadow Gradle plugin! This document provides guidelines and information to help you get started.
- Java Development Kit (JDK): JDK 17 or higher is required to build the project. JDK 25 is recommended.
- Gradle: The project uses the Gradle Wrapper, so you do not need to install Gradle globally. Run command-line tasks
using
./gradlew(orgradlew.baton Windows).
Shadow uses Spotless to maintain consistent code formatting.
- Check and format code:
./gradlew spotlessApply
Please ensure your code is properly formatted before submitting a pull request.
Shadow has multiple test suites to ensure code quality:
- Unit tests:
./gradlew test - Documentation tests:
./gradlew documentTest- Tests code snippets in thedocs/directory - Functional/Integration tests:
./gradlew functionalTest
To speed up local development, you can run specific test classes or methods:
- Run a specific unit test:
./gradlew test --tests "com.example.YourTestClass" - Run functional tests against a specific Gradle version:
./gradlew functionalTest -PtestGradleVersion=9.1.0(useful to verify compatibility locally with the minimum or a custom Gradle version)
Make sure all tests pass before submitting your changes.
Shadow uses Kotlin's built-in ABI validator to track public API changes.
- Check API dumps:
./gradlew checkKotlinAbi - Update API dumps:
./gradlew updateKotlinAbi
API dump files are located under the api/ directory (e.g., shadow.api). If you add or modify public
APIs, you'll need to run ./gradlew updateKotlinAbi to update the API dump files and include the updated dump files in
your pull request.
Shadow uses Android Lint to catch potential issues.
- Run lint checks:
./gradlew lint - Update lint baseline:
./gradlew updateLintBaseline
Shadow's user guide is built using MkDocs Material. You can build and preview the documentation website locally:
- Install MkDocs dependencies:
pip install mkdocs mkdocs-material - Preview documentation locally:
mkdocs serve(then navigate tohttp://127.0.0.1:8000/) - Build the static site:
mkdocs build
When fixing bugs or issues:
- Ensure all existing tests pass
- Add regression tests that verify the fix for the reported issue
- Run the full test suite to ensure no unintended side effects
- Update documentation if the fix changes behavior
When adding new features or public APIs:
- Ensure proper visibility modifiers are used
- All public APIs must be documented with KDoc comments
- Run
./gradlew updateKotlinAbito update the API dump files - Add appropriate tests for the new functionality
- Update the documentation in the
./docsdirectory if applicable
- Run
./gradlew spotlessApplyto format your code - Run all test suites:
./gradlew test documentTest functionalTest - Run
./gradlew checkKotlinAbito ensure API compatibility - Run
./gradlew lintto check for potential issues - Optionally, run
./gradlew buildto run compilation, tests, and standard verification tasks configured for the project - Ensure your commit messages are clear and descriptive
- Update the
Unreleasedsection in CHANGELOG if applicable