Skip to content

Conversation

@nickclark2016
Copy link
Member

Reverts the version back to 5.0.0-dev in the build, updates copyright year in src/host/premake.h

@nickclark2016 nickclark2016 requested a review from a team November 11, 2024 15:31
@nickclark2016 nickclark2016 force-pushed the release/5.0.0-beta3-post branch from 313364d to b5871b8 Compare November 11, 2024 15:32

#define PREMAKE_VERSION "5.0.0-beta3"
#define PREMAKE_COPYRIGHT "Copyright (C) 2002-2021 Jess Perkins and the Premake Project"
#define PREMAKE_VERSION "5.0.0-dev"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about having version.h.in using git describe?

Something like:

local function template(file_in, dict, file_out)
	local content = io.readfile(file_in)
	for k,v in pairs(dict) do
		content = content:gsub(k, v)
	end
	os.mkdir(path.getdirectory(file_out))
	local f, err = os.writefile_ifnotequal(content, file_out)

	if (f == 0) then
		-- file not modified
	elseif (f < 0) then
		error(err, 0)
		return false
	elseif (f > 0) then
		print("Generated " .. file_out)
	end
	return true
end

local function autoversion_h()
	local git_tag, errorCode = os.outputof("git describe --tag --always")
	if errorCode ~= 0 then
        error("`git describe --tag` failed with error code", errorCode, git_tag)
    end
    print("git description: ", git_tag)
	return template(
		"src/autoversion.h.in",
		{["@GIT_DESC@"] = git_tag},
		path.join("solution", _ACTION, "autoversion.h")
end

gitintegration "Always" -- to add git hook

if _ACTION ~= nil then -- Do nothing for premake --version :-)
    autoversion_h()
end

So no longer need to modify the code, it just use git tag.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's table this for a follow up, just so we can complete the current release cycle under the existing release guide. Then we can discuss updating this for the future in maybe a GH discussion?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No pb to postpone the discussion (I approved BTW).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, you're not a reviewer with write access so I have to wait for another review :(

@nickclark2016 nickclark2016 merged commit 4ac3770 into premake:master Nov 11, 2024
15 checks passed
@nickclark2016
Copy link
Member Author

Thanks @starkos :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants