Skip to content

Commit f8d59ee

Browse files
committed
Merge branch 'release/v1.12.3'
2 parents f23e08e + 9e48b6b commit f8d59ee

File tree

4 files changed

+63
-14
lines changed

4 files changed

+63
-14
lines changed

.github/workflows/examples.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Examples
22

3-
on: [push]
3+
on: [push, pull_request]
44

55
jobs:
66
build:

builder/compat.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Copyright 2014-present PlatformIO <[email protected]>
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
from SCons.Script import AlwaysBuild, Import
16+
17+
18+
Import("env")
19+
20+
21+
# Added in PIO Core 4.4.0
22+
if not hasattr(env, "AddPlatformTarget"):
23+
24+
def AddPlatformTarget(
25+
env,
26+
name,
27+
dependencies,
28+
actions,
29+
title=None,
30+
description=None,
31+
always_build=True,
32+
):
33+
target = env.Alias(name, dependencies, actions)
34+
if always_build:
35+
AlwaysBuild(target)
36+
return target
37+
38+
env.AddMethod(AddPlatformTarget)

builder/main.py

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ def __fetch_spiffs_size(target, source, env):
128128

129129

130130
env = DefaultEnvironment()
131+
env.SConscript("compat.py", exports="env")
131132
platform = env.PioPlatform()
132133
board = env.BoardConfig()
133134
mcu = board.get("build.mcu", "esp32")
@@ -210,7 +211,7 @@ def __fetch_spiffs_size(target, source, env):
210211
# Target: Build executable and linkable firmware or SPIFFS image
211212
#
212213

213-
target_elf = env.BuildProgram()
214+
target_elf = None
214215
if "nobuild" in COMMAND_LINE_TARGETS:
215216
target_elf = join("$BUILD_DIR", "${PROGNAME}.elf")
216217
if set(["uploadfs", "uploadfsota"]) & set(COMMAND_LINE_TARGETS):
@@ -219,15 +220,16 @@ def __fetch_spiffs_size(target, source, env):
219220
else:
220221
target_firm = join("$BUILD_DIR", "${PROGNAME}.bin")
221222
else:
223+
target_elf = env.BuildProgram()
222224
if set(["buildfs", "uploadfs", "uploadfsota"]) & set(COMMAND_LINE_TARGETS):
223225
target_firm = env.DataToBin(
224226
join("$BUILD_DIR", "${ESP32_SPIFFS_IMAGE_NAME}"), "$PROJECTDATA_DIR")
225227
AlwaysBuild(target_firm)
226-
AlwaysBuild(env.Alias("buildfs", target_firm))
227228
else:
228229
target_firm = env.ElfToBin(
229230
join("$BUILD_DIR", "${PROGNAME}"), target_elf)
230231

232+
env.AddPlatformTarget("buildfs", target_firm, None, "Build Filesystem Image")
231233
AlwaysBuild(env.Alias("nobuild", target_firm))
232234
target_buildprog = env.Alias("buildprog", target_firm, target_firm)
233235

@@ -246,10 +248,13 @@ def __fetch_spiffs_size(target, source, env):
246248
# Target: Print binary size
247249
#
248250

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+
)
253258

254259
#
255260
# Target: Upload firmware or SPIFFS image
@@ -394,18 +399,24 @@ def __fetch_spiffs_size(target, source, env):
394399
else:
395400
sys.stderr.write("Warning! Unknown upload protocol %s\n" % upload_protocol)
396401

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")
398406

399407
#
400408
# Target: Erase Flash
401409
#
402410

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..."),
407416
env.VerboseAction("$ERASECMD", "Erasing...")
408-
]))
417+
],
418+
"Erase Flash",
419+
)
409420

410421
#
411422
# Information about obsolete method of specifying linker scripts

platform.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"type": "git",
1313
"url": "https://github.com/platformio/platform-espressif32.git"
1414
},
15-
"version": "1.12.2",
15+
"version": "1.12.3",
1616
"packageRepositories": [
1717
"https://dl.bintray.com/platformio/dl-packages/manifest.json",
1818
"http://dl.platformio.org/packages/manifest.json",

0 commit comments

Comments
 (0)