EditSign (Forge&Fabric)

EditSign (Forge&Fabric)

820k Downloads

Replace `version=0.0.1-dev` in `gradle.properties` with auto-detection

mk-pmb opened this issue ยท 4 comments

commented

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)

commented

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?

commented

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.

commented

Can you try the feat/auto-version branch and see if it solves your issue?

commented

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.