Skip to content

Store metadata paths relative to the root project - #903

Open
zalewskise wants to merge 1 commit into
icerockdev:developfrom
zalewskise:fix/relocatable-metadata-paths
Open

zalewskise wants to merge 1 commit into
icerockdev:developfrom
zalewskise:fix/relocatable-metadata-paths

Conversation

@zalewskise

@zalewskise zalewskise commented Nov 23, 2026 •

Copy link
Copy Markdown

What has changed?

  • File paths in <sourceSet>-metadata.json are stored relative to the root project dir and resolved against it when read. Files outside of it (only possible with a custom resourcesSourceSets dir or a module outside the root) keep absolute paths as before, so those setups behave the same as now.
  • The root dir is passed to the task as an @Internal property, so it's not part of the cache key.

Why it was changed?

Fixes #902 . Since #881, generateMRcommonMain can be restored from a cache entry made in another checkout, and the absolute paths in its metadata made the platform tasks copy resources from that checkout, or fail if it no longer exists.

Notes for Reviewers

  • ResourceMetadataSerializer now decodes with the caller's Json (decoder.json) instead of its own instance, otherwise the contextual File serializer isn't available for nested metadata. This drops the old instance's lenient options (ignoreUnknownKeys, isLenient, coerceInputValues), which aren't needed since metadata is only read by the same plugin version that wrote it.

@zalewskise
zalewskise marked this pull request as ready for review November 23, 2026 06:48
@ExNDY
ExNDY self-requested a review November 30, 2026 10:34
@ExNDY ExNDY added this to the 0.28.0 milestone Nov 30, 2026
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.

generateMR tasks restored from build cache point to files in another checkout

2 participants