Releases: google/dagger
Dagger 2.26
What's new
- Fix #1700: Remove usages of non-Android Guava APIs. (0925e8f)
- Fix #1720: Fix incremental dagger-android-processor in kapt when using dagger.android.experimentalUseStringKeys. (6a0ce58)
- Fix #1721: Migrate dagger-android to AndroidX. (f45213e)
- Better support for binding declarations within Kotlin companion objects of
@Moduleannotated classes. (8190c7c)
Known breaking changes
Companion object modules are no longer allowed on Component#modules list (8190c7c)
It is now an error to add an @Module annotated companion object class to Component#modules (or Subcomponent#modules) list. Instead, only the outer class should be added to the module list.
// Only add this class to the Component#modules list.
@Module
abstract class FooModule {
@Binds abstract fun bindFoo(impl: FooImpl): Foo
// @Module is no longer needed here!
companion object {
// @JvmStatic is no longer needed here!
@Provides fun provideBar(): Bar = Bar()
}
}Note: For backwards compatibility, we still allow @Module on the companion object and @JvmStatic on the provides methods. However, @Module on the companion object is now a no-op and all of its attributes (e.g. "includes") will be ignored. In future releases, we will make it an error to use @Module on a companion object.
Dagger Android artifacts now use Androidx (f45213e)
The following artifacts have been migrated from the support library to AndroidX:
com.google.dagger:dagger-android:2.26com.google.dagger:dagger-android-support:2.26
This change may break users who have not already migrated to AndroidX. The fix is to either migrate your app to AndroidX, or switch back to the support library artifacts which are now available at:
com.google.dagger:dagger-android-legacy:2.26com.google.dagger:dagger-android-support-legacy:2.26
Dagger 2.25.4
Dagger 2.25.3
What's new
-
Bug fixes
-
Maintenance
Dagger 2.25.2
Known breaking changes
- The Kotlin change in
2.ii(below) will break users who were passing in object module
instances into a Component builder method rather than using@JvmStatic.
To fix this issue, remove the call to the builder method -- the module instance is
no longer needed and the Component builder method will no longer be generated.
What's new
-
Bug fixes
- Fix duplicate missing binding error messages. (2411074)
- Fix dagger-spi pom file from dependency cycle. (3699697)
- Fix issue with missing shaded deps from release 2.25 (efe1b00)
-
Kotlin support
-
Performance Improvements
Dagger 2.25
Do not depend on this release.
Depend on release 2.25.2 instead, which fixes issue #1639.
Dagger 2.24
- Deprecations/removals
dagger.android'sHas{Activity,Fragment,Service,ContentProvider,BroadcastReceiver}interfaces are now removed in favor ofHasAndroidInjector(which can handle any type).HasAndroidInjectorwas added in 2.23, and is supported together with the old types in that version. (3bd8f70)
- Bug fixes
- Duplicate keys were erroneously not detected when MapKey.unwrapValue=false which may have resulted in a runtime error (depending on whether fastInit mode was used). This is now detected and failed at compile time. (8b5dbea)
- Build performance
- Gradle's incremental annotation processing is now enabled for all builds (50bc180)
Dagger 2.23.2
In addition to the 2.23.1 release notes, this release:
Dagger 2.23.1
In addition to the 2.23 release notes, this release fixes support for gradle incremental annotation processing (a91d962)
Dagger 2.23
- Validation/strictness
- Build performance
- Android
- Added
dagger.android.HasAndroidInjector, which will soon replace theHas*Injectorinterfaces. This one interfaces coalesces the others and should be functionally equivalent. (8f01526)
- Added
- Full Binding Graph Validation
- Bug Fixes
Dagger 2.22.1
In addition to the 2.22 release notes, this release fixes an issue where @BindsInstance on a @Component.Builder setter method's parameter caused a failure in code generation if the parameter had a different name than the method itself (#1464). (8051d28)