Skip to content

Releases: ZacSweers/anvil

0.4.0

02 Nov 05:08
Compare
Choose a tag to compare

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 and annotations-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

20 Oct 01:16
Compare
Choose a tag to compare
  • 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

Full Changelog: 0.3.2...0.3.3

0.3.2

11 Oct 19:31
Compare
Choose a tag to compare
  • 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

Full Changelog: 0.3.1...0.3.2

0.3.1

02 Sep 18:28
Compare
Choose a tag to compare
  • 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

31 Aug 19:12
Compare
Choose a tag to compare
  • 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 of FORK.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() for KSClassDeclaration 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

22 Aug 18:37
Compare
Choose a tag to compare
  • 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

22 Aug 18:36
Compare
Choose a tag to compare
  • 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

13 Aug 03:31
Compare
Choose a tag to compare
  • 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

Full Changelog: 0.2.3...0.2.4

0.2.3

09 Aug 19:27
Compare
Choose a tag to compare
  • 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

08 Aug 19:06
Compare
Choose a tag to compare
  • 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

Full Changelog: 0.2.1...0.2.2