mirror of
https://github.com/meshtastic/firmware.git
synced 2025-08-20 04:01:14 +00:00
use sha in build filenames
This commit is contained in:
parent
50f739bacf
commit
361556a6a7
2
.gitignore
vendored
2
.gitignore
vendored
@ -19,4 +19,4 @@ Thumbs.db
|
|||||||
nanopb*
|
nanopb*
|
||||||
flash.uf2
|
flash.uf2
|
||||||
cmake-build*
|
cmake-build*
|
||||||
|
__pycache__
|
@ -1,11 +1,7 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
import configparser
|
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}")
|
print(f"{verStr}")
|
||||||
|
@ -4,32 +4,14 @@ import subprocess
|
|||||||
import configparser
|
import configparser
|
||||||
import traceback
|
import traceback
|
||||||
import sys
|
import sys
|
||||||
|
from readprops import readProps
|
||||||
|
|
||||||
Import("projenv")
|
Import("projenv")
|
||||||
|
|
||||||
prefsLoc = projenv["PROJECT_DIR"] + "/version.properties"
|
prefsLoc = projenv["PROJECT_DIR"] + "/version.properties"
|
||||||
config = configparser.RawConfigParser()
|
verStr = readProps(prefsLoc)
|
||||||
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"])
|
|
||||||
|
|
||||||
print("Using meshtastic platform-custom.py, firmare version " + verStr)
|
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
|
# General options that are passed to the C and C++ compilers
|
||||||
projenv.Append(CCFLAGS=[
|
projenv.Append(CCFLAGS=[
|
||||||
|
Loading…
Reference in New Issue
Block a user