Browse Source

pio: make sure "y" for shared libs still works

And update other options to support y, yes and true
pull/2471/head
Maxim Prokhorov 2 years ago
parent
commit
bacff3102d
3 changed files with 10 additions and 5 deletions
  1. +1
    -1
      .github/workflows/push.yml
  2. +1
    -1
      code/ota.py
  3. +8
    -3
      code/scripts/pio_pre.py

+ 1
- 1
.github/workflows/push.yml View File

@ -47,7 +47,7 @@ jobs:
build:
runs-on: ubuntu-latest
env:
ESPURNA_PIO_SHARED_LIBRARIES: "y"
ESPURNA_PIO_SHARED_LIBRARIES: "1"
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2


+ 1
- 1
code/ota.py View File

@ -301,7 +301,7 @@ def run(device, env):
environ["ESPURNA_BOARD"] = device["board"]
environ["ESPURNA_AUTH"] = device["auth"]
environ["ESPURNA_FLAGS"] = device["flags"]
environ["ESPURNA_PIO_SHARED_LIBRARIES"] = "y"
environ["ESPURNA_PIO_SHARED_LIBRARIES"] = "1"
command = ("platformio", "run", "--silent", "--environment", env, "-t", "upload")
subprocess.check_call(command, env=environ)


+ 8
- 3
code/scripts/pio_pre.py View File

@ -21,7 +21,12 @@ from SCons.Script import ARGUMENTS
from espurna_utils.build import merge_cpp
CI = "true" == os.environ.get("CI", "false")
def check_env(name, default):
return os.environ.get(name, default) in ("1", "y", "yes", "true")
CI = check_env("CI", "false")
PIO_PLATFORM = env.PioPlatform()
CONFIG = env.GetProjectConfig()
VERBOSE = "1" == ARGUMENTS.get("PIOVERBOSE", "0")
@ -110,7 +115,7 @@ if CI:
break
# to speed-up build process, install libraries in a way they are shared between our envs
if "1" == os.environ.get("ESPURNA_PIO_SHARED_LIBRARIES", "0"):
if check_env("ESPURNA_PIO_SHARED_LIBRARIES", "0"):
storage = get_shared_libdeps_dir("common", "shared_libdeps_dir")
subprocess_libdeps(env.GetProjectOption("lib_deps"), storage, verbose=VERBOSE)
@ -125,7 +130,7 @@ if len(ino) == 1 and ino[0].name == "espurna.ino":
env.AddMethod(ConvertInoToCpp)
# merge every .cpp into a single file and **only** build that single file
if "1" == os.environ.get("ESPURNA_BUILD_SINGLE_SOURCE", "0"):
if check_env("ESPURNA_BUILD_SINGLE_SOURCE", "0"):
cpp_files = []
for root, dirs, filenames in os.walk("espurna"):
for name in filenames:


Loading…
Cancel
Save