MILESTONE define is now bound to the current Git tag name (which is beta).
Subject to.
This commit is contained in:
parent
c0e3a49234
commit
db4f9ad6ec
20
premake5.lua
20
premake5.lua
@ -1,3 +1,16 @@
|
|||||||
|
-- Quote the given string input as a C string
|
||||||
|
function cstrquote(value)
|
||||||
|
result = value:gsub("\\", "\\\\")
|
||||||
|
result = result:gsub("\"", "\\\"")
|
||||||
|
result = result:gsub("\n", "\\n")
|
||||||
|
result = result:gsub("\t", "\\t")
|
||||||
|
result = result:gsub("\r", "\\r")
|
||||||
|
result = result:gsub("\a", "\\a")
|
||||||
|
result = result:gsub("\b", "\\b")
|
||||||
|
result = "\"" .. result .. "\""
|
||||||
|
return result
|
||||||
|
end
|
||||||
|
|
||||||
-- Option to allow copying the DLL file to a custom folder after build
|
-- Option to allow copying the DLL file to a custom folder after build
|
||||||
newoption {
|
newoption {
|
||||||
trigger = "copy-to",
|
trigger = "copy-to",
|
||||||
@ -54,7 +67,7 @@ newaction {
|
|||||||
proc:close()
|
proc:close()
|
||||||
|
|
||||||
-- get whether this is a clean revision (no uncommitted changes)
|
-- get whether this is a clean revision (no uncommitted changes)
|
||||||
local proc = assert(io.popen("git status --porcelain", "r"))
|
proc = assert(io.popen("git status --porcelain", "r"))
|
||||||
local revClean = 1
|
local revClean = 1
|
||||||
local revCleanSuffix = ""
|
local revCleanSuffix = ""
|
||||||
if assert(proc:read('*a')) ~= "" then
|
if assert(proc:read('*a')) ~= "" then
|
||||||
@ -63,6 +76,10 @@ newaction {
|
|||||||
end
|
end
|
||||||
proc:close()
|
proc:close()
|
||||||
|
|
||||||
|
-- get current tag name (aka milestone for now)
|
||||||
|
proc = assert(io.popen("git tag"))
|
||||||
|
local tagName = assert(proc:read('*l'))
|
||||||
|
|
||||||
-- get old version number from version.hpp if any
|
-- get old version number from version.hpp if any
|
||||||
local oldRevNumber = "(none)"
|
local oldRevNumber = "(none)"
|
||||||
local oldRevClean = 1
|
local oldRevClean = 1
|
||||||
@ -100,6 +117,7 @@ newaction {
|
|||||||
versionHeader:write("\n")
|
versionHeader:write("\n")
|
||||||
versionHeader:write("#define REVISION " .. revNumber .. "\n")
|
versionHeader:write("#define REVISION " .. revNumber .. "\n")
|
||||||
versionHeader:write("#define REVISION_CLEAN " .. revClean .. "\n")
|
versionHeader:write("#define REVISION_CLEAN " .. revClean .. "\n")
|
||||||
|
versionHeader:write("#define MILESTONE " .. cstrquote(tagName) .. "\n")
|
||||||
versionHeader:close()
|
versionHeader:close()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -123,7 +123,6 @@ using namespace std::literals;
|
|||||||
|
|
||||||
#define BASEGAME "iw4x"
|
#define BASEGAME "iw4x"
|
||||||
#define CLIENT_CONFIG "iw4x_config.cfg"
|
#define CLIENT_CONFIG "iw4x_config.cfg"
|
||||||
#define MILESTONE "beta"
|
|
||||||
|
|
||||||
#define REVISION_STR STRINGIZE(REVISION)
|
#define REVISION_STR STRINGIZE(REVISION)
|
||||||
#if !REVISION_CLEAN
|
#if !REVISION_CLEAN
|
||||||
|
Loading…
Reference in New Issue
Block a user