build: pin packageOfResClass in every Compose module - #13
Merged
Conversation
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>
Code Coverage
|
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.
Summary
Every module that generates a Compose
Resclass now pinspackageOfResClassexplicitly, instead of six of them taking the derived default.The Compose default is
{group}.{module}.generated.resources. This project sets nogroup, so it derived fromrootProject.name— meaning renamingrootProject.name = "Ledger"would have silently repackaged every module's accessors and broken every resource import at once. Only:core:composewas already pinned.:core:bootstrapledger.core.bootstrap.generated.resourcesapp.oreshkov.ledger.core.bootstrap.resources:core:navigationledger.core.navigation.generated.resourcesapp.oreshkov.ledger.core.navigation.resources:core:uiledger.core.ui.generated.resourcesapp.oreshkov.ledger.core.ui.resources:feature:posting:implledger.feature.posting.impl.generated.resourcesapp.oreshkov.ledger.feature.posting.impl.resources:feature:settings:implledger.feature.settings.impl.generated.resourcesapp.oreshkov.ledger.feature.settings.impl.resources:iosExportledger.iosexport.generated.resourcesapp.oreshkov.ledger.iosexport.resources:core:composeis 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:iosExportstill generate aResclass, because theledger.kotlin.multiplatform.koin.composeconvention plugin adds an explicitcompose.components.resourcesdependency andgenerateResClass = autogenerates on that basis. Each was leaking an emptyledger.*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 generatedResclasses into coverage against the 90% line floors. Both the root aggregate and the shared convention plugin now useapp.oreshkov.ledger.*.resources.*. Verified against the generated coverage XML: 20 packages, none of them a…resourcespackage.CLAUDE.mdrecords the coupling so a future module can't break it quietly.publicResClassis untouched. It stays at itsfalsedefault everywhere;:core:composeremains the only module that setstrue, because itsback_content_descriptionstring is consumed by the feature modules.The klib API dumps are part of the change. The generated accessors surface there, so
./gradlew apiDumpwas run and the six affected dumps are committed alongside.Verification scope
./gradlew checkand./gradlew allTestsare green locally, covering JVM and Android. Verified on Windows, where the iOS targets are unavailable —iosSimulatorArm64Testand friends reportSKIPPED, and BCV produced the:iosExportdump viaklibApiMergeInferredrather than a real iOS compilation. The rename is applied uniformly incommonMainwith 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
Checklist
./gradlew allTests)./gradlew check)CLAUDE.md/README.md)