Skip to content

Replace GradleBuild by tooling API usage (#304) - #407

Open
Vampire wants to merge 1 commit into
researchgate:mainfrom
Vampire:issue-304
Open

Replace GradleBuild by tooling API usage (#304)#407
Vampire wants to merge 1 commit into
researchgate:mainfrom
Vampire:issue-304

Conversation

@Vampire

@Vampire Vampire commented Dec 6, 2025

Copy link
Copy Markdown
Contributor

fixes #304

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 GradleBuild task type with custom implementation using GradleConnector from the Tooling API
  • Removed a test case that verified subproject task path qualification (no longer relevant with the new implementation)
  • Introduced a new launchGradle method that manually translates StartParameter settings 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.

Comment thread src/main/groovy/net/researchgate/release/ReleasePlugin.groovy
Comment thread src/main/groovy/net/researchgate/release/ReleasePlugin.groovy
Comment thread src/main/groovy/net/researchgate/release/ReleasePlugin.groovy
Comment thread src/main/groovy/net/researchgate/release/ReleasePlugin.groovy Outdated
Comment thread src/main/groovy/net/researchgate/release/ReleasePlugin.groovy Outdated
@Vampire
Vampire force-pushed the issue-304 branch 2 times, most recently from c956c53 to 7a75195 Compare April 1, 2026 21:59
@Vampire
Vampire requested a review from Copilot April 1, 2026 22:01

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Comment thread src/main/groovy/net/researchgate/release/ReleasePlugin.groovy
Comment thread src/main/groovy/net/researchgate/release/ReleasePlugin.groovy
Comment thread src/test/groovy/net/researchgate/release/ReleasePluginTests.groovy
}
if (GradleVersion.current() >= GradleVersion.version("8.5")) {
// language=groovy
def configurationCacheRequested = objects.newInstance(Eval.me('''

@diegourban diegourban Apr 22, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

question: THis compiles at runtime to read BuildFeatures.configurationCache. Could it be extracted to a compiled BuildFeaturesProvider sibling interface?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

@Vampire

Vampire commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

@Hillkorn could you finally consider this PR?
I've seen that you updated the changelog with a 3.2.0 version which though is not released yet, so I'd hope this can still get into the new release.

@Hillkorn

Copy link
Copy Markdown
Collaborator

@Hillkorn could you finally consider this PR? I've seen that you updated the changelog with a 3.2.0 version which though is not released yet, so I'd hope this can still get into the new release.

Wanted to do a release first and then test and merge this PR and create another release shortly after. I tested the current branch that would be 3.2.0 with gradle 9.5 but had some issues that I'm looking at right now before the release will be created.

@Vampire

Vampire commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

Ok, that sounds great also, thanks.

@Vampire

Vampire commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

Btw. still getting a run-failure e-mail for every push due to: https://github.com/researchgate/gradle-release/actions/runs/28170226799

@Vampire

Vampire commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

Btw. which problems do you have with Gradle 9?
I did a quick minimal try and it seemed to work just fine.

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.

GradleBuild is not compatible with composite builds

4 participants