use sha in build filenames

pull/792/head
Kevin Hester 2021-04-16 10:59:46 +08:00
rodzic 50f739bacf
commit 361556a6a7
3 zmienionych plików z 6 dodań i 28 usunięć

2
.gitignore vendored
Wyświetl plik

@ -19,4 +19,4 @@ Thumbs.db
nanopb*
flash.uf2
cmake-build*
__pycache__

Wyświetl plik

@ -1,11 +1,7 @@
#!/usr/bin/env python3
import configparser
from readprops import readProps
config = configparser.RawConfigParser()
config.read('version.properties')
version = dict(config.items('VERSION'))
verStr = "{}.{}.{}".format(version["major"], version["minor"], version["build"])
verStr = readProps('version.properties')
print(f"{verStr}")

Wyświetl plik

@ -4,32 +4,14 @@ import subprocess
import configparser
import traceback
import sys
from readprops import readProps
Import("projenv")
prefsLoc = projenv["PROJECT_DIR"] + "/version.properties"
config = configparser.RawConfigParser()
config.read(prefsLoc)
version = dict(config.items('VERSION'))
# Try to find current build SHA if if the workspace is clean. This could fail if git is not installed
try:
sha = subprocess.check_output(
['git', 'rev-parse', '--short', 'HEAD']).decode("utf-8").strip()
isDirty = subprocess.check_output(
['git', 'diff', 'HEAD']).decode("utf-8").strip()
suffix = sha
if isDirty:
suffix = sha + "-dirty"
verStr = "{}.{}.{}.{}".format(
version["major"], version["minor"], version["build"], suffix)
except:
print("Unexpected error:", sys.exc_info()[0])
traceback.print_exc()
verStr = "{}.{}.{}".format(
version["major"], version["minor"], version["build"])
verStr = readProps(prefsLoc)
print("Using meshtastic platform-custom.py, firmare version " + verStr)
# print("path is" + ','.join(sys.path))
# General options that are passed to the C and C++ compilers
projenv.Append(CCFLAGS=[