Repository navigation
Phase 1.0b: Convert all Gradle build scripts to Kotlin DSL - #20
Merged
sjaramillo10 merged 2 commits intoMay 26, 2026
Merged
Conversation
Replaces every Groovy build script in the repo with its KTS
equivalent:
- settings.gradle → settings.gradle.kts (also adds pluginManagement
block with gradlePluginPortal + google + mavenCentral, required so
Paparazzi's transitive com.android.tools:sdk-common resolves from
Google Maven)
- build.gradle (root) → build.gradle.kts (folds the detekt
configuration directly into the allprojects block; see below)
- detekt/detekt.gradle removed — script plugins applied via
apply(from = ...) run with their own compilation classpath and
cannot see plugin extension types like DetektExtension. Inlining
the config into the root build.gradle.kts allprojects {} block
preserves identical behavior with cleaner KTS semantics.
- All 14 module build.gradle files → build.gradle.kts.
Plugin application convention:
- Plugins on the buildscript classpath (AGP, Kotlin, shot,
vanniktech maven-publish) use plain id("...") in module scripts
with no version (version comes from the buildscript classpath).
- Plugins resolved through pluginManagement (ksp, compose-compiler,
paparazzi, detekt) use alias(libs.plugins.*).
- Mixing alias() with a plugin already on the buildscript classpath
produces "plugin already on classpath with unknown version"
errors at configuration time.
Other notes captured during the conversion:
- The afterEvaluate block in showkase-screenshot-testing-paparazzi-
sample/build.gradle was a workaround for KSP issue airbnb#37 (fixed in
KSP 1.0.7, June 2022). KSP 2.x — which we use — registers
generated Kotlin sources automatically, so the block was a no-op
and has been dropped during conversion. Documented inline.
Local verification: ./gradlew check assembleDebug
:showkase-processor:test passes (3m30s, 762 actionable tasks).
Refs #3
- "Kotlin DSL throughout" replaces the prior Groovy DSL note. - Documents the plugin application convention surfaced during conversion: id(...) for buildscript-classpath plugins, alias(...) for plugin-portal plugins. - Notes the pluginManagement block in settings.gradle.kts and why google() is required there (paparazzi transitive deps). - Drops the "no version catalog yet" line — catalog landed in 1.0a. - Updates path references from build.gradle to build.gradle.kts. - Prunes the catalog/KTS entries from the "Keep this file in sync" examples now that those phases have shipped.
sjaramillo10
enabled auto-merge (squash)
May 26, 2026 02:22
sjaramillo10
deleted the
3-10b-convert-build-files-to-kotlin-dsl-buildgradlekts
branch
May 26, 2026 02:36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Linked issue
Closes #3.
What changed
.gradlefile in the repo became.gradle.kts:settings.gradle, rootbuild.gradle,detekt/detekt.gradle, and all 14 module build files. Pure syntax conversion on top of the 1.0a version catalog — no dependency or version changes.settings.gradle.ktsadds apluginManagementblock withgradlePluginPortal(),google(), andmavenCentral(). Required because Paparazzi's transitivecom.android.tools:sdk-commononly resolves from Google Maven.detekt/detekt.gradle.ktsremoved; detekt config folded into rootbuild.gradle.kts. Script plugins loaded viaapply(from = ...)run with their own compilation classpath and can't see plugin extension types (DetektExtension). Inlining into theallprojects {}block preserves identical behavior with cleaner KTS semantics.id("...")in module scripts with no version.pluginManagement(KSP, compose-compiler, paparazzi, detekt) usealias(libs.plugins.*).afterEvaluate { ... }block inshowkase-screenshot-testing-paparazzi-sample/build.gradlewas a workaround for KSP issue Setup for testing the annotation processor airbnb/Showkase#37 (fixed in KSP 1.0.7, June 2022). KSP 2.x — what we run — registers generated Kotlin sources automatically, so the block was already a no-op. Dropped during conversion with an inline comment explaining the rationale and how to restore if a regression surfaces.How to validate locally
Ran locally: green in 3m30s, 762 actionable tasks executed. CI runs the same.
CI status
ci.ymlwill runcheck assembleDebug :showkase-processor:teston JDK 17. Expecting green.Out-of-scope follow-ups
useKsptoggle and KAPT branches everywhere. Plugin aliaskotlin-kaptbecomes unused and can be removed from the catalog.packagingOptions→packaging, librarytargetSdk, etc.) that should be addressed at the toolchain bump.vanniktech maven-publishcan move off the buildscript classpath entirely and use plugin-portal resolution (one of the few duplications between buildscript classpath and root plugins block).