Closed jonpas closed 1 year ago
For smaller projects I often just use the day's date as a version signifier - could HEMTT support that? E.g, 2019.02.17.
Once templating is done, you should be able to do that
@bovine3dom this is how it would look like with date
templating, just need to support version
templating.
version = "{{date \"%Y\"}}.{{date \"%m\"}}.{{date \"%d\"}}"
This request is probably best implement with a version
utility which can:
scripts
(to be ran manually or by external script before releases - not all release builds):
[scripts.version]
show_output = true
steps = [
"@version -i build",
"git commit -am \"Prepare release {{version}}\""
]
$ hemtt version -i minor # Increment minor number
$ hemtt run version # Run helper script (build number + git commit)
This is of course entirely up to the project and how they handle or wish to handle releases. But I think we shouldn't do any invasive git operations automatically in HEMTT, scripts provide a perfect way to accomplish that. I came up with this examples from how we would want to do it in ACE3/CBA (how it is done) and ACRE2 (how Jenkins would do it through external script).
Idea on version file list configuration (files that contain version that needs updating):
# Specify files where version needs updating, without source (script_version.hpp)
version_files = [
"mod.cpp",
"README.md"
]
Ideas on version
utility usage:
$ hemtt version # Argument --update -u maybe?
$ hemtt version --increment major
$ hemtt version --inc minor # Maybe not?
$ hemtt version -i patch
$ hemtt version -i build
version
would update all files specified in version_files
config using p.version
as source
x.y.z
and x.y.z.w
fits HEMTT version specification very well, could just match on that like we do in ACE3's and CBA's make.py
version -i
would just update p.version
and run version
routine (above)
date
)script_version.hpp
? Does HEMTT config overwrite that and we automatically add script_version.hpp
into version_files
with special handling (different definition)?This is all largely taken from ACE3/CBA/ACRE2's make.py
where I implemented a very similar system.
Ideally, we could also support:
$ hemtt version -i minor
$ hemtt run release
[scripts.release]
show_output = true
steps = [
"@version -i build", # Would automatically use date specifier as above
"git commit -am \"Prepare release {{version}}\"",
"build --release -f", # After version commit, we want headerext to be up-to-date
"git push" # Push preperation commit
]
For that, we need to allow running HEMTT commands inside scripts - though warning, could end up in a loop if not used correctly.
This is now possible with hooks, I don't think a specific command is needed
release MINOR/MAJOR/PATCH
with build always increased (if it exists).Could also do
release --inc minor/major/patch
.version