A Kotlin compiler plugin to make dependency injection with Dagger 2 easier.
APACHE-2.0 License
Bot releases are visible (Hide)
const
arguments in propagated annotation arguments (#940)@ContributesSubcomponent
generation until the last analysis rounds (#946)Published by github-actions[bot] 7 months ago
2.51
.@ContributesBinding
and @ContributesMultibinding
have been completely reworked to a new implementation that generates one binding dagger module for each contributed binding. While not an ABI-breaking change, this does change the generated code and requires users to re-run Anvil's code gen over any projects contributing bindings in order to be merged with the new implementation.@Contributes___
annotation in a dependency module is now correctly deleted when there is a relevant change in the dependency module.Published by github-actions[bot] 8 months ago
Published by github-actions[bot] 8 months ago
projectDir
or binaryFile
as part of GeneratedFileCache
by @RBusarow in (#883)Published by github-actions[bot] 8 months ago
Incremental compilation and build caching fixes (#836)
This feature is disabled by default.
It can be enabled via a Gradle property or the Gradle DSL:
# default is false
com.squareup.anvil.trackSourceFiles=true
// build.gradle[.kts]
anvil {
trackSourceFiles = true // default is false
}
Configuration options can now be set via Gradle properties (#851)
# ./gradle.properties
com.squareup.anvil.addOptionalAnnotations=true
com.squareup.anvil.disableComponentMerging=true
com.squareup.anvil.generateDaggerFactories=true
com.squareup.anvil.generateDaggerFactoriesOnly=true
com.squareup.anvil.syncGeneratedSources=true
com.squareup.anvil.trackSourceFiles=true
1.9.22
(#814)GeneratedFile
result type has been deprecated in favor of GeneratedFileWithSources
. This new type allows for precise tracking of the generated files, which in turn drastically improves incremental compilation performance (#693).Published by github-actions[bot] 10 months ago
1.9.20
2.4.9-1-8
if your project is using Kotlin 1.8.x
. This is also the last planned release with Kotlin 1.8.x
support.Published by github-actions[bot] about 1 year ago
annotations-optional
artifact for non-required annotations that we've found to be helpful with managing larger dependency graphs, including @SingleIn
and @ForScope
(#692).2.4.8-1-8
if your project is using Kotlin 1.8.x
.Published by github-actions[bot] about 1 year ago
1.9.0
as the primary supported version1.8.22
for dual-release artifacts. Use Anvil version 2.4.7-1-8
if your project is using Kotlin 1.8.x
.2.46.1
0.6.2
Published by github-actions[bot] over 1 year ago
1.13.0
and fix bug uncovered by new TypeName#equals/hashCode changes, see #699.1.8.21
.Published by github-actions[bot] over 1 year ago
compileOnly
dependency, allowing the plugin to defer to whatever version the user already has. If you were accidentally depending on KGP through Anvil, you'll need to explicitly add the plugin yourself now.Any
as bound type when using @ContributesBinding
or @ContributesMultibinding
, see #680.AnvilCompilation
class, see #682.Published by github-actions[bot] almost 2 years ago
projectFiles.topLevelFunctionReferences(module)
and projectFiles.topLevelPropertyReferences(module)
. This allows you write code generators reacting to top-level functions and properties and not only classes, see #644.FunctionReference
type has been renamed to MemberFunctionReference
and a new super type FunctionReference
has been introduced for TopLevelFunctionReference
and MemberFunctionReference
.PropertyReference
type has been renamed to MemberPropertyReference
and a new super type PropertyReference
has been introduced for TopLevelPropertyReference
and MemberPropertyReference
.Published by github-actions[bot] almost 2 years ago
@Binds
methods are now validated for correctness when generating Dagger factories, see #649.1.7.20
and Gradle to 7.5.1
, see #643.1.8.x
releases, we now use a fork of kotlin-compile-testing
: dev.zacsweers.kctfork:core:0.1.0-1.8.0-Beta01
.2.4.3-1-8-0-RC
if you want to test Kotlin 1.8.0-RC
. Until Anvil has fully adopted Kotlin 1.8
we'll publish additional versions that are required due to compiler API incompatibilities.Published by github-actions[bot] about 2 years ago
FqName
s check the inner class hierarchy for the right reference, see #617.Any
as boundType
, see #619.DisableIncrementalCompilationTask
, if there are multiple Kotlin compilation tasks for the same module, see #602.TypeReference
, see #611.Published by github-actions[bot] over 2 years ago
1.7.0
only. For Kotlin 1.6.*
support please use version 2.4.1-1-6
instead. Future Anvil versions will remove support for Kotlin 1.6.@Merge*
annotations are used, see #596.ClassReference
to return TypeReference
instead.PropertyReference.Psi
from primary constructor properties to have the same behavior as the descriptor implementation, see #609.Published by github-actions[bot] over 2 years ago
main
branch.compiler-utils
artifact have changed. Some highlights:
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.classesAndInnerClass(module)
, use classAndInnerClassReferences()
instead.1.5
.AnvilExtension
in the gradle plugin.@ContributedSubcomponent
when the trigger is created AFTER the contribution, see #478.FqName
if the type reference is an inner class, see #479.Published by github-actions[bot] over 2 years ago
Published by github-actions[bot] over 2 years ago
main
branch.1.5
.AnvilExtension
in the gradle plugin.@ContributedSubcomponent
s when the trigger is created AFTER the contribution, see #478.FqName
if the type reference is an inner class, see #479.Published by vRallev over 2 years ago
@ContributesSubcomponent
to stable, see #474.@ContributesSubcomponent
through a new replaces
attribute, see #466.@ContributesSubcomponent
uses a factory and is used in multiple parent components, see #459.CodeGenerator
s for AnvilCompilation
. This makes it easier to unit-test specific scenarios, see #470.CodeGenerator
s), see #467.2.3.11-1-6-10
if you use Kotlin 1.6.10
. Until Anvil hasn't adopted Kotlin 1.6
I'll publish additional versions that are required due to compiler API incompatibilities.
Published by vRallev almost 3 years ago
@ContributesSubcomponent
to delay merging contributions until the parent component is created, see #160.@MergeInterfaces
and @MergeModules
to another scope with @ContributesTo
.2.3.10-1-6-0
if you want to test Kotlin 1.6.0
. Until Anvil hasn't adopted Kotlin 1.6
I'll publish additional versions that are required due to compiler API incompatibilities.Published by vRallev almost 3 years ago
syncGeneratedSources
, see #413.2.3.9-1-6-0-RC2
if you want to test Kotlin 1.6.0-RC2
. Until Anvil hasn't adopted Kotlin 1.6
I'll publish additional versions that are required due to compiler API incompatibilities.2.3.9-1-6-0
if you want to test Kotlin 1.6.0
. Until Anvil hasn't adopted Kotlin 1.6
I'll publish additional versions that are required due to compiler API incompatibilities.