Skip to content

--prerelease does not work on build.gradle #194

Open
@mnorlin

Description

@mnorlin

Describe the bug
The version is not updated in build.gradle when using the --prerelease flag.

Current behavior

When executing

commit-and-tag-version --packageFiles build.gradle --bumpFiles build.gradle --prerelease SNAPSHOT

the version inside build.gradle is not updated.

The terminal outputs

Failed to read the version field in your gradle file - is it present?
✔ outputting changes to CHANGELOG.md
✔ committing CHANGELOG.md
✔ tagging release v0.0.4-SNAPSHOT.0
ℹ Run `git push --follow-tags origin main` to publish

When running the same command without --prerelease

commit-and-tag-version --packageFiles build.gradle --bumpFiles build.gradle

The terminal outputs

✔ bumping version in build.gradle from 0.0.3 to 0.0.4
✔ outputting changes to CHANGELOG.md
✔ committing build.gradle and CHANGELOG.md
✔ tagging release v0.0.4
ℹ Run `git push --follow-tags origin main` to publish

And the version is correctly updated in build.gradle

Expected behavior
Before the command:

version = "0.0.3"

after the command:

version = "0.0.4-SNAPSHOT.0"

Environment

  • commit-and-tag-version version(s): 12.5.0
  • Node/npm version: v20.15.0
  • OS: MacOS 14.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions