
Replace `version=0.0.1-dev` in `gradle.properties` with auto-detection
mk-pmb opened this issue ยท 4 comments
Describe the feature
Hi! Obviously it's no longer 0.0.1-dev, so how about an empty version=
(or fully omitted) and detect it from latest git tag of current branch? (git describe --tags --abbrev=0
)
That is what was done before. (Maybe not, maybe was manual I don't remember) However for people downloading the project as zip, all the git info are lost. The version is simply overridden when a build is being made and is obtained from the tag name.
I'm not sure to understand how 0.0.01-dev is an issue?
However for people downloading the project as zip, all the git info are lost.
Indeed, there should be a safe fallback for when git cannot determine the tag. Maybe something like 0.0.0-version-unknown
, or an error message that version could not be detected and must be configured explicitly.
I'm not sure to understand how 0.0.01-dev is an issue?
I feel it would be more elegant a project if I wouldn't need this hotfix to make it build correctly on GitHub.
Building finished and produced this JAR whose fabric.mod.json
and META-INF/mods.toml
both state version 2.8.0-16
. I consider it solved. Thanks! ๐
However you may not need additional code for the commitDistance condition. As far as I understand git-describe, you can just omit the abbrev option and it will add the distance and also the hash.