mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
Multi-language/I18n support #22
This commit is contained in:
@@ -5,7 +5,6 @@ Import("env")
|
||||
|
||||
OUTPUT_DIR = "build{}".format(os.path.sep)
|
||||
|
||||
|
||||
def bin_copy(source, target, env):
|
||||
|
||||
# get the build info
|
||||
@@ -21,20 +20,23 @@ def bin_copy(source, target, env):
|
||||
app_version = bag.get('app_version')
|
||||
platform = "ESP32"
|
||||
|
||||
flash_size = env["PIOENV"].split('_')[1]
|
||||
|
||||
# print(env.Dump())
|
||||
# my_flags = env.ParseFlags(env['BUILD_FLAGS'])
|
||||
# defines = {k: v for (k, v) in my_flags.get("CPPDEFINES")}
|
||||
# print(my_flags)
|
||||
# print((my_flags.get("CPPDEFINES"))
|
||||
|
||||
# alternatively take platfrom from the pio target
|
||||
# alternatively take platform from the pio target
|
||||
# platform = str(target[0]).split(os.path.sep)[2]
|
||||
|
||||
print("app version: "+app_version)
|
||||
print("platform: "+platform)
|
||||
print("flash size: "+flash_size)
|
||||
|
||||
# convert . to _ so Windows doesn't complain
|
||||
variant = "EMS-ESP-" + app_version.replace(".", "_") + "-" + platform
|
||||
variant = "EMS-ESP-" + app_version.replace(".", "_") + "-" + platform + "_" + flash_size
|
||||
|
||||
# check if output directories exist and create if necessary
|
||||
if not os.path.isdir(OUTPUT_DIR):
|
||||
@@ -52,10 +54,9 @@ def bin_copy(source, target, env):
|
||||
if os.path.isfile(f):
|
||||
os.remove(f)
|
||||
|
||||
print("renaming file to "+bin_file)
|
||||
print("Renaming file to "+bin_file)
|
||||
|
||||
# copy firmware.bin to firmware/<variant>.bin
|
||||
shutil.copy(str(target[0]), bin_file)
|
||||
|
||||
|
||||
env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", [bin_copy])
|
||||
|
||||
Reference in New Issue
Block a user