forked from platformio/platformio-core
Refactor PLATFORM and FRAMEWORK build variables with PIO prefix
This commit is contained in:
1 parent
daac1b2590
commit
8eed54ca45
9 files changed
+18
-11
No files matched your search
@@ -29,7 +29,7 @@ def initDevPlatform(name):
|
||||
|
||||
def DevPlatform(env):
|
||||
variables = {}
|
||||
for key in ("board", "framework"):
|
||||
for key in ("board", "pioframework"):
|
||||
if key not in env:
|
||||
continue
|
||||
variables[key] = env[key.upper()]
|
||||
|
||||
@@ -35,7 +35,7 @@ class LibBuilderFactory(object):
|
||||
clsname = "PlatformIOLibBuilder"
|
||||
else:
|
||||
env_frameworks = [
|
||||
f.lower().strip() for f in env.get("FRAMEWORK", "").split(",")]
|
||||
f.lower().strip() for f in env.get("PIOFRAMEWORK", "").split(",")]
|
||||
used_frameworks = LibBuilderFactory.get_used_frameworks(env, path)
|
||||
common_frameworks = set(env_frameworks) & set(used_frameworks)
|
||||
if common_frameworks:
|
||||
@@ -328,7 +328,7 @@ def GetLibBuilders(env):
|
||||
items = []
|
||||
libs_dirs = []
|
||||
env_frameworks = [
|
||||
f.lower().strip() for f in env.get("FRAMEWORK", "").split(",")]
|
||||
f.lower().strip() for f in env.get("PIOFRAMEWORK", "").split(",")]
|
||||
|
||||
for key in ("LIB_EXTRA_DIRS", "LIBSOURCE_DIRS"):
|
||||
for d in env.get(key, []):
|
||||
|
||||
@@ -185,7 +185,7 @@ def DumpIDEData(env):
|
||||
defines.append(env_.subst(item).replace('\\"', '"'))
|
||||
|
||||
# special symbol for Atmel AVR MCU
|
||||
if env.subst("$PLATFORM") == "atmelavr":
|
||||
if env['PIOPLATFORM'] == "atmelavr":
|
||||
defines.append(
|
||||
"__AVR_%s__" % env.BoardConfig().get("build.mcu").upper()
|
||||
.replace("ATMEGA", "ATmega")
|
||||
|
||||
@@ -122,7 +122,7 @@ void output_complete(void)
|
||||
print("Warning: Could not remove temporary file '%s'. "
|
||||
"Please remove it manually." % file_)
|
||||
|
||||
framework = env.subst("$FRAMEWORK").lower()
|
||||
framework = env.subst("$PIOFRAMEWORK").lower()
|
||||
if framework not in FRAMEWORK_PARAMETERS:
|
||||
env.Exit(
|
||||
"Error: %s framework doesn't support testing feature!" % framework)
|
||||
|
||||
@@ -114,7 +114,7 @@ def AutodetectUploadPort(*args, **kwargs): # pylint: disable=unused-argument
|
||||
print env.subst("Manually specified: $UPLOAD_PORT")
|
||||
return
|
||||
|
||||
if env.subst("$FRAMEWORK") == "mbed":
|
||||
if env.subst("$PIOFRAMEWORK") == "mbed":
|
||||
env.Replace(UPLOAD_PORT=_look_for_mbed_disk())
|
||||
else:
|
||||
if (system() == "Linux" and
|
||||
|
||||
@@ -53,9 +53,9 @@ def BuildProgram(env):
|
||||
# apply user flags
|
||||
env.ProcessFlags(env.get("BUILD_FLAGS"))
|
||||
|
||||
if env.get("FRAMEWORK"):
|
||||
if env.get("PIOFRAMEWORK"):
|
||||
env.BuildFrameworks([
|
||||
f.lower().strip() for f in env.get("FRAMEWORK", "").split(",")])
|
||||
f.lower().strip() for f in env['PIOFRAMEWORK'].split(",")])
|
||||
|
||||
# restore PIO macros if it was deleted by framework
|
||||
_append_pio_macros()
|
||||
|
||||
Reference in new issue
Block a user