Skip to content

fix: resolve Gradle configuration cache incompatibility in PluginBuilder#1065

Merged
Daniel-ADFA merged 2 commits intostagefrom
ADFA-3110-plugin-template-fails-to-build
Mar 12, 2026
Merged

fix: resolve Gradle configuration cache incompatibility in PluginBuilder#1065
Daniel-ADFA merged 2 commits intostagefrom
ADFA-3110-plugin-template-fails-to-build

Conversation

@Daniel-ADFA
Copy link
Contributor

No description provided.

@Daniel-ADFA Daniel-ADFA requested a review from a team March 11, 2026 21:24
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 11, 2026

📝 Walkthrough

Walkthrough

The PluginBuilder.kt file underwent refactoring to improve variable scope and logging context. Top-level local variables now compute pluginName, apkDir, and outputDir outside inner task execution blocks, and logging switched from project-scoped to task-scoped logger for APK lookup and assembly operations. Redundant variable re-declarations within the execute block were removed.

Changes

Cohort / File(s) Summary
PluginBuilder Refactoring
plugin-api/plugin-builder/src/main/kotlin/com/itsaky/androidide/plugins/build/PluginBuilder.kt
Moved variable declarations (pluginName, apkDir, outputDir) to outer scope in createDebugTask and createReleaseTask methods; switched logging context from project.logger to task.logger for APK operations.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Suggested reviewers

  • jomen-adfa

Poem

🐰 Variables hop to outer scopes so clean,
Task loggers whisper where project ones had been,
Redundant declarations bid farewell with grace,
Cleaner code now fills this refactored space! ✨

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive No pull request description was provided by the author, making it impossible to assess whether the description relates to the changeset. Add a description explaining the Gradle configuration cache incompatibility issue, why it occurs, and how the variable scope changes resolve it.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix: resolve Gradle configuration cache incompatibility in PluginBuilder' accurately describes the main change: refactoring PluginBuilder to fix Gradle configuration cache incompatibility by moving variable declarations outside inner task blocks and using task-scoped loggers.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ADFA-3110-plugin-template-fails-to-build

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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@plugin-api/plugin-builder/src/main/kotlin/com/itsaky/androidide/plugins/build/PluginBuilder.kt`:
- Around line 27-30: The task captures
extension.pluginName.getOrElse(project.name) at configuration time (stored in
pluginName) which eagerly materializes the Property and breaks
configuration-cache; move resolution into the task action by passing the
Extension instance (or accessing the task's extension) inside the doLast/execute
block and call extension.pluginName.getOrElse(project.name) there, instead of
using the captured pluginName variable; similarly defer any use of
apkDir/outputDir that depends on pluginName by computing paths inside the action
so PluginBuilder's task action reads properties lazily.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 73bb60b3-dda5-4c91-9608-a9e14a66252a

📥 Commits

Reviewing files that changed from the base of the PR and between 99c02e8 and 38e62bc.

📒 Files selected for processing (1)
  • plugin-api/plugin-builder/src/main/kotlin/com/itsaky/androidide/plugins/build/PluginBuilder.kt

@Daniel-ADFA Daniel-ADFA merged commit 0af40d5 into stage Mar 12, 2026
2 checks passed
@Daniel-ADFA Daniel-ADFA deleted the ADFA-3110-plugin-template-fails-to-build branch March 12, 2026 18:57
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.

2 participants