MetroPluginExtension
Constructors
Properties
Controls whether Metro's runtime artifact dependencies should be automatically added.
Override the Kotlin compiler version Metro operates with.
Compiler version aliases mapping fake IDE versions to their real compiler versions.
If enabled, treats @Contributes* annotations (except ContributesTo) as implicit @Inject annotations.
Configures the Metro compiler plugin to warn, error, or do nothing when it encounters uses of the desugared Provider<T> form as a provider type. Prefer the function syntax form () -> T instead.
Enable/disable Metro-native Circuit code generation. When enabled, Metro will generate Ui.Factory and Presenter.Factory implementations for @CircuitInject-annotated classes and functions.
Enable/disable treating () -> T (i.e., Function0<T>) as a provider type.
Enable/disable graph sharding of binding graphs. Enabled by default.
Enable/disable kotlin.reflect.KClass/Class interop for multibinding map keys. When enabled, java.lang.Class and kotlin.reflect.KClass are 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>).
Enable/disable klib parameter qualifier checking.
Enable/disable Kotlin version compatibility checks. Defaults to true or the value of the metro.version.check gradle property.
Enables switching providers for deferred class loading. This reduces graph initialization time by deferring bindings' class init until it's actually requested.
Enables whether the Metro compiler plugin can inject top-level functions. See the kdoc on Inject for more details.
Force enable Metro's FIR extensions in IDE even if the compat layer cannot be determined.
Enables whether the Metro compiler plugin will automatically generate assisted factories for injected constructors with assisted parameters. See the kdoc on AssistedFactory for more details.
Enable/disable contribution hint generation in IR for contributed types. Enabled by default.
Enable/disable contribution hint generation in FIR. Disabled by default as this is still experimental. Requires generateContributionHints to be true.
When enabled, generates top-level contribution provider classes with @Provides functions instead of nested @Binds interfaces for @ContributesBinding, @ContributesIntoSet, and @ContributesIntoMap. This allows implementation classes to remain internal since the generated provider directly constructs them (which in turn allows for finer grained IC).
Configures the Metro compiler plugin to warn, error, or do nothing when it encounters interop annotations using positional arguments instead of named arguments.
Maximum number of binding keys per graph shard when sharding is enabled. Default is 2000, must be > 0.
Maximum number of IR errors to report before exiting IR processing. Default is 20, must be > 0.
Configures the Metro compiler plugin to warn, error, or do nothing when it encounters @Contributes*-annotated declarations that are non-public (internal, private, protected, nested in non-public classes, etc.)
Controls the behavior of optional dependencies on a per-compilation basis. Default is OptionalBindingBehavior.DEFAULT mode.
Enable/disable patching of klib parameter qualifiers to work around a kotlinc bug. Only applies when enableKlibParamsCheck is also enabled.
Configures the Metro compiler plugin to warn, error, or do nothing when it encounters scoped public provider callables. See the kdoc on Provides for more details.
If set, the Metro compiler will dump verbose report diagnostics about resolved dependency graphs to the given destination. Outputs are per-compilation granularity (i.e. build/metro/main/...).
Maximum number of statements per init function when chunking field initializers. Default is 25, must be > 0.
Sets the platforms for which contribution hints will be generated. If not set, defaults are computed per-platform and per Kotlin version based on known compatible combinations.
If set, the Metro compiler will dump compiler trace information to the given destination. Outputs are per-compilation granularity (i.e. build/metro-traces/main/...).
Configures the Metro compiler plugin to warn, error, or do nothing when it encounters unused graph inputs (graph factory parameters or directly included binding containers that are not used by the graph).
Enable/disable suggestion to lift @Inject to class when there is only one constructor. Enabled by default.