Skip to content

chore: remove kotlin-android plugin to be fully compatible with AGP 9#211

Merged
Manabu-GT merged 1 commit into
mainfrom
chore-agp9-followup
Mar 27, 2026
Merged

chore: remove kotlin-android plugin to be fully compatible with AGP 9#211
Manabu-GT merged 1 commit into
mainfrom
chore-agp9-followup

Conversation

@Manabu-GT

@Manabu-GT Manabu-GT commented Mar 27, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

Release Notes

  • Chores
    • Refactored Gradle build configuration and plugin management for improved maintainability.
    • Updated Hilt dependency to version 2.59.2 for improved compatibility and stability.
    • Removed deprecated Gradle properties and consolidated build setup across modules.

@coderabbitai

coderabbitai Bot commented Mar 27, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: cf07ee61-4e04-42c4-bac7-105349ec6f4b

📥 Commits

Reviewing files that changed from the base of the PR and between 01c3cb7 and 864f39a.

📒 Files selected for processing (9)
  • build.gradle.kts
  • debugoverlay-core/build.gradle.kts
  • debugoverlay-extension-okhttp/build.gradle.kts
  • debugoverlay-extension-timber/build.gradle.kts
  • debugoverlay/build.gradle.kts
  • gradle.properties
  • gradle/libs.versions.toml
  • sample/build.gradle.kts
  • settings.gradle.kts
💤 Files with no reviewable changes (5)
  • debugoverlay-extension-okhttp/build.gradle.kts
  • debugoverlay-core/build.gradle.kts
  • debugoverlay-extension-timber/build.gradle.kts
  • gradle.properties
  • debugoverlay/build.gradle.kts

📝 Walkthrough

Walkthrough

Gradle build configuration refactored to remove explicit kotlin.android plugin applications across multiple modules and remove related configuration properties. Detekt plugin application logic updated to trigger via Android plugin presence instead of Kotlin plugin presence. Hilt dependency version updated from 2.57.2 to 2.59.2.

Changes

Cohort / File(s) Summary
Detekt Plugin Logic
build.gradle.kts
Modified Detekt plugin application to trigger when Android plugins (com.android.library or com.android.application) are present instead of Kotlin plugin IDs; updated corresponding comment.
Kotlin Android Plugin Removal
debugoverlay-core/build.gradle.kts, debugoverlay-extension-okhttp/build.gradle.kts, debugoverlay-extension-timber/build.gradle.kts, debugoverlay/build.gradle.kts
Removed alias(libs.plugins.kotlin.android) plugin declaration from module build scripts.
Sample Module Build Configuration
sample/build.gradle.kts
Removed kotlin-android plugin; updated Android sourceSets to register Kotlin sources via kotlin.srcDirs() instead of Java sources via java.srcDir().
Gradle Properties and Version Catalog
gradle.properties, gradle/libs.versions.toml
Removed android.builtInKotlin=false and android.newDsl=false from properties; removed kotlin-android plugin alias from version catalog; updated Hilt version from 2.57.2 to 2.59.2.
Settings Configuration
settings.gradle.kts
Updated comment for enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") to remove specific references to Gradle 9 and android.newDsl=false.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • PR #210: Directly reverses gradle.properties changes (android.builtInKotlin and android.newDsl) that were previously added; both modify Gradle configuration at the property level.
  • PR #120: Modifies Gradle plugin declarations in the same build script files and version catalog entries, affecting plugin alias availability.
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: removing the kotlin-android plugin for AGP 9 compatibility, which is reflected consistently across all modified build files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore-agp9-followup

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@claude

claude Bot commented Mar 27, 2026

Copy link
Copy Markdown

Claude finished @Manabu-GT's task in 1m 23s —— View job


PR Review: chore: remove kotlin-android plugin for AGP 9 compatibility

  • Gather context
  • Read changed files
  • Analyze changes
  • Post review feedback

The changes are clean and correct. Here's a breakdown by change area:

build.gradle.kts — Detekt application logic

The old approach hooked detekt via the Kotlin plugin IDs:

plugins.withId("org.jetbrains.kotlin.android") { apply(plugin = "io.gitlab.arturbosch.detekt") }

The new approach hooks via Android plugin IDs instead, which is the right call since AGP 9's built-in Kotlin no longer applies the standalone org.jetbrains.kotlin.android plugin. All submodules in this project use either com.android.library or com.android.application, so coverage remains the same.

One edge case to be aware of: if a pure JVM Kotlin module (no Android Gradle Plugin) is ever added in the future, detekt would need to be applied separately for that module. The old approach would have caught it automatically.

sample/build.gradle.kts — source set declaration

// Before
java.srcDir("src/debugOverlay/kotlin")
// After
kotlin.srcDirs("src/debugOverlay/kotlin")

This is the correct change. When kotlin-android is removed, the java source set accessor no longer implicitly includes Kotlin files in some configurations. Using kotlin.srcDirs() is also semantically clearer.

gradle.properties — flag removal

Removing android.builtInKotlin=false and android.newDsl=false is the key enabler here. These flags were explicitly opted out of AGP 9's built-in Kotlin support and the new DSL. Their removal is intentional and correct.

libs.versions.toml — Hilt bump (2.57.2 → 2.59.2)

This is a reasonable maintenance bump. Hilt 2.59.x has KSP/AGP alignment fixes that are relevant when switching to built-in Kotlin compilation.

Overall

The migration is minimal, well-scoped, and correct. No concerns with the approach.

@github-actions

Copy link
Copy Markdown

Qodana for JVM

It seems all right 👌

No new problems were found according to the checks applied

💡 Qodana analysis was run in the pull request mode: only the changed files were checked
☁️ View the detailed Qodana report

Contact Qodana team

Contact us at qodana-support@jetbrains.com

@Manabu-GT Manabu-GT merged commit 6e51cbd into main Mar 27, 2026
6 checks passed
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