2026-02-18
Following Anvil's move to maintenance mode, this library is now deprecated and recommends adopting Metro.
This library was always a stopgap solution to unlock K2 support with Anvil semantics. With Anvil ceasing new development in favor of Metro, there's no reason to continue developing this library. Metro is my primary focus now.
I am happy to accept small patches as needed for bugfixes, but otherwise no new features will be happening.
- Fix support for generic modules in factory gen.
2025-12-09
Following Anvil's move to maintenance mode, this library is now deprecated and recommends adopting Metro.
This library was always a stopgap solution to unlock K2 support with Anvil semantics. With Anvil ceasing new development in favor of Metro, there's no reason to continue developing this library. Metro is my primary focus now.
I am happy to accept small patches as needed for bugfixes, but otherwise no new features will be happening.
- Fix annotation parameter preservation in KSP2.
Special thanks to @jstewart5000 for contributing to this release!
2025-12-05
Following Anvil's move to maintenance mode, this library is now deprecated and recommends adopting Metro.
This library was always a stopgap solution to unlock K2 support with Anvil semantics. With Anvil ceasing new development in favor of Metro, there's no reason to continue developing this library. Metro is my primary focus now.
I am happy to accept small patches as needed for bugfixes, but otherwise no new features will be happening.
- Avoid removed
useK2()API in legacy compiler plugin.
Special thanks to @jstewart5000 for contributing to this release!
2025-11-21
Following Anvil's move to maintenance mode, this library is now deprecated and recommends adopting Metro.
This library was always a stopgap solution to unlock K2 support with Anvil semantics. With Anvil ceasing new development in favor of Metro, there's no reason to continue developing this library. Metro is my primary focus now.
I am happy to accept small patches as needed for bugfixes, but otherwise no new features will be happening.
- Support KSP2
- Build against Gradle
8.13
Special thanks to @WhosNickDoglio for contributing to this release!
2025-01-13
Happy new year!
- Fix: Fix missing Jakarta
@Inject-annotated constructors in factory gen. - Deprecated:
ClassReference.functionshas been deprecated in favor ofClassReference.memberFunctionsandClassReference.declaredMemberFunctions.
Special thanks to @esafirm for contributing to this release!
2024-11-02
Note: Up to this point, this library has largely attempted to preserve the pre-K2 Anvil impl and compatibility to ease adoption. This release marks a shift in that approach. New features will be implemented now (beyond just KSP support) and eventually K1 support will be dropped.
- New: Experimental support for jakarta.inject annotations. Note that Dagger itself appears to only partially support these at the moment. Generated code is identical, but jakarta
@Inject/@Qualifier/@Scopeannotations should be recognized now. - Enhancement: The
annotationsandannotations-optionalartifacts are now Kotlin multiplatform libraries. This allows for easier integration with multiplatform projects and/or adoption of kotlin-inject. - Enhancement:
@SingleInand@ForScopecan now be used with jakarta.inject and kotlin-inject. - Enhancement: Improve error messaging for error types used as annotation arguments.
- Update Dagger to
2.52.
Special thanks to @mrmans0n and @gabrielittner for contributing to this release!
2024-10-19
- Enhancement: Move various KSP helper functions to
compiler-utils.
Special thanks to @WhosNickDoglio for contributing to this release!
2024-10-11
- Enhancement: Report more context for error types, such as the name of the parameter it came from.
- Fix: For generic types, check for error types in their type arguments as well.
Special thanks to @jmartinesp for contributing to this release!
2024-09-02
- Enhancement: Better handle error types and round deferral for generated types.
2024-08-31
- New: Add option to disable contributes subcomponent handling. This can be useful if working in a codebase or project that doesn't use
@ContributeSubcomponentand thus doesn't need to scan the classpath for them while merging. More details can be found in the## Optionssection ofFORK.md. - Enhancement: Improve hint caching during contribution merging. Hints from the classpath are now only searched for once rather than every round.
- Enhancement: Improve error messaging when class lookups fail.
- Fix: Don't use
ClassName.toString()forKSClassDeclarationlookups. - Fix: Ensure round processing is correctly reset if no
@ContributeSubcomponenttriggers are found in a given round. This was an edge case that affected projects with custom code generators that generated triggers in a later round.
2024-08-22
- Significantly improve performance during component merging.
- Add a new
anvil-ksp-verboseKSP option to enable verbose logging, such as timing information. - Fix: Sort contributed interfaces when merging to ensure build cache idempotence. This also adds a few defensive stable sorts for other areas.
- Fix: Fix resolution of nested class generics in constructor injection.
2024-08-13
- Source
AnvilKspExtension.supportedAnnotationTypesin contribution merging when deciding when to defer.
2024-08-12
- Significantly improve error messaging when encountering error types. All these cases should now also show the location of the error type in source and ease debugging.
2024-08-08
- Fix: Use more unique names for default parent component functions.
- Fix: Strip
ABSTRACTmodifiers if present when overriding component-returning functions.
2024-08-08
- Fix: Correctly track inputs to KSP command line options so they don't result in incorrect task build cache hits.
- Fix: Don't set default AnvilExtension property values until after all properties are initialized.
2024-08-08
- Fix: Don't cache symbols between processing rounds. This better supports KSP2.
- Fix: Workaround Kotlin plugin option parsing limitations. Contributing annotations should now be colon-delimited, and the underlying KSP argument is changed to a more consistent
anvil-ksp-extraContributingAnnotations.
2024-08-07
- New: Introduce an
AnvilKspExtensionAPI. See instructions here. - Fix: Allow contribution merging if factory generation is enabled.
2024-08-03
Initial release of Anvil KSP. See FORK.md for more information and installation instructions.
For past Anvil release notes, see the original changelog: https://github.com/square/anvil/blob/main/CHANGELOG.md#250-beta09---2024-05-09