Use git to retrieve version instead of manually change PREMAKE_VERSION.#2405
Use git to retrieve version instead of manually change PREMAKE_VERSION.#2405nickclark2016 merged 1 commit intopremake:masterfrom
PREMAKE_VERSION.#2405Conversation
premake5.lua
Outdated
| local function autoversion_h() | ||
| local git_tag, errorCode = os.outputof("git describe --tag --always") | ||
| if errorCode == 0 then | ||
| print("git description: ", git_tag) |
There was a problem hiding this comment.
Is this debug print and should it be removed?
There was a problem hiding this comment.
I see it more as information than debugging.
|
Overall looks good and great improvement over the current way of handling the version string. But long-term (maybe as future PR) I think it makes sense to provide a core API for this task (generating a config file), which is a pretty common requirement for many projects. We can take a look at inspiration from CMake's configure_file. |
A simple function taking "template_path", "output_path" and a table for mapping seems sufficient. But outside scope of that PR IMO. |
|
As previously discussed, I'm not a fan of this approach. Here are some of my issues:
|
I don't see a way to "fix" 1. and 2. Just noticed that "script/package.lua" would be broken too with that change (and can/should be fixed). |
e56ef4e to
5d7b959
Compare
|
5d7b959 to
0f91939
Compare
0f91939 to
8c3e3ec
Compare
|
@Jarod42 have you tested this out locally to ensure the variable is set correctly with tags? And can you post the output here if the current commit is the tagged commit vs an untagged commit? |
8c3e3ec to
e7a9394
Compare
|
From https://github.com/premake/premake-core/actions/runs/14019395362/job/39249271176
Which is an untagged version Locally, with custom tag (there was indeed a typo for substring to remove prefix "v") |
What does this PR do?
Handle
PREMAKE_VERSIONfrom git tagHow does this PR change Premake's behavior?
No behavior changed.
Anything else we should know?
gitintegrationsetup, so premake5 is launched at each checkout.Did you check all the boxes?
closes #XXXXin comment to auto-close issue when PR is merged)