chore: update dependency dev.zacsweers.metro:gradle-plugin to v0.13.2#97
Open
renovate[bot] wants to merge 1 commit intomainfrom
Open
chore: update dependency dev.zacsweers.metro:gradle-plugin to v0.13.2#97renovate[bot] wants to merge 1 commit intomainfrom
renovate[bot] wants to merge 1 commit intomainfrom
Conversation
18c6f0b to
a78e124
Compare
a78e124 to
8a077c2
Compare
8a077c2 to
2577646
Compare
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.
This PR contains the following updates:
0.10.2→0.13.2Release Notes
ZacSweers/metro (dev.zacsweers.metro:gradle-plugin)
v0.13.2Compare Source
2026-04-06
This is another small bugfix release for some issues with the new experimental Circuit code gen and
generateContributionProvidersfeatures. Apologies for the churn! This should be the last of it, and is only necessary if you wanted to try out those new features.Fixes
@CircuitInjectpresenter functions.Fixes
generateContributionProviderswhen the map key uses implicit class keys.@CircuitInjectfunctions are UI types.v0.13.1Compare Source
2026-04-06
This is a small bugfix release for some issues with the new experimental Circuit code gen and
generateContributionProvidersfeatures.Enhancements
@ExposeImplBindingannotation to disablegenerateContributionProvidersbehavior on a per-class basis.generateContributionProvidersand the class isn't annotated@ExposeImplBinding.Fixes
@ContributesTo-annotated classes whengenerateContributionProvidersis enabled.@AssistedFactory-annotated classes whengenerateContributionProvidersis enabled.enableCircuitCodegenandgenerateContributionProviderswork together when both enabled.generateContributionProvidersis enabled. This specifically affected scoped or private bindings.generateContributionProvidersis enabled.generateContributionProviders.Contributors
Special thanks to the following contributors for contributing to this release!
Consider sponsoring Metro's development
v0.13.0Compare Source
2026-04-04
New
Circuit codegen
Metro now includes experimental built-in support for Circuit, a Compose-first architecture for building kotlin apps. See the docs for more details.
In the long term, this will eventually move out to a separate plugin that can gracefully participate with Metro's code gen APIs. This is initially implemented within Metro to ease development.
generateContributionProvidersThis release introduces a new
generateContributionProvidersAPI (Kotlin 2.3.20+) to optimize behavior with contributed APIs.Up to now, Metro's aggregation APIs (i.e.
@Contributes*binding annotations) have worked similar to Anvil, where the ultimately just generate@Bindsdeclarations as simple shorthands for the consuming graphs. This comes with the caveat that the injected class must be publicly visible if it's used outside of that module.Now, if you enable the new
generateContributionProvidersfeature, Metro will instead generate top-level@Providesdeclarations that mirror the injected class's inputs but only return its bound type. This means the annotated class can remaininternal, which both helps encapsulation and incremental compilation.The tradeoff is that
Implis no longer available directly on the graph. If you had any explicit code usages ofImpl, you would have to remove those too in favor of purely the bound type.[MEEP-1776]
@DefaultBindingThis release introduces a new
@DefaultBindingannotation that allows for setting a default binding on supertypes of contributed classes. This is useful for common base classes with generics that would otherwise require repetitive (or error-prone) explicitbinding<T>()declarations in subtypes.Enhancements
METRO_ERRORfor a general catch-all in a lot of places).Fixes
rankparameter when processing contributed binding containers.Changes
2.4.0-Beta1.@Assisted.value. See the docs on why in case you missed this! TL;DR, Metro matches by parameter names going forward.chunkFieldInitstransformProvidersToPrivatepublicProviderSeverity(usepublicScopedProviderSeverity)assistedIdentifierSeveritygenerateThrowsAnnotationContributors
Special thanks to the following contributors for contributing to this release!
Consider sponsoring Metro's development
v0.12.1Compare Source
2026-03-30
Enhancements
2.3.21+ and2.4.0-Beta2+.Fixes
allSessionslookup lazy to avoid lockups in the IDE.copyfunctions from@Includesaccessor candidates.@Includesaccessor candidates.Changes
androidx.tracingto 2.0.0-alpha04.2.4.0-Beta1.Contributors
Special thanks to the following contributors for contributing to this release!
v0.12.0Compare Source
2026-03-24
New
[MEEP-2014] Implicit class (map) keys
MapKey.implicitClassKeyis a new API to allow for class-based map keys to have their class parameters inferred on classes and@Bindsdeclarations.This means that instead of redeclaring the annotated class in the key, for example
@ViewModelKey, you can now omit it and it will be inferred.For classes, the implicit type is the annotated class. For
@Bindsdeclarations, the receiver or single parameter are the implicit type.You may still specify an explicit type. The compiler will warn you if you specify a redundant one. If you need to suppress this diagnostic temporarily to ease migration, you can add
-Xwarning-level=MAP_KEY_REDUNDANT_IMPLICIT_CLASS_KEY:disabledto your compiler arguments.The compiler will also error if you attempt to do this on
@Providesdeclarations, as those cannot be inferred.Metro's first-party class-based map keys (like
@ClassKey,@ViewModelKey, etc.) now support this. Custom map keys can opt-in to this by settingMapKey.implicitClassKeyto true. See its doc for more details.Misc
mingwX64target.Enhancements
FUNCTIONtargets if they have a@Targetannotation.Fixes
IllegalArgumentExceptionthrown when there are multiple top-level functions with the same name but only one is annotated with@Inject.SuspiciousUnusedMultibindinglocations.@OptionalBindingannotations to generated static factory creators if present.IntoSetandIntoMapno longer have aTargetofAnnotationTarget.CLASSChanges
2.2.@Assisted.valueis formally deprecated now. See the docs on why in case you missed this! TL;DR, Metro matches by parameter names going forward.2.3.20but still targets Kotlin 2.2 for its runtime artifacts and supports 2.2.20 all to 2.4.0 dev builds in its compiler.macosX64,tvosX64, andwatchosX64targets.2.4.0-dev-539to2.4.0-dev-2124. This should support the upcoming IntelliJ 2026.1 release as well as the upcoming Kotlin2.4.0-Beta1.2026.1 RC.6.1.0.Contributors
Special thanks to the following contributors for contributing to this release!
v0.11.4Compare Source
2026-03-17
Fixes
@Injectconstructor.Contributors
Special thanks to the following contributors for contributing to this release!
v0.11.3Compare Source
2026-03-16
Enhancements
@ContributesBinding(..., multibinding = true)interop with kotlin-inject-anvil.Fixes
FirSessioninstances as it seems that the IDE will mutate the underlying source lists in some cases.Map<Class<*>, V>map key interop in constructor injection paths whenenableKClassToClassMapKeyInteropis enabled.Loggerand graphBalso providesLogger(overridingA's), graphCwould incorrectly try to get it fromAinstead ofB.NoSuchFieldErrorat runtime when sharded graphs access@Includesdependency properties.@Originannotations when performing IR-based contribution merging.@Bindsoverriding a grandparent's@Providesof the same type).CreationExtrasto thecreateViewModellambda forassistedMetroViewModelwhen usingManualViewModelAssistedFactory.Changes
androidx.tracingto2.0.0-alpha03.6.0.0.Contributors
Special thanks to the following contributors for contributing to this release!
v0.11.2Compare Source
2026-03-02
New
Class/KClassmap key interopThis release introduces a special-cased opt-in
java.lang.Classandkotlin.reflect.KClassinterop on JVM/android compilations. While these types are not intrinsics of each other in regular code, they are in annotations and are often used inMapmultibindings. Metro can support these if you enable theenableKClassToClassMapKeyInteropoption. When enabled,java.lang.Classandkotlin.reflect.KClassare treated as interchangeable in map key types, matching Kotlin's own annotation compilation behavior. This only applies to map keys because these are the only scenario where annotation arguments are materialized into non-annotation code (i.e.@ClassKey(Foo::class) -> Map<Class<*>, V>).This is disabled by default (even if other framework interops like
includeDaggerare enabled) because this is purely for annotations interop and potentially comes at some runtime overhead cost to interop sinceKClasstypes are still used under the hood and must be mapped in some cases. It's recommended to migrate these toKClassand call.javawhere necessary if possible.Enhancements
@LazyClassKeyas this is unsupported in Metro.@RequiresIdeSupportopt-in message.Fixes
@Providesgraph parameters wouldn't correctly be used by scoped bindings directly held in that graph.Contributors
Special thanks to the following contributors for contributing to this release!
v0.11.1Compare Source
2026-02-25
Enhancements
outputModuleNamenames to all JS/wasm artifacts.Fixes
2.2.20) in runtime artifacts for JVM and native. Web artifacts unfortunately must target2.3.0since that's what Metro compiles against (star KT-84582).BindingContainerCallableCheckerandMultibindsCheckerdiagnostics on value parameters.0.11.0to better handle top-level constants but this solution accidentally regressed enum constants support.@OptionalBindingaccidentally reporting missing bindings.generateAssistedFactoriesis enabled.Contributors
Special thanks to the following contributors for contributing to this release!
v0.11.0Compare Source
2026-02-25
New
Metro now has an informal proposal system inspired by Kotlin KEEPs called MEEPs! Importantly, the
Pin MEEP stands for proposal, not process. It's an informal system for myself and future maintainers to seek broader community input on newer, splashier features and changes to Metro going forward.[MEEP-1826]
@Assistedparameters now rely on matching parameter names.Historically, Dagger/Guice's
@Assistedparameters allowed specifying a custom identifier via@Assisted("some string"), and Metro matched this behavior. However, this is a vestige of Java support, which did not include parameter names in bytecode until Java 8's-parametersflag.Since Metro is in an all-Kotlin world and parameter names are a first-class citizen in Kotlin APIs, Metro is now leveraging that and phasing out support for implicit type matching and custom identifiers.
This means that
@Assistedparameter names in assisted-inject constructors/top-level-functions must match their analogous parameters in@AssistedFactorycreators. No more matching by types, no more disambiguating with@Assisted("customIdentifier").To ease migration to this, this will be rolled out in phases.
@Assisted.valueis soft-deprecated. This is controlled by theassistedIdentifierSeverityGradle DSL option, which is set toWARNby default in this release. This control allows for easy disabling or promotion to error.assistedIdentifierSeveritywill be removed and@Assisted.valuewill be formally deprecated.@Assisted.valuewill be fully deleted and legacy behavior will be unsupported with Metro's first-party annotation.Note that interop annotations are not affected by this change, and any previous Dagger/Guice interop
@Assistedannotation's custom identifiers will still be respected.If you want to completely restore the legacy behavior, you can disable this new mode via
useAssistedParamNamesAsIdentifiersGradle DSL option. Note, however, that this option will eventually be removed.[MEEP-1770] Allow use of
() -> TasProvidertypes.Metro's primary provider type remains
Provider, but as of this release there are a couple of important changes in this space to allow more idiomatic use.Providernow implements() -> Ton supported platfroms (all but Kotlin/JS).enableFunctionProvidersoption to allow use of Kotlin's() -> Thigher order functions. This is disabled by default, but will possibly be promoted to the default behavior in the future. Please share feedback in the linked MEEP.Providersystem.Function0type will be wrapped/unwrapped like otherProviderinterop scenarios do. This limitation is because JS does not allow extending function types.This now allows you to write code like this.
The primary caveat of this new feature is that, if enabled, it essentially prohibits using function types as regular bindings in your graph. If you rely on this behavior, you may need to migrate to something more strongly typed.
[MEEP-1769] Introduce
@GraphPrivateAPI.Up to now, all bindings in graphs are implicitly available to all graph extensions.
Indicates this
@Providesor@Bindsdeclaration shall be private to the graph it's provided in. This means the following:This is a mechanism to enforce that annotated bindings cannot be directly leaked. It may be depended on by any bindings within this graph as an implementation detail or encapsulation.
This is useful for a few situations.
HttpClient.@ForScopeto disambiguate which one you need. By marking each provision in a graph as private, you can trust that parent graph instances are not being accidentally leaked to your extension's scope.This feature is experimental, please share any feedback on the original MEEP.
Misc new stuff
Providerimplement() -> Ton applicable platforms (everything but Kotlin/JS).@ExperimentalMetroApiexperimental annotation to better indicate which APIs are experimental and likely to change.@RequiresIdeSupportexperimental annotation to better indicate which APIs require IDE support.@ExperimentalMetroGradleApiexperimental annotation to better indicate which APIs are experimental and likely to change.@DangerousMetroGradleApiexperimental annotation withERRORseverity to better propagate severity of certain APIs.publicScopedProviderSeverityproperty with a more narrow focus. The previouspublicProviderSeverityis now deprecated and just calls through to this.Enhancements
_assisted context parameter names in top-level function injection.Previously, Metro's IR would run in two passes:
MetroContributioninterfaces.Now, Metro runs in a single pass. Most of Metro's core transformations are run in the first full pass, collects any seen dependency graphs along the way, then they are processed at the end (rather than visit the whole IR tree a second time).
DiagnosticSeveritymetro extension properties to be configurable asmetro.*gradle properties of the same name.ReentrantLock(JVM), a port of the stdlib's Lazy spinlock on (Native), and no-op on web targets.Fixes
@HiddenFromObjCto generated top-level composable classes for native compilations.@Assistedor@Named.@BindingContainerclasses included via@Includeswith concrete type arguments (e.g.,@Includes TypedBindings<Int>). Type parameters are now properly propagated to generated factory classes and substituted during binding resolution.Mapgraph inputs down to graph extensions.Mapinstance not getting reused at injection sites.@Binds-provided bindings from parent graphs.reports/keys-populated-test_Graph_ChildGraph.txtwill now be generated asreports/keys-populated/test/Graph/ChildGraph.txtChanges
enableGraphShardingis now enabled by default. Note this only kicks in (by default) for graphs with 2000+ bindings by default.unusedGraphInputsSeverityis now enabled toWARNseverity by default.2.3.20-RC.Android Studio 2025.3.1.8 Panda 1 Patch 1.8.8via Gradle's not-so-obviousGRADLE_PLUGIN_API_VERSION_ATTRIBUTEAPI.forceEnableFirInIdeandcompilerVersionwith@DangerousMetroGradleApi.generateAssistedFactories,enableTopLevelFunctionInjectionwith@RequiresIdeSupport.generateContributionHintsInFir,supportedHintContributionPlatforms,enableKlibParamsCheck,patchKlibParams, with@ExperimentalMetroGradleApi.enableFullBindingGraphValidation,shrinkUnusedBindings, with@DelicateMetroGradleApi.chunkFieldInits, this will always be enabled in the future.publicProviderSeverity, this now just calls through topublicScopedProviderSeverity.transformProvidersToPrivatedeprecation level toERROR.Contributors
Special thanks to the following contributors for contributing to this release!
v0.10.4Compare Source
2026-02-13
Enhancements
@Scopeclass or graph-like class, as that's not usually what you want!fun dependency(): Dependencyaccessor and@Provides fun dependency(): Dependencyprovider elsewhere, which previously resulted in undefined runtime behavior.For example, the below snippet
Now yields this error trace
Fixes
Mapgraph factory inputs correctly so they can properly satisfy map requests on the graph.objectclasses in non-jvm compilations.Changes
generateThrowsAnnotationsoption and make it no-op. This was only in place when debugging a past kotlin/native issue.Contributors
Special thanks to the following contributors for contributing to this release!
v0.10.3Compare Source
2026-02-09
New
androidx.tracingand can produce perfetto traces of its IR transformations.Enhancements
androidx.collectionprimitive and scatter collections in a few more places to further help improve memory performance.Fixes
IllegalStateException: No value parameter foundissues when reconstructing dependency cycle stacks to report cycle errors.metrox-androidartifact single-variant (release only).Changes
2025.2.xas of this version. Android Studio Panda and IntelliJ 2025.3 are tested and working though!SwitchingProviders or valid cycle breaking withDelegateFactory, as both of those requireProvidertypes and assisted-inject types' factories don't implementProvider.KotlinCompilation.implementationConfigurationNameAPI.enableTopLevelFunctionInjection,generateContributionHintsInFir, andsupportedHintContributionPlatformswill error if enabled on Kotlin/JS with JS incremental compilation enabled as it turns out this does not yet support generating top-level declarations from compiler plugins with incremental compilation enabled.2.3.20-dev-7791compat into2.3.20-Beta2compat, meaning the former is no longer tested on CI.2.3.20-dev-5437compat into2.3.20-dev-5706compat. This is to help Metro's main branch stay stable as the5437artifact came from a dev maven repo with ephemeral artifacts.2.3.20-Beta2.2.3.10.2.4.0-dev-539.2.3.10-RC.2.3.0. This allows it to test2.4.0builds, but is still compatible down to Kotlin2.2.20. Metro's runtime artifacts also explicitly have their language version still set to2.2(and2.0for the Gradle plugin).Contributors
Special thanks to the following contributors for contributing to this release!
Configuration
📅 Schedule: (in timezone Europe/Ljubljana)
* 17-23 * * 2)🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.