mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-29 17:47:14 +02:00
Ignore "[platformio]" section from custom project configuration CI
This commit is contained in:
@ -15,6 +15,9 @@ PlatformIO 2.0
|
||||
* Improved project generator for `CLion IDE <http://docs.platformio.org/en/latest/ide/clion.html>`__
|
||||
* Auto-remove project cache when PlatformIO is upgraded
|
||||
* Keep user changes for ``.gitignore`` file when re-generate/update project data
|
||||
* Ignore ``[platformio]`` section from custom project configuration file when
|
||||
`platformio ci --project-conf <http://docs.platformio.org/en/latest/userguide/cmd_ci.html>`__
|
||||
command is used
|
||||
* Fixed missed ``--boot`` flag for the firmware uploader for ATSAM3X8E
|
||||
Cortex-M3 MCU based boards (Arduino Due, etc)
|
||||
(`issue #710 <https://github.com/platformio/platformio/issues/710>`_)
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
import sys
|
||||
|
||||
VERSION = (2, 11, "1b1")
|
||||
VERSION = (2, 11, "1b2")
|
||||
__version__ = ".".join([str(s) for s in VERSION])
|
||||
|
||||
__title__ = "platformio"
|
||||
|
@ -27,6 +27,12 @@ from platformio.commands.run import cli as cmd_run
|
||||
from platformio.exception import CIBuildEnvsEmpty
|
||||
from platformio.util import get_boards
|
||||
|
||||
# pylint: disable=wrong-import-order
|
||||
try:
|
||||
from configparser import ConfigParser
|
||||
except ImportError:
|
||||
from ConfigParser import ConfigParser
|
||||
|
||||
|
||||
def validate_path(ctx, param, value): # pylint: disable=W0613
|
||||
invalid_path = None
|
||||
@ -91,7 +97,7 @@ def cli(ctx, src, lib, exclude, board, # pylint: disable=R0913
|
||||
_copy_contents(join(build_dir, dir_name), contents)
|
||||
|
||||
if project_conf and isfile(project_conf):
|
||||
copyfile(project_conf, join(build_dir, "platformio.ini"))
|
||||
_copy_project_conf(build_dir, project_conf)
|
||||
elif not board:
|
||||
raise CIBuildEnvsEmpty()
|
||||
|
||||
@ -157,3 +163,12 @@ def _exclude_contents(dst_dir, patterns):
|
||||
rmtree(path)
|
||||
elif isfile(path):
|
||||
remove(path)
|
||||
|
||||
|
||||
def _copy_project_conf(build_dir, project_conf):
|
||||
cp = ConfigParser()
|
||||
cp.read(project_conf)
|
||||
if cp.has_section("platformio"):
|
||||
cp.remove_section("platformio")
|
||||
with open(join(build_dir, "platformio.ini"), "w") as fp:
|
||||
cp.write(fp)
|
||||
|
Reference in New Issue
Block a user