Replace GradleBuild by tooling API usage (#304)#407
Conversation
There was a problem hiding this comment.
Pull request overview
This PR replaces the deprecated GradleBuild task with the Gradle Tooling API to execute nested Gradle builds. This change addresses issue #304 and modernizes the plugin's approach to launching separate Gradle processes.
Key Changes:
- Replaced
GradleBuildtask type with custom implementation usingGradleConnectorfrom the Tooling API - Removed a test case that verified subproject task path qualification (no longer relevant with the new implementation)
- Introduced a new
launchGradlemethod that manually translatesStartParametersettings into command-line arguments for the Tooling API
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| src/main/groovy/net/researchgate/release/ReleasePlugin.groovy | Refactored 'release' and 'runBuildTasks' tasks to use Tooling API instead of GradleBuild; added comprehensive launchGradle method with parameter mapping |
| src/test/groovy/net/researchgate/release/ReleasePluginTests.groovy | Removed test case for subproject task path qualification as it's no longer applicable with the new Tooling API approach |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
c956c53 to
7a75195
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| } | ||
| if (GradleVersion.current() >= GradleVersion.version("8.5")) { | ||
| // language=groovy | ||
| def configurationCacheRequested = objects.newInstance(Eval.me(''' |
There was a problem hiding this comment.
question: THis compiles at runtime to read BuildFeatures.configurationCache. Could it be extracted to a compiled BuildFeaturesProvider sibling interface?
There was a problem hiding this comment.
The BuildFeatures interface was only added in Gradle 8.5, so unless you would build against a newer Gradle API, you could not build a class or interface using that interface, hence the dynamic evaluation after it is checked that Gradle version is new enough.
fixes #304