github google/dagger dagger-2.38
Dagger 2.38

latest releases: dagger-2.52, dagger-2.51.1, dagger-2.51...
3 years ago

What’s New in Dagger

New breaking changes

Add the Google Maven repository for KSP artifacts

As part of necessary changes in order to eventually support running Dagger as a KSP processor, Dagger now has a dependency on the KSP artifacts. These artifacts are available from the Google Maven repository, so this may break users who currently do not use this repository for other dependencies. The Google Maven repository is available at https://maven.google.com.

Adding the repository in Gradle

In your build.gradle file, add google() in repositories.

repositories {
  google()
}

Example:

Adding the repository in Bazel

If using the repository list from our workspace_defs.bzl, then no change is needed.

Otherwise, pass "https://maven.google.com" to your usage of maven_install.

maven_install(
    repositories = [
      "https://maven.google.com",
      ...
    ],
    ...
)

Adding the repository in Maven

Add the repository in your pom.xml file like the following:

  <repositories>
    <repository>
      <id>google-maven</id>
      <name>Google Maven Repo</name>
      <url>https://maven.google.com</url>
    </repository>
  </repositories>

Example:

dagger/examples/maven/pom.xml

Line 20 in ff62b19

<repositories>

Bug Fixes

  • Fix #2576. Check and give a better error message when a user added method has a name that is a java reserved keyword. (436ac2e)
  • Fix #2575. Check and give a better error message when a user added method has the same method signature as generated factory methods. (6971d00)
  • Fix #2570. De-dupe assisted parameter names and field names to avoid a case where generated code may have naming conflicts. #2570 (3d93625)
  • Fix #2710. Allow Dagger-defined map keys (like ClassKey and StringKey) to be placed on fields in order to support Hilt's @BindValueIntoMap. (7af40df)
  • Errors for requesting bindings from the wrong component now include the component name for each binding along the dependency path for easier debugging. (2335e0f)

What’s New in Hilt

This release fixes an incompatibility in the Hilt Gradle Plugin with AGP 7.0-beta04 and 7.1-alpha03. However, with this fix the HiltGradlePlugin will not work with alpha/beta versions of AGP 7.0 and 7.1 older than the versions previously mentioned. This fixes #2700. (be2f89a)

Bug Fixes

  • Fix #2710. Allow Dagger-defined map keys (like ClassKey and StringKey) to be placed on fields in order to support Hilt's @BindValueIntoMap. (7af40df)
  • Fix #2695. Fix an issue where enableAggregatingTask would not correctly generate Hilt classes when compiling in a dev environment with Windows OS. (a7c3c9e)
  • Fix #2672. Fix cast errors when getApplicationContext() is overridden. (4b695ae)

Don't miss a new dagger release

NewReleases is sending notifications on new releases.