Skip to content

build: centralize plugin classpaths in a hedvig.settings convention plugin - #3055

Open
StylianosGakis wants to merge 2 commits into
developfrom
chore/gradle-plugin-cleanup
Open

build: centralize plugin classpaths in a hedvig.settings convention plugin#3055
StylianosGakis wants to merge 2 commits into
developfrom
chore/gradle-plugin-cleanup

Conversation

@StylianosGakis

Copy link
Copy Markdown
Member

a11y

  • if these are UI changes - check for their accessibility

…lugin

Move the build's plugin classpath into build-logic and apply it from the settings
script, so plugin versions live only in gradle/libs.versions.toml.

Applying a build-logic plugin from settings.gradle.kts puts build-logic's whole plugin
classpath on the settings classloader, which is the parent of every project's
classloader. That is what lets project build scripts apply plugins by id without a
version. A settings `plugins {}` block cannot do this itself: it has no version-catalog
accessors and accepts only literals, which would mean duplicating every plugin version.

- New precompiled settings plugin `hedvig.settings` (applies develocity).
- build-logic declares every build plugin as `implementation` rather than `compileOnly`,
  so the plugins live on its classloader and its own handler code (ApolloHandler,
  ComposeHandler, ...) can reference their types at runtime. New build plugins go in
  that one list.
- Kotlin compiler plugins (ksp, metro, kmpNativeCoroutines) must share a classloader
  with the Kotlin plugin. KSP2's analysis worker fails with PROCESSING_ERROR when split
  from it, so they are declared alongside AGP/KGP here.
- Root build.gradle.kts drops the versioned `apply false` list and now declares only the
  plugins applied to the root project itself (dependencyAnalysis, doctor).
  `hedvig.gradle.plugin` needed no declaration: it is a build-logic plugin already
  available via includeBuild.
- Module scripts that applied these plugins by `alias(...)` now use version-less `id(...)`.

No behaviour change intended: same plugins, same versions, different classpath ownership.

Verified: :app debug/staging/release, :design-showcase, design-showcase-desktop,
hedvig-lint, :umbrella iosArm64/jvm, `test jvmTest` (608 test executions across the 14
test-bearing library modules, none skipped) and `lint` all pass.
Everything below the divider comment is a Gradle plugin artifact, everything above is a
normal dependency. Moves firebase-crashlytics-buildtools up into the alphabetical
libraries where it belongs, moves the lint/workaround entries above the divider, sorts
the plugin artifacts, and replaces the two overlapping comments with one short one.
@StylianosGakis
StylianosGakis marked this pull request as ready for review August 14, 2026 08:42
@StylianosGakis
StylianosGakis requested a review from a team as a code owner August 14, 2026 08:42
@StylianosGakis
StylianosGakis force-pushed the chore/gradle-plugin-cleanup branch from 5319ef5 to df0c89c Compare August 14, 2026 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant