mirror of
https://github.com/xoseperez/espurna.git
synced 2026-03-13 03:37:05 +01:00
pio: major version option renames
This commit is contained in:
@@ -21,7 +21,7 @@ import shlex
|
||||
import configparser
|
||||
import collections
|
||||
|
||||
Build = collections.namedtuple("Build", "env extends build_flags src_build_flags")
|
||||
Build = collections.namedtuple("Build", "env extends build_flags build_src_flags")
|
||||
|
||||
|
||||
def expand_variables(cfg, value):
|
||||
@@ -47,7 +47,7 @@ def get_builds(cfg):
|
||||
continue
|
||||
|
||||
build_flags = None
|
||||
src_build_flags = None
|
||||
build_src_flags = None
|
||||
|
||||
try:
|
||||
build_flags = cfg.get(section, "build_flags")
|
||||
@@ -59,9 +59,9 @@ def get_builds(cfg):
|
||||
pass
|
||||
|
||||
try:
|
||||
src_build_flags = cfg.get(section, "src_build_flags")
|
||||
src_build_flags = RE_NEWLINE.sub(" ", src_build_flags).strip()
|
||||
src_build_flags = expand_variables(cfg, src_build_flags)
|
||||
build_src_flags = cfg.get(section, "build_src_flags")
|
||||
build_src_flags = RE_NEWLINE.sub(" ", build_src_flags).strip()
|
||||
build_src_flags = expand_variables(cfg, build_src_flags)
|
||||
except configparser.NoOptionError:
|
||||
pass
|
||||
|
||||
@@ -69,7 +69,7 @@ def get_builds(cfg):
|
||||
section.replace("env:", ""),
|
||||
cfg.get(section, "extends").replace("env:", ""),
|
||||
build_flags,
|
||||
src_build_flags,
|
||||
build_src_flags,
|
||||
)
|
||||
|
||||
|
||||
@@ -92,8 +92,8 @@ def generate_lines(builds, ignore):
|
||||
flags = []
|
||||
if build.build_flags:
|
||||
flags.append('PLATFORMIO_BUILD_FLAGS="{}"'.format(build.build_flags))
|
||||
if build.src_build_flags:
|
||||
flags.append('ESPURNA_FLAGS="{}"'.format(build.src_build_flags))
|
||||
if build.build_src_flags:
|
||||
flags.append('ESPURNA_FLAGS="{}"'.format(build.build_src_flags))
|
||||
flags.append('ESPURNA_BUILD_NAME="{env}"'.format(env=build.env))
|
||||
|
||||
cmd = ["env"]
|
||||
@@ -104,7 +104,7 @@ def generate_lines(builds, ignore):
|
||||
|
||||
# push core variants to the front as they definetly include global build_flags
|
||||
output = generic
|
||||
if "ESPURNA_CORE" in build.src_build_flags:
|
||||
if "ESPURNA_CORE" in build.build_src_flags:
|
||||
output = cores
|
||||
|
||||
output.append(line)
|
||||
|
||||
@@ -99,7 +99,7 @@ def run(prefix, env, modules, debug):
|
||||
flags = " ".join("-D{}_SUPPORT={:d}".format(k, v) for k, v in modules.items())
|
||||
|
||||
os_env = os.environ.copy()
|
||||
os_env["PLATFORMIO_SRC_BUILD_FLAGS"] = flags
|
||||
os_env["PLATFORMIO_BUILD_SRC_FLAGS"] = flags
|
||||
os_env["PLATFORMIO_BUILD_CACHE_DIR"] = "test/pio_cache"
|
||||
|
||||
command = [os.path.join(prefix, "platformio"), "run"]
|
||||
|
||||
@@ -54,7 +54,7 @@ if "DISABLE_POSTMORTEM_STACKDUMP" in env["CPPFLAGS"]:
|
||||
app_inject_version(projenv)
|
||||
|
||||
# handle ESPURNA_BOARD and ESPURNA_FLAGS here, since projenv is not available in pre-scripts
|
||||
# TODO: prefer PLATFORMIO_SRC_BUILD_FLAGS instead? both of these only allow -D...
|
||||
# TODO: prefer PLATFORMIO_BUILD_SRC_FLAGS instead? both of these only allow -D...
|
||||
app_inject_flags(projenv)
|
||||
|
||||
# handle when CI does a tagged build or user explicitly asked to store the firmware.bin
|
||||
|
||||
@@ -55,7 +55,7 @@ def build_configurations(args, configurations):
|
||||
if not args.no_single_source:
|
||||
os_env["ESPURNA_BUILD_SINGLE_SOURCE"] = "1"
|
||||
|
||||
os_env["PLATFORMIO_SRC_BUILD_FLAGS"] = " ".join(
|
||||
os_env["PLATFORMIO_BUILD_SRC_FLAGS"] = " ".join(
|
||||
[
|
||||
'-DMANUFACTURER=\\"TEST_BUILD\\"',
|
||||
'-DDEVICE=\\"{}\\"'.format(cfg.stem.replace(" ", "_").upper()),
|
||||
|
||||
Reference in New Issue
Block a user