Skip to content

ADFA-6110: Apply IDE sub-plugins only to Android application modules - #2304

Open
itsaky-adfa wants to merge 1 commit into
stagefrom
bugfix/ADFA-6110
Open

itsaky-adfa wants to merge 1 commit into
stagefrom
bugfix/ADFA-6110

Conversation

@itsaky-adfa

@itsaky-adfa itsaky-adfa commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

ADFA-6110

Sync failed on any project whose included build has a non-Android module (e.g. CoGo's own build-logic): Could not generate a decorated class for type LogSenderPlugin.

Cause: Gradle builds a subclass of a plugin before calling apply(), which loads every AGP type in the plugin's method signatures. LogSender, JDWP, Profiler and Quick Build all have AGP types there, so they fail on modules without AGP before their own "not an app" check runs.

Fix: AndroidIDEGradlePlugin applies these four only to modules with com.android.application. App modules behave as before. Loading them by name (Class.forName) was tried and does not help.

Tests:

  • New: each of the four sub-plugins on a java-library in an included build. All four fail without the fix.
  • New: Profiler still applies to :app. Fails if the new check never lets plugins through.

Not covered: applying com.itsaky.androidide.logsender directly to a non-Android module still fails, as it did before this change.

The init script applies AndroidIDEGradlePlugin to every subproject of
every build, including included builds such as a build-logic
java-library. Gradle decorates a plugin class before calling apply(),
resolving every type in its method signatures, compiled lambdas
included. LogSender, Jdwp, Profiler and QuickBuild all carry AGP types
there, so on a project without AGP the build failed with "Could not
generate a decorated class ... com/android/build/..." before each
sub-plugin's own APP_PLUGIN guard could decline.

Gate all four in AndroidIDEGradlePlugin on hasPlugin(APP_PLUGIN). Each
sub-plugin already returned early without it, so app modules are
unaffected. Loading the classes by name (Class.forName) does not help:
decoration happens either way, and the new test fails with it.

Tests: a parameterized case per sub-plugin on a java-library in an
included build (fails on all four without the gate), and a Profiler
case on :app (fails if the gate never opens).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JULeV2jMSV6tkuLknMpc89
@itsaky-adfa itsaky-adfa self-assigned this Nov 24, 2026
@atlassian

atlassian Bot commented Nov 24, 2026

Copy link
Copy Markdown

To enable Code Reviewer, link your GitHub account to your Atlassian account.

This is a one-time task that takes less than a minute. Once your account is linked, resubmit the pull request to trigger a code review.

@itsaky-adfa
itsaky-adfa marked this pull request as ready for review November 25, 2026 04:08

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

@coderabbitai

coderabbitai Bot commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Summary

  • Gates LogSender, JDWP, Profiler, and Quick Build sub-plugins on com.android.application in AndroidIDEGradlePlugin. Fixes Gradle sync failures in included builds with non-Android modules, such as build-logic.
  • Moves sub-plugin application into applyApplicationPlugins(). Property checks are unchanged. Task configuration stays outside the gate.
  • Updates docs/PLUGIN_AUTHORING.md and quickbuild/docs/pipeline.md to match the new behavior.

Risks:

  • Direct application of com.itsaky.androidide.logsender to a non-Android module still fails. The PR does not address it.
  • The gate checks for the application plugin at apply time. If com.android.application is applied later, sub-plugins are skipped.
  • Test results are not available. The added tests were not confirmed to have run.

The plugin now gates optional application sub-plugins on the Android application plugin. New tests cover Java-library and Android application projects. Documentation clarifies the LogSender scope and Quick Build conditions.

Changes: Application Plugin Gating

Layer / File(s) Summary
Gate application sub-plugins
gradle-plugin/src/main/java/com/itsaky/androidide/gradle/AndroidIDEGradlePlugin.kt
The plugin checks for the Android application plugin before applying LogSender, JDWP, Profiler, and Quick Build. Each sub-plugin still requires its property to equal "true", and Quick Build is still loaded reflectively.
Verify and document plugin conditions
gradle-plugin/src/test/java/com/itsaky/androidide/gradle/AndroidIDEInitScriptPluginTest.kt, docs/PLUGIN_AUTHORING.md, quickbuild/docs/pipeline.md
Tests cover enabled sub-plugin properties on a Java-library project in an included build and Profileable on an Android application. The documentation describes the LogSender application-module scope and the Android application plugin requirement for Quick Build.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: daniel-adfa, fryanpan, hal-eisen-adfa

Merge Risk: Minimal · up to 8f3a8

The change limits IDE sub-plugin application to Android application modules, which should avoid sync failures for non-Android modules in included builds. App-module behavior is intended to remain unchanged, and no merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the primary change: IDE sub-plugins (LogSender, JDWP, Profiler, Quick Build) are now applied only to Android application modules. It matches the objectives and the AndroidIDEGradlePlug…
Description check Passed The description gives the ticket link, the cause (Gradle decorates plugin classes before apply(), which loads AGP types on non-AGP modules), the fix (gate the four sub-plugins on com.android.applicati…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the primary change: IDE sub-plugins (LogSender, JDWP, Profiler, Quick Build) are now applied only to Android application modules. It matches the objectives and the AndroidIDEGradlePlugin.apply change, and it includes the ticket ID. It is specific and concise.

Full details: Description check

Explanation

The description gives the ticket link, the cause (Gradle decorates plugin classes before apply(), which loads AGP types on non-AGP modules), the fix (gate the four sub-plugins on com.android.application), the tests added, and a known gap (direct logsender application to non-Android modules still fails). This matches the changeset, including the docs and test files.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit checks the plugin gate,
Then hops where app modules await.
Four switches glow when set to true,
Tests follow where the code runs through.
The docs leave tracks across the dew.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 645268cb-018a-4b4e-b57f-5621412e4750
Commits

Reviewing files that changed from the base of the PR and between 041d0b2 and 8f3a8ba.

Files selected for processing: 4

  • docs/PLUGIN_AUTHORING.md
  • gradle-plugin/src/main/java/com/itsaky/androidide/gradle/AndroidIDEGradlePlugin.kt
  • gradle-plugin/src/test/java/com/itsaky/androidide/gradle/AndroidIDEInitScriptPluginTest.kt
  • quickbuild/docs/pipeline.md

Included review availability: This review used your included allowance. 4 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.

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.

3 participants