premake5: Add "version" command which prints the version string.
Needed for the CI to apply build naming by revision number.
This commit is contained in:
parent
1b572511da
commit
e55f48dbe2
14
premake5.lua
14
premake5.lua
@ -11,6 +11,20 @@ newoption {
|
|||||||
description = "Do not use new virtual path structure (separating headers and source files)."
|
description = "Do not use new virtual path structure (separating headers and source files)."
|
||||||
}
|
}
|
||||||
|
|
||||||
|
newaction {
|
||||||
|
trigger = "version",
|
||||||
|
description = "Returns the version string for the current commit of the source code.",
|
||||||
|
onWorkspace = function(wks)
|
||||||
|
-- get revision number via git
|
||||||
|
local proc = assert(io.popen("git rev-list --count HEAD", "r"))
|
||||||
|
local revNumber = assert(proc:read('*a')):gsub("%s+", "")
|
||||||
|
proc:close()
|
||||||
|
|
||||||
|
print(revNumber)
|
||||||
|
os.exit(0)
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
newaction {
|
newaction {
|
||||||
trigger = "generate-buildinfo",
|
trigger = "generate-buildinfo",
|
||||||
description = "Sets up build information file like version.h.",
|
description = "Sets up build information file like version.h.",
|
||||||
|
Loading…
Reference in New Issue
Block a user