mirror of
https://github.com/letscontrolit/ESPEasy.git
synced 2026-07-27 19:57:38 +00:00
[Build] Remove previously created __tmpfile.cpp files on ESP8266 build
This commit is contained in:
+1
-1
@@ -83,8 +83,8 @@ extra_scripts = pre:tools/pio/install-requirements.py
|
||||
|
||||
[extra_scripts_esp8266]
|
||||
extra_scripts = tools/pio/gzip-firmware.py
|
||||
pre:tools/pio/remove_concat_cpp_files.py
|
||||
pre:tools/pio/concat_cpp_files.py
|
||||
post:tools/pio/remove_concat_cpp_files.py
|
||||
${extra_scripts_default.extra_scripts}
|
||||
|
||||
|
||||
|
||||
@@ -1,31 +1,34 @@
|
||||
Import("env")
|
||||
import os
|
||||
|
||||
|
||||
|
||||
def clear_concat_cpp_files(path_to_concat):
|
||||
cpp_path_out = '{}_tmp'.format(path_to_concat)
|
||||
tmp_cpp_file = os.path.join(cpp_path_out, '__tmpfile.cpp')
|
||||
|
||||
if os.path.exists(tmp_cpp_file):
|
||||
print("\u001b[33m Delete: \u001b[0m {}".format(tmp_cpp_file))
|
||||
os.remove(tmp_cpp_file)
|
||||
|
||||
if os.path.exists(cpp_path_out):
|
||||
os.rmdir(cpp_path_out)
|
||||
|
||||
|
||||
def clear_all_concat_cpp_files(source, target, env):
|
||||
print("\u001b[32m Remove temp concatenated files \u001b[0m")
|
||||
clear_concat_cpp_files('./src/src/Commands')
|
||||
clear_concat_cpp_files('./src/src/ControllerQueue')
|
||||
clear_concat_cpp_files('./src/src/DataStructs')
|
||||
clear_concat_cpp_files('./src/src/DataTypes')
|
||||
clear_concat_cpp_files('./src/src/Globals')
|
||||
clear_concat_cpp_files('./src/src/Helpers')
|
||||
clear_concat_cpp_files('./src/src/PluginStructs')
|
||||
clear_concat_cpp_files('./src/src/WebServer')
|
||||
print("\u001b[32m ------------------------------ \u001b[0m")
|
||||
|
||||
|
||||
#env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", [clear_all_concat_cpp_files])
|
||||
Import("env")
|
||||
import os
|
||||
|
||||
|
||||
|
||||
def clear_concat_cpp_files(path_to_concat):
|
||||
cpp_path_out = '{}_tmp'.format(path_to_concat)
|
||||
tmp_cpp_file = os.path.join(cpp_path_out, '__tmpfile.cpp')
|
||||
|
||||
if os.path.exists(tmp_cpp_file):
|
||||
print("\u001b[33m Delete: \u001b[0m {}".format(tmp_cpp_file))
|
||||
os.remove(tmp_cpp_file)
|
||||
|
||||
if os.path.exists(cpp_path_out):
|
||||
os.rmdir(cpp_path_out)
|
||||
|
||||
|
||||
def remove_concat_cpp_files(paths_to_remove_concat_files):
|
||||
print("\u001b[32m Remove temp concatenated files \u001b[0m")
|
||||
for path_to_remove in paths_to_remove_concat_files:
|
||||
clear_concat_cpp_files(path_to_remove)
|
||||
print("\u001b[32m ------------------------------ \u001b[0m")
|
||||
|
||||
|
||||
remove_concat_cpp_files(['./src/src/Commands',
|
||||
'./src/src/ControllerQueue',
|
||||
'./src/src/DataStructs',
|
||||
'./src/src/DataTypes',
|
||||
'./src/src/ESPEasyCore',
|
||||
'./src/src/Globals',
|
||||
'./src/src/Helpers',
|
||||
'./src/src/PluginStructs',
|
||||
'./src/src/WebServer'])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user