Skip to content

Commit dc5cf41

Browse files
committed
Releasing v2.5.0
1 parent 777f39c commit dc5cf41

File tree

2 files changed

+99
-2
lines changed

2 files changed

+99
-2
lines changed

CHANGELOG.md

+98-1
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,111 @@
1111
### Removed
1212

1313
### Fixed
14+
15+
### Security
16+
17+
### Custom Code Generator
18+
19+
### Other Notes & Contributions
20+
21+
## [2.5.0] - 2024-12-4
22+
23+
Anvil now experimentally supports incremental compilation and Gradle's build caching,
24+
as of [v2.5.0](https://github.com/square/anvil/releases/tag/v2.5.0-beta01).
25+
26+
This feature is disabled by default.
27+
It can be enabled via a Gradle property or the Gradle DSL:
28+
29+
<details open>
30+
<summary>Gradle Properties</summary>
31+
32+
```properties
33+
# gradle.properties
34+
com.squareup.anvil.trackSourceFiles=true # default is false
35+
```
36+
37+
</details>
38+
<details>
39+
<summary>Gradle DSL</summary>
40+
41+
```groovy
42+
// build.gradle
43+
anvil {
44+
trackSourceFiles = true // default is false
45+
}
46+
```
47+
48+
</details>
49+
50+
### Added
51+
52+
- Incremental compilation and build caching fixes ([#836](https://github.com/square/anvil/pull/836))
53+
- Configuration options can now be set via Gradle properties ([#851](https://github.com/square/anvil/pull/851))
54+
55+
### Changed
56+
57+
- Anvil's generated hints are now all generated to the same `anvil.hint` package, which simplifies hint lookups and better future-proofs future KSP work. Note that this is a user-invisible change, but it will require a one-time recompilation of any Anvil-generated hints. ([#975](https://github.com/square/anvil/pull/975))
58+
- Interface merging is now done in the IR backend, improving performance and future compatibility with K2.
59+
- `@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.
60+
61+
### Deprecated
62+
63+
- `ClassReference.functions` has been deprecated in favor of `ClassReference.memberFunctions` and `ClassReference.declaredMemberFunctions`
64+
- `ClassReference.properties` has been deprecated in favor of `ClassReference.memberProperties` and `ClassReference.declaredMemberProperties`
65+
- `ClassName.generateClassName()` and `ClassReference.generateClassName()` have been renamed to `__.joinSimpleNames()` for the sake of clarity. The `ClassName` version has also moved packages, so its new fully qualified name is `com.squareup.anvil.compiler.internal.joinSimpleNames`.
66+
- `ClassName.generateClassNameString()` has been renamed/moved to `com.squareup.anvil.compiler.internal.generateHintFileName()`.
67+
- `ContributesBinding.priority` has been deprecated in favor of the int-value-based `ContributesBinding.rank`. This allows for more granular prioritization, rather than just the three enum entries that `ContributesBinding.Priority` offered.
68+
69+
> [!IMPORTANT]
70+
> IDE auto-replace can auto-replace the enum entry with the corresponding integer, but not the named argument. Automatically-migrated code may wind up with something like `priority = RANK_NORMAL`. This is an IntelliJ limitation.
71+
72+
### Removed
73+
74+
- Drop Kotlin 1.8 support ([#841](https://github.com/square/anvil/pull/841))
75+
76+
### Fixed
77+
78+
- don't leak Anvil's annotation artifacts to the target project's compile classpath ([#822](https://github.com/square/anvil/pull/822))
1479
- Gradle configuration caching will no longer be invalidated by changes to `ir-merges.txt` ([#1045](https://github.com/square/anvil/pull/1045))
1580
- The Anvil plugin will no longer cause `KaptGenerateStubsTask` tasks to be configured eagerly ([#1043](https://github.com/square/anvil/pull/1043))
81+
- resolve inherited field-injected generic properties to their substituted type ([#1040](https://github.com/square/anvil/pull/1040))
82+
- Resolve generic types when checking Subcomponent factory return types ([#1041](https://github.com/square/anvil/pull/1041))
83+
- consider `ignoreQualifier` arguments when checking for duplicate bindings ([#1033](https://github.com/square/anvil/pull/1033))
84+
- incremental compilation is automatically disabled for source sets that perform interface or module merging ([#1024](https://github.com/square/anvil/pull/1024))
85+
- include inherited functions in Subcomponent Factory checks ([#1038](https://github.com/square/anvil/pull/1038))
86+
- Anvil will now attempt to shorten the names of hint files, generated "merged" subcomponents, and contributed binding modules so that all file names derived from them will have 255 characters or fewer.
87+
- cache generated file paths relative to the build directory (changed from project directory) ([#979](https://github.com/square/anvil/pull/979))
88+
- pass files with only top-level function/property declarations to `CodeGenerator` implementations ([#956](https://github.com/square/anvil/pull/956))
89+
- rename the new int-based priority to `rank`, restore the enum to `priority` ([#957](https://github.com/square/anvil/pull/957))
90+
- Fix private targets API use ([#961](https://github.com/square/anvil/pull/961))
91+
- Always generate provider factories for binding modules ([#951](https://github.com/square/anvil/pull/951))
92+
- use the resolved value of `const` arguments in propagated annotation arguments ([#940](https://github.com/square/anvil/pull/940))
93+
- re-run analysis between an incremental sync and code generation ([#943](https://github.com/square/anvil/pull/943))
94+
- delay `@ContributesSubcomponent` generation until the last analysis rounds ([#946](https://github.com/square/anvil/pull/946))
95+
- Code generated because of a `@Contributes___` annotation in a dependency module is now correctly deleted when there is a relevant change in the dependency module.
96+
- Nested interfaces and modules can now be contributed to enclosing classes.
97+
- Don't fail the build when a `@Binds`-annotated function binds a generic type ([#885](https://github.com/square/anvil/issues/885))
98+
- This is a revert of the changes in ([#833](https://github.com/square/anvil/issues/833)).
99+
- Binding supertype which is narrower than return type is wrongly allowed by @IlyaGulya in ([#833](https://github.com/square/anvil/pull/833))
100+
- Don't cache the `projectDir` or `binaryFile` as part of `GeneratedFileCache` ([#883](https://github.com/square/anvil/pull/883))
101+
- Add restored-from-cache, previously-generated files to analysis results after code generation ([#882](https://github.com/square/anvil/pull/882))
16102

17-
### Security
103+
### Dependencies
104+
- Update dependency gradle to v8.11.1 ([#1072](https://github.com/square/anvil/pull/1072))
105+
- Update dagger to v2.51.1 ([#944](https://github.com/square/anvil/pull/944))
106+
- Upgrade Kotlin to `1.9.24` ([#891](https://github.com/square/anvil/pull/891))
18107

19108
### Custom Code Generator
20109

110+
- The `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](https://github.com/square/anvil/pull/693)).
111+
21112
### Other Notes & Contributions
22113

114+
- @IlyaGulya made their first contribution in ([#833](https://github.com/square/anvil/pull/833))
115+
- @brentwatson made their first contribution in ([#1055](https://github.com/square/anvil/pull/1055))
116+
117+
**Full Changelog**: https://github.com/square/anvil/compare/v2.4.9...v2.5.0
118+
23119
## [2.5.0-beta11] - 2024-07-29
24120

25121
### Fixed
@@ -772,6 +868,7 @@
772868
- Initial release.
773869
774870
[Unreleased]: https://github.com/square/anvil/compare/v2.5.0-beta11...HEAD
871+
[2.5.0]: https://github.com/square/anvil/releases/tag/v2.5.0
775872
[2.5.0-beta11]: https://github.com/square/anvil/releases/tag/v2.5.0-beta11
776873
[2.5.0-beta10]: https://github.com/square/anvil/releases/tag/v2.5.0-beta10
777874
[2.5.0-beta09]: https://github.com/square/anvil/releases/tag/v2.5.0-beta09

gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
GROUP=com.squareup.anvil
22

33
# When updating this, make sure to also update the parallel release versions in release.yml
4-
VERSION_NAME=2.5.0-SNAPSHOT
4+
VERSION_NAME=2.5.0
55

66
POM_DESCRIPTION=A Kotlin compiler plugin to make dependency injection with Dagger 2 easier by automatically merging Dagger modules and component interfaces.
77
POM_INCEPTION_YEAR=2020

0 commit comments

Comments
 (0)