Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Post Release 5.0.0-beta3 Cleanup #2323

Merged

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

@@ -12,8 +12,8 @@
#include <stdint.h>
#include <stdlib.h>

#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