Skip to content

Conversation

@copybara-service
Copy link

@copybara-service copybara-service bot commented Nov 27, 2025

Update HiltGradlePlugin to AGP 9.

This required a number of changes:

  • Updated Gradle 8.14.3 -> 9.2.0
  • Updated shadow plugin from com.github.johnrengelman.shadow:8.1.1 to 'com.gradleup.shadow:9.2.2' (old artifact doesn't support Gradle 9).
  • Updated HiltGradlePlugin to 9.0.0-beta05:
    • Migrated BaseExtension to AndroidComponentsExtension
    • Migrated BaseVariant to Component
    • Migrated variant.javaCompileOutput.classpath to variant.compileClasspath
    • Migrated variant.javaCompileOutput.destinationDirectory to variant.artifacts.use(HiltCopyTask).toGet()
    • Migrated variant.javaCompileOutput.options.bootstrapClasspath with androidExtension.sdkComponents.bootClasspath
    • Migrated variant.javaCompileOutput.options.compilerArgumentProviders with variant.javaCompilation.annotationProcessor.argumentProviders
    • project.buildDir = ... to project.layout.buildDirectory.set(...)
  • Updated HiltGradlePlugin tests to use AGP 9.0.0-beta05:
    • Migrate to builtin kotlin
      • removed 'kotlin-android'
      • replaced 'kotlin-kapt' with 'legacy-kapt'
    • Migrated javatests/artifacts/hilt-android/simple/app/build.gradle to kts and replace GradleVersion with custom AgpVersion.
      The GradleVersion does not work with APG versions like 9.0.0-beta02, so I had to do this with custom parsing.
    • removed android.kotlinOptions (removed in AGP 9)
    • removed android.useAndroidX=true (default in AGP 9)
    • added android.disallowKotlinSourceSets=false (workaround for KSP uses kotlin.sourceSets DSL when using AGP Built-In Kotlin ksp#2729)

RELNOTES=The next Dagger release will require AGP 9 when using the HiltGradlePlugin. This requirement is due to certain fixes only being available in AGP 9.

@copybara-service copybara-service bot force-pushed the test_837566667 branch 5 times, most recently from f42ef5c to 1ebf530 Compare November 30, 2025 21:59
@copybara-service copybara-service bot force-pushed the test_837566667 branch 3 times, most recently from 6bf317f to c3a0f39 Compare December 9, 2025 17:42
@copybara-service copybara-service bot force-pushed the test_837566667 branch 4 times, most recently from 012a1e6 to aaa0ba1 Compare December 16, 2025 16:59
This required a number of changes:

   * Updated Gradle 8.14.3 -> 9.2.0
   * Updated shadow plugin from `com.github.johnrengelman.shadow:8.1.1` to 'com.gradleup.shadow:9.2.2' (old artifact doesn't support Gradle 9).
   * Updated HiltGradlePlugin to 9.0.0-beta05:
     * Migrated `BaseExtension` to `AndroidComponentsExtension`
     * Migrated `BaseVariant` to `Component`
     * Migrated `variant.javaCompileOutput.classpath` to `variant.compileClasspath`
     * Migrated `variant.javaCompileOutput.destinationDirectory` to `variant.artifacts.use(HiltCopyTask).toGet()`
     * Migrated `variant.javaCompileOutput.options.bootstrapClasspath` with `androidExtension.sdkComponents.bootClasspath`
     * Migrated `variant.javaCompileOutput.options.compilerArgumentProviders` with `variant.javaCompilation.annotationProcessor.argumentProviders`
     * `project.buildDir = ...` to `project.layout.buildDirectory.set(...)`
   * Updated HiltGradlePlugin tests to use AGP 9.0.0-beta05:
     * Migrate to builtin kotlin
       * removed 'kotlin-android'
       * replaced 'kotlin-kapt' with 'legacy-kapt'
     * Migrated javatests/artifacts/hilt-android/simple/app/build.gradle to kts and replace GradleVersion with custom AgpVersion.
       The GradleVersion does not work with APG versions like 9.0.0-beta02, so I had to do this with custom parsing.
     * removed `android.kotlinOptions` (removed in AGP 9)
     * removed `android.useAndroidX=true` (default in AGP 9)
     * added `android.disallowKotlinSourceSets=false` (workaround for google/ksp#2729)

RELNOTES=The next Dagger release will require AGP 9 when using the HiltGradlePlugin. This requirement is due to certain fixes only being available in AGP 9.
PiperOrigin-RevId: 845306929
@copybara-service copybara-service bot merged commit e92e3f3 into master Dec 16, 2025
@copybara-service copybara-service bot deleted the test_837566667 branch December 16, 2025 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant