Skip to content

Commit e37d34b

Browse files
committed
Merge branch 'release/3.6.5'
2 parents 4504080 + b562541 commit e37d34b

File tree

13 files changed

+82
-57
lines changed

13 files changed

+82
-57
lines changed

HISTORY.rst

+26-15
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@ Release Notes
44
PlatformIO 3.0
55
--------------
66

7+
3.6.5 (2019-03-07)
8+
~~~~~~~~~~~~~~~~~~
9+
10+
* Project Generator: added new targets for CLion IDE "BUILD_VERBOSE" and "MONITOR" (serial port monitor)
11+
(`issue #359 <https://github.com/platformio/platformio-core/issues/359>`_)
12+
* Fixed an issue with slow updating of PlatformIO Core packages on Windows
13+
* Fixed an issue when `platformio ci <https://docs.platformio.org/en/latest/userguide/cmd_ci.html>`__ recompiles project if ``--keep-build-dir`` option is passed
14+
(`issue #2109 <https://github.com/platformio/platformio-core/issues/2109>`_)
15+
* Fixed an issue when ``$PROJECT_HASH`` template was not expanded for the other directory ``***_dir`` options in `"platformio.ini" (Project Configuration File) <https://docs.platformio.org/page/projectconf.html>`__
16+
(`issue #2170 <https://github.com/platformio/platformio-core/issues/2170>`_)
17+
718
3.6.4 (2019-01-23)
819
~~~~~~~~~~~~~~~~~~
920

@@ -46,8 +57,8 @@ PlatformIO 3.0
4657
~~~~~~~~~~~~~~~~~~
4758

4859
* Generate an `include <http://docs.platformio.org/page/projectconf/section_platformio.html#include-dir>`__ and `test <http://docs.platformio.org/page/projectconf/section_platformio.html#test-dir>`__ directories with a README file when initializing a new project
49-
* Support in-line comments for multi-line value (``lib_deps``, ``build_flags``, etc) in `platformio.ini (Project Configuration File) <https://docs.platformio.org/page/projectconf.html>`__
50-
* Added ``$PROJECT_HASH`` template variable for `build_dir <http://docs.platformio.org/en/latest/projectconf/section_platformio.html#projectconf-pio-build-dir>`__. One of the use cases is setting a global storage for project artifacts using `PLATFORMIO_BUILD_DIR <http://docs.platformio.org/en/latest/envvars.html#envvar-PLATFORMIO_BUILD_DIR>`__ system environment variable. For example, ``/tmp/pio-build/$PROJECT_HASH`` (Unix) or ``%TEMP%/pio-build/$PROJECT_HASH`` (Windows)
60+
* Support in-line comments for multi-line value (``lib_deps``, ``build_flags``, etc) in `"platformio.ini" (Project Configuration File) <https://docs.platformio.org/page/projectconf.html>`__
61+
* Added ``$PROJECT_HASH`` template variable for `build_dir <http://docs.platformio.org/en/latest/projectconf/section_platformio.html#projectconf-pio-build-dir>`__. One of the use cases is setting a global storage for project artifacts using `PLATFORMIO_BUILD_DIR <http://docs.platformio.org/en/latest/envvars.html#envvar-PLATFORMIO_BUILD_DIR>`__ system environment variable. For example, ``/tmp/pio-build/$PROJECT_HASH`` (Unix) or ``$[sysenv.TEMP}/pio-build/$PROJECT_HASH`` (Windows)
5162
* Improved a loading speed of PIO Home "Recent News"
5263
* Improved `PIO Unified Debugger <https://docs.platformio.org/en/page/plus/debugging.html>`__ for "mbed" framework and fixed issue with missed local variables
5364
* Introduced `"Release" and "Debug" Build Configurations <http://docs.platformio.org/page/projectconf/build_configurations.html>`__
@@ -131,7 +142,7 @@ PlatformIO 3.0
131142

132143
* Simplify configuration for `PIO Unit Testing <https://docs.platformio.org/page/plus/unit-testing.html>`__: separate main program from a test build process, drop
133144
requirement for ``#ifdef UNIT_TEST`` guard
134-
* Override any option from board manifest in `platformio.ini (Project Configuration File) <https://docs.platformio.org/page/projectconf/section_env_board.html#more-options>`__
145+
* Override any option from board manifest in `"platformio.ini" (Project Configuration File) <https://docs.platformio.org/page/projectconf/section_env_board.html#more-options>`__
135146
(`issue #1612 <https://github.com/platformio/platformio-core/issues/1612>`_)
136147
* Configure a custom path to SVD file using `debug_svd_path <https://docs.platformio.org/page/projectconf/section_env_debug.html#debug-svd-path>`__
137148
option
@@ -194,7 +205,7 @@ PlatformIO 3.0
194205
(`issue #1274 <https://github.com/platformio/platformio-core/issues/1274>`_)
195206
* Configure a custom firmware/program name in build directory (`example <https://docs.platformio.org/page/projectconf/advanced_scripting.html#custom-firmware-program-name>`__)
196207
* Renamed ``envs_dir`` option to ``build_dir``
197-
in `platformio.ini (Project Configuration File) <https://docs.platformio.org/page/projectconf/section_platformio.html#build-dir>`__
208+
in `"platformio.ini" (Project Configuration File) <https://docs.platformio.org/page/projectconf/section_platformio.html#build-dir>`__
198209
* Refactored code without "arrow" dependency (resolve issue with "ImportError:
199210
No module named backports.functools_lru_cache")
200211
* Improved support of PIO Unified Debugger for Eclipse Oxygen
@@ -229,7 +240,7 @@ PlatformIO 3.0
229240
folder for project's header files
230241
(`issue #1107 <https://github.com/platformio/platformio-core/issues/1107>`_)
231242
* Depend on development platform using VCS URL (Git, Mercurial and Subversion)
232-
instead of a name in `platformio.ini (Project Configuration File) <https://docs.platformio.org/page/projectconf/section_env_general.html#platform>`__.
243+
instead of a name in `"platformio.ini" (Project Configuration File) <https://docs.platformio.org/page/projectconf/section_env_general.html#platform>`__.
233244
Drop support for ``*_stage`` dev/platform names (use VCS URL instead).
234245
* Reinstall/redownload package with a new ``-f, --force`` option for
235246
`platformio lib install <https://docs.platformio.org/page/userguide/lib/cmd_install.html>`__
@@ -250,7 +261,7 @@ PlatformIO 3.0
250261
- Parse library source file in pair with a header when they have the same name
251262
(`issue #1175 <https://github.com/platformio/platformio-core/issues/1175>`_)
252263
- Handle library dependencies defined as VCS or SemVer in
253-
`platformio.ini (Project Configuration File) <https://docs.platformio.org/page/projectconf/section_env_general.html#platform>`__
264+
`"platformio.ini" (Project Configuration File) <https://docs.platformio.org/page/projectconf/section_env_general.html#platform>`__
254265
(`issue #1155 <https://github.com/platformio/platformio-core/issues/1155>`_)
255266
- Added option to configure library `Compatible Mode <https://docs.platformio.org/page/librarymanager/ldf.html#compatibility-mode>`__
256267
using `library.json <https://docs.platformio.org/page/librarymanager/config.html>`__
@@ -286,7 +297,7 @@ PlatformIO 3.0
286297
* Use a root of library when filtering source code using
287298
`library.json <https://docs.platformio.org/page/librarymanager/config.html>`__
288299
and ``srcFilter`` field
289-
* Added ``monitor_*`` options to white-list for `platformio.ini (Project Configuration File) <https://docs.platformio.org/page/projectconf.html>`__
300+
* Added ``monitor_*`` options to white-list for `"platformio.ini" (Project Configuration File) <https://docs.platformio.org/page/projectconf.html>`__
290301
(`issue #982 <https://github.com/platformio/platformio-core/issues/982>`_)
291302
* Do not ask for board ID when initialize project for desktop platform
292303
* Handle broken PIO Core state and create new one
@@ -307,18 +318,18 @@ PlatformIO 3.0
307318
- Integration with `Eclipse <https://docs.platformio.org/page/ide/eclipse.html>`__ and `Sublime Text <https://docs.platformio.org/page/ide/sublimetext.html>`__
308319

309320
* Filter `PIO Unit Testing <https://docs.platformio.org/page/plus/unit-testing.html>`__
310-
tests using a new ``test_filter`` option in `platformio.ini (Project Configuration File) <https://docs.platformio.org/page/projectconf.html>`__
321+
tests using a new ``test_filter`` option in `"platformio.ini" (Project Configuration File) <https://docs.platformio.org/page/projectconf.html>`__
311322
or `platformio test --filter <https://docs.platformio.org/page/userguide/cmd_test.html#cmdoption-platformio-test-f>`__ command
312323
(`issue #934 <https://github.com/platformio/platformio-core/issues/934>`_)
313324
* Custom ``test_transport`` for `PIO Unit Testing <https://docs.platformio.org/page/plus/unit-testing.html>`__ Engine
314-
* Configure Serial Port Monitor in `platformio.ini (Project Configuration File) <https://docs.platformio.org/page/projectconf.html>`__
325+
* Configure Serial Port Monitor in `"platformio.ini" (Project Configuration File) <https://docs.platformio.org/page/projectconf.html>`__
315326
(`issue #787 <https://github.com/platformio/platformio-core/issues/787>`_)
316327
* New `monitor <https://docs.platformio.org/page/userguide/cmd_run.html#cmdoption-platformio-run-t>`__
317328
target which allows to launch Serial Monitor automatically after successful
318329
"build" or "upload" operations
319330
(`issue #788 <https://github.com/platformio/platformio-core/issues/788>`_)
320331
* Project generator for `VIM <https://docs.platformio.org/page/ide/vim.html>`__
321-
* Multi-line support for the different options in `platformio.ini (Project Configuration File) <https://docs.platformio.org/page/projectconf.html>`__,
332+
* Multi-line support for the different options in `"platformio.ini" (Project Configuration File) <https://docs.platformio.org/page/projectconf.html>`__,
322333
such as: ``build_flags``, ``build_unflags``, etc.
323334
(`issue #889 <https://github.com/platformio/platformio-core/issues/889>`_)
324335
* Handle dynamic ``SRC_FILTER`` environment variable from
@@ -330,7 +341,7 @@ PlatformIO 3.0
330341
that were installed from repository
331342
* Add support for ``.*cc`` extension
332343
(`issue #939 <https://github.com/platformio/platformio-core/issues/939>`_)
333-
* Handle ``env_default`` in `platformio.ini (Project Configuration File) <https://docs.platformio.org/page/projectconf.html>`__
344+
* Handle ``env_default`` in `"platformio.ini" (Project Configuration File) <https://docs.platformio.org/page/projectconf.html>`__
334345
when re-initializing a project
335346
(`issue #950 <https://github.com/platformio/platformio-core/issues/950>`_)
336347
* Use root directory for PIO Home when path contains non-ascii characters
@@ -428,10 +439,10 @@ PlatformIO 3.0
428439
(`issue #808 <https://github.com/platformio/platformio-core/issues/808>`_,
429440
`issue #467 <https://github.com/platformio/platformio-core/issues/467>`_)
430441
* Inject system environment variables to configuration settings in
431-
`platformio.ini (Project Configuration File) <https://docs.platformio.org/page/projectconf.html>`__
442+
`"platformio.ini" (Project Configuration File) <https://docs.platformio.org/page/projectconf.html>`__
432443
(`issue #792 <https://github.com/platformio/platformio-core/issues/792>`_)
433444
* Custom boards per project with ``boards_dir`` option in
434-
`platformio.ini (Project Configuration File) <https://docs.platformio.org/page/projectconf.html>`__
445+
`"platformio.ini" (Project Configuration File) <https://docs.platformio.org/page/projectconf.html>`__
435446
(`issue #515 <https://github.com/platformio/platformio-core/issues/515>`_)
436447
* Unix shell-style wildcards for `upload_port <https://docs.platformio.org/page/projectconf/section_env_upload.html#upload-port>`_
437448
(`issue #839 <https://github.com/platformio/platformio-core/issues/839>`_)
@@ -442,7 +453,7 @@ PlatformIO 3.0
442453
* Added new `LDF Modes <https://docs.platformio.org/page/librarymanager/ldf.html#ldf-mode>`__:
443454
``chain+`` and ``deep+`` and set ``chain+`` as default
444455
* Added global ``lib_extra_dirs`` option to ``[platformio]`` section for
445-
`platformio.ini (Project Configuration File) <https://docs.platformio.org/page/projectconf.html>`__
456+
`"platformio.ini" (Project Configuration File) <https://docs.platformio.org/page/projectconf.html>`__
446457
(`issue #842 <https://github.com/platformio/platformio-core/issues/842>`_)
447458
* Enabled caching by default for API requests and Library Manager (see `enable_cache <https://docs.platformio.org/page/userguide/cmd_settings.html#enable-cache>`__ setting)
448459
* Native integration with VIM/Neovim using `neomake-platformio <https://github.com/coddingtonbear/neomake-platformio>`__ plugin
@@ -465,7 +476,7 @@ PlatformIO 3.0
465476
3.1.0 (2016-09-19)
466477
~~~~~~~~~~~~~~~~~~
467478

468-
* New! Dynamic variables/templates for `platformio.ini (Project Configuration File) <https://docs.platformio.org/page/projectconf.html>`__
479+
* New! Dynamic variables/templates for `"platformio.ini" (Project Configuration File) <https://docs.platformio.org/page/projectconf.html>`__
469480
(`issue #705 <https://github.com/platformio/platformio-core/issues/705>`_)
470481
* Summary about processed environments
471482
(`issue #777 <https://github.com/platformio/platformio-core/issues/777>`_)

docs

Submodule docs updated 584 files

platformio/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
import sys
1616

17-
VERSION = (3, 6, 4)
17+
VERSION = (3, 6, 5)
1818
__version__ = ".".join([str(s) for s in VERSION])
1919

2020
__title__ = "platformio"

platformio/app.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -352,8 +352,8 @@ def get_cid():
352352
pass
353353
cid = str(
354354
uuid.UUID(
355-
bytes=hashlib.md5(str(_uid if _uid else uuid.getnode())).
356-
digest()))
355+
bytes=hashlib.md5(str(
356+
_uid if _uid else uuid.getnode())).digest()))
357357
if "windows" in util.get_systype() or os.getuid() > 0:
358358
set_state_item("cid", cid)
359359
return cid

