Skip to content

fix: use ExecOperations in release tasks for Gradle 9 - #72

Merged
markjschreiber merged 1 commit into
awslabs:mainfrom
costajohnt:fix-gradle9-exec
Nov 18, 2026
Merged

markjschreiber merged 1 commit into
awslabs:mainfrom
costajohnt:fix-gradle9-exec

Conversation

@costajohnt

Copy link
Copy Markdown
Contributor

Issue #, if available: none

Description of Changes

Gradle 9 removed Project.exec(), and the wrapper has been on Gradle 9 since #64. Since then every release task in the root build.gradle fails with "Could not find method exec()". This change gets an ExecOperations instance through an injected interface once at configuration time and calls execOps.exec { } in place of exec { }. The commands and their spec settings are unchanged.

Description of how you validated changes

With Gradle 9.4.0 from the wrapper on JDK 17, ./gradlew preRelease -PreleaseVersion=0.1.3 and ./gradlew listReleases failed with "Could not find method exec()" before the change. After it, preRelease reports the working tree status, branch and tag checks. listReleases lists local tags, checkGitStatus and getCurrentBranch behave as before, and generateChecksums (run with stub jars and -x buildAll) writes the same hashes as sha256sum. I did not run the tasks that push to the remote.

Checklist

  • If I have added a new rule, that rule has also been added to healthomics-nextflow-rules/src/main/resources/rulesets/healthomics.xml
  • If this change would make any existing documentation invalid, I have included those updates within this PR
  • I have added unit tests that prove my fix is effective or that my feature works
  • I have confirmed that I am able to locally build the project with no errors (./gradlew clean build)
  • I have not made extensive or unnecessary formatting changes unless this PR is specifically and only about reformatting
  • Title of this Pull Request follows Conventional Commits standard: https://www.conventionalcommits.org/en/v1.0.0/

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

Found with groovyfmt, a Groovy formatter and linter.

@markjschreiber markjschreiber left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@markjschreiber
markjschreiber merged commit 489c93b into awslabs:main Nov 18, 2026
1 check passed
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