Skip to content

Use scoped contribution hints with Metro 1.2.0#72

Draft
tcmulcahy wants to merge 6 commits into
mainfrom
tomm/use-scoped-contribution-hints
Draft

Use scoped contribution hints with Metro 1.2.0#72
tcmulcahy wants to merge 6 commits into
mainfrom
tomm/use-scoped-contribution-hints

Conversation

@tcmulcahy

@tcmulcahy tcmulcahy commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

(TODO: rewrite the following AI slop)

Summary

  • Bump Metro from 1.1.1 to the released 1.2.0 artifact.
  • Stop reporting generated @ContributesMultibindingScoped binding containers through MetroContributionExtension.Contribution.
  • Rely on the existing ContributesMultibindingScopedFir.getContributionHints() path for discovery of the generated binding containers.

Context

Metro 1.2.0 includes an upstream behavior change: generated binding containers from contributed binding declarations are no longer merged as graph supertypes. @ContributesMultibindingScoped was relying on that older behavior by returning generated binding containers from ContributesMultibindingScopedMetroExtension.getContributions().

The release notes do not call out contribution hints specifically. The hint part is from Metro's existing FIR extension API and this project already had the required hints in ContributesMultibindingScopedFir.getContributionHints(). With Metro 1.2.0, the old synthetic contribution/supertype bridge is no longer valid, so this removes that duplicate path and leaves discovery to the existing hint path.

Tests

  • JAVA_HOME=$(/usr/libexec/java_home -v 25) ./gradlew :compiler:test --tests 'com.squareup.metro.extensions.runners.BoxTestGenerated$Contributesfeatureflag' --tests 'com.squareup.metro.extensions.runners.BoxTestGenerated$Contributesrobot' --tests 'com.squareup.metro.extensions.runners.BoxTestGenerated$Contributesservice' --tests 'com.squareup.metro.extensions.runners.BoxTestGenerated$Developmentappcomponent' --tests 'com.squareup.metro.extensions.runners.BoxTestGenerated$Contributesmultibindingscoped' --rerun-tasks --quiet
  • JAVA_HOME=$(/usr/libexec/java_home -v 25) ./gradlew :compiler:apiCheck --quiet

@tcmulcahy tcmulcahy force-pushed the tomm/use-scoped-contribution-hints branch from 196c698 to 66916b0 Compare June 11, 2026 04:06
@tcmulcahy tcmulcahy changed the title Use contribution hints for scoped multibindings Use scoped contribution hints with Metro 1.2.0 Jun 11, 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.

1 participant