Releases: ZacSweers/anvil
0.4.0
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
/@Scope
annotations should be recognized now. - Enhancement: The
annotations
andannotations-optional
artifacts are now Kotlin multiplatform libraries. This allows for easier integration with multiplatform projects and/or adoption of kotlin-inject. - Enhancement:
@SingleIn
and@ForScope
can 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!
0.3.3
- Enhancement: Move various KSP helper functions to
compiler-utils
.
Special thanks to @WhosNickDoglio for contributing to this release!
What's Changed
- Move KSP util functions into compiler-utils and make them public by @WhosNickDoglio in #75
New Contributors
- @WhosNickDoglio made their first contribution in #75
Full Changelog: 0.3.2...0.3.3
0.3.2
- 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!
What's Changed
- Report location of code causing KSP exceptions when generating assisted factories by @jmartinesp in #73
New Contributors
- @jmartinesp made their first contribution in #73
Full Changelog: 0.3.1...0.3.2
0.3.1
- Enhancement: Better handle error types and round deferral for generated types.
What's Changed
- Better handle error types and round deferral by @ZacSweers in #70
Full Changelog: 0.3.0...0.3.1
0.3.0
- New: Add option to disable contributes subcomponent handling. This can be useful if working in a codebase or project that doesn't use
@ContributeSubcomponent
and thus doesn't need to scan the classpath for them while merging. More details can be found in the## Options
section 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()
forKSClassDeclaration
lookups. - Fix: Ensure round processing is correctly reset if no
@ContributeSubcomponent
triggers 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.
What's Changed
- Ensure round processing is correctly reset if no triggers are found by @ZacSweers in #64
- Add option to disable contributes subcomponent handling by @ZacSweers in #67
- Introduce multi-level caching by @ZacSweers in #68
Full Changelog: 0.2.6...0.3.0
0.2.6
- Significantly improve performance during component merging. Our internal measurements at Slack range from 86%-95% improvement.
- Add a new
anvil-ksp-verbose
KSP 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.
What's Changed
- Add verbose option + start some timing logging + optimizations by @ZacSweers in #55
- Fix resolution of nested class generics in constructor injection by @ZacSweers in #58
Full Changelog: 0.2.5...0.2.6
0.2.5
- Source
AnvilKspExtension.supportedAnnotationTypes
in contribution merging when deciding when to defer.
What's Changed
- Source extension supportedAnnotationTypes in contribution merging when deciding when to defer by @ZacSweers in #54
Full Changelog: 0.2.4...0.2.5
0.2.4
- 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.
What's Changed
- Update README.md by @ZacSweers in #50
- Significantly improve error messaging when encountering error types by @ZacSweers in #53
Full Changelog: 0.2.3...0.2.4
0.2.3
- Fix: Use more unique names for default parent component functions.
- Fix: Strip
ABSTRACT
modifiers if present when overriding component-returning functions.
What's Changed
- Document alternatives and limitations by @ZacSweers in #46
- Use more unique names for default parent component functions by @ZacSweers in #47
- Strip ABSTRACT modifiers if present when overriding component returning functions by @ZacSweers in #48
Full Changelog: 0.2.2...0.2.3
0.2.2
- 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.
What's Changed
- Introduce AnvilKspOptionsProvider by @ZacSweers in #44
- Fix init order in AnvilExtension by @ZacSweers in #45
Full Changelog: 0.2.1...0.2.2