Skip to content

Commit 60f0f77

Browse files
committed
Merge branch 'release/v4.0.3'
2 parents 54f14c6 + 9f1dd3d commit 60f0f77

File tree

26 files changed

+197
-133
lines changed

26 files changed

+197
-133
lines changed

HISTORY.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@ Release Notes
66
PlatformIO 4.0
77
--------------
88

9+
4.0.3 (2019-08-30)
10+
~~~~~~~~~~~~~~~~~~
11+
12+
* Added support for multi-environment PlatformIO project for `CLion IDE <http://docs.platformio.org/page/ide/clion.html>`__ (`issue #2824 <https://github.com/platformio/platformio-core/issues/2824>`_)
13+
* Generate ``.ccls`` LSP file for `Vim <http://docs.platformio.org/en/page/vim.html>`__ cross references, hierarchies, completion and semantic highlighting (`issue #2952 <https://github.com/platformio/platformio-core/issues/2952>`_)
14+
* Added support for `PLATFORMIO_DISABLE_COLOR <http://docs.platformio.org/page/envvars.html#envvar-PLATFORMIO_DISABLE_COLOR>`__ system environment variable which disables color ANSI-codes in a terminal output (`issue #2956 <https://github.com/platformio/platformio-core/issues/2956>`_)
15+
* Updated SCons tool to 3.1.1
16+
* Remove ProjectConfig cache when "platformio.ini" was modified outside
17+
* Fixed an issue with PIO Unified Debugger on Windows OS when debug server is piped
18+
* Fixed an issue when `--upload-port <http://docs.platformio.org/page/userguide/cmd_run.html#cmdoption-platformio-run-upload-port>`__ CLI flag does not override declared `upload_port <http://docs.platformio.org/page/projectconf/section_env_upload.html#upload-port>`__ option in `"platformio.ini" (Project Configuration File) <https://docs.platformio.org/page/projectconf.html>`__
19+
920
4.0.2 (2019-08-23)
1021
~~~~~~~~~~~~~~~~~~
1122

platformio/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
VERSION = (4, 0, 2)
15+
VERSION = (4, 0, 3)
1616
__version__ = ".".join([str(s) for s in VERSION])
1717

1818
__title__ = "platformio"

platformio/__main__.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,15 @@ def configure():
5555
except (AttributeError, ImportError):
5656
pass
5757

58-
# handle PLATFORMIO_FORCE_COLOR
59-
if str(os.getenv("PLATFORMIO_FORCE_COLOR", "")).lower() == "true":
60-
try:
58+
try:
59+
if str(os.getenv("PLATFORMIO_DISABLE_COLOR", "")).lower() == "true":
60+
# pylint: disable=protected-access
61+
click._compat.isatty = lambda stream: False
62+
elif str(os.getenv("PLATFORMIO_FORCE_COLOR", "")).lower() == "true":
6163
# pylint: disable=protected-access
6264
click._compat.isatty = lambda stream: True
63-
except: # pylint: disable=bare-except
64-
pass
65+
except: # pylint: disable=bare-except
66+
pass
6567

6668
# Handle IOError issue with VSCode's Terminal (Windows)
6769
click_echo_origin = [click.echo, click.secho]

platformio/builder/tools/pioide.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ def DumpIDEData(env, projenv):
140140
LINTCXXCOM = "$CXXFLAGS $CCFLAGS $CPPFLAGS"
141141

142142
data = {
143+
"env_name":
144+
env['PIOENV'],
143145
"libsource_dirs": [env.subst(l) for l in env.GetLibSourceDirs()],
144146
"defines":
145147
_dump_defines(env),

platformio/builder/tools/piolib.py

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -300,20 +300,8 @@ def get_search_files(self):
300300
])
301301
return items
302302

303-
def _validate_search_files(self, search_files=None):
304-
if not search_files:
305-
search_files = []
306-
assert isinstance(search_files, list)
307-
308-
_search_files = []
309-
for path in search_files:
310-
if path not in self._processed_files:
311-
_search_files.append(path)
312-
self._processed_files.append(path)
313-
314-
return _search_files
315-
316-
def _get_found_includes(self, search_files=None):
303+
def _get_found_includes( # pylint: disable=too-many-branches
304+
self, search_files=None):
317305
# all include directories
318306
if not LibBuilderBase._INCLUDE_DIRS_CACHE:
319307
LibBuilderBase._INCLUDE_DIRS_CACHE = []
@@ -326,14 +314,23 @@ def _get_found_includes(self, search_files=None):
326314
include_dirs.extend(LibBuilderBase._INCLUDE_DIRS_CACHE)
327315

328316
result = []
329-
for path in self._validate_search_files(search_files):
317+
for path in (search_files or []):
318+
if path in self._processed_files:
319+
continue
320+
self._processed_files.append(path)
321+
330322
try:
331323
assert "+" in self.lib_ldf_mode
332324
candidates = LibBuilderBase.CCONDITIONAL_SCANNER(
333325
self.env.File(path),
334326
self.env,
335327
tuple(include_dirs),
336328
depth=self.CCONDITIONAL_SCANNER_DEPTH)
329+
# mark candidates already processed via Conditional Scanner
330+
self._processed_files.extend([
331+
c.get_abspath() for c in candidates
332+
if c.get_abspath() not in self._processed_files
333+
])
337334
except Exception as e: # pylint: disable=broad-except
338335
if self.verbose and "+" in self.lib_ldf_mode:
339336
sys.stderr.write(

platformio/builder/tools/pioproject.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ def GetProjectOption(env, option, default=None):
3232
def LoadProjectOptions(env):
3333
for option, value in env.GetProjectOptions():
3434
option_meta = ProjectOptions.get("env." + option)
35-
if not option_meta or not option_meta.buildenvvar:
35+
if (not option_meta or not option_meta.buildenvvar
36+
or option_meta.buildenvvar in env):
3637
continue
3738
env[option_meta.buildenvvar] = value
3839

platformio/commands/debug/helpers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from io import BytesIO
2020
from os.path import isfile
2121

22-
from platformio import exception, util
22+
from platformio import exception, fs, util
2323
from platformio.commands.platform import \
2424
platform_install as cmd_platform_install
2525
from platformio.commands.run import cli as cmd_run
@@ -165,11 +165,11 @@ def configure_esp32_load_cmds(debug_options, configuration):
165165

166166
mon_cmds = [
167167
'monitor program_esp32 "{{{path}}}" {offset} verify'.format(
168-
path=item['path'], offset=item['offset'])
168+
path=fs.to_unix_path(item['path']), offset=item['offset'])
169169
for item in configuration.get("flash_extra_images")
170170
]
171171
mon_cmds.append('monitor program_esp32 "{%s.bin}" 0x10000 verify' %
172-
configuration['prog_path'][:-4])
172+
fs.to_unix_path(configuration['prog_path'][:-4]))
173173
return mon_cmds
174174

175175

platformio/commands/debug/process.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import click
1818
from twisted.internet import protocol # pylint: disable=import-error
1919

20+
from platformio import fs
2021
from platformio.compat import string_types
2122
from platformio.proc import get_pythonexe_path
2223
from platformio.project.helpers import get_project_core_dir
@@ -38,6 +39,10 @@ def apply_patterns(self, source, patterns=None):
3839
_patterns = self.COMMON_PATTERNS.copy()
3940
_patterns.update(patterns or {})
4041

42+
for key, value in _patterns.items():
43+
if key.endswith(("_DIR", "_PATH")):
44+
_patterns[key] = fs.to_unix_path(value)
45+
4146
def _replace(text):
4247
for key, value in _patterns.items():
4348
pattern = "$%s" % key

0 commit comments

Comments
 (0)