[pull] develop from mikepenz:develop - #22
Merged
Merged
Conversation
…tion `DuplicateMode.MERGE` grouped libraries by `groupId + name + description`, which collapsed distinct sibling modules of the same project onto a single entry — one of them silently disappeared from the output. `com.materialkolor:material-kolor` and `com.materialkolor:material-color-utilities` both publish `<name>MaterialKolor</name>` with the same description, so only one of the two was reported (independent of `mergePlatformArtifacts`). Sub-cluster each duplicate group by module id, so only actual platform variants of the same module are merged (`collection` + `collection-jvm`), never sibling modules. The surviving entry now breaks name-length ties on the shortest uniqueId, making the root module the deterministic survivor of a KMP merge. Fixes #1430
…dules fix(plugin): don't merge sibling modules sharing POM name and description
…blings `associated` is documented as "references all associated libraries", but the filter kept only the entry equal to the library's own `uniqueId` — every linked library ended up with a single-element list pointing at itself. The field is serialized into `aboutlibraries.json`, so the wrong value shipped. Also adds unit coverage for the duplicate handling that had none: `LINK`, `KEEP`, and the `SIMPLE` / `GROUP` rules.
Clustering by "root id plus any suffix" merged a sibling module into a shorter one it happened to share a prefix with: `androidx.core:core-ktx` collapsed into `core`, and a `com.foo:android` module absorbed `android-core` / `android-extra` whole. Require the suffix to be a Kotlin target name as published (`jvm`, `android`, `js`, `wasm-js`, `desktop`, `linuxx64`, `iossimulatorarm64`, …). An unrecognized target degrades to reporting the artifact separately — the pre-merge output — never to a wrong merge.
fix(plugin): `DuplicateMode.LINK` associated itself instead of its siblings
fix(plugin): only merge artifact suffixes that name a Kotlin target
…not the id The suffix allowlist inferred the platform-variant relationship from artifact names. Gradle already knows it exactly: `DependencyCollector.redirectTargetModule()` reads it from `ResolvedVariantResult.getExternalVariant()`, and the result rides along on `DependencyCoordinates.rootModule`. Record redirects unconditionally rather than only under `mergePlatformArtifacts`, and pass the resulting "platform artifact id -> root module id" map into `processDuplicates`. The duplicate handling runs on the default `MERGE` whether or not the flag is set, so the relationship has to be known in both modes; the flag keeps deciding only whether the root coordinate also becomes the reported `uniqueId`. Drops the target-name regex. Any suffix a publisher invents now merges correctly, and no sibling module can be absorbed by one it shares a prefix with. Costs one `Optional` lookup per resolved component (~0.5µs, measured ~0.04ms per export on a 248-component graph) — a component exposes only the variant selected in this graph, so there is no variant list to walk. Populating `rootModule` unconditionally changes the task's build-cache key once.
The sibling-module case was only asserted at unit level, with a hand-fed redirect map. This exercises a real resolution of `com.materialkolor:material-kolor:5.0.0` with `mergePlatformArtifacts` off and the default `MERGE` / `EXACT`, which is what the report used — and what proves the `available-at` redirects are recorded and reach the duplicate handling regardless of the flag.
Platform artifacts are now reported under the root coordinate they redirect from, so ids match what the build scripts declare (`androidx.collection:collection` rather than `collection-jvm` / `collection-android`). - `com.github.skydoves:compose-stability-runtime-*` drops out: the stability analyzer is no longer applied to the samples, so it is not on their classpath. Unrelated to the id changes — regenerating on `develop` drops it too. - web sample loses `org.jetbrains.compose.components:components-resources-wasmJs` as a separate entry: it is a platform artifact of `components-resources`, which the previous suffix matching missed because of the camelCase `wasmJs`. No library is lost otherwise — entry counts are unchanged for every other sample.
refactor(plugin): cluster duplicates by the `available-at` redirect, not the artifact id
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )