Skip to content

Anvil creates factories for object Multibinding even if factory generation is disabling #1143

@kozaxinan

Description

@kozaxinan

Anvil 2.5.1

The factory generation is disabled and kaptTest is added with dagger compiler.

anvil {
    generateDaggerFactories = false
}

There are multiple ContributeMultibindings in the test code as object.

interface class Key

@ContributesMultibinding(ApplicationScope::class)
object ExperimentKey :  Key

Anvil still generates Factory for ExperimentKey object.

The will-have-dagger-factories has logic and checks for generateDaggerFactories and dagger kapt.
https://github.com/square/anvil/blob/main/gradle-plugin/src/main/java/com/squareup/anvil/plugin/AnvilPlugin.kt#L305
#951

Dagger kapt already generates factories for ExperimentKey as well as the Anvil. (I am not able to reproduce in sample application at the moment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions