mirror of https://github.com/arendst/Tasmota.git
refac firmware-metrics (#18466)
* refac firmware-metrics * rm debugging print * fix esp8266
This commit is contained in:
parent
5a2266289e
commit
112c254d54
|
@ -20,10 +20,6 @@ def map_gzip(source, target, env):
|
||||||
with map_file.open("rb") as fp:
|
with map_file.open("rb") as fp:
|
||||||
with gzip.open(gzip_file, "wb", compresslevel=9) as f:
|
with gzip.open(gzip_file, "wb", compresslevel=9) as f:
|
||||||
shutil.copyfileobj(fp, f)
|
shutil.copyfileobj(fp, f)
|
||||||
if env["PIOPLATFORM"] == "espressif32":
|
|
||||||
# Print Metrics for firmware using "map" file
|
|
||||||
import tasmota_metrics
|
|
||||||
env.Execute("$PYTHONEXE -m tasmota_metrics " + str(map_file.resolve()))
|
|
||||||
|
|
||||||
# remove map file
|
# remove map file
|
||||||
if map_file.is_file():
|
if map_file.is_file():
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
Import("env")
|
||||||
|
|
||||||
|
import tasmotapiolib
|
||||||
|
def firm_metrics(source, target, env):
|
||||||
|
if env["PIOPLATFORM"] == "espressif32":
|
||||||
|
import tasmota_metrics
|
||||||
|
env.Execute("$PYTHONEXE -m tasmota_metrics " + str(tasmotapiolib.get_source_map_path(env).resolve()))
|
||||||
|
|
||||||
|
env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin",firm_metrics)
|
|
@ -25,7 +25,10 @@ def bin_map_copy(source, target, env):
|
||||||
|
|
||||||
# copy firmware.bin and map to final destination
|
# copy firmware.bin and map to final destination
|
||||||
shutil.copy(firsttarget, bin_file)
|
shutil.copy(firsttarget, bin_file)
|
||||||
shutil.move(tasmotapiolib.get_source_map_path(env), map_file)
|
|
||||||
if env["PIOPLATFORM"] == "espressif32":
|
if env["PIOPLATFORM"] == "espressif32":
|
||||||
|
# the map file is needed later for fimrmware-metrics.py
|
||||||
|
shutil.copy(tasmotapiolib.get_source_map_path(env), map_file)
|
||||||
shutil.copy(factory, one_bin_file)
|
shutil.copy(factory, one_bin_file)
|
||||||
|
else:
|
||||||
|
shutil.move(tasmotapiolib.get_source_map_path(env), map_file)
|
||||||
env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", bin_map_copy)
|
env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", bin_map_copy)
|
||||||
|
|
|
@ -73,6 +73,7 @@ extra_scripts = pre:pio-tools/pre_source_dir.py
|
||||||
[esp_defaults]
|
[esp_defaults]
|
||||||
extra_scripts = post:pio-tools/name-firmware.py
|
extra_scripts = post:pio-tools/name-firmware.py
|
||||||
post:pio-tools/gzip-firmware.py
|
post:pio-tools/gzip-firmware.py
|
||||||
|
post:pio-tools/metrics-firmware.py
|
||||||
post:pio-tools/custom_target.py
|
post:pio-tools/custom_target.py
|
||||||
; post:pio-tools/obj-dump.py
|
; post:pio-tools/obj-dump.py
|
||||||
${scripts_defaults.extra_scripts}
|
${scripts_defaults.extra_scripts}
|
||||||
|
|
Loading…
Reference in New Issue