Skip to content

ADFA-2496 Add gradle task for plugin-builder and change dependsOn for it#788

Closed
hal-eisen-adfa wants to merge 2 commits intostagefrom
ADFA-2496-fix-release-yml-gradle
Closed

ADFA-2496 Add gradle task for plugin-builder and change dependsOn for it#788
hal-eisen-adfa wants to merge 2 commits intostagefrom
ADFA-2496-fix-release-yml-gradle

Conversation

@hal-eisen-adfa
Copy link
Collaborator

FAILURE: Build failed with an exception.

  • What went wrong:
    Could not determine the dependencies of task ':app:createPluginArtifactsZip'.

A problem occurred configuring project ':plugin-api:plugin-builder'.
org.gradle.api.internal.initialization.DefaultClassLoaderScope@793258c0 must be locked before it can be used to compute a classpath!

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 6, 2026

📝 Walkthrough

Release Notes

Changes

  • Modified app/build.gradle.kts: removed the immediate dependency on the included build's jar and instead configure createPluginArtifactsZip inside an afterEvaluate block to add dependsOn(gradle.includedBuild("plugin-builder").task(":jar")) after project evaluation.
  • This defers access to the included build's jar until after configuration, addressing the configuration-time classloader error.

Risks & Best Practice Violations

⚠️ No task inputs/outputs declared: the changed task still lacks explicit inputs/outputs, preventing up-to-date checks and build-cache benefits and causing unnecessary re-execution.

⚠️ Workaround, not structural fix: deferring included-build access via afterEvaluate is a workaround for Gradle classloader timing and may be fragile against Gradle internal changes.

⚠️ Fragile hardcoded path dependency: createPluginArtifactsZip continues to read a hardcoded jar path (plugin-api/plugin-builder/build/libs/plugin-builder-1.0.0.jar) without declaring that output, creating a brittle implicit dependency.

⚠️ Possible incomplete execution guarantee: depending on the included build's :jar task via afterEvaluate may not fully guarantee the expected task output semantics; prefer expressing an explicit task dependency/output relationship or using composite build artifact publishing to ensure correctness.

Walkthrough

Replaced the immediate dependency on the included build's :jar task with an afterEvaluate hook that adds gradle.includedBuild("plugin-builder").task(":jar") as a dependency of createPluginArtifactsZip after project evaluation; other asset-copy behavior unchanged.

Changes

Cohort / File(s) Summary
Build task wiring
app/build.gradle.kts
Removed direct dependsOn(gradle.includedBuild("plugin-builder").task(":jar")) during configuration and instead adds that dependency inside an afterEvaluate block to avoid classloader locking; existing copyPluginApiJarToAssets dependency and assets jar inclusion remain unchanged.

Sequence Diagram(s)

(omitted — change is localized build-script wiring and does not introduce a multi-component runtime control flow that benefits from a sequence diagram)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • jomen-adfa

Poem

🐰
I hopped through Gradle's tangled tree,
Moved a jar-depend to after-eval, you see—
No locks, no stalls, just tidy art,
A quiet build and a happy heart. 🥕

Pre-merge checks and finishing touches

❌ Failed checks (2 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title partially describes the changes but is somewhat vague. It mentions adding a gradle task and changing dependsOn, but doesn't clearly convey the core fix: deferring task dependency configuration using afterEvaluate to resolve classloader locking issues. Consider a more specific title like 'Fix classloader locking by deferring gradle task dependency configuration' or 'Use afterEvaluate to defer plugin-builder task dependency'.
Description check ❓ Inconclusive The description is a verbatim error message from a failed build but doesn't provide context about the intended fix or solution, making it unclear what changes are being made to resolve the issue. Add explanation of the fix being implemented, such as 'This PR resolves the classloader locking issue by deferring the plugin-builder task dependency using afterEvaluate block'.
✅ Passed checks (1 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 638d0e9 and d9e8c0e.

📒 Files selected for processing (1)
  • app/build.gradle.kts
🔇 Additional comments (1)
app/build.gradle.kts (1)

642-649: LGTM! Correct approach to avoid classloader locking.

Using afterEvaluate to defer the dependency configuration on the included build's task is the appropriate fix. This ensures gradle.includedBuild("plugin-builder").task(":jar") is accessed after project evaluation, avoiding the "must be locked before it can be used to compute a classpath" error while still properly declaring the task dependency via dependsOn().


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

🤖 Fix all issues with AI Agents
In @app/build.gradle.kts:
- Around line 630-638: The buildPluginBuilder task currently invokes
gradle.includedBuild("plugin-builder").task(":jar").get() inside doLast which
causes an unresolved-reference compilation error and improperly runs another
task during execution; instead declare the dependency during configuration by
removing doLast and calling dependsOn with the TaskReference/TaskProvider
obtained from gradle.includedBuild("plugin-builder").task(":jar") so that
buildPluginBuilder dependsOn that included build jar task and execution is
deferred to the Gradle task graph (refer to the buildPluginBuilder task,
gradle.includedBuild("plugin-builder"), and task(":jar") symbols when
implementing this change).
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b37d175 and 638d0e9.

📒 Files selected for processing (1)
  • app/build.gradle.kts
🧰 Additional context used
🪛 GitHub Actions: Build and deploy to firebase app distribution
app/build.gradle.kts

[error] 636-636: Script compilation error in Gradle Kotlin DSL: Unresolved reference for 'gradle.includedBuild("plugin-builder").task(":jar").get()' at line 636. This caused the Gradle build to fail during the ':app:assembleV8Debug' task.

🔇 Additional comments (1)
app/build.gradle.kts (1)

641-641: Dependency declaration looks correct.

The updated dependency on buildPluginBuilder is properly structured. Once the implementation of buildPluginBuilder is fixed (see previous comment), this will correctly ensure the plugin-builder jar is built before creating the plugin artifacts zip.

@hal-eisen-adfa
Copy link
Collaborator Author

Already addressed by Daniel's PR #783 a few hours ago

@hal-eisen-adfa hal-eisen-adfa deleted the ADFA-2496-fix-release-yml-gradle branch January 20, 2026 22:19
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