platformio/builder/tools/pioplatform.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,10 @@ def LoadPioPlatform(env, variables):
9595
for key, value in variables.UnknownVariables().items():
9696
if not key.startswith("BOARD_"):
9797
continue
98-
env.Replace(
99-
**{key.upper().replace("BUILD.", ""): base64.b64decode(value)})
98+
env.Replace(**{
99+
key.upper().replace("BUILD.", ""):
100+
base64.b64decode(value)
101+
})
100102
return
101103

102104
# update board manifest with a custom data

platformio/commands/ci.py

+6-7
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def validate_path(ctx, param, value): # pylint: disable=unused-argument
7373
@click.option("-O", "--project-option", multiple=True)
7474
@click.option("-v", "--verbose", is_flag=True)
7575
@click.pass_context
76-
def cli( # pylint: disable=too-many-arguments
76+
def cli( # pylint: disable=too-many-arguments, too-many-branches
7777
ctx, src, lib, exclude, board, build_dir, keep_build_dir, project_conf,
7878
project_option, verbose):
7979

@@ -84,7 +84,11 @@ def cli( # pylint: disable=too-many-arguments
8484

8585
try:
8686
app.set_session_var("force_option", True)
87-
_clean_dir(build_dir)
87+
88+
if not keep_build_dir and isdir(build_dir):
89+
util.rmtree_(build_dir)
90+
if not isdir(build_dir):
91+
makedirs(build_dir)
8892

8993
for dir_name, patterns in dict(lib=lib, src=src).items():
9094
if not patterns:
@@ -116,11 +120,6 @@ def cli( # pylint: disable=too-many-arguments
116120
util.rmtree_(build_dir)
117121

118122

119-
def _clean_dir(dirpath):
120-
util.rmtree_(dirpath)
121-
makedirs(dirpath)
122-
123-
124123
def _copy_contents(dst_dir, contents):
125124
items = {"dirs": set(), "files": set()}
126125

platformio/commands/platform.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -365,8 +365,8 @@ def platform_update(platforms, only_packages, only_check, json_output):
365365
if not pkg_dir:
366366
continue
367367
latest = pm.outdated(pkg_dir, requirements)
368-
if (not latest and not PlatformFactory.newPlatform(pkg_dir).
369-
are_outdated_packages()):
368+
if (not latest and not PlatformFactory.newPlatform(
369+
pkg_dir).are_outdated_packages()):
370370
continue
371371
data = _get_installed_platform_data(
372372
pkg_dir, with_boards=False, expose_packages=False)

platformio/ide/tpls/clion/CMakeLists.txt.tpl

+12
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ add_custom_target(
99
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
1010
)
1111

12+
add_custom_target(
13+
PLATFORMIO_BUILD_VERBOSE ALL
14+
COMMAND ${PLATFORMIO_CMD} -f -c clion run --verbose
15+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
16+
)
17+
1218
add_custom_target(
1319
PLATFORMIO_UPLOAD ALL
1420
COMMAND ${PLATFORMIO_CMD} -f -c clion run --target upload
@@ -21,6 +27,12 @@ add_custom_target(
2127
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
2228
)
2329

30+
add_custom_target(
31+
PLATFORMIO_MONITOR ALL
32+
COMMAND ${PLATFORMIO_CMD} -f -c clion device monitor
33+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
34+
)
35+
2436
add_custom_target(
2537
PLATFORMIO_TEST ALL
2638
COMMAND ${PLATFORMIO_CMD} -f -c clion test

platformio/ide/tpls/clion/CMakeListsPrivate.txt.tpl

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# !!! WARNING !!!
2+
# PLEASE DO NOT MODIFY THIS FILE!
3+
# USE https://docs.platformio.org/page/projectconf/section_env_build.html#build-flags
4+
15
% def _normalize_path(path):
26
% if project_dir in path:
37
% path = path.replace(project_dir, "${CMAKE_CURRENT_LIST_DIR}")

platformio/managers/core.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,10 @@ def update_core_packages(only_check=False, silent=False):
106106

107107
def shutdown_piohome_servers():
108108
port = 8010
109-
while port < 8100:
109+
while port < 8050:
110110
try:
111-
requests.get("http://127.0.0.1:%d?__shutdown__=1" % port)
111+
requests.get(
112+
"http://127.0.0.1:%d?__shutdown__=1" % port, timeout=0.01)
112113
except: # pylint: disable=bare-except
113114
pass
114115
port += 1

platformio/managers/platform.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -633,10 +633,8 @@ def get_lib_storages(self):
633633
if not isdir(libcore_dir):
634634
continue
635635
storages.append({
636-
"name":
637-
"%s-core-%s" % (opts['package'], item),
638-
"path":
639-
libcore_dir
636+
"name": "%s-core-%s" % (opts['package'], item),
637+
"path": libcore_dir
640638
})
641639

642640
return storages

platformio/util.py

+18-20
Original file line numberDiff line numberDiff line change
@@ -203,28 +203,34 @@ def pioversion_to_intstr():
203203

204204

205205
def get_project_optional_dir(name, default=None):
206-
data = None
206+
paths = None
207207
var_name = "PLATFORMIO_%s" % name.upper()
208208
if var_name in os.environ:
209-
data = os.getenv(var_name)
209+
paths = os.getenv(var_name)
210210
else:
211211
try:
212212
config = load_project_config()
213213
if (config.has_section("platformio")
214214
and config.has_option("platformio", name)):
215-
data = config.get("platformio", name)
215+
paths = config.get("platformio", name)
216216
except exception.NotPlatformIOProject:
217217
pass
218218

219-
if not data:
219+
if not paths:
220220
return default
221221

222222
items = []
223-
for item in data.split(", "):
223+
for item in paths.split(", "):
224224
if item.startswith("~"):
225225
item = expanduser(item)
226226
items.append(abspath(item))
227-
return ", ".join(items)
227+
paths = ", ".join(items)
228+
229+
while "$PROJECT_HASH" in paths:
230+
paths = paths.replace("$PROJECT_HASH",
231+
sha1(get_project_dir()).hexdigest()[:10])
232+
233+
return paths
228234

229235

230236
def get_home_dir():
@@ -314,9 +320,6 @@ def get_projectboards_dir():
314320
def get_projectbuild_dir(force=False):
315321
path = get_project_optional_dir("build_dir",
316322
join(get_project_dir(), ".pioenvs"))
317-
if "$PROJECT_HASH" in path:
318-
path = path.replace("$PROJECT_HASH",
319-
sha1(get_project_dir()).hexdigest()[:10])
320323
try:
321324
if not isdir(path):
322325
os.makedirs(path)
@@ -565,16 +568,11 @@ def get_services(self):
565568
pass
566569

567570
items.append({
568-
"type":
569-
service.type,
570-
"name":
571-
service.name,
572-
"ip":
573-
".".join([str(ord(c)) for c in service.address]),
574-
"port":
575-
service.port,
576-
"properties":
577-
properties
571+
"type": service.type,
572+
"name": service.name,
573+
"ip": ".".join([str(ord(c)) for c in service.address]),
574+
"port": service.port,
575+
"properties": properties
578576
})
579577
return items
580578

@@ -682,7 +680,7 @@ def get_api_result(url, params=None, data=None, auth=None, cache_valid=None):
682680

683681
PING_INTERNET_IPS = [
684682
"192.30.253.113", # github.com
685-
"159.122.18.156", # dl.bintray.com
683+
"18.195.111.75", # dl.bintray.com
686684
"193.222.52.25" # dl.platformio.org
687685
]
688686

0 commit comments

Comments
 (0)