@@ -128,6 +128,7 @@ def __fetch_spiffs_size(target, source, env):
128
128
129
129
130
130
env = DefaultEnvironment ()
131
+ env .SConscript ("compat.py" , exports = "env" )
131
132
platform = env .PioPlatform ()
132
133
board = env .BoardConfig ()
133
134
mcu = board .get ("build.mcu" , "esp32" )
@@ -210,7 +211,7 @@ def __fetch_spiffs_size(target, source, env):
210
211
# Target: Build executable and linkable firmware or SPIFFS image
211
212
#
212
213
213
- target_elf = env . BuildProgram ()
214
+ target_elf = None
214
215
if "nobuild" in COMMAND_LINE_TARGETS :
215
216
target_elf = join ("$BUILD_DIR" , "${PROGNAME}.elf" )
216
217
if set (["uploadfs" , "uploadfsota" ]) & set (COMMAND_LINE_TARGETS ):
@@ -219,15 +220,16 @@ def __fetch_spiffs_size(target, source, env):
219
220
else :
220
221
target_firm = join ("$BUILD_DIR" , "${PROGNAME}.bin" )
221
222
else :
223
+ target_elf = env .BuildProgram ()
222
224
if set (["buildfs" , "uploadfs" , "uploadfsota" ]) & set (COMMAND_LINE_TARGETS ):
223
225
target_firm = env .DataToBin (
224
226
join ("$BUILD_DIR" , "${ESP32_SPIFFS_IMAGE_NAME}" ), "$PROJECTDATA_DIR" )
225
227
AlwaysBuild (target_firm )
226
- AlwaysBuild (env .Alias ("buildfs" , target_firm ))
227
228
else :
228
229
target_firm = env .ElfToBin (
229
230
join ("$BUILD_DIR" , "${PROGNAME}" ), target_elf )
230
231
232
+ env .AddPlatformTarget ("buildfs" , target_firm , None , "Build Filesystem Image" )
231
233
AlwaysBuild (env .Alias ("nobuild" , target_firm ))
232
234
target_buildprog = env .Alias ("buildprog" , target_firm , target_firm )
233
235
@@ -246,10 +248,13 @@ def __fetch_spiffs_size(target, source, env):
246
248
# Target: Print binary size
247
249
#
248
250
249
- target_size = env .Alias ("size" , target_elf ,
250
- env .VerboseAction ("$SIZEPRINTCMD" ,
251
- "Calculating size $SOURCE" ))
252
- AlwaysBuild (target_size )
251
+ target_size = env .AddPlatformTarget (
252
+ "size" ,
253
+ target_elf ,
254
+ env .VerboseAction ("$SIZEPRINTCMD" , "Calculating size $SOURCE" ),
255
+ "Program Size" ,
256
+ "Calculate program size" ,
257
+ )
253
258
254
259
#
255
260
# Target: Upload firmware or SPIFFS image
@@ -394,18 +399,24 @@ def __fetch_spiffs_size(target, source, env):
394
399
else :
395
400
sys .stderr .write ("Warning! Unknown upload protocol %s\n " % upload_protocol )
396
401
397
- AlwaysBuild (env .Alias (["upload" , "uploadfs" ], target_firm , upload_actions ))
402
+ env .AddPlatformTarget ("upload" , target_firm , upload_actions , "Upload" )
403
+ env .AddPlatformTarget ("uploadfs" , target_firm , upload_actions , "Upload Filesystem Image" )
404
+ env .AddPlatformTarget (
405
+ "uploadfsota" , target_firm , upload_actions , "Upload Filesystem Image OTA" )
398
406
399
407
#
400
408
# Target: Erase Flash
401
409
#
402
410
403
- AlwaysBuild (
404
- env .Alias ("erase" , None , [
405
- env .VerboseAction (env .AutodetectUploadPort ,
406
- "Looking for serial port..." ),
411
+ env .AddPlatformTarget (
412
+ "erase" ,
413
+ None ,
414
+ [
415
+ env .VerboseAction (env .AutodetectUploadPort , "Looking for serial port..." ),
407
416
env .VerboseAction ("$ERASECMD" , "Erasing..." )
408
- ]))
417
+ ],
418
+ "Erase Flash" ,
419
+ )
409
420
410
421
#
411
422
# Information about obsolete method of specifying linker scripts
0 commit comments