Releases: square/anvil
Releases · square/anvil
v2.4.1
Changed
- Attention: This version supports Kotlin
1.7.0
only. For Kotlin1.6.*
support please use version2.4.1-1-6
instead. Future Anvil versions will remove support for Kotlin 1.6.
Fixed
- Support wildcard imports for constants when resolving annotation arguments, see #592.
- Fix dagger factory member injection not handling generics, see #486.
- Correctly merge bindings from all scopes, if multiple
@Merge*
annotations are used, see #596.
Custom Code Generator
v2.4.0
Added
- Anvil annotations are repeatable. Modules and bindings can now be contributed multiple times to different scopes. Multiple scopes can be merged in a single component, see #236.
- Rewrote many of the internals of Anvil and as a result Anvil is up to 41% faster due to heavy caching of already parsed code structures.
- Automatically publish snapshots for the
main
branch. - Documented Anvil's internal, see here.
Changed
- Many of the internals of Anvil were rewritten and the non-stable APIs of the
compiler-utils
artifact have changed. Some highlights:- Instead of working with PSI or Descriptor APIs directly, you should work with the common
ClassReference
API. ClassReference
is a sealed class and either implemented with PSI or Descriptors, so it's easy to fallback to a specific API and add your own extensions.- The entry point to iterate through all classes used be
classesAndInnerClass(module)
, useclassAndInnerClassReferences()
instead.
- Instead of working with PSI or Descriptor APIs directly, you should work with the common
Removed
- Removed support for Kotlin
1.5
. - Removed deprecated APIs from the
AnvilExtension
in the gradle plugin.
Fixed
v2.4.0-M2
v2.4.0-M1
Added
- Rewrote many of the internals of Anvil and as a result Anvil is up to 41% faster.
- Automatically publish snapshots for the
main
branch. - Documented Anvil's internal, see here.
Removed
- Removed support for Kotlin
1.5
. - Removed deprecated APIs from the
AnvilExtension
in the gradle plugin.
Fixed
v2.3.11
- Promote
@ContributesSubcomponent
to stable, see #474. - Support replacing
@ContributesSubcomponent
through a newreplaces
attribute, see #466. - Avoid duplicate bindings when a
@ContributesSubcomponent
uses a factory and is used in multiple parent components, see #459. - Fix rare duplicate bindings error for the same type with incremental compilation, see #460.
- Support member injection for super types from different modules, see #438, #439 and #442.
- Support custom
CodeGenerator
s forAnvilCompilation
. This makes it easier to unit-test specific scenarios, see #470. - Detect duplicated generated files (helpful for custom
CodeGenerator
s), see #467. - Fix the import resolver for wildcard imports and inner classes, see #468.
- Use Anvil version
2.3.11-1-6-10
if you use Kotlin1.6.10
. Until Anvil hasn't adopted Kotlin1.6
I'll publish additional versions that are required due to compiler API incompatibilities.- Attention: This is the last release to simultaneously support Kotlin 1.5 and 1.6. The next release will only support Kotlin 1.6.
v2.3.10
- New experimental annotation
@ContributesSubcomponent
to delay merging contributions until the parent component is created, see #160. - Add option to contribute class using
@MergeInterfaces
and@MergeModules
to another scope with@ContributesTo
. - Add a workaround for a bug in the Kotlin 1.6.0 compiler, see KT-49340.
- Use Anvil version
2.3.10-1-6-0
if you want to test Kotlin1.6.0
. Until Anvil hasn't adopted Kotlin1.6
I'll publish additional versions that are required due to compiler API incompatibilities.
v2.3.9
- Add a workaround for AGP to sync generated sources with
syncGeneratedSources
, see #413. - Ignore functions with defaults in assisted factories, see #415.
- Use Anvil version
2.3.9-1-6-0-RC2
if you want to test Kotlin1.6.0-RC2
. Until Anvil hasn't adopted Kotlin1.6
I'll publish additional versions that are required due to compiler API incompatibilities. - Use Anvil version
2.3.9-1-6-0
if you want to test Kotlin1.6.0
. Until Anvil hasn't adopted Kotlin1.6
I'll publish additional versions that are required due to compiler API incompatibilities.
v2.3.8
- Add an option in the Anvil DSL
syncGeneratedSources
to sync generated sources in the IDE, see #412. - Fall back to PSI parsing for
BindingModuleGenerator
, see #310. (this allows you generated@ContributesBinding
annotations in custom code generators) - Support generic supers for assisted factories when the assisted factory interface is generated, see #407.
- Support generic type resolution in assisted factories, see #395. (regression in previous release)
- Align
TypeNames
for assisted lambda arguments between descriptors and PSI, see #400. (regression in previous release) - Enable experimental Anvil APIs by default in the compiler testing utilities, see #398.
- Make it easy the feed a compilation result to another Anvil compilation in the testing utilities, see #404.
- Use Anvil version
2.3.8-1-6-0-RC2
if you want to test Kotlin1.6.0-RC2
. Until Anvil hasn't adopted Kotlin1.6
I'll publish additional versions that are required due to compiler API incompatibilities.
v2.3.7
- Allow configuring the
KotlinCompilation
when using the utilities to test custom code generators, see #386. - Support invariant and covariant type parameters properly, see #388.
- Use Psi parsing for assisted factory generation, see #326.
- Support assisted injection for deeply nested inner classes, see #394.
- Use Anvil version
2.3.7-1-6-0-RC
if you want to test Kotlin1.6.0-RC
. Until Anvil hasn't adopted Kotlin1.6
I'll publish additional versions that are required due to compiler API incompatibilities.