android-gradle-logic▌
new-silvermoon/awesome-android-agent-skills · updated Apr 8, 2026
This skill helps you configure a scalable, maintainable build system for Android apps using Gradle Convention Plugins and Version Catalogs, following the "Now in Android" (NiA) architecture.
Android Gradle Build Logic & Convention Plugins
This skill helps you configure a scalable, maintainable build system for Android apps using Gradle Convention Plugins and Version Catalogs, following the "Now in Android" (NiA) architecture.
Goal
Stop copy-pasting code between build.gradle.kts files. Centralize build logic (Compose setup, Kotlin options, Hilt, etc.) in reusable plugins.
Project Structure
Ensure your project has a build-logic directory included in settings.gradle.kts as a composite build.
root/
├── build-logic/
│ ├── convention/
│ │ ├── src/main/kotlin/
│ │ │ └── AndroidApplicationConventionPlugin.kt
│ │ └── build.gradle.kts
│ ├── build.gradle.kts
│ └── settings.gradle.kts
├── gradle/
│ └── libs.versions.toml
├── app/
│ └── build.gradle.kts
└── settings.gradle.kts
Step 1: Configure settings.gradle.kts
Include the build-logic as a plugin management source.
// settings.gradle.kts
pluginManagement {
includeBuild("build-logic")
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
}
}
Step 2: Define Dependencies in libs.versions.toml
Use the Version Catalog for both libraries and plugins.
[versions]
androidGradlePlugin = "8.2.0"
kotlin = "1.9.20"
[libraries]
# ...
[plugins]
android-application = { id = "com.android.application", version.ref = "androidGradlePlugin" }
android-library = { id = "com.android.library", version.ref = "androidGradlePlugin" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
# Define your own plugins here
nowinandroid-android-application = { id = "nowinandroid.android.application", version = "unspecified" }
Step 3: Create a Convention Plugin
Inside build-logic/convention/src/main/kotlin/AndroidApplicationConventionPlugin.kt:
import com.android.build.api.dsl.ApplicationExtension
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.configure
class AndroidApplicationConventionPlugin : Plugin<Project> {
override fun apply(target: Project) {
with(target) {
with(pluginManager) {
apply("com.android.application")
apply("org.jetbrains.kotlin.android")
}
extensions.configure<ApplicationExtension> {
defaultConfig.targetSdk = 34
// Configure common options here
}
}
}
}
Don't forget to register it in build-logic/convention/build.gradle.kts:
gradlePlugin {
plugins {
register("androidApplication") {
id = "nowinandroid.android.application"
implementationClass = "AndroidApplicationConventionPlugin"
}
}
}
Usage
Apply your custom plugin in your modules (e.g., app/build.gradle.kts):
plugins {
alias(libs.plugins.nowinandroid.android.application)
}
This drastically cleans up module-level build files.
Discussion
Product Hunt–style comments (not star reviews)- No comments yet — start the thread.
Ratings
4.5★★★★★45 reviews- ★★★★★Dhruvi Jain· Dec 28, 2024
Registry listing for android-gradle-logic matched our evaluation — installs cleanly and behaves as described in the markdown.
- ★★★★★Pratham Ware· Dec 28, 2024
android-gradle-logic has been reliable in day-to-day use. Documentation quality is above average for community skills.
- ★★★★★Arya Wang· Dec 8, 2024
Solid pick for teams standardizing on skills: android-gradle-logic is focused, and the summary matches what you get after install.
- ★★★★★Mia Gupta· Dec 4, 2024
android-gradle-logic is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
- ★★★★★Evelyn Abebe· Nov 27, 2024
android-gradle-logic is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
- ★★★★★Henry Gupta· Nov 23, 2024
Solid pick for teams standardizing on skills: android-gradle-logic is focused, and the summary matches what you get after install.
- ★★★★★Oshnikdeep· Nov 19, 2024
android-gradle-logic reduced setup friction for our internal harness; good balance of opinion and flexibility.
- ★★★★★Yuki Choi· Oct 18, 2024
android-gradle-logic fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
- ★★★★★Noor Kim· Oct 14, 2024
We added android-gradle-logic from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
- ★★★★★Ganesh Mohane· Oct 6, 2024
I recommend android-gradle-logic for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
showing 1-10 of 45