Repository navigation
ADFA-6110: Apply IDE sub-plugins only to Android application modules - #2304
Merged
Merged
Conversation
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 <[email protected]> Claude-Session: https://claude.ai/code/session_01JULeV2jMSV6tkuLknMpc89
|
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
marked this pull request as ready for review
November 25, 2026 04:08
There was a problem hiding this comment.
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.
Contributor
Daniel-ADFA
approved these changes
Nov 25, 2026
davidschachterADFA
added a commit
that referenced
this pull request
Nov 27, 2026
Brings in #2280 and #2304 (David, 2026-11-27: merge now, ahead of the merge-time stage merge). One conflict, in AndroidIDEGradlePlugin.kt: #2304 (ADFA-6110) moved the sub-plugins into applyApplicationPlugins(), called only when the project has the Android application plugin, and this PR adds the SQLite rewrite and debugger plugins and the Quick Build exclusion at the same place. Resolved by putting them inside applyApplicationPlugins(). Both SQLite plugins already decline any project without that plugin, so they apply where they did before, and they now get #2304's protection too: Gradle no longer decorates them on a project without AGP. The Quick Build message is logged for application modules only, as Quick Build itself applies there. The PR's own diff against stage is otherwise unchanged: outside that file, the +/- lines of git diff 6612799 42f01ae and of this merge against 55f3f8f are identical (9,562 lines, 84 files). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
AndroidIDEGradlePluginapplies these four only to modules withcom.android.application. App modules behave as before. Loading them by name (Class.forName) was tried and does not help.Tests:
java-libraryin an included build. All four fail without the fix.:app. Fails if the new check never lets plugins through.Not covered: applying
com.itsaky.androidide.logsenderdirectly to a non-Android module still fails, as it did before this change.