Skip to content

build: pin packageOfResClass in every Compose module - #13

Merged
aoreshkov merged 1 commit into
mainfrom
build/pin-package-of-res-class
Aug 7, 2026
Merged

build: pin packageOfResClass in every Compose module#13
aoreshkov merged 1 commit into
mainfrom
build/pin-package-of-res-class

Conversation

@aoreshkov

Copy link
Copy Markdown
Owner

Summary

Every module that generates a Compose Res class now pins packageOfResClass explicitly, instead of six of them taking the derived default.

The Compose default is {group}.{module}.generated.resources. This project sets no group, so it derived from rootProject.name — meaning renaming rootProject.name = "Ledger" would have silently repackaged every module's accessors and broken every resource import at once. Only :core:compose was already pinned.

Module Was Now
:core:bootstrap ledger.core.bootstrap.generated.resources app.oreshkov.ledger.core.bootstrap.resources
:core:navigation ledger.core.navigation.generated.resources app.oreshkov.ledger.core.navigation.resources
:core:ui ledger.core.ui.generated.resources app.oreshkov.ledger.core.ui.resources
:feature:posting:impl ledger.feature.posting.impl.generated.resources app.oreshkov.ledger.feature.posting.impl.resources
:feature:settings:impl ledger.feature.settings.impl.generated.resources app.oreshkov.ledger.feature.settings.impl.resources
:iosExport ledger.iosexport.generated.resources app.oreshkov.ledger.iosexport.resources

:core:compose is unchanged — it already used this convention, which is what the new packages follow.

Notes for review

Four of the six have no composeResources/ directory. :core:bootstrap, :core:navigation, :core:ui, and :iosExport still generate a Res class, because the ledger.kotlin.multiplatform.koin.compose convention plugin adds an explicit compose.components.resources dependency and generateResClass = auto generates on that basis. Each was leaking an empty ledger.* class into its klib dump.

The Kover excludes were coupled to the old package and had to move. They keyed off *.generated.resources.*, which the rename would have stopped matching — silently readmitting all seven generated Res classes into coverage against the 90% line floors. Both the root aggregate and the shared convention plugin now use app.oreshkov.ledger.*.resources.*. Verified against the generated coverage XML: 20 packages, none of them a …resources package. CLAUDE.md records the coupling so a future module can't break it quietly.

publicResClass is untouched. It stays at its false default everywhere; :core:compose remains the only module that sets true, because its back_content_description string is consumed by the feature modules.

The klib API dumps are part of the change. The generated accessors surface there, so ./gradlew apiDump was run and the six affected dumps are committed alongside.

Verification scope

./gradlew check and ./gradlew allTests are green locally, covering JVM and Android. Verified on Windows, where the iOS targets are unavailable — iosSimulatorArm64Test and friends report SKIPPED, and BCV produced the :iosExport dump via klibApiMergeInferred rather than a real iOS compilation. The rename is applied uniformly in commonMain with no platform-specific variation, so inference should hold, but CI on macOS is the real check for the iOS side.

Related issue

n/a

Type of change

  • Bug fix
  • New feature
  • Refactor / cleanup
  • Build / CI
  • Documentation

Checklist

  • Tests pass locally (./gradlew allTests)
  • Checks pass (./gradlew check)
  • Documentation updated where relevant
  • Changes follow the project's architecture and conventions (see CLAUDE.md / README.md)

Six modules generated their Compose `Res` class into the derived default
package `{group}.{module}.generated.resources`. With no `group` set that
derives from `rootProject.name`, so renaming the root project would have
silently repackaged every module's accessors at once. Only :core:compose
was already pinned.

Each module now sets `packageOfResClass` explicitly, following the
convention :core:compose already established:

  :core:bootstrap        -> app.oreshkov.ledger.core.bootstrap.resources
  :core:navigation       -> app.oreshkov.ledger.core.navigation.resources
  :core:ui               -> app.oreshkov.ledger.core.ui.resources
  :feature:posting:impl  -> app.oreshkov.ledger.feature.posting.impl.resources
  :feature:settings:impl -> app.oreshkov.ledger.feature.settings.impl.resources
  :iosExport             -> app.oreshkov.ledger.iosexport.resources

Four of those have no composeResources/ directory, but the koin.compose
convention plugin adds an explicit compose.components.resources dependency
and generateResClass=auto generates on that basis, so each was leaking an
empty `ledger.*` Res class into its klib dump.

`publicResClass` stays at its false default; :core:compose remains the only
module publishing its Res for cross-module use.

The Kover excludes keyed off `*.generated.resources.*`, which the rename
would have stopped matching, silently readmitting all seven generated Res
classes into coverage against the 90% line floors. Both the root aggregate
and the shared convention plugin now use `app.oreshkov.ledger.*.resources.*`;
CLAUDE.md records the coupling so a future module cannot break it quietly.

The generated accessors surface in the klib API dumps, so those are
refreshed accordingly.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

Code Coverage

Overall Project 87.19% 🍏
File Coverage
SettingsScreen.kt 98.93% 🍏
PostingEditScreen.kt 97.88% 🍏
PostingListScreen.kt 74.82% 🍏
PostingDetailsScreen.kt 67.22% 🍏

@aoreshkov
aoreshkov merged commit 02c9732 into main Aug 7, 2026
14 checks passed
@aoreshkov
aoreshkov deleted the build/pin-package-of-res-class branch August 7, 2026 04:58
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