diff options
| author | Selene ToyKeeper | 2023-12-05 11:54:54 -0700 |
|---|---|---|
| committer | Selene ToyKeeper | 2023-12-05 11:54:54 -0700 |
| commit | 7153149c99e416f6efad3b84e5b550c0abf56454 (patch) | |
| tree | cb7060886b8be63caff06bbee5170e493638d7be /bin/build-all.sh | |
| parent | forgot one item in the ChangeLog (diff) | |
| download | anduril-7153149c99e416f6efad3b84e5b550c0abf56454.tar.gz anduril-7153149c99e416f6efad3b84e5b550c0abf56454.tar.bz2 anduril-7153149c99e416f6efad3b84e5b550c0abf56454.zip | |
moved version string calculation to bin/version-string.sh
Also updated the format slightly, so this rev is: `2023-12-03+2#1`
+N for commits since tag
#1 for dirty
Diffstat (limited to '')
| -rwxr-xr-x | bin/build-all.sh | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/bin/build-all.sh b/bin/build-all.sh index f239217..f2420a7 100755 --- a/bin/build-all.sh +++ b/bin/build-all.sh @@ -80,19 +80,7 @@ function make-version-h { # old: version = build date #date '+#define VERSION_NUMBER "%Y-%m-%d"' > ui/$UI/version.h - # version = git tag + revs since + dirty flag - REV=$(git describe --tags --dirty --abbrev=8 --match='r2*') - # reformatting this would be easier with a perl one-liner, - # but I'm trying to avoid extra build dependencies - REV="${REV:1}" # strip the leading 'r' - # strip rev hash (git won't give "commits since tag" without the rev hash) - REV="${REV/-g[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]/}" - REV="${REV/-dirty/.1}" # convert '-dirty' to '.1' - # handle an empty name (happens during github action runs) - if [[ -z "$REV" ]]; then - HASH=$(git describe --always) - REV="0.$HASH" - fi + REV=$(bin/version-string.sh c) # save the version name to version.h mkdir -p ".build/$UI" echo '#define VERSION_NUMBER "'"$REV"'"' > ".build/$UI/version.h" |
