mirror of
https://github.com/EyeTrackVR/OpenIris.git
synced 2025-11-04 15:39:42 +08:00
update
- remove old versioning system - add new custom firmware name handler
This commit is contained in:
parent
e795567988
commit
6e210485ae
@ -1,14 +1,28 @@
|
||||
FILENAME_BUILDNO = 'tools/versioning'
|
||||
version = 'v0.1.'
|
||||
build_no = 0
|
||||
|
||||
FILENAME_VERSION = 'tools/version.txt'
|
||||
build_no = 'v0.0.0'
|
||||
try:
|
||||
with open(FILENAME_BUILDNO) as f:
|
||||
build_no = int(f.readline()) + 1
|
||||
with open(FILENAME_VERSION) as f:
|
||||
build_no = f.readline()
|
||||
if build_no == '':
|
||||
raise Exception("Empty file")
|
||||
version = build_no.split('v')
|
||||
version = version[1].split('.')
|
||||
first_num = int(version[0])
|
||||
second_num = int(version[1])
|
||||
last_num = int(version[2])
|
||||
if last_num <= 9:
|
||||
last_num += 1
|
||||
elif second_num <= 9 and last_num >= 9:
|
||||
second_num += 1
|
||||
elif second_num and last_num >= 9:
|
||||
first_num += 1
|
||||
second_num = 0
|
||||
last_num = 0
|
||||
else:
|
||||
raise Exception("Invalid version number")
|
||||
build_no = 'v' + str(first_num) + '.' + str(second_num) + '.' + str(last_num)
|
||||
except:
|
||||
build_no = 1
|
||||
with open(FILENAME_BUILDNO, 'w+') as f:
|
||||
f.write(str(build_no))
|
||||
|
||||
#print("-DVERSION=\"%s\"" % version+str(build_no))
|
||||
print("-DVERSION={0}".format(version+str(build_no)))
|
||||
build_no = "v0.0.1"
|
||||
with open(FILENAME_VERSION, 'w+') as f:
|
||||
f.write(build_no)
|
||||
print("-DVERSION={0}".format(build_no))
|
||||
|
||||
@ -2,6 +2,9 @@
|
||||
|
||||
Import("env")
|
||||
|
||||
# Dump global construction environment (for debug purpose)
|
||||
#print(env.Dump())
|
||||
|
||||
my_flags = env.ParseFlags(env['BUILD_FLAGS'])
|
||||
defines = dict()
|
||||
for x in my_flags.get("CPPDEFINES"):
|
||||
@ -21,3 +24,12 @@ env.Replace(
|
||||
PROGNAME="%s-%s-%s-%s-%s" %
|
||||
(s(defines.get("PIO_SRC_NAM")), s(defines.get("VERSION")), str(env["PIOENV"]),
|
||||
s(defines.get("PIO_SRC_REV")), s(defines.get("PIO_SRC_BRH"))))
|
||||
|
||||
#detect if there is a forward slash in the PROGNAME and replace it with an underscore
|
||||
if "/" in env["PROGNAME"]:
|
||||
env.Replace(
|
||||
PROGNAME="%s" %
|
||||
(env["PROGNAME"].replace("/", "-")))
|
||||
|
||||
# create a file with the name of the firmware
|
||||
env.Execute("echo %s > %s" % (env["PROGNAME"], env.subst("./tools/firmware_name.txt")))
|
||||
@ -1 +1 @@
|
||||
OpenIris-v0.1.685-esp32Cam_release-400bd99-feature-mdns-autodiscovery
|
||||
OpenIris-v0.0.1-esp32Cam_release-be1530b-feature-mdns-autodiscovery
|
||||
|
||||
1
ESP/tools/version.txt
Normal file
1
ESP/tools/version.txt
Normal file
@ -0,0 +1 @@
|
||||
v1.0.0
|
||||
@ -1 +0,0 @@
|
||||
566
|
||||
Loading…
Reference in New Issue
Block a user