Ejemplo n.º 1
0
    if k not in environ:
        continue
    if var in ("UPLOAD_PORT", "EXTRA_SCRIPT") or not env.get(var):
        env[var] = environ.get(k)
    else:
        env[var] = "%s%s%s" % (environ.get(k), ", "
                               if var == "LIB_EXTRA_DIRS" else " ", env[var])

# Parse comma separated items
for opt in ("PIOFRAMEWORK", "LIB_DEPS", "LIB_IGNORE", "LIB_EXTRA_DIRS"):
    if opt not in env:
        continue
    env[opt] = [l.strip() for l in env[opt].split(", ") if l.strip()]

# Configure extra library source directories for LDF
if util.get_project_optional_dir("lib_extra_dirs"):
    env.Prepend(LIBSOURCE_DIRS=[
        l.strip()
        for l in util.get_project_optional_dir("lib_extra_dirs").split(", ")
        if l.strip()
    ])
env.Prepend(LIBSOURCE_DIRS=env.get("LIB_EXTRA_DIRS", []))

env.LoadPioPlatform(commonvars)

env.SConscriptChdir(0)
env.SConsignFile(join("$PROJECTPIOENVS_DIR", ".sconsign.dblite"))
env.SConscript("$BUILD_SCRIPT")

AlwaysBuild(env.Alias("__test", DEFAULT_TARGETS + ["size"]))
Ejemplo n.º 2
0
    if var in ("UPLOAD_PORT", "EXTRA_SCRIPT") or not env.get(var):
        env[var] = environ.get(k)
    elif isinstance(env[var], list):
        env.Append(**{var: environ.get(k)})
    else:
        env[var] = "%s%s%s" % (environ.get(k), ", "
                               if var == "LIB_EXTRA_DIRS" else " ", env[var])

# Parse comma separated items
for opt in ("PIOFRAMEWORK", "LIB_DEPS", "LIB_IGNORE", "LIB_EXTRA_DIRS"):
    if opt not in env or isinstance(env[opt], list):
        continue
    env[opt] = [l.strip() for l in env[opt].split(", ") if l.strip()]

# Configure extra library source directories for LDF
if util.get_project_optional_dir("lib_extra_dirs"):
    items = util.get_project_optional_dir("lib_extra_dirs")
    env.Prepend(LIBSOURCE_DIRS=[
        l.strip() for l in items.split("\n" if "\n" in items else ", ")
        if l.strip()
    ])
env.Prepend(LIBSOURCE_DIRS=env.get("LIB_EXTRA_DIRS", []))

env.LoadPioPlatform(commonvars)

env.SConscriptChdir(0)
env.SConsignFile(join("$PROJECTPIOENVS_DIR", ".sconsign.dblite"))
env.SConscript("$BUILD_SCRIPT")

AlwaysBuild(env.Alias("__debug", DEFAULT_TARGETS + ["size"]))
AlwaysBuild(env.Alias("__test", DEFAULT_TARGETS + ["size"]))
Ejemplo n.º 3
0
elif not int(ARGUMENTS.get("PIOVERBOSE", 0)):
    print "Verbose mode can be enabled via `-v, --verbose` option"

# Handle custom variables from system environment
for var in ("BUILD_FLAGS", "SRC_BUILD_FLAGS", "SRC_FILTER", "EXTRA_SCRIPTS",
            "UPLOAD_PORT", "UPLOAD_FLAGS", "LIB_EXTRA_DIRS"):
    k = "PLATFORMIO_%s" % var
    if k not in environ:
        continue
    if var in ("UPLOAD_PORT", ):
        env[var] = environ.get(k)
        continue
    env.Append(**{var: util.parse_conf_multi_values(environ.get(k))})

# Configure extra library source directories for LDF
if util.get_project_optional_dir("lib_extra_dirs"):
    env.Prepend(
        LIBSOURCE_DIRS=util.parse_conf_multi_values(
            util.get_project_optional_dir("lib_extra_dirs")))
env.Prepend(LIBSOURCE_DIRS=env.get("LIB_EXTRA_DIRS", []))
env['LIBSOURCE_DIRS'] = [
    expanduser(d) if d.startswith("~") else d for d in env['LIBSOURCE_DIRS']
]

env.LoadPioPlatform(commonvars)

env.SConscriptChdir(0)
env.SConsignFile(join("$PROJECTBUILD_DIR", ".sconsign.dblite"))

for item in env.GetPreExtraScripts():
    env.SConscript(item, exports="env")
Ejemplo n.º 4
0
elif not int(ARGUMENTS.get("PIOVERBOSE", 0)):
    print "Verbose mode can be enabled via `-v, --verbose` option"

# Handle custom variables from system environment
for var in ("BUILD_FLAGS", "SRC_BUILD_FLAGS", "SRC_FILTER", "EXTRA_SCRIPTS",
            "UPLOAD_PORT", "UPLOAD_FLAGS", "LIB_EXTRA_DIRS"):
    k = "PLATFORMIO_%s" % var
    if k not in environ:
        continue
    if var in ("UPLOAD_PORT", ):
        env[var] = environ.get(k)
        continue
    env.Append(**{var: util.parse_conf_multi_values(environ.get(k))})

# Configure extra library source directories for LDF
if util.get_project_optional_dir("lib_extra_dirs"):
    env.Prepend(LIBSOURCE_DIRS=util.parse_conf_multi_values(
        util.get_project_optional_dir("lib_extra_dirs")))
env.Prepend(LIBSOURCE_DIRS=env.get("LIB_EXTRA_DIRS", []))
env['LIBSOURCE_DIRS'] = [
    expanduser(d) if d.startswith("~") else d for d in env['LIBSOURCE_DIRS']
]

env.LoadPioPlatform(commonvars)

env.SConscriptChdir(0)
env.SConsignFile(join("$PROJECTPIOENVS_DIR", ".sconsign.dblite"))

for item in env.GetPreExtraScripts():
    env.SConscript(item, exports="env")
Ejemplo n.º 5
0
    "UPLOAD_PORT",
    "UPLOAD_FLAGS",
    "LIB_EXTRA_DIRS",
):
    k = "PLATFORMIO_%s" % var
    if environ.get(k):
        env[var] = environ.get(k)

# Parse comma separated items
for opt in ("PIOFRAMEWORK", "LIB_DEPS", "LIB_IGNORE", "LIB_EXTRA_DIRS"):
    if opt not in env:
        continue
    env[opt] = [l.strip() for l in env[opt].split(", ") if l.strip()]

# Configure extra library source directories for LDF
if util.get_project_optional_dir("lib_extra_dirs"):
    env.Prepend(
        LIBSOURCE_DIRS=[l.strip() for l in util.get_project_optional_dir("lib_extra_dirs").split(", ") if l.strip()]
    )
env.Prepend(LIBSOURCE_DIRS=env.get("LIB_EXTRA_DIRS", []))

env.LoadPioPlatform(commonvars)

env.SConscriptChdir(0)
env.SConsignFile(join("$PROJECTPIOENVS_DIR", ".sconsign.dblite"))
env.SConscript("$BUILD_SCRIPT")

AlwaysBuild(env.Alias("__test", DEFAULT_TARGETS + ["size"]))

if "UPLOAD_FLAGS" in env:
    env.Append(UPLOADERFLAGS=["$UPLOAD_FLAGS"])