Open radai-rosenblatt opened 5 years ago
Im seeing the same issue
It should probably check to see whether there are any tags first before doing anything. This is definitely a bug.
@radai-rosenblatt What version of the plugin are you use, and what version of git? I checked the source and it looks like it does check to see if there are any tags at all, and if not, it will use the starting version.
@radai-rosenblatt @ldiaz2 do you guys have a sample repo where this is happening?
i worked around it by setting a 0.0.0 tag and then it does not hit this error.
That's still pretty strange, given that it should automatically use the default version if it cannot find any tags. I wasn't able to duplicate this, so I'm closing this issue for now.
Hey @vivin. I've faced the same issue. The way to reproduce:
v0.0.1
gradle tasks
git commit --amend --no-edit
gradle tasks
againHere is a state, which causes Cannot invoke method split() on null object
* 61767ac (HEAD -> gradle-debian) Update changelog for 0.0.1 release
| * 936da14 (tag: v0.0.1, origin/gradle-debian) Update changelog for 0.0.1 release
|/
* a7e093f Build, publish and deploy the package
The setting startingVersion = '0.0.1'
mitigates this, BTW
upd I use v 4.0.0 of the plugin
Hi, I also encountered the same issue and created a repository that reproduces it: https://github.com/vitorog/gradle-semantic-build-versioning-bug
To reproduce it, just run on the master branch: ./gradlew printVersion (or any other task)
Steps that I took:
Additional info: Plugin version: 4.0.0 Git version: git version 2.22.0.windows.1 Gradle version: Gradle 5.3 Build time: 2019-03-20 11:03:29 UTC Revision: f5c64796748a98efdbf6f99f44b6afe08492c2a0
Kotlin: 1.3.21 Groovy: 2.5.4 Ant: Apache Ant(TM) version 1.9.13 compiled on July 10 2018 JVM: 1.8.0_212-release (JetBrains s.r.o 25.212-b4) OS: Windows 10 10.0 amd64
@vitorog Thanks for a working example. I will try to look at this as soon as I can.
@vivin Are there any news on it? Does some workaround exist?
I got passed this by making sure I was cloning the repository and not just fetching it. My guess is that fetch does not get the tags. I am using gitlab. Here is how to do it https://docs.gitlab.com/ee/ci/pipelines/settings.html.
on new(-ish) projects, where the git history has no tags to gen an initial version from, I get this when running
./gradlew printVersion
. also happens for most other gradle commands