build-plugin/README.md
The build-plugin folder defines Gradle build plugins, used as single source of truth for the project configuration.
This helps to avoid duplicated build script setups and provides a central location for all common build logic.
We use Gradle's
sharing build logic in a multi-repo setup
to create common configuration. It allows usage of xyz.gradle.kts files, that are then automatically converted to
Gradle Plugins.
The build-plugin is used as included build in the root settings.gradle.kts and provides all
included xyz.gradle.kts as plugins under their xyz name to the whole project.
The plugins should try to accomplish single responsibility and leave one-off configuration to the
module's build.gradle.kts.
thunderbird.app.android - Configures common options for Android appsthunderbird.app.android.compose - Configures common options for Jetpack Compose, based
on thunderbird.app.androidthunderbird.library.android - Configures common options for Android librariesthunderbird.library.android.compose - Configures common options for Jetpack Compose, based
on thunderbird.library.androidthunderbird.library.jvm - Configures common options for JVM librariesthunderbird.dependency.check - Gradle Versions: Gradle plugin to discover dependency updates
./gradlew dependencyUpdates to generate a dependency update reportthunderbird.quality.detekt - Detekt - Static code analysis for Kotlin
./gradlew detekt to check for any issue and ./gradlew detektBaseline in case you can't fix the reported
issue.thunderbird.quality.spotless - Spotless - Code formatter
with Ktlint - Kotlin linter and formatter
./gradlew spotlessCheck to check for any issue and ./gradlew spotlessApply to format your codethunderbird.quality.badging - Android Badging Check Plugin
./gradlew generate{VariantName}Badging to generate badging file./gradlew check{VariantName}Badging to validate allowed badging./gradlew update{VariantName}Badging to update allowed badgingCreate a thunderbird.xyz.gradle.kts file, while xyz describes the new plugin.
If you need to access dependencies that are not yet defined in build-plugin/build.gradle.kts you have to:
gradle/libs.versions.tomlbuild-plugin/build.gradle.kts.
implementation(plugin(libs.plugins.YOUR_PLUGIN_DEPENDENCY)).implementation(libs.YOUR_DEPENDENCY)).When done, add the plugin to build-plugin/src/main/kotlin/ThunderbirdPlugins.kt
Then apply the plugin to any subproject it should be used with:
plugins {
id(ThunderbirdPlugins.xyz)
}
If the plugin is meant for the root build.gradle.kts, you can't use ThunderbirdPlugins, as it's not available to
the plugins block. Instead use:
plugins {
id("thunderbird.xyz")
}