BrettMayson / HEMTT

Build System for Arma 3
http://hemtt.dev/
GNU General Public License v2.0
113 stars 40 forks source link

Build Feature - Version Increment #16

Closed jonpas closed 1 year ago

jonpas commented 5 years ago

release MINOR/MAJOR/PATCH with build always increased (if it exists).

Could also do release --inc minor/major/patch.

bovine3dom commented 5 years 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.

BrettMayson commented 5 years ago

Once templating is done, you should be able to do that

jonpas commented 5 years ago

@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:


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

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.

BrettMayson commented 1 year ago

This is now possible with hooks, I don't think a specific command is needed