Skip to content

v2.0.0

Compare
Choose a tag to compare
@vRallev vRallev released this 07 Aug 16:42
· 1548 commits to main since this release
  • Change the replaces attribute from a single class to an array. This gives the API more flexibility and avoids redundant classes. E.g. one Dagger module with several binding and provider methods may wish to replace multiple other Dagger modules.
  • Introduce the new @ContributesBinding annotation. This annotation allows you to contribute binding methods without actually writing a Dagger module.
    interface Authenticator
    
    @ContributesBinding(AppScope::class)
    class RealAuthenticator @Inject constructor() : Authenticator
    
    // The generated and automatically included Dagger module would look similar like this:
    @Module
    @ContributesTo(AppScope::class)
    abstract class AuthenticatorModule {
      @Binds abstract fun bindRealAuthenticator(authenticator: RealAuthenticator): Authenticator
    }
  • Support nested classes for contributed Dagger modules and component interfaces if the outer class uses a different scope #45.