Closed DevLomoSE closed 2 weeks ago
I wonder if this is because of -SNAPSHOT
?
Make sense, i'll try I think is better if some exception is thrown and process of commit tag and that stuff is aborted.
I agree. I think my instinct was right- looks like the regex only matches digits and dots. It should be updated so that it matches full semver versions: https://github.com/absolute-version/commit-and-tag-version/blob/master/lib/updaters/types/gradle.jsAs you can see, the gradle implementation isn’t especially advanced- it’s just looking for a regular expression match. Definitely lots of opportunities for improvement there.On 7 Jul 2024, at 4:35 PM, Jonathan Guzman Guadarrama @.***> wrote: Make sense, i'll try I think is better if some exception is thrown and process of commit tag and that stuff is aborted.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>
I just tried and even with version:
version = '1.0.0'
there is no update in build.gradle
the command shows this output
commit-and-tag-version build.gradle build.gradle src/resources/application.yml
✔ bumping version in package.json from 1.2.3 to 1.3.0
✔ bumping version in package-lock.json from 1.2.3 to 1.3.0
✔ outputting changes to CHANGELOG.md
✔ committing package-lock.json and package.json and CHANGELOG.md
✔ tagging release v1.3.0
so im wonder if there is something else that is failing. how can i help by getting more info about this issue?
i've created a new empty git repo with package.json build.gradle
if i install the cli tool in global with:
npm install -g commit-and-tag-version
then run
commit-and-tag-version --packageFiles build.gradle --bumpFiles build.gradle
the output is
✔ bumping version in build.gradle from 1.0.2 to 1.0.3
✔ outputting changes to CHANGELOG.md
✔ committing build.gradle and CHANGELOG.md
✔ tagging release v1.0.3
ℹ Run `git push --follow-tags origin main` to publish
here the version in the gradle file is updated and the package.json is ignored.
if i run the npm script like
npm run release --packageFiles build.gradle --bumpFiles build.gradle
the output is
> commit-and-tag-version build.gradle build.gradle
✔ bumping version in package.json from 1.2.0 to 1.2.1
✔ outputting changes to CHANGELOG.md
✔ committing package.json and CHANGELOG.md
✔ tagging release v1.2.1
ℹ Run `git push --follow-tags origin main && npm publish` to publish
here the build.gradle is ignored and the version is updated in the package.json
if i run the cli with npx like
npx commit-and-tag-version --packageFiles build.gradle --bumpFiles build.gradle
the output is
✔ bumping version in build.gradle from 1.0.3 to 1.0.4
✔ outputting changes to CHANGELOG.md
✔ committing build.gradle and CHANGELOG.md
✔ tagging release v1.0.4
ℹ Run `git push --follow-tags origin main` to publish
here the version in the gradle file is updated and the package.json is ignored.
so there should be something that cause a "conflict" when you run the command with the npm script
Aha! Thanks for the extensive testing.
# This won't work
npm run release --packageFiles build.gradle --bumpFiles build.gradle
^ this isn't the right way to pass arguments prefixed with --
through npm to the script. You'll need to add --
before the arguments (docs here). It should work when you do this.
# This should work
npm run release -- --packageFiles build.gradle --bumpFiles build.gradle
Alternatively, you can just add the arguments to the scripts stanza in your package json:
"scripts": {
...
"release": "commit-and-tag-version --packageFiles build.gradle --bumpFiles build.gradle"
}
Also, sorry I didn't notice this in the first post!
no worries, i just noticed that too. then we can close this. sorry for the false alarm :/
Describe the bug I've installed with:
I've a package.json (to use other cli tools) and i've also created the script like
and im using it like:
Current behavior after run the command i can see changelog.md has been updated, the package.json has been updated with new version but build.gradle remains
Expected behavior build.gradle updated to
Environment
commit-and-tag-version
version(s): [^12.4.1]Possible Solution
Additional context