mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-30 11:59:12 +03:00
Убрал ошибку при одновременной сборки с ФС
This commit is contained in:
@@ -2,12 +2,27 @@
|
|||||||
import os
|
import os
|
||||||
import configparser
|
import configparser
|
||||||
|
|
||||||
config = configparser.ConfigParser() # создаём объекта парсера INI
|
def before_build(): # source, target, env
|
||||||
config.read("platformio.ini")
|
print("Current Build targets", BUILD_TARGETS)
|
||||||
deviceName = config["platformio"]["default_envs"]
|
# Это всё потому что не работает "buildprog". При сборке прошивки Targets пустой, на всякий случай исключим все остальные
|
||||||
# удаляем объектный файл где используется время сборки, для обновления
|
if (BUILD_TARGETS == ['upload'] or
|
||||||
try:
|
BUILD_TARGETS == ['buildfs'] or
|
||||||
os.remove("./.pio/build/"+deviceName+"/src/Main.cpp.o")
|
BUILD_TARGETS == ['uploadfs'] or
|
||||||
except OSError as e:
|
BUILD_TARGETS == ['uploadfsota'] or
|
||||||
# If it fails, inform the user.
|
BUILD_TARGETS == ['size']):
|
||||||
print("Error: %s - %s." % (e.filename, e.strerror))
|
return
|
||||||
|
|
||||||
|
print("Clear BUILD_TIME, delete main.o !")
|
||||||
|
config = configparser.ConfigParser() # создаём объекта парсера INI
|
||||||
|
config.read("platformio.ini")
|
||||||
|
deviceName = config["platformio"]["default_envs"]
|
||||||
|
# удаляем объектный файл где используется время сборки, для обновления
|
||||||
|
try:
|
||||||
|
os.remove("./.pio/build/"+deviceName+"/src/Main.cpp.o")
|
||||||
|
except OSError as e:
|
||||||
|
# If it fails, inform the user.
|
||||||
|
print("Error: %s - %s." % (e.filename, e.strerror))
|
||||||
|
|
||||||
|
#env.AddPreAction("buildprog", before_build) # $BUILD_DIR/src/main.cpp.o
|
||||||
|
|
||||||
|
before_build()
|
||||||
Reference in New Issue
Block a user