ADFA-2602: Resolve buildscript classpaths from the on-device Maven repo - #1646
Conversation
COTGSettingsPlugin injects the bundled repo into pluginManagement and
dependencyResolutionManagement only. A `buildscript { }` block resolves
against its own repositories, which nothing reached, so any project
declaring its build classpath that way could only be built online. That
is why plugin-template builds required network.
Inject the repo for both scopes, each before the script that consumes it
is evaluated:
- beforeSettings, for a buildscript block in settings.gradle.kts
(the plugin template declares AGP and Kotlin there)
- beforeProject, for a buildscript block in build.gradle.kts
settingsEvaluated is too late: by then the settings buildscript classpath
has already resolved.
A missing repo is not fatal. The directory does not exist until onboarding
has installed the assets, and failing there would break every build before
that point.
itsaky-adfa
left a comment
There was a problem hiding this comment.
Looks good to me so far.
Since this is a draft, I'll re-review when it's ready for review.
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.
📝 Summary
WalkthroughThe Gradle init script now injects the existing local Maven repository into settings- and project-level buildscript repositories. Missing repositories are logged and skipped. ChangesLocal Maven repository injection
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
A rabbit hops where Maven files lie, Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@gradle-plugin/src/main/java/com/itsaky/androidide/gradle/COTGSettingsPlugin.kt`:
- Line 97: Update the missing-repository log in the beforeSettings/beforeProject
helper to use the parameterized Logger.info overload: keep the repository value
as a placeholder argument and pass MAVEN_LOCAL_REPOSITORY separately instead of
interpolating it into the message.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: e799fca5-d220-4b64-b0b1-b463247aed47
📒 Files selected for processing (2)
gradle-plugin/src/main/java/com/itsaky/androidide/gradle/AndroidIDEInitScriptPlugin.ktgradle-plugin/src/main/java/com/itsaky/androidide/gradle/COTGSettingsPlugin.kt
Brings the branch up to date with stage so the stacked merge can proceed; GitHub refuses update-branch on a stacked PR.
Brings the branch up to date with stage (including #1646) so the stacked merge can proceed; GitHub refuses update-branch on a stacked PR.
COTGSettingsPlugin injects the bundled repo into pluginManagement and
dependencyResolutionManagement only. A
buildscript { }block resolvesagainst its own repositories, which nothing reached, so any project
declaring its build classpath that way could only be built online. That
is why plugin-template builds required network.
Inject the repo for both scopes, each before the script that consumes it
is evaluated:
(the plugin template declares AGP and Kotlin there)
settingsEvaluated is too late: by then the settings buildscript classpath
has already resolved.
A missing repo is not fatal. The directory does not exist until onboarding
has installed the assets, and failing there would break every build before
that point.
Stack created with GitHub Stacks CLI • Give Feedback 💬