diff --git a/platformio/builder/main.py b/platformio/builder/main.py index 3fbb0d58..1f4dd490 100644 --- a/platformio/builder/main.py +++ b/platformio/builder/main.py @@ -34,8 +34,8 @@ commonvars.AddVariables( ("EXTRA_SCRIPT",), ("PIOENV",), ("PIOTEST",), - ("PLATFORM",), - ("FRAMEWORK",), + ("PIOPLATFORM",), + ("PIOFRAMEWORK",), # build options ("BUILD_FLAGS",), diff --git a/platformio/builder/tools/devplatform.py b/platformio/builder/tools/devplatform.py index 5004c0c7..deaa017e 100644 --- a/platformio/builder/tools/devplatform.py +++ b/platformio/builder/tools/devplatform.py @@ -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()] diff --git a/platformio/builder/tools/piolib.py b/platformio/builder/tools/piolib.py index 6a06f985..d00f0c08 100644 --- a/platformio/builder/tools/piolib.py +++ b/platformio/builder/tools/piolib.py @@ -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, []): diff --git a/platformio/builder/tools/piomisc.py b/platformio/builder/tools/piomisc.py index 4280d353..94b2b4d6 100644 --- a/platformio/builder/tools/piomisc.py +++ b/platformio/builder/tools/piomisc.py @@ -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") diff --git a/platformio/builder/tools/piotest.py b/platformio/builder/tools/piotest.py index db1e1886..af820dc4 100644 --- a/platformio/builder/tools/piotest.py +++ b/platformio/builder/tools/piotest.py @@ -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) diff --git a/platformio/builder/tools/pioupload.py b/platformio/builder/tools/pioupload.py index 88b1d4ff..198885cd 100644 --- a/platformio/builder/tools/pioupload.py +++ b/platformio/builder/tools/pioupload.py @@ -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 diff --git a/platformio/builder/tools/platformio.py b/platformio/builder/tools/platformio.py index 601b43e5..f1963f36 100644 --- a/platformio/builder/tools/platformio.py +++ b/platformio/builder/tools/platformio.py @@ -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() diff --git a/platformio/commands/run.py b/platformio/commands/run.py index a678ceae..f23e35ac 100644 --- a/platformio/commands/run.py +++ b/platformio/commands/run.py @@ -97,6 +97,11 @@ def cli(ctx, environment, target, upload_port, # pylint: disable=R0913,R0914 class EnvironmentProcessor(object): + REMAPED_OPTIONS = { + "FRAMEWORK": "PIOFRAMEWORK", + "PLATFORM": "PIOPLATFORM" + } + RENAMED_OPTIONS = { "INSTALL_LIBS": "LIB_INSTALL", "IGNORE_LIBS": "LIB_IGNORE", @@ -158,6 +163,8 @@ class EnvironmentProcessor(object): if self.upload_port: variables['upload_port'] = self.upload_port for k, v in self.options.items(): + if k.upper() in self.REMAPED_OPTIONS: + k = self.REMAPED_OPTIONS[k.upper()] k = k.lower() if k == "targets" or (k == "upload_port" and self.upload_port): continue diff --git a/platformio/managers/platform.py b/platformio/managers/platform.py index 16cf6c86..d0d83b93 100644 --- a/platformio/managers/platform.py +++ b/platformio/managers/platform.py @@ -440,7 +440,7 @@ class PlatformBase(PlatformPackagesMixin, PlatformRunMixin): def configure_default_packages(self, variables, targets): # enbale used frameworks - for framework in variables.get("framework", "").split(","): + for framework in variables.get("pioframework", "").split(","): if not self.frameworks: continue framework = framework.lower().strip()