Compare commits

...

3874 Commits

Author SHA1 Message Date
444c57b4a6 Bump version to 6.1.19a2 2025-05-07 19:49:31 +03:00
d787648e71 Fixed a regression issue where custom build flags were not properly reflected in the compile_commands.json // Resolve #5090 Resolve #5147 2025-05-07 19:45:16 +03:00
846588deec Sync examples 2025-05-07 19:43:52 +03:00
79142965ce Bump version to 6.1.19a1 2025-03-11 22:15:54 +02:00
93bc4fae6c Merge tag 'v6.1.18' into develop
Bump version to 6.1.18
2025-03-11 21:47:33 +02:00
1aa256d63c Merge branch 'release/v6.1.18' 2025-03-11 21:47:32 +02:00
3a133af1a6 Bump version to 6.1.18 2025-03-11 21:47:22 +02:00
f93d3d509b Resolved a regression issue that prevented PIO Home from opening external links // Resolve #5084 2025-03-10 19:57:13 +02:00
145142ea6c Update deps 2025-02-24 13:15:19 +02:00
b4b02982d6 build and publish wheel (#5088) 2025-02-14 12:15:12 +02:00
841489c154 Sync docs 2025-02-14 12:14:31 +02:00
23c142dffd Bump version to 6.1.18a1 2025-02-13 13:58:19 +02:00
fc946baa93 Merge branch 'release/v6.1.17' 2025-02-13 13:08:40 +02:00
a447022e7f Merge tag 'v6.1.17' into develop
Bump version to 6.1.17
2025-02-13 13:08:40 +02:00
4c697d9032 Bump version to 6.1.17 2025-02-13 13:08:31 +02:00
a71443a2ee Clarified language and fixed some grammar issues (#5085) 2025-02-13 13:04:48 +02:00
20e076191e Bump version to 6.1.17rc1 2025-02-09 12:24:37 +02:00
d907ecb9e9 Sync docs 2025-02-09 12:22:58 +02:00
c950d6d366 CI: Disable cleaning of ubuntu instance 2025-02-08 21:51:50 +02:00
29cd2d2bdb Update GH actions 2025-02-08 21:24:54 +02:00
a584a6bce3 Fix spell issues 2025-02-08 19:27:58 +02:00
4dc7ea5bd0 Fix typos discovered by codespell (#5078)
* Fix typos discovered by codespell

* codespell-project/actions-codespell@v2
2025-02-08 17:21:12 +02:00
1be6e10f99 Introduced the PLATFORMIO_RUN_JOBS environment variable // Resolve #5077 2025-02-08 17:15:34 +02:00
c9016d6939 Simplify PyPi dependencies // Resolve #5059 2025-01-03 12:56:03 +02:00
baab25a48c Update SPDX license list to v3.24.0 2025-01-03 12:43:51 +02:00
4d4f5a217b Bump version to 6.1.17b2 2024-12-18 14:39:48 +02:00
b6d1f4d769 Resolved an issue where the |LDF| occasionally excluded bundled platform libraries from the dependency graph // Issue #4940 2024-12-18 14:38:56 +02:00
90fc36cf2d Update deps 2024-12-18 14:38:24 +02:00
9be0a8248d LDF: refresh lib dependency after recursive search (#4941)
LDF might mistakenly remove recursive dependency libs from a graph
usually platform bundled ones

Closes #4940
2024-12-18 14:24:35 +02:00
d15314689d Resolved an issue where the `--project-dir` flag did not function correctly with the check and debug commands // Resolve #5029 2024-12-13 13:01:40 +02:00
1d4b5c8051 Upgrade docs to the sphinx 8 2024-12-13 13:01:21 +02:00
47a87c57f2 Bump version to 6.1.17b1 2024-12-12 19:56:35 +02:00
ec2d01f277 Ensured that dependencies of private libraries are no longer unnecessarily re-installed // Resolve #4987 2024-12-12 19:55:29 +02:00
4e05309e02 Added support for `tar.xz` tarball dependencies // Issue #4974 2024-12-12 19:49:47 +02:00
1fd3a4061f add support for tar.xz tarballs (#4974)
* tar.xz

* add magic bytes for `tar.xz`
2024-12-12 19:47:23 +02:00
014ac79c87 Resolved an issue with incorrect path resolution when linking static libraries via the build_flags // Resolve #5004 2024-12-12 19:46:11 +02:00
dd3fe909a1 Better handling of the missed args for exec command // Resolve #5047 2024-12-12 16:32:43 +02:00
c1afb364e9 Allow HTTP 203 as successful response (#5043)
Fixes downloading library dependencies from Azure Devops repositories.
2024-12-09 20:07:27 +02:00
f3c27eadf6 Switch to named argument (PY 3.13+) 2024-12-02 21:32:44 +02:00
fe2fd5e880 Sync docs 2024-12-02 21:32:10 +02:00
07e7dc4717 Update deps 2024-12-02 20:38:05 +02:00
a94e5bd5ab Bump version to 6.1.17a2 2024-10-17 12:33:15 +03:00
f5ab0e5ddd Resolve an issue where the `compiledb` target failed to properly escape compiler executable paths containing spaces // Resolve #4998 2024-10-17 12:32:52 +03:00
3e20abec90 Disable temporary "test_custom_testing_command" 2024-10-17 11:10:58 +03:00
a4276b4ea6 Update dependencies.py 2024-10-15 22:43:13 +03:00
cade63fba5 Allow Starlette 0.40.x (#5000)
This release of Starlette contains a fix for a security bug:

- GHSA-f96h-pmfr-66vw:
  https://github.com/encode/starlette/security/advisories/GHSA-f96h-pmfr-66vw
- CVE-2024-47874: https://nvd.nist.gov/vuln/detail/CVE-2024-47874
2024-10-15 22:41:10 +03:00
3a57661230 Switch to the stable Python 3.13 for CI 2024-10-13 21:46:22 +03:00
33fadd028d Sync docs 2024-10-13 11:54:21 +03:00
647b131d9b Sync docs 2024-10-04 12:22:54 +03:00
b537004a75 Bump version to 6.1.17a1 2024-09-26 13:40:24 +03:00
67b2759be2 Merge branch 'release/v6.1.16' 2024-09-26 13:14:01 +03:00
fe2e8a0a40 Merge tag 'v6.1.16' into develop
Bump version to 6.1.16
2024-09-26 13:14:01 +03:00
03e84fe325 Bump version to 6.1.16 2024-09-26 13:13:50 +03:00
b45cdc9cb6 Declare pip dependencies statically // Resolve #4955 2024-09-26 13:13:31 +03:00
3aed8e1259 Drop Python 3.6 & 3.7 from CI 2024-09-23 23:33:25 +03:00
2d4a87238a Add support for Python 3.13 2024-09-23 23:25:46 +03:00
023b58e9f0 Fix PyLint warnings 2024-09-23 16:02:07 +03:00
3211a2b91b Bump version to 6.1.16rc1 2024-09-23 15:34:04 +03:00
4b61de0136 Update deps 2024-09-23 15:33:06 +03:00
e6ae18ab0d Enhanced internet connection checks by falling back to HTTPS protocol when HTTP (port 80) fails // Resolve #4980 2024-09-23 15:32:23 +03:00
4230b223d2 Update bottle to 0.13.* 2024-09-16 20:45:30 +03:00
d224ae658d Sync docs 2024-09-14 13:14:26 +03:00
20dc006345 Bump version to 6.1.16b2 2024-09-04 11:48:59 +03:00
13035ced59 Upgrade the build engine to the latest version of SCons (4.8.1) 2024-09-04 11:48:30 +03:00
b9d27240b5 Drop ESPHome from CI 2024-08-30 11:06:38 +03:00
2441d47321 Upgrade the build engine to the latest version of SCons (4.8.0) 2024-08-29 15:58:40 +03:00
cf497e8829 Update tests 2024-08-29 15:58:12 +03:00
013153718d Allow manual override of system type 2024-08-29 11:30:18 +03:00
f1726843a2 allow manual override of system type (#4952)
* allow manual override of system type
https://community.platformio.org/t/windows-on-arm64-problem-installing-xtensa-toolchain/25497

* fix lint
2024-08-29 11:28:52 +03:00
44ef6e3469 Use owner-based platform declaration // Resolve #4962 2024-08-28 19:43:52 +03:00
eeb5ac456e Upgrade Doctest and GoogleTest testing frameworks to the latest versions 2024-08-01 14:30:00 +03:00
aea9075d4b Bump version to 6.1.16b1 2024-07-29 15:33:33 +03:00
11a8d9ff7a Updated Unity testing framework to v2.6.0 // Resolve #4871 2024-07-29 15:32:39 +03:00
7b587ba8bf Corrected an issue where the incorrect public class was imported for the `DoctestTestRunner` // Resolve #4949 2024-07-29 14:43:03 +03:00
9eb6e5166d Allow Starlette 0.38.1 (#4953) 2024-07-25 14:33:32 +03:00
aa580360e8 Sync docs 2024-07-11 12:53:55 +03:00
4c490cc63c Adding Zephyr framework USB VID PID to udev rules. (#4947)
As Zephyr is officially supported by platformio, it make sense to add its default VID:PID to udev rules.
2024-07-11 12:48:35 +03:00
882d4da8cb Sync docs 2024-07-10 23:09:07 +03:00
781114f026 Update deps 2024-06-30 12:44:48 +03:00
7cf8d1d696 Exclude Python 3.6 and 3.7 from CI matrix for MacOS 2024-06-03 15:06:46 +03:00
fd1333f031 Update SPDX licenses to 3.24.0 2024-05-24 09:25:30 +03:00
8e21259222 Disable macOS runner for Pyrhon 3.6, 3.7 2024-05-24 09:04:00 +03:00
9899547b73 Sync docs 2024-05-24 09:03:35 +03:00
4075789a32 Sync docs 2024-05-10 12:45:07 +03:00
ff364610c5 Sync docs 2024-05-07 22:22:26 +03:00
e5940673d7 Bump version to 6.1.16a1 2024-04-25 11:41:53 +03:00
fe140b0566 Merge branch 'release/v6.1.15' 2024-04-25 11:37:53 +03:00
2ec5a3154e Merge tag 'v6.1.15' into develop
Bump version to 6.1.15
2024-04-25 11:37:53 +03:00
956f21b639 Bump version to 6.1.15 2024-04-25 11:37:28 +03:00
cdac7d497c Resolved an issue related to the inaccurate detection of the Clang compiler // Resolve #4897 2024-04-24 23:08:00 +03:00
591b377e4a Sync docs 2024-03-29 21:33:54 +02:00
c475578db6 Resolved an issue where the |LDF| couldn't locate a library dependency declared via version control system repository // Resolve #4885 2024-03-26 13:44:26 +02:00
2bad42ecb1 Update 99-platformio-udev.rules (#4880)
Fix typo
2024-03-23 16:26:25 +02:00
0acfc25d56 Bump version to 6.1.15a1 2024-03-21 21:30:22 +02:00
9d1593da0b Merge branch 'release/v6.1.14' 2024-03-21 21:11:24 +02:00
e9433de50f Merge tag 'v6.1.14' into develop
Bump version to 6.1.14
2024-03-21 21:11:24 +02:00
fcba901611 Bump version to 6.1.14 2024-03-21 21:11:15 +02:00
0e3249e8b1 Update deps 2024-03-21 21:08:41 +02:00
0d647e164b Skip unnecessary import 2024-03-18 17:45:54 +02:00
c01ef88265 Upgraded the build engine to the latest version of SCons (4.7.0) 2024-03-18 14:27:45 +02:00
9fb9e586a0 Sync docs 2024-03-18 13:14:39 +02:00
28bd200cd6 Move core/pip dependencies to the separate "dependencies" module 2024-03-18 13:14:22 +02:00
56be27fb0b Bump version to 6.1.14rc1 2024-03-16 15:15:05 +02:00
32991356f3 Enhanced Static Code Analysis to accommodate scenarios where custom src_dir or include_dir are located outside the project folder // Issue #4874 2024-03-16 14:07:01 +02:00
dbe58b49bf paths fix for check tool (#4874)
* paths fix for check tool

* Minor changes

- Handle an edge case on Windows when sources and the project are located on different drives
- Cover edge cases with tests

---------

Co-authored-by: Valerii Koval <valeros@users.noreply.github.com>
2024-03-16 14:00:30 +02:00
d36e39418e Corrected the validation of `symlink://` package specifications // Issue #4870 2024-03-16 13:45:21 +02:00
c28740cfb1 Update tests 2024-03-16 13:43:44 +02:00
430acc87de Fix symlink package spec validation (#4870)
When validating symlink:// packages, use the specified symlink path,
the same as for file:// packages.  This fixes missing symlink packages
in 'pkg list' and reinstalling on every build.
2024-03-16 13:29:31 +02:00
c0d97287dd Add support for Python 3.12+ Tar extract filter 2024-03-16 12:32:15 +02:00
0f3dbe623d Update tests 2024-03-16 12:30:51 +02:00
6449115635 Update dependencies 2024-03-16 12:30:38 +02:00
d085a02068 Sync docs 2024-02-22 18:27:22 +02:00
76a11a75b7 Sync docs 2024-02-16 22:47:02 +02:00
93018930ab Bump version to 6.1.14b1 2024-02-16 17:08:28 +02:00
621b24b665 Introduced the `--json-output option to the pio test` command // Resolve #4740 2024-02-16 17:08:03 +02:00
7606dd4faf Minor improvements // Issue #4710 2024-02-16 17:06:50 +02:00
aa06d21abe Resolved an issue with the hexlify filter in the device monitor command // Resolve #4732 2024-02-15 22:28:09 +02:00
042f8dc668 Bump version to 6.1.14a2 2024-02-13 22:48:06 +02:00
c4f76848a7 Validate only owner/name/version fields 2024-02-13 22:47:22 +02:00
e1ff9a469d Resolved an issue where the LDF selected an incorrect library version // Resolve #4860 2024-02-13 19:32:57 +02:00
2239616484 Sync docs 2024-02-13 19:01:20 +02:00
55be7181b3 Add STM32 virtual COM port to udev.rules (#4773)
* add Espressif USB JTAG/serial debug unit to udev

* add STM32 virtual COM port
2024-02-10 22:21:49 +02:00
f519a9d524 Update SPDX to 3.23 2024-02-09 11:34:12 +02:00
f4319f670c Update piomaxlen.py change from 8192 to 8191 MAX_LINE_LENGTH (#4856)
The maximum length of the string that you can use at the command prompt is 8191 characters.

This limitation applies to:

the command line
individual environment variables that are inherited by other processes, such as the PATH variable
all environment variable expansions
If you use Command Prompt to run batch files, this limitation also applies to batch file processing.

https://learn.microsoft.com/en-us/troubleshoot/windows-client/shell-experience/command-line-string-limitation#:~:text=The%20maximum%20length%20of%20the,such%20as%20the%20PATH%20variable
2024-02-09 08:20:40 +02:00
80fc335528 add LuatOS ESP32-C3 Development Board (#4852) 2024-02-07 13:42:49 +02:00
353f440335 Addressed an issue where passing a relative path to the pio project init // Resolve #4847 2024-02-07 13:36:21 +02:00
3e9ca48588 Update deps 2024-02-07 13:35:50 +02:00
255e91b51c fix a typo (#4845) 2024-01-29 08:54:18 +02:00
adf94843ea Apply formatting 2024-01-27 14:01:42 +02:00
e3e08d9691 Resolved an issue related to the relative package path in the pio pkg publish 2024-01-22 22:57:07 +02:00
84c7ede0e1 Sync docs 2024-01-22 22:54:58 +02:00
28c90652bc Update deps 2024-01-22 22:51:23 +02:00
a75da327d0 Broadened version support for the pyelftools dependency // Resolve #4834 2024-01-17 12:45:33 +02:00
adf4012b96 Update deps 2024-01-17 12:43:57 +02:00
1fe806269d Start 6.1.14a1 2024-01-12 12:53:51 +02:00
ffacd17387 Merge branch 'release/v6.1.13' 2024-01-12 12:52:01 +02:00
4742ffc9d8 Merge tag 'v6.1.13' into develop
Bump version to 6.1.13
2024-01-12 12:52:01 +02:00
700c705317 Bump version to 6.1.13 2024-01-12 12:51:49 +02:00
17ba91977d Update deps 2024-01-12 12:51:28 +02:00
f31f9fa616 Expanded support for SCons variables declared in the legacy format `${SCONS_VARNAME}` // Resolve #4828 2024-01-11 21:33:01 +02:00
485f801c74 Bump version to 6.1.13a2 2024-01-11 19:23:59 +02:00
adab425c6d Expanded support for SCons variables declared in the legacy format `${SCONS_VARNAME}` // Resolve #4828 2024-01-11 19:23:26 +02:00
aabbbef944 Start 6.1.13 2024-01-10 16:39:38 +02:00
14ce28e028 Merge tag 'v6.1.12' into develop
Bump version to 6.1.12
2024-01-10 16:17:11 +02:00
ca1f633f9c Merge branch 'release/v6.1.12' 2024-01-10 16:17:10 +02:00
a2f3e85760 Bump version to 6.1.12 2024-01-10 16:17:02 +02:00
f422b5e05c Bump version to 6.1.12rc1 2024-01-09 21:01:09 +02:00
ba58db3079 Introduced the capability to launch the debug server in a separate process // Resolve #4722 2024-01-09 21:00:42 +02:00
4729d9f55d Bump version to 6.1.12b2 2024-01-06 17:48:47 +02:00
41bd751ec2 Implemente automatic installation of missing dependencies when utilizing a SOCKS proxy // Resolve #4822 2024-01-06 17:48:18 +02:00
c74c9778a1 Enhance PIP dependency declarations // Resolve #4819 2024-01-06 16:24:01 +02:00
f2d16e7631 Bump version to 6.1.12b1 2023-12-31 14:56:39 +02:00
b181406a1f Resolve an issue where custom debug configurations were being inadvertently overwritten in VSCode's `launch.json` // Resolve #4810 2023-12-31 14:54:57 +02:00
dc16f80ffc Minor improvements // Issue #4699 2023-12-30 18:27:40 +02:00
125be4bfd4 urllib3 v2.0 only supports OpenSSL 1.1.1+ // Issue #4614 2023-12-30 14:44:35 +02:00
14907579cd Docs: Sync dev-platforms 2023-12-27 15:23:01 +02:00
b0a1f3ae16 Update deps 2023-12-22 19:55:15 +02:00
195304bbea Implemented a fail-safe mechanism to terminate a debugging session if an unknown CLI option is passed // Resolve #4699 2023-12-09 15:27:06 +02:00
e4c4f2ac50 Resolved an issue where native debugging failed on the host machine // Resolve #4745 2023-12-09 15:12:16 +02:00
77e6d1b099 PyLint fix for Python 3.12 2023-12-09 13:51:51 +02:00
cf4da42b25 Bump version to 6.1.12a6 2023-12-09 13:18:21 +02:00
51bf17515e Revert back normalizing platformio.*_dir option 2023-12-09 13:18:03 +02:00
1e2c37c190 Bump version to 6.1.12a5 2023-12-09 13:06:42 +02:00
204a60dd52 Parse only $PROJECT_HASH legacy built-in variable 2023-12-09 13:06:20 +02:00
0f554d2f31 PyLint fixes 2023-12-09 13:05:51 +02:00
f382aae66b Do not normalize platformio.***_dir path when validating 2023-12-09 13:05:30 +02:00
998da59f7c Add support for Python 3.12 2023-12-08 20:18:29 +02:00
4cad98601d Bump version to 6.1.12a4 2023-12-08 19:48:36 +02:00
34545d3f12 Switch to Python 3.11 for CI tasks 2023-12-08 19:45:31 +02:00
127b422d25 Rectified an issue where ${platformio.name} erroneously represented None as the default project name // Resolve #4717 2023-12-08 19:38:50 +02:00
8c61f0f6b6 Enhanced the handling of built-in variables during interpolation // Resolve #4695 2023-12-08 19:12:00 +02:00
fb93c1937c Provide a map for nrf52 and rp2040 declared in library.properties // Resolve #4803 2023-12-07 14:09:11 +02:00
827bd09c61 Bump version to 6.1.12a3 2023-12-01 20:28:50 +02:00
984d63983d Upgrade the build engine to the latest version of SCons (4.6.0) // Resolve #4789 2023-12-01 20:28:25 +02:00
11df021750 Resolve an issue where running pio project metadata resulted in duplicated include entries // Resolve #4723 2023-12-01 19:38:25 +02:00
ac6d94860b Update deps 2023-12-01 15:55:36 +02:00
b238c55e53 Introduced a warning during the verification of MCU maximum RAM usage // Resolve #4791 2023-11-28 18:15:16 +02:00
961ab6b35e Properly handle the check_src_filters option per environment
Resolves #4788
2023-11-17 13:12:40 +02:00
e1f34c7ea0 Drastically enhanced the speed of project building when operating in verbose mode // Resolve #4783 2023-11-16 20:05:44 +02:00
f70e6d50c6 Remove unused build output buffer (#4786)
* Remove unused build output buffer

* Update proc.py

* Update proc.py

---------

Co-authored-by: Ivan Kravets <me@ikravets.com>
2023-11-16 19:59:30 +02:00
540465291a Resolved an issue where `get_systype()` inaccurately returned the architecture // Resolve #4777 2023-11-16 19:01:24 +02:00
0b3c0144e6 fix get_systype() on raspbian (#4784)
fix get_systype on raspbian

fixes #4777
2023-11-16 18:57:16 +02:00
7ab27ddf9d Resolved an issue where the `COMPILATIONDB_INCLUDE_TOOLCHAIN` setting was not correctly applying to private libraries // Resolve #4762 2023-11-16 18:54:45 +02:00
e78bf51f68 Issue #4762 compiledb include toolchains with user defined libs (#4763)
Issue #4762 separated out the optional addition of toolchains to compiledb include paths and added a call to it in the library building step for user defined libraries, allowing the automatic inclusion of toolchains in private lib compiledb generation
2023-11-16 18:44:32 +02:00
5f8c15b96a add Espressif USB JTAG/serial debug unit to udev (#4759) 2023-10-16 00:01:23 +03:00
9c61ef544d Fix test 2023-10-16 00:01:05 +03:00
5548197a74 Update "pyelftools" to 0.30 2023-10-09 11:41:22 +03:00
2458309d55 Update SPDX to 3.22 2023-10-09 11:41:01 +03:00
7229e1cce4 Add missing Zephyr project files in tests for PIO Check 2023-09-30 12:09:36 +03:00
3e95134721 Sync docs 2023-09-29 23:24:03 +03:00
687189a142 Sync docs 2023-09-23 20:51:47 +03:00
51b4cd88db Docs: Add image with PlatformIO CLI for VSCode 2023-09-22 20:02:48 +03:00
fe52b79eb2 Docs: Fix example with the custom common options 2023-09-13 20:21:22 +03:00
091c96eb07 Sync docs 2023-08-31 19:40:20 +03:00
f2eead6ece Bump version to 6.1.12a1 2023-08-31 19:32:15 +03:00
c2b3097618 Merge branch 'release/v6.1.11' 2023-08-31 19:31:46 +03:00
2728c90441 Merge tag 'v6.1.11' into develop
Bump version to 6.1.11
2023-08-31 19:31:46 +03:00
5cac6d8b88 Bump version to 6.1.11 2023-08-31 19:31:37 +03:00
bd34c0f437 Bump version to 6.1.12a1 2023-08-31 17:55:04 +03:00
f1c445be15 Bump version to 6.1.11 2023-08-31 17:54:11 +03:00
b88c393b4e Ensure SCons is installed on "project init" 2023-08-31 15:53:29 +03:00
897844ebc1 Docs: Sync dev-platforms 2023-08-18 14:39:03 +03:00
00409fc096 Sync docs 2023-08-16 17:44:37 +03:00
b75bdbd320 Bump version to 6.1.11a2 2023-08-14 19:03:19 +03:00
a0f8def616 Resolved a regression issue with Memory Inspection in PIO Home 2023-08-14 19:02:58 +03:00
c946613019 Improve docs for the Installer Script 2023-08-14 16:18:28 +03:00
2ee8214485 Use CC location for resolving toolchain path in VSCode template
VSCode uses the "packagetoolchainBinDir" option to find the objdump
binary and if GDB is shipped separately from the toolchain package then
VSCode will fail to launch a debug session due to missing objdump
2023-08-14 15:57:00 +03:00
7e89e551ae Sync docs 2023-08-14 14:04:09 +03:00
6972c9c100 Sync docs 2023-08-14 13:05:30 +03:00
5cfaea91d6 Docs: Update docs to use curl or wget on Unix when installing PlatformIO Core 2023-08-14 11:45:31 +03:00
ce735c0ae5 Sync docs 2023-08-14 10:59:43 +03:00
aa0df36c8a Remove CLion from tests 2023-08-11 13:49:16 +03:00
99224d7d4e Remove CLion from tests 2023-08-11 13:49:03 +03:00
532759c0c6 Bump version to 6.1.11a1 2023-08-11 13:21:44 +03:00
fb43d2508a Merge branch 'release/v6.1.10' 2023-08-11 13:18:54 +03:00
07944a9d5b Merge tag 'v6.1.10' into develop
Bump version to 6.1.10
2023-08-11 13:18:54 +03:00
8b6a4b8ce8 Bump version to 6.1.10 2023-08-11 13:18:41 +03:00
6e75dc0d57 Remove unnecessary files 2023-08-11 12:46:19 +03:00
a733f3c868 Update slogan 2023-08-11 12:07:16 +03:00
65397fe059 Bump version to 6.1.10b1 2023-08-04 20:16:49 +03:00
48a823d39e Do not check internet connection on the postponed telemetry // Resolve #4706 2023-08-04 20:15:14 +03:00
f8b5266c1e Bump version to 6.1.10a4 2023-07-29 16:04:20 +03:00
9170eee6e4 Resolved an issue with "ModuleNotFoundError: No module named 'chardet'" on macOS ARM // Resolve #4702 2023-07-29 16:03:14 +03:00
89f4574680 Remove unused files 2023-07-29 16:02:18 +03:00
831f7f52bc Automatically update PIO Core PyPi dependencies on "upgrade" operation 2023-07-29 16:01:57 +03:00
dccc14b507 Ensure that PIO Core System Info works on all supported Pythons 2023-07-28 18:40:14 +03:00
3a21f48c9c Lock "marshmallow" dependency to the 3.19.0 for Python 3.7 2023-07-28 18:37:30 +03:00
54ff3a8d4e Test all compatible Pythons 2023-07-28 18:24:47 +03:00
4474175e52 Docs: Sync renesas-ra dev-platform 2023-07-28 14:34:59 +03:00
a983075dac Update deps 2023-07-27 15:04:09 +03:00
3268b516a9 Respect user privacy based on UA data 2023-07-27 15:03:57 +03:00
5c9b373b65 Update Cppcheck to v2.11 2023-07-17 14:12:52 +03:00
0fe6bf262e Ensure that the `monitor` target is not executed if any of the preceding targets encounter failures 2023-07-15 15:15:21 +03:00
390755c499 Implement app.get_project_id() 2023-07-15 14:56:56 +03:00
deca77d1a3 Implement project.configuration endpoint 2023-07-15 14:22:27 +03:00
bc2e51d51f Bump version to 6.1.10a3 2023-07-15 12:09:15 +03:00
bce70d4945 Remove unnecessary dependencies 2023-07-15 12:08:41 +03:00
940fa327f5 Lock "starlette==0.29.0" to Python 3.7 2023-07-13 17:14:59 +03:00
db8f027f30 Refactor platform-related calls to PlatformFactory.from_env 2023-07-12 18:28:20 +03:00
39b61d50e6 Fix issues reported by Pylint 2023-07-12 10:39:50 +03:00
f85c3081fe Minor improvements for firmware memory footprint analysis
- Added section name to the section data so that a dev-platform can apply a regex to determine section location in memory
- Performance improvement by analyzing memory location of a firmware section only once
2023-07-11 22:12:54 +03:00
2a1fd273ee Normalize configuration file path 2023-07-11 20:13:26 +03:00
a423a4dde4 Rename "PackageMetaData" class to "PackageMetadata" 2023-07-11 20:12:20 +03:00
abda3edad6 Use "UNIX_TIME" as the main variable 2023-07-11 15:20:57 +03:00
be4d016f61 Resolved an issue with "pio pkg exec" command on WIndows while executing Python scripts from a package 2023-07-11 14:23:05 +03:00
68e62c7137 Expose sizedata API 2023-07-10 17:41:21 +03:00
bf8f1e9efb Remove redundant code 2023-07-07 22:48:09 +03:00
a102fd2d48 Bump version to 6.1.10a2 2023-07-07 22:36:58 +03:00
ff221b103a Resolved an issue that caused generated projects for PlatformIO IDE for VSCode to break when the `-iprefix` compiler flag was used 2023-07-07 22:36:43 +03:00
646aa4f45b Bump version to 6.1.10a1 2023-07-06 14:44:56 +03:00
325d4c16b8 Merge tag 'v6.1.9' into develop
Bump version to 6.1.9
2023-07-06 14:34:07 +03:00
f47083b86b Merge branch 'release/v6.1.9' 2023-07-06 14:34:06 +03:00
3d48f3ec04 Bump version to 6.1.9 2023-07-06 14:33:15 +03:00
837ea85c3c Resolved an issue that resulted in unresolved absolute toolchain paths when generating the "compile_commands.json" // Resolve #4684 2023-07-06 13:53:14 +03:00
9585e2a3e3 Fixed handling of `-include` flag // Resolve #4683 2023-07-06 13:42:19 +03:00
5396882e75 Bump version to 6.1.9rc1 2023-07-06 11:40:58 +03:00
109c537d86 Fixed handling of `-include` flag // Resolve #4683 2023-07-06 11:40:30 +03:00
b239628ac3 Install "wheel" package for package publishing 2023-07-05 15:30:50 +03:00
25c7c60f0d Install "wheel" package for package publishing 2023-07-05 15:30:40 +03:00
8a38442bba Bump version to 6.1.9a1 2023-07-05 15:13:22 +03:00
205b29560f Merge tag 'v6.1.8' into develop
Bump version to 6.1.8
2023-07-05 15:12:02 +03:00
bbcd92b7c6 Merge branch 'release/v6.1.8' 2023-07-05 15:12:01 +03:00
3b3fbecbf3 c 2023-07-05 15:11:34 +03:00
a3e66d6325 Enable "esphome" project for CI 2023-07-05 14:08:26 +03:00
355f57e888 Update deps 2023-07-05 14:08:09 +03:00
6eff31b5d3 Bump version to 6.1.8rc2 2023-07-04 15:36:46 +03:00
01423a7659 Revert back ProjectConfigDirsMixin (PIO Core 3.x depends on it) 2023-07-04 15:36:19 +03:00
0f9a5f8eee Show only the package name in "cyan" color 2023-07-04 15:35:57 +03:00
1c419ef71a Bump version to 6.1.8rc1 2023-07-03 18:38:48 +03:00
01ab1fa4c0 Resolved a critical issue related to the usage of the `-include` flag // Resolve #4682 2023-07-03 18:37:57 +03:00
0ff46bdd88 Improve support for Python 3.6 2023-07-03 13:53:12 +03:00
dd033bf675 Sync docs 2023-07-03 13:52:09 +03:00
a28a3d31c9 Keep http session per active PIO Home 2023-06-29 21:28:46 +03:00
450f48ba81 Implement platform.fetch_examples endpoint 2023-06-29 21:28:00 +03:00
813861ddae Implement new project.init_v2 endpoint 2023-06-29 21:26:59 +03:00
939b9b9112 Support "file://" scheme for the requested URL 2023-06-29 21:26:33 +03:00
98edf7609f Mock ajsonrpc.utils.is_invalid_params broken implementation 2023-06-29 21:26:00 +03:00
9f0efdeb5c Bump version to 6.1.8b3 2023-06-27 16:03:59 +03:00
3fd063d8ed Minor improvements 2023-06-27 16:03:37 +03:00
1b55da0af2 Force to installed dev-platform is available 2023-06-27 15:10:26 +03:00
4dc44868ea Use native asyncio.to_thread if available 2023-06-24 19:40:54 +03:00
f720cd841c Use typex name instead of type_ 2023-06-24 19:39:34 +03:00
53f1d82890 Handle HTTP Client Error as UserSideException 2023-06-23 12:15:42 +03:00
e78efff33b Allow the use of the underscore symbol in the "keywords" field 2023-06-22 20:41:44 +03:00
a754a28cd8 Unlock "urllib3" package version if SSL module is supported // Issue #4614 2023-06-22 13:55:44 +03:00
1d97982230 Bump version to 6.1.8b2 2023-06-21 16:31:43 +03:00
e022b67161 Import PlatformioException (espressif32 dev-platform monitor depends on it) 2023-06-21 16:31:05 +03:00
82de26d401 Bump version to 6.1.8b1 2023-06-21 13:56:50 +03:00
31218060db ProjectOptionValueError: displays the config option description (#4674)
ProjectOptionValueError: display the config option description

It gives a bit more context of the problem for the user.

Example message with the description included:

`Error: Invalid value: 'invalid_debug_mode' is not one of 'always', 'modified', 'manual'. for option `debug_load_mode` (Allows one to control when PlatformIO should load debugging firmware to the end target) in section [env:nodemcu]`

Co-authored-by: Ivan Kravets <me@ikravets.com>
2023-06-21 13:49:22 +03:00
e25b170b34 Show error name when raising UserSideException 2023-06-21 13:47:45 +03:00
326ebcf593 Support -std=gnu++2a and similar standards // Issue #3653 2023-06-21 12:45:28 +03:00
8b604c1a03 fix typo in a method name (#4672) 2023-06-20 21:03:57 +03:00
f219f35ac8 Updated the "pio project metadata" command to return C/C++ flags as parsed Unix shell arguments 2023-06-20 20:55:00 +03:00
4d89593b05 Removed PlatformIO IDE for Atom from the documentation as Atom has been deprecated 2023-06-20 17:53:37 +03:00
3881a8c677 Removed PlatformIO IDE for Atom from the documentation as Atom has been deprecated 2023-06-20 14:47:20 +03:00
e9cf551101 Added a new --lint option to the pio project config command // Resolve #4644 2023-06-20 14:25:30 +03:00
5ffa42a5a2 Eliminated erroneous warning regarding the use of obsolete PlatformIO Core // Resolve #4664 2023-06-19 19:01:05 +03:00
a5052433f2 Refactored Unit Testing engine to resolve compiler warnings with "-Wpedantic" option // Resolve #4671 2023-06-19 16:49:14 +03:00
425332040e Bump version to 6.1.8a5 2023-06-19 14:25:21 +03:00
3a230dfb51 Handle PlatformIO's "on_exit" event 2023-06-19 14:24:47 +03:00
292dc3fd71 Update user-related exceptions to UserSideException 2023-06-19 11:40:40 +03:00
e48dfbaadc Update SPDX Data to v3.21 2023-06-19 11:38:43 +03:00
c0d2abc9a7 Call "on_platformio_end" when Click finished 2023-06-16 20:10:39 +03:00
d017a8197e Refactor event logging 2023-06-16 20:09:23 +03:00
378528abfc Switch to Python's time module 2023-06-16 20:08:45 +03:00
91487f179e Catch debug init error 2023-06-16 20:07:26 +03:00
363fee4ba0 Use direct urllib3 module 2023-06-16 20:06:46 +03:00
41cc735979 VCS base exception is UserSideException 2023-06-16 20:06:00 +03:00
c9235a5276 Use UTC-based timestamp 2023-06-09 15:18:07 +03:00
355f5afab9 * Optimized project integration templates to address the issue of long paths on Windows // Resolve #4652 2023-06-08 15:03:42 +03:00
2b36c7086a Publish wheels to the PyPi registry 2023-06-08 14:52:18 +03:00
f819cbb4b8 Sync docs 2023-06-08 14:51:52 +03:00
e3c33596db Use python -m pip instead of pip 2023-06-07 12:13:55 +03:00
1bcec6654d Update deps 2023-06-07 12:10:00 +03:00
9df692529b Bump version to 6.1.8a4 2023-06-06 14:23:30 +03:00
141d6fc4a6 Use unix timestamp as session id 2023-06-06 14:23:19 +03:00
6bc915f7db Bump version to 6.1.8a3 2023-06-06 14:15:02 +03:00
4ae24a619f Implement anonymous session mechanism to respect user privacy 2023-06-06 14:14:38 +03:00
7f7bc76b20 Sync docs 2023-06-05 20:10:37 +03:00
55e7b36dc4 Minor fixes 2023-06-05 18:51:58 +03:00
395a4053aa Bump version to 6.1.8a2 2023-06-05 18:25:02 +03:00
cb65bdf22f Enhance user privacy protection through refined telemetry implementation 2023-06-05 18:24:42 +03:00
6ea7ded483 Run tests against API v3 2023-06-05 18:15:30 +03:00
eeb0116f28 Skip exception when fetching SSL settings 2023-06-01 18:41:50 +03:00
63ca19541f Enhance the parsing of the platformio.ini to provide comprehensive diagnostic information 2023-05-31 20:15:36 +03:00
e0f839a372 Update deps 2023-05-31 20:15:08 +03:00
4fc6b26db5 Fix docs builder 2023-05-16 18:46:38 +03:00
4388cd4321 Improve "CONTRIBUTING" guide // Resolve #4622 2023-05-16 18:12:25 +03:00
71afa639e2 Fix tox's "docs" environment // Resolve #4624 2023-05-16 17:59:47 +03:00
89ffd82275 Update ISSUE_TEMPLATE.md 2023-05-10 18:05:48 +03:00
148ce1a897 Bump version to 6.1.8a1 2023-05-08 18:03:34 +03:00
fc12dda765 Merge branch 'release/v6.1.7' 2023-05-08 17:58:34 +03:00
58a59f8ae8 Merge tag 'v6.1.7' into develop
Bump version to 6.1.7
2023-05-08 17:58:34 +03:00
41fb1ca8bd Bump version to 6.1.7 2023-05-08 17:58:23 +03:00
bba5bc9d0f Lock "urllib3<2" becuase urllib3 v2.0 only supports OpenSSL 1.1.1+ // Resolve #4614 2023-05-06 14:15:40 +03:00
f8f3e9863e Bump version to 6.1.7rc2 2023-05-04 23:14:21 +03:00
eb20f3410a Minor fixes 2023-05-04 23:13:10 +03:00
681b90e6b2 Implement ProjectRPC.create_empty 2023-05-03 22:28:16 +03:00
c016d6827b Implement RPC notification system 2023-05-03 22:27:00 +03:00
f840577066 Remove unnecessary logging 2023-05-03 22:26:12 +03:00
475c5d2a3c Implement native async RPC core.exec 2023-05-03 22:25:44 +03:00
f9cbf6cb97 Set caller id when available 2023-05-03 11:22:19 +03:00
d728e0e873 Introduced a new --sample-code option to the pio project init command 2023-05-03 11:21:49 +03:00
7876626f04 Add BaseRPCHandler 2023-05-02 21:47:10 +03:00
f6aa95a4fe test/runners/unity.py: fixed warnings: [-Wunused-parameter] (#4610)
They appear when the tests are run with the `Wextra` flag.

I know of 3 possible solutions:
* A.) `static_cast<void>(unusedParameter);` – the preferred C++ way, but `unity` can also be used with `C`
* B.) `(void) unusedParameter;` – "old" C–style casting – the one I used – compatible with both C and C++
* C.) remove `unusedParameter` var from the function arguments – but keeping the name better explains what it is

```
Library Manager: Installing throwtheswitch/Unity @ ^2.5.2
Unpacking  [####################################]  100%
Library Manager: Unity@2.5.2 has been installed!
.pio/build/native/unity_config/unity_config.c:39:37: warning: unused parameter 'baudrate' [-Wunused-parameter]
void unityOutputStart(unsigned long baudrate) { }
                                    ^
1 warning generated.
Testing...
```
2023-05-01 14:30:27 +03:00
4596acab81 Add os.call_path_module_func RPC 2023-05-01 11:37:44 +03:00
09f1269440 Docs: Sync dev-platforms 2023-04-29 16:48:46 +03:00
939f8e0812 Fetch framework data from PIO Registry 2023-04-29 16:48:33 +03:00
1d0d89a4fa Remove unused code 2023-04-29 16:48:14 +03:00
2908efd337 Bump version to 6.1.7rc1 2023-04-27 22:56:39 +03:00
9dc6ed031f Resolved an issue where upgrading PlatformIO Core fails on Windows with Python 3.11 // Resolve #4540 2023-04-27 22:56:25 +03:00
21c4f091e2 Skip mbed legacy examples from PIO Core CI 2023-04-27 15:12:01 +03:00
2c94fb2aad Resolved installation issues with PIO Remote on Raspberry Pi and other small form-factor PCs // Resolve #4425 , Resolve #4493 , Resolve #4607 2023-04-27 14:24:34 +03:00
2312ca929d Cleanup code 2023-04-27 14:19:31 +03:00
6f0b1fbb91 Resolved an issue where multiple targets were not executed sequentially // Resolve #4604 2023-04-25 22:32:18 +03:00
c8eea40dd0 Better handling "clean" & "monitor" targets 2023-04-25 20:47:04 +03:00
53cd43b676 Remove obsolate code 2023-04-25 16:32:17 +03:00
981266646c Force drive letter to lower case when calculating project checksum on Windows // Resolve #4600 2023-04-24 18:24:35 +03:00
0acf968b2d Return result for JSON RPC 2023-04-24 18:20:15 +03:00
1e5a728f3c Return result for JSON RPC 2023-04-24 16:43:42 +03:00
c4d178e50e Bump version to 6.1.7b2 2023-04-22 22:32:42 +03:00
b991d9f25c Do not normalize path to abs if directory does not exist 2023-04-21 12:52:39 +03:00
82d380d895 Improve docs for "build_flags" 2023-04-21 11:40:54 +03:00
9344f3cd81 Revert "Improved support for projects located on Windows network drives // Issue #3417"
This reverts commit a0c959be28.
2023-04-21 11:25:48 +03:00
6ee9cc04fb Minor SCons optimizations 2023-04-20 22:29:00 +03:00
a0c959be28 Improved support for projects located on Windows network drives // Issue #3417 2023-04-20 19:34:15 +03:00
df896ad401 Fix normalizing path to unix // Resolve #4117 2023-04-20 18:58:04 +03:00
743fc8e636 Improved support for projects located on Windows network drives // Resolve #3417 2023-04-20 18:57:22 +03:00
fa255ff8b3 Provide verbose unpacking in non-terminal mode 2023-04-20 14:21:34 +03:00
97a7cdd2a2 Check simultaneous use of monitor_raw and monitor_filters 2023-04-18 21:35:22 +03:00
02a63a6954 Provide CODE_OF_CONDUCT.md 2023-04-18 20:20:03 +03:00
7f38e222c9 Provide SECURITY.md 2023-04-18 20:16:59 +03:00
f71317dad9 Bump version to 6.1.7b1 2023-04-17 13:17:27 +03:00
4444a0db99 Implement PIO Home PlatformRPC 2023-04-17 13:15:21 +03:00
e8ffa244e5 Better handling of verbosity in debug mode 2023-04-17 13:15:00 +03:00
7e9b637143 Resolved an issue where the PlatformIO Debugging solution was not escaping the tool installation process into MI2 correctly // Resolve #4565 2023-04-15 19:21:46 +03:00
0d9ee75b05 Resolved an issue where native tests would fail if a custom program name was specified // Resolve #4546 2023-04-15 13:40:53 +03:00
66fe55668e Resolved an issue where the incorrect debugging environment was generated for VSCode in "Auto" mode // Resolve #4597 2023-04-12 22:21:51 +03:00
5c3ae15bee Store device monitor logs in the project "logs" directory // Resolve #4596 2023-04-12 20:02:26 +03:00
58a1d5d96e Revert "InoToCpp: add ':' to arguments regexp" (#4595)
Revert "InoToCpp: add ':' to arguments regexp (#4586)"

This reverts commit 71bb84f3f2.
2023-04-12 14:18:33 +03:00
ab15da4f4b Sync docs 2023-04-08 23:14:05 +03:00
71bb84f3f2 InoToCpp: add ':' to arguments regexp (#4586)
InoToCpp: allow ':' in arguments
2023-04-07 22:58:08 +03:00
faff0fb56c Sync docs and examples 2023-03-29 08:29:52 -06:00
0fb064eba3 Fixed an issue where organization details could not be updated 2023-03-27 18:59:06 -06:00
bea5e87543 Sync docs 2023-03-26 14:41:04 -06:00
62e9589851 Use the built-in SCons "compile_db" tool 2023-03-26 14:36:51 -06:00
7d86eebe77 Upgraded the build engine to the latest version of SCons (4.5.2) 2023-03-26 14:35:59 -06:00
0bba598c61 Temporary fix for unreleased dev-platforms with broken env name 2023-03-20 18:56:39 -06:00
4b446b0d72 Fixed an issue when "build_cache_dir" was not honored across different environments // Resolve #4574 2023-03-20 15:40:24 -06:00
f43f41cc53 Format code 2023-03-20 15:39:51 -06:00
00c5d30ce9 Bump version to 6.1.7a4 2023-03-20 15:00:59 -06:00
269d5e0a3e Added validation for project working environment names 2023-03-20 15:00:22 -06:00
331ff2dc9c Format code 2023-03-20 12:38:40 -06:00
a24cf50413 Minor fixes 2023-03-18 23:13:24 -06:00
8d33a3d151 Do not build project when only "monitor" target is passed 2023-03-18 22:41:14 -06:00
d9ff250f82 Improved file filtering for the Static Analysis feature (#4570)
* Improved file filtering for the Static Analysis feature

* Better handling of legacy "check_patterns" option

* Rename "check_src_filter" to plural form to better represent functionality

* Move to plural forms of filter variables
2023-03-19 00:45:59 +02:00
f2d206ca54 Fixed "RuntimeError: deque mutated during iteration" 2023-03-18 12:40:11 -06:00
d7c9dc2411 Update deps 2023-03-16 20:13:54 -06:00
3e6725bb5f Sync docs 2023-03-16 15:29:04 -06:00
c3e287672e Sync docs 2023-03-09 12:51:13 -07:00
a387f9708a PyLint fix 2023-03-08 14:47:47 -07:00
07bfa8ce4a Docs: Sync dev-platforms 2023-03-08 11:16:40 -07:00
3dfb936f3c Use query params for DELETE request 2023-03-07 11:38:36 -07:00
e39438791c Sync docs 2023-02-28 09:47:01 -07:00
c7060f93e8 Docs: Add link to the Serial & UDP Plotter 2023-02-24 13:18:57 -07:00
8794b2a3a1 Docs: Update "sphinx-rtd-theme" to 1.2.0 2023-02-24 10:03:24 -07:00
cabe7d8c11 Docs: recommend specific version for a dev platform 2023-02-24 10:02:59 -07:00
56cc7ce270 Update SPDX License List to v3.20 2023-02-18 13:48:41 +02:00
5b13aeda52 Update deps 2023-02-18 13:48:20 +02:00
674d00183e Update deps 2023-02-11 22:07:48 +02:00
598d2b24de Sync docs 2023-02-06 22:44:00 +02:00
4c4fb5029e Docs: Sync dev-platforms 2023-02-06 15:55:33 +02:00
2c4055d9e1 Sync docs 2023-02-06 14:33:19 +02:00
efbe3d4aa6 PyLint fix 2023-02-02 19:35:40 +02:00
c785c8c6f3 Bump version to 6.1.7a3 2023-02-02 18:14:44 +02:00
9b4a045413 Restored project generator for NetBeans IDE 2023-02-02 18:14:15 +02:00
7c650c2c08 Sync docs 2023-02-02 18:14:05 +02:00
1422b77298 Allow extra path when fetching package data 2023-02-02 17:46:27 +02:00
1af508272b Format code with Black 23.1.0 2023-02-02 17:46:03 +02:00
5073313c33 PyLint fixes 2023-02-02 17:43:38 +02:00
18b6aad369 Bump version to 6.1.7a2 2023-02-01 23:55:02 +02:00
097de2be98 Do not copy PIO Core Python PATH to the global env 2023-01-30 14:05:15 +02:00
188c65ef7b Show detailed library dependency tree only in the verbose mode // Resolve #4517 2023-01-29 14:34:54 +02:00
b2a04f265e Code cleanup 2023-01-29 14:34:06 +02:00
15d53c95c0 Prevent shell injection when converting INO file to CPP // Resolve #4532 2023-01-27 21:06:13 +02:00
0d57a799b5 Port RPC "registry.call_client" to async 2023-01-27 20:53:43 +02:00
464b167e65 Wrap "NoInternetConnection" to 4008 RPC error 2023-01-27 20:52:48 +02:00
380652eb52 Raise 5000 error for RPC calls 2023-01-27 20:51:37 +02:00
4350c4ca48 Rename "InternetIsOffline" exception to "InternetConnectionError" 2023-01-27 20:50:38 +02:00
8835a03cd9 Rename "InternetIsOffline" exception to "InternetConnectionError" 2023-01-27 20:49:59 +02:00
61ba8afee6 Bump version to 6.1.7a1 2023-01-23 13:51:41 +02:00
199e3d8958 Merge branch 'release/v6.1.6' 2023-01-23 13:01:56 +02:00
9f09657997 Merge tag 'v6.1.6' into develop
Bump version to 6.1.6
2023-01-23 13:01:56 +02:00
2e64056787 Bump version to 6.1.6 2023-01-23 13:01:47 +02:00
83d2173748 Add Registry RPC 2023-01-23 12:49:06 +02:00
1503eb5d41 Minor refactoring 2023-01-21 17:19:45 +02:00
6db3eb8e33 Bump version to 6.1.6rc1 2023-01-14 22:17:33 +02:00
355222b0c0 Fixed an issue when "pio pkg list" and "pio pkg uninstall" commands fail if there are circular dependencies in the library.json manifests // Resolve #4475 2023-01-14 20:20:15 +02:00
2fbd766fd9 Remove debug code 2023-01-14 19:43:31 +02:00
fb5e99473f Fixed an issue when extends does not override options in the right order // Resolve #4462 2023-01-14 19:40:53 +02:00
de4ba4cbe1 Fixed an issue with an incorrect test summary when a testcase name includes a colon // Resolve #4508 2023-01-14 17:38:26 +02:00
42f1197de8 Added a new "name" configuration option to customize a project name // Resolve #4498 2023-01-14 17:17:26 +02:00
2337dbd2cd Fix incorrect type of "examples" // Resolve #4502 2023-01-13 20:50:29 +02:00
17360b0ed2 Show the real error message instead of "Can not remove temporary directory" when "platform.ini" is broken // Resolve #4480 2023-01-13 19:56:08 +02:00
5ee79f1724 Sync docs 2023-01-13 19:55:53 +02:00
20067c5736 Removed dependency on the "zeroconf" package and install it only when a user lists mDNS devices (issue with zeroconf's LGPL license) 2023-01-13 19:09:19 +02:00
d43c5696cc Lock "sphinx-rtd-theme" to the 1.1.1 2023-01-05 18:31:51 +02:00
8970f36f1a Docs: Remove simulators from "onboard debug" list // Resolve #150 2023-01-05 16:14:43 +02:00
75716d26ff Sync docs 2023-01-04 18:40:04 +02:00
d0ca48661c Sync docs 2022-12-29 13:47:25 +02:00
4121882a9d Split project configuration docs into the multiple pages 2022-12-21 09:34:36 +02:00
9c38cf6621 Make "get_config_options_schema" public 2022-12-19 16:34:54 +02:00
6395a032e5 Ensure dependent packages for PIO Home are installed 2022-12-15 20:01:28 +02:00
a0387bd16e Update tox configuration 2022-12-14 21:15:23 +02:00
4d4aec4f57 Export test suite directory 2022-12-13 19:36:41 +02:00
7bbfaab891 Avoid tox 4.0 2022-12-13 19:36:15 +02:00
337e7fe43a Update deps 2022-12-10 11:22:52 +02:00
38f03224d3 Switch to ubuntu-20.04 (supports Python 3.6) 2022-12-07 16:07:48 +02:00
48655ad728 Update Clang-Tidy to v15.0.5 // Resolve #4420 2022-12-05 11:58:01 +02:00
5de541e493 Update SPDX Data List to 3.19 2022-11-30 21:17:06 +02:00
527d61296f add udev rule for AIR32F103 board (#4481) 2022-11-30 12:52:55 +02:00
2141a09736 A JSON Schema for library.json // Resolve #1903 2022-11-28 22:44:57 +02:00
190ebcccfe add library.json schema (#4476) 2022-11-28 19:57:36 +02:00
a1d9798594 Bump version to 6.1.6a4 2022-11-25 02:20:38 +02:00
bf3942e7cc Use full paths to the assets (issue with setuptools) 2022-11-25 02:20:06 +02:00
5ec5660fa6 Update deps 2022-11-22 20:06:00 +02:00
fb09077c38 Update docs.yml 2022-11-18 21:56:09 +02:00
ec5bf1b5e7 Bump version to 6.1.6a3 2022-11-18 19:52:02 +02:00
bf7fb15941 Made assets (templates, "99-platformio-udev.rules") part of Python’s module // Resolve #4458 2022-11-18 19:51:19 +02:00
b35f1ea572 Added support for Python 3.11 2022-11-18 15:48:39 +02:00
7e6cb84c87 Add "env.IsCleanTarget()" to the Build API 2022-11-18 15:44:49 +02:00
bf769e1a9e Update deps 2022-11-18 13:39:36 +02:00
476bf20923 Update CI scripts 2022-11-18 13:34:08 +02:00
3277ac3a18 ci: update actions (#4464)
* ci: update actions

* ci: update actions

* ci: update actions

* ci: use py3.9 for docs
2022-11-18 12:24:04 +02:00
93ce9b0c5e add missing space (#4463) 2022-11-18 12:23:33 +02:00
b11925a9ec Bump version to 6.1.6a2 2022-11-05 12:04:50 +02:00
7f8784e2a8 PyLint fix 2022-11-05 12:04:36 +02:00
ca7a100392 Import the "zeroconf" module only when a user lists mDNS devices (issue with zeroconf's LGPL license) 2022-11-05 12:03:06 +02:00
32c2e33edf Sync docs 2022-11-05 11:47:34 +02:00
30fc00098d Black formatting 2022-11-02 13:08:36 +02:00
1dd62361c7 Add list_logical_devices to public (#4450)
* Add list_logical_devices to public

https://github.com/maxgerhardt/platform-raspberrypi/issues/15

* Sort imports

Co-authored-by: Ivan Kravets <me@ikravets.com>
2022-11-02 13:06:03 +02:00
c870c09d67 Bump version to 6.1.6a1 2022-11-01 20:54:20 +02:00
30b00e7a9d Merge branch 'release/v6.1.5' 2022-11-01 20:28:49 +02:00
c763f4b3a3 Merge tag 'v6.1.5' into develop
Bump version to 6.1.5
2022-11-01 20:28:49 +02:00
9800fb7b2c Bump version to 6.1.5 2022-11-01 20:28:27 +02:00
3b66f4270c Update PIO Project location for the smartknob project 2022-10-26 23:51:34 +03:00
dc14bd7362 Bump version to 6.1.5rc1 2022-10-26 23:38:03 +03:00
4be5185ed3 Added a new `enable_proxy_strict_ssl` setting to disable the proxy server certificate verification // Resolve #4432 2022-10-26 23:37:19 +03:00
1ea0adf6af Update deps 2022-10-26 23:35:39 +03:00
7cb40ef3b0 Support short version of "package" command 2022-10-13 21:21:38 +03:00
044bf61a4d Add udev Entry for Wio Terminal (#4427)
* Add udev Entry for Wio Terminal

* Merge WIO into the one rule

* Merge rules

Co-authored-by: Ivan Kravets <me@ikravets.com>
2022-10-01 12:26:52 +03:00
e0f9cb8c26 Fixed an issue when pio pkg install --storage-dir command requires PlatformIO project // Resolve #4410 2022-09-30 14:10:23 +03:00
d6d1c6b327 Docs: Sync dev-platforms 2022-09-30 13:25:34 +03:00
4c177c1ad3 Bump version to 6.1.5a4 2022-09-27 19:42:16 +03:00
490af8ac37 Speeded up device port finder 2022-09-27 19:41:32 +03:00
ca48e6c172 Document a stringification of ampersand // Resolve #4396 2022-09-27 19:28:41 +03:00
7533c369d4 Update deps 2022-09-27 19:03:28 +03:00
cd8024c762 Bump version to 6.1.5a3 2022-09-03 12:14:15 +03:00
0b4aedbeeb Remove temporary code // Issue #3980 2022-09-03 12:13:55 +03:00
3d2ac4698c PyLint fix 2022-09-03 12:13:25 +03:00
e0a3b81877 Fixed "UnboundLocalError: local variable 'port' referenced before assignment" // Resolve #4407 2022-09-03 12:08:17 +03:00
af21c50aec make bash version check case insensitive (#4399)
the output of `bash --version` is different when the system is configured for e.g. de_DE locale. For german locale the it's `GNU bash, Version 5.0…` with an uppercase 'V'. This makes the bash completion setup fail with the error `Error: The minimal supported Bash version is 4.4`.

To fix this, the version match regex now uses the `IGNORECASE` flag.
2022-08-24 13:44:56 +03:00
1cbc424488 Cleanup debug code 2022-08-24 13:34:07 +03:00
887e542cb2 Bump version to 6.1.5a2 2022-08-24 13:30:39 +03:00
780c62d925 Speeded up device port finder by avoiding loading board HWIDs from development platforms 2022-08-24 13:30:19 +03:00
122ebed16d Update deps 2022-08-24 13:29:55 +03:00
158aabbdf2 Improved caching of build metadata in debug mode 2022-08-24 12:54:35 +03:00
a8c3f2bdf6 Bump version to 6.1.5a1 2022-08-12 17:01:19 +03:00
8814f4e92d Merge branch 'release/v6.1.4' 2022-08-12 16:55:00 +03:00
ba5f61f92b Merge tag 'v6.1.4' into develop
Bump version to 6.1.4
2022-08-12 16:55:00 +03:00
43dd429aa2 Use random to remove a cache 2022-08-12 16:54:44 +03:00
cd8179a41f Bump version to 6.1.4 2022-08-12 15:00:05 +03:00
10136729ab Increase expire time 2022-08-12 14:59:37 +03:00
c5d7c4f88e Update SPDX list to v3.18 2022-08-12 12:47:16 +03:00
e3796cfda1 Allow custom system for the package manager API 2022-08-12 12:46:55 +03:00
847fdd4deb Fixed an issue when the "cleanall" target removes dependencies from all working environments // Resolve #4386 2022-08-10 15:05:31 +03:00
c56b35f504 Bump version to 6.1.4b4 2022-08-09 15:47:38 +03:00
bc9d9ac2db Keep custom "unwantedRecommendations" when generating projects for VSCode // Resolve #4383 2022-08-09 15:47:04 +03:00
e2f0d96f09 Formatting 2022-08-09 15:46:19 +03:00
4e78c3ec40 Improve docs for Github Actions 2022-08-09 15:45:37 +03:00
dfffd5e97b Warn about calling “env.BuildSources” in a POST-type script // Resolve #4385 2022-08-08 17:39:36 +03:00
8c13d13f80 Added support for accepting the original FileNode environment in a “callback” function when using Build Middlewares // Resolve #4380 2022-08-08 16:51:19 +03:00
32d501bed1 optionally pass env to AddBuildMiddleware callback (#4380) 2022-08-08 15:22:42 +03:00
17a7293967 Bump version to 6.1.4b3 2022-08-04 10:48:58 +03:00
59902abd09 Keep support for legacy "IDE_EXTRA_DATA" // Resolve #4379 2022-08-04 10:48:37 +03:00
a4756987a4 Provide a simplified download progress in non-terminal environments 2022-08-03 20:33:24 +03:00
b04c1591c2 Use "get_terminal_size().columns" directly 2022-08-03 20:31:56 +03:00
83c4e5f463 Improve downloading progress for non-terminal stream 2022-08-03 17:32:40 +03:00
8ada1c2b34 Use "strip_ansi" from click module 2022-08-03 16:56:21 +03:00
b7b01dd6a0 Drop "pio --force" option 2022-08-03 16:35:37 +03:00
5c2673cd71 Bump version to 6.1.4b2 2022-08-01 20:08:46 +03:00
09f7ff2db3 Upgraded build engine to the SCons 4.4.0 2022-08-01 20:08:25 +03:00
5e8eb77090 Rename "platformio" conflicted tool/module name to "piobuild" 2022-08-01 19:49:24 +03:00
a0493e6ac4 Handle both extra IDE data: IDE_EXTRA_DATA & INTEGRATION_EXTRA_DATA 2022-08-01 19:48:27 +03:00
4d755f2692 Remove deprecated "absolute_import" 2022-08-01 19:47:27 +03:00
fcb676abc6 Docs: Sync dev-platforms 2022-08-01 13:06:12 +03:00
fa0de1dad4 Switch to the official PROGPATH 2022-07-30 12:16:32 +03:00
6653c02487 Use the cached "BUILD_TYPE" from env 2022-07-30 12:15:49 +03:00
0939b43899 Bump version to 6.1.4b1 2022-07-29 20:03:55 +03:00
537558d410 Do not resolve project dependencies on for the "cleanall" target // Resolve #4344 2022-07-29 20:03:14 +03:00
7c9e0393f8 Improved device port finder when using dual channel UART converter // Resolve #4367 2022-07-29 19:37:59 +03:00
9ddf73baa6 Fixed an issue when escaping macros/defines for IDE integration // Resolve #4360 2022-07-29 17:18:21 +03:00
699da0a8fb Prefer global env when generating integration data 2022-07-29 14:58:11 +03:00
fd8c9786c0 Sync docs 2022-07-25 16:39:20 +03:00
410324b2c7 Move banners to the bottom 2022-07-25 16:39:09 +03:00
36d470279c Bump version to 6.1.4a2 2022-07-22 18:18:51 +03:00
e498119e0d Improved project dependency resolving when using the pio project init --ide command 2022-07-22 18:18:26 +03:00
9ff117b0fb Sync docs 2022-07-22 18:17:44 +03:00
2695690b34 Bump version to 6.1.4a1 2022-07-18 21:06:32 +03:00
8dc20f93d5 Merge branch 'release/v6.1.3' 2022-07-18 20:48:22 +03:00
f8d21e5b32 Merge tag 'v6.1.3' into develop
Bump version to v6.1.3
2022-07-18 20:48:22 +03:00
72ac6c86df Bump version to v6.1.3 2022-07-18 20:48:10 +03:00
8c2a7df53e Fixed a regression bug when opening device monitor without any filters // Resolve #4363 2022-07-18 20:46:27 +03:00
d92e36efa0 Minor fixes to email regexp 2022-07-18 18:06:37 +03:00
741e9a40b3 Bump version to 6.1.3a1 2022-07-18 17:27:13 +03:00
7527143fff Merge branch 'release/v6.1.2' 2022-07-18 17:26:24 +03:00
a23fef010f Merge tag 'v6.1.2' into develop
Bump version to 6.1.2
2022-07-18 17:26:24 +03:00
cd4f5541ac Bump version to 6.1.2 2022-07-18 17:26:10 +03:00
73089b3cb0 Warn about unknown device monitor filters // Resolve #4362 2022-07-18 17:24:38 +03:00
3a70c902a9 Docs: Improve docs for the test suite filter/ignore options 2022-07-18 14:57:22 +03:00
bedbae6311 Bump version to 6.1.2a3 2022-07-14 14:45:55 +03:00
842679c32b Export a "PIO_UNIT_TESTING" macro to the project source files and dependent libraries in the Unit Testing mode 2022-07-14 14:45:31 +03:00
10ff4ae77a Docs: Improve docs for advanced scripting 2022-07-14 14:45:16 +03:00
bc325ab2cc Increase number of http retries to 5 2022-07-13 18:32:04 +03:00
a31a7f2b06 Improved detection of Windows architecture // Resolve #4353 2022-07-13 18:26:21 +03:00
4278574450 Fixed an issue when the "pio pkg publish" command didn’t work with Python 3.6 // #4352 2022-07-13 14:46:40 +03:00
6f8f2511c2 Look for another mirror on any requests.exceptions.RequestException 2022-07-13 14:31:28 +03:00
5282124664 Bump version to 6.1.2a2 2022-07-12 22:21:42 +03:00
83bb6611b9 Fixed a regression bug when libArchive option declared in the library.json manifest was ignored // Resolve # 2022-07-12 22:21:09 +03:00
dcc02c3e14 Revert "Use generic MISSING helper"
This reverts commit 31a24e1652.
2022-07-12 22:06:29 +03:00
f070399cad Bump version to 6.1.2a1 2022-07-11 13:39:17 +03:00
b9920b286f CI: Run deployment on the master branch 2022-07-11 13:36:32 +03:00
d278f8f215 CI: Run deployment on the master branch 2022-07-11 13:36:01 +03:00
3c5c65769c Merge tag 'v6.1.1' into develop
Bump version to 6.1.1
2022-07-11 13:34:00 +03:00
2f7362951c Merge branch 'release/v6.1.1' 2022-07-11 13:33:59 +03:00
f4535190a3 Bump version to 6.1.1 2022-07-11 13:33:34 +03:00
236c4570cf Added new `monitor_encoding` project configuration option // Resolve #4350 2022-07-11 13:26:43 +03:00
5844c536a4 Typo fix 2022-07-10 11:50:13 +03:00
6627fd5790 fix compat mode when no framework (#4346)
fix strict compat mode when no framework
2022-07-09 22:50:02 +03:00
25074d80d3 Allowed specifying project environments for "pio ci" command // Resolve #4347 2022-07-09 21:58:34 +03:00
f032663b33 Bump version to 6.1.1rc1 2022-07-09 21:43:14 +03:00
d24702eb29 Fixed an issue with endless scanning of project dependencies // Resolve #4349 2022-07-09 21:42:47 +03:00
9051677d74 Deploy package to PyPi on the master push 2022-07-09 21:41:52 +03:00
7637286efa Improve detecting of common builder by paths 2022-07-09 21:36:37 +03:00
31a24e1652 Use generic MISSING helper 2022-07-09 19:25:04 +03:00
c8c4028a23 Bump version to 6.1.1a3 2022-07-09 17:23:57 +03:00
0bd27a36e9 Fixed an issue when a serial port was not automatically detected if the board has predefined HWIDs 2022-07-09 17:23:38 +03:00
ddfe5a6c03 Extend udev rules with QinHeng Electronics CH9102 USB-Serial adapter 2022-07-08 21:13:39 +03:00
ee93ca1615 Bump version to 6.1.1a2 2022-07-08 15:19:25 +03:00
4c2aca4956 Show "TimeoutError" only in the verbose mode when can not find a serial port 2022-07-08 15:18:52 +03:00
dd14b5e2ed Docs: Make supported IDEs "plural" 2022-07-08 14:22:13 +03:00
6464420c1c Bump version to 6.1.1a1 2022-07-06 20:06:16 +03:00
79ec493c79 Deployment: Build Python source tarball 2022-07-06 19:51:38 +03:00
abb464707d Merge branch 'release/v6.1.0' 2022-07-06 18:41:44 +03:00
7c846b8968 Merge tag 'v6.1.0' into develop
Bump version to 6.1.0
2022-07-06 18:41:44 +03:00
84c2e0a3d6 Tests: fest latest package version in runtime 2022-07-06 18:41:00 +03:00
c2ddc89e46 Bump version to 6.1.0 2022-07-06 16:24:03 +03:00
1495e24e1e Temporary disable ESPHome from CI 2022-07-06 16:22:13 +03:00
6e16b43568 Automatically upgrade outdated Unity library 2022-07-05 18:57:06 +03:00
6c18b37d54 Bump version to 6.1.0rc1 2022-07-04 18:50:23 +03:00
6134db8e81 Fixed an issue when library dependencies were installed for the incompatible project environment // Resolve #4338 2022-07-04 18:50:06 +03:00
3cf62f8fa6 Disable GoogleTest and Doctest frameworks on CI/Github Actions 2022-07-04 18:04:45 +03:00
523b6dfa98 Do not immediately terminate a testing program when results are received 2022-07-04 17:32:11 +03:00
3928cb522e Bump version to 6.1.0b2 2022-07-04 13:55:11 +03:00
de856ee730 Export IDEs templates 2022-07-04 13:54:40 +03:00
d3b7508bd5 docs: Fix a few typos (#4340)
There are small typos in:
- platformio/test/helpers.py
- platformio/util.py
- tests/project/test_savedeps.py

Fixes:
- Should read `specified` rather than `sepcified`.
- Should read `overridden` rather than `overriden`.
- Should read `compatibility` rather than `compatiblty`.
2022-07-03 13:16:33 +03:00
6c71a3bea2 Disable core linting with Python 3.6 2022-07-02 20:18:26 +03:00
d2e27f5385 Better wording with dependency resolving 2022-07-02 20:17:31 +03:00
2a5de43964 Refactor project IDE integration 2022-07-02 20:16:56 +03:00
029e66cd06 PyLint fixes 2022-07-02 19:19:48 +03:00
96fb8c74f9 PyLint: fix "superfluous-parens" 2022-07-02 19:05:32 +03:00
b006f53010 PyLint: Fix "useless-object-inheritance" 2022-07-02 19:03:25 +03:00
19d518fc4c Fix PyLint: Consider explicitly re-raising 2022-07-02 18:37:57 +03:00
f01cd7570c Fix handling of unknown targets when processing pre/post actions 2022-07-01 20:14:58 +03:00
ffebfd4376 Drop deprecated "program" target 2022-07-01 19:44:14 +03:00
e4264a6a51 Make $PROGPATH configurable 2022-07-01 19:38:51 +03:00
d85bc0f7f8 Make $PROGPATH configurable 2022-07-01 19:29:07 +03:00
1445a91fab Docs: Refactor "Custom firmware/program name" scripting example 2022-07-01 18:43:08 +03:00
3b878747f2 Bump GoogleTest dependency to 1.12.1 2022-07-01 18:03:48 +03:00
401f8a4891 Added new "pio run --monitor-port" option to specify custom device monitor port to the "monitor" target // Resolve #4337 2022-06-29 22:46:53 +03:00
6bec593b93 Simplify output from the clean target 2022-06-29 22:17:30 +03:00
aef49a8bff Docs: Improve advanced scripting docs 2022-06-29 14:34:49 +03:00
772e25df49 Bump version to 6.1.0b1 2022-06-28 19:37:16 +03:00
3363b3a516 Significantly improved support for Pre & Post Actions 2022-06-28 19:36:49 +03:00
1f096fe03f Fixed "non-existent variable ''projenv''" when ESP-IDF is used // Resolve #4329 2022-06-28 14:28:52 +03:00
32e440bec7 Fixed an issue when testing results were wrong in the verbose mode // Resolve #4336 2022-06-28 12:59:23 +03:00
99b5204802 Fixed a "PermissionError" on Windows when running "clean" or "cleanall" targets // Resolve #4331 2022-06-27 20:12:04 +03:00
3c17b31d5e Export twice to maintain backward compatability (#4333)
* Export twice to maintain backward compattability

* Removed double import and just use another variable (after running make before-commit)

* Improve comment
2022-06-27 13:24:42 +03:00
89a80f158e Bump version to 6.0.3rc2 2022-06-26 17:33:22 +03:00
c42db2ec22 Rename pio pkg publish --non-interactive option to the --no-interactive 2022-06-26 17:32:47 +03:00
6a3b6f0d44 Bump GoogleTest to ^1.12.0 and Doctest to ^2.4.9 2022-06-26 17:21:09 +03:00
ca2622b7a6 Skip GoogleTest for CI on Windows 2022-06-26 16:06:25 +03:00
b9a9fd4f43 Updated "Getting Started" documentation for GoogleTest 2022-06-26 14:47:25 +03:00
1ea6d47110 Initialize unit testing target once per project builder 2022-06-25 22:44:35 +03:00
256acf7e23 Merge branch 'feature/c-scanner' into develop 2022-06-25 20:53:18 +03:00
284ccc9e8a Remove ProjectAsLibBuilder's singleton 2022-06-25 20:53:08 +03:00
655eedd7b0 Export Unit Testing flags only to the project build environment 2022-06-25 20:20:13 +03:00
bb6490d6f2 Do not automatically configure any flags for the testing frameworks 2022-06-25 20:11:17 +03:00
300b7b2138 Minor improvements to the ProjectAsLibBuilder 2022-06-25 20:10:18 +03:00
86c4bd69d2 Fixed an issue with the LDF when recursively scanning dependencies in the "chain" mode 2022-06-24 21:17:26 +03:00
dd63c8002a Make "MatchSourceFiles' configurable for source extensions 2022-06-24 21:09:44 +03:00
13fc8508b3 Bump "uvicorn" dependency to 0.18.* 2022-06-23 18:58:53 +03:00
a76933990c Remove generic targets 2022-06-23 14:20:27 +03:00
7e3e394707 Bump version to 6.0.3rc1 2022-06-22 19:05:05 +03:00
cee3f4d90f Do not resolve debugging serial port by default 2022-06-22 19:03:50 +03:00
c557473cfb Docs: Fix redirect URL 2022-06-22 13:15:32 +03:00
f893fcf135 Bump version to 6.0.3b1 2022-06-20 22:41:02 +03:00
092326cb91 Warn about incompatible Bash version for the Shell Completion // Resolve #4326 2022-06-20 22:40:36 +03:00
92a5c1bac6 Handle UDEV rules and their PID/VID data when searching for serial port 2022-06-20 22:21:28 +03:00
4b2f0eb1d5 Extend CP210X rules 2022-06-20 22:20:47 +03:00
9ae67fdad9 Fixed an issue on Windows OS when flags were wrapped to the temporary file while generating compilation database 2022-06-20 14:49:39 +03:00
5142feba7a Use new unified package API for deprecated pio lib command // Resolve #4198 2022-06-20 14:24:09 +03:00
8cbe7bc7a6 Use new unified package API for deprecated pio platform command // Issue #4198 2022-06-18 17:25:38 +03:00
d8f36b6534 Minor improvements to pkg show layout 2022-06-18 16:59:49 +03:00
58d533a3bb Prefer Black Magic GDB for uploading // Issue #4023 2022-06-18 14:06:24 +03:00
18e130fd12 Bump version to 6.0.3a7 2022-06-17 23:05:47 +03:00
b72c1636f7 Improved a serial port finder for Black Magic Probe // Resolve #4023 2022-06-17 23:05:20 +03:00
f68c18d1e5 Fixed an issue when the build_unflags option was not applied to the ASPPFLAGS scope 2022-06-17 18:58:21 +03:00
db6b8a6dbc Fixed an issue when `build_unflags operation ignores a flag value // Resolve #4309 2022-06-17 14:25:39 +03:00
5afa0a955e PyLint fix 2022-06-17 13:58:26 +03:00
ca3b3717d3 Bump version to 6.0.3a6 2022-06-17 12:31:51 +03:00
d4784c05f5 Documented Stringification – converting a macro argument into a string constant // Resolve #4310 2022-06-17 12:29:09 +03:00
7a01da7039 Added `env.StringifyMacro(value)` helper function for the Advanced Scripting 2022-06-17 12:25:52 +03:00
42690d3fa7 Find serial port using known device HWIDs 2022-06-16 16:58:03 +03:00
50cbc4d4e2 Allowed to Import("projenv") in a library extra script // Resolve #4305 2022-06-16 13:04:38 +03:00
63c2278a83 Bump version to 6.0.3a5 2022-06-16 09:46:04 +03:00
4bccaae945 Fix an issue with serial port finding when board does not have HWIDs // Issue #4323 2022-06-16 09:45:20 +03:00
e12bc9fe5f Do not resolve dependencies from the project "src" folder when the test_build_src option is not enabled 2022-06-15 18:05:55 +03:00
ac63cf0240 Bump version to 6.0.3a4 2022-06-15 15:37:20 +03:00
30709fd0b3 Replaced monitor_flags with independent project configuration options: monitor_parity, monitor_eol, monitor_raw, monitor_echo 2022-06-15 15:36:17 +03:00
6f9985125d Fixed an issue when the monitor filters were not applied in their order // Resolve #4320 2022-06-15 14:30:05 +03:00
743a3e2c02 Improved a serial port finder for a board with predefined HWIDs // Resolve #4308 2022-06-15 12:51:06 +03:00
bd21ff0d3e Fixed an issue when monitor_speed was ignored in configuration file // Resolve #4319 2022-06-14 10:02:23 +03:00
46858fff39 Bump version to 6.0.3a3 2022-06-13 20:19:28 +03:00
854c549e1c Restore original standard streams for device monitor // Issue #3939 2022-06-13 20:19:09 +03:00
4b5bc91abb Merged the Unit Testing “building” stage with “uploading” for the embedded target // Resolve #4307 2022-06-12 12:33:02 +03:00
375c396b7b Minor improvements for pio device monitor command 2022-06-12 12:14:28 +03:00
7aaa9c028b Bump version to 6.0.3a2 2022-06-11 20:56:24 +03:00
7f351bc7c8 Automatically reconnect device monitor if a connection fails // Resolve #3939 2022-06-11 20:55:52 +03:00
c42fe32972 Fix typo in upload_protocol 2022-06-10 17:30:36 +03:00
a6e61a7a5a Restructure "device" module 2022-06-10 14:01:55 +03:00
4bc3e3cf95 Restructure "device" module 2022-06-10 14:01:42 +03:00
4a7a8b8b68 Update tests 2022-06-10 14:00:46 +03:00
51ab0bbd3c Update tests 2022-06-10 13:32:48 +03:00
30937df4e6 Lock "requests" dependency for Python 3.6 2022-06-10 12:46:52 +03:00
b15a4e746a Bump version to 6.0.3a1 2022-06-02 18:09:11 +03:00
1b17234c41 Fixed an issue when a custom "pio test --project-config" was not handled properly // Resolve #4299 2022-06-02 18:05:41 +03:00
26f897cb55 Fix PyLint 2022-06-01 18:29:49 +03:00
99d049a6dd Run deployment on tags 2022-06-01 17:24:02 +03:00
f3c3402b35 Run deployment on tags 2022-06-01 17:21:57 +03:00
55b9c446f1 Merge tag 'v6.0.2' into develop
Bump version to 6.0.2
2022-06-01 16:27:53 +03:00
e3ca0c6f04 Merge branch 'release/v6.0.2' 2022-06-01 16:27:53 +03:00
4ff591bd7e Bump version to 6.0.2 2022-06-01 15:55:42 +03:00
b02335a294 Allow to implement own "FindInoNodes" method // Resolve #4297 2022-06-01 14:11:10 +03:00
cc3ea65faa Fix release branch name 2022-06-01 13:49:52 +03:00
206bb38f54 Move "team" command to the "account" module 2022-06-01 13:16:57 +03:00
10da6bf5c6 Cleanup 2022-06-01 13:16:45 +03:00
22860cd4e5 Rename "helpers" to "validate" 2022-06-01 12:57:23 +03:00
0b8a595288 Move "access" command to the registry module 2022-06-01 12:46:57 +03:00
7e7856e44c Restructure "registry" modules 2022-06-01 12:35:55 +03:00
b104b840c4 Move "org" command to the account module 2022-06-01 12:28:41 +03:00
32386bec18 Make "get_project_watch_lib_dirs" public for IDEs 2022-06-01 12:11:26 +03:00
db366b3163 Fix test 2022-06-01 12:10:57 +03:00
472c80159d Do not export common libdeps_dir 2022-05-31 21:59:24 +03:00
4a95148cd0 Do not modify existing directory 2022-05-31 20:37:44 +03:00
11a43b2693 Regroup "system" commands 2022-05-31 17:31:21 +03:00
12fb02db6e Use "cli" to the top commands 2022-05-31 17:30:41 +03:00
52f8e98eed Move "run" command to the root 2022-05-31 17:20:56 +03:00
dcc63da2ef Move "check" command to the root 2022-05-31 17:16:55 +03:00
756bb07d1a Move "home" command to the root 2022-05-31 17:14:52 +03:00
d2be7033e9 Move "remote" command to the root 2022-05-31 17:12:59 +03:00
27ccdc76a0 Move "system" command to the root 2022-05-31 17:09:22 +03:00
dcecd5f922 Refactor handling of CLI commands 2022-05-31 17:07:56 +03:00
506a08c7cf Fix tests 2022-05-31 14:04:49 +03:00
e2892d5d4c Bump version to 6.0.2rc2 2022-05-30 22:23:36 +03:00
0ce7885833 Fix module import 2022-05-30 22:23:06 +03:00
6b7e8ebe97 Bump version to 6.0.2rc1 2022-05-30 21:04:19 +03:00
6e5aee5ef3 Rename "registry" module to the "client" 2022-05-30 21:02:59 +03:00
4aebf8c9d7 Refactor account module 2022-05-30 21:00:22 +03:00
1f75430fab Move registry client to the package module 2022-05-30 20:36:18 +03:00
2564b9eb78 Move http module to the root 2022-05-30 20:29:35 +03:00
cf558036d0 Sync docs 2022-05-30 20:22:48 +03:00
b568eb68d6 Docs: refactor installation guide and FAQ 2022-05-30 18:53:53 +03:00
19006378a8 Sync docs 2022-05-30 14:27:45 +03:00
a19c4dbcda Show a warning when testing an empty project without a test suite // Resolve #4278 2022-05-28 22:09:14 +03:00
22a0a20666 Update deps 2022-05-28 22:07:44 +03:00
440bb1e6f4 Bump version to 6.0.2b1 2022-05-26 22:30:20 +03:00
87dffa36b8 Improved support for user inputs 2022-05-26 22:29:51 +03:00
bd052d0ce0 Show a warning when testing an empty project without a test suite // Resolve #4278 2022-05-26 19:55:23 +03:00
73dd29c59c Follow symbolic links during searching for the unit test suites // Resolve #4288 2022-05-26 19:18:21 +03:00
460a983ab2 Do not export empty scopes to the build environment 2022-05-26 19:15:15 +03:00
ea94f65159 Minor improvements 2022-05-26 19:11:33 +03:00
6f6460fd4e Minor improvements 2022-05-26 19:10:58 +03:00
5f812409d4 Fixed an issue with debugging assembly files without preprocessor (".s") 2022-05-25 19:23:24 +03:00
87f2e86928 Fix filter argument used in remote agent (#4291)
* Fix filter argument used in remote agent

* Linting

* Renamed reserved variable name to filter_
2022-05-25 14:54:08 +03:00
626640cc05 Accurate information about broken test suites in PIO Core 5.0 // Resolve #4279 2022-05-20 21:10:10 +03:00
f5e0ccecc3 Docs: Sync dev-platforms 2022-05-20 14:44:54 +03:00
598769fe1b Bump version to 6.0.2a2 2022-05-20 10:57:24 +03:00
f7e24f2093 Drop "test_verbosity_level" configuration option // Issue #4276 2022-05-20 10:56:42 +03:00
9b141bf5a8 Control Unit Testing verbosity with a new test_verbosity_level configuration option // Resolve #4276 2022-05-19 21:23:30 +03:00
9d2adb37f3 Sync examples 2022-05-19 19:32:08 +03:00
97e2d24cd1 Use Python 3.9 for CI examples 2022-05-19 19:18:38 +03:00
720732eba6 Fix env section location 2022-05-19 19:16:52 +03:00
37c6f20747 Test only popular dev-platforms 2022-05-19 19:10:54 +03:00
e27c1c39e4 Remove debug messages 2022-05-19 18:38:17 +03:00
1e000027c7 Fix master branch 2022-05-19 18:32:27 +03:00
e3fea07596 Add deployment workflow 2022-05-19 18:23:06 +03:00
06ed9ba77d Fixed an issue when "build_src_flags" were applied outside project scope // Resolve #4277 2022-05-19 17:55:27 +03:00
f4d9769450 Move ino2cpp tests to the misc folder 2022-05-19 14:36:24 +03:00
9da7c42be4 Exclude ESPHome from projects CI on Windows 2022-05-19 14:31:00 +03:00
3419558265 Use private Github Actions environment 2022-05-19 13:29:48 +03:00
61383f9b08 Pass extra envs to the tox 2022-05-19 12:18:08 +03:00
be0acaed40 Cleanup CI configs 2022-05-19 12:02:52 +03:00
0c4c4ac657 Use globals() instead of sys.modules 2022-05-18 23:14:15 +03:00
bb8b115a0b Fix projects CI workflow 2022-05-18 22:29:40 +03:00
2e2735a49c Typo fix 2022-05-18 22:28:05 +03:00
7badd54c89 Exclude "esphome" from testing projects for macOS and Windows 2022-05-18 22:23:09 +03:00
4dfc561551 Dynamically import legacy platform module 2022-05-18 22:18:53 +03:00
3c2afeba89 Fix account related tests 2022-05-18 22:18:15 +03:00
d2d46f4aea Ignore "DeprecationWarning: the load_module() method is deprecated and slated for removal in Python 3.12" SCons warning 2022-05-18 18:47:27 +03:00
ccc7d9c9a4 Update CI badges 2022-05-18 16:17:20 +03:00
45fcb40a5c Dynamically load refactored dev-platform module 2022-05-18 16:16:51 +03:00
1585b829be Add CI workflow for popular PlatformIO projects (#4273)
* Add CI workflow for popular PlatformIO projects

* Run projects CI on each commit

* Run mega2560 env for Marlin project

* Run projects CI on several OS with Python 3.9

* Use the latest version of 3rd party actions

Co-authored-by: Ivan Kravets <me@ikravets.com>
2022-05-18 15:54:54 +03:00
0ceae62701 Better informing about deprecated commands 2022-05-17 21:11:29 +03:00
f2bdb17c55 Bump version to 6.0.2a1 2022-05-17 19:47:33 +03:00
83b00ac80c Remove pio update test 2022-05-17 19:47:15 +03:00
a76e445ed9 Merge branch 'release/v6.0.1' 2022-05-17 19:23:31 +03:00
edff591c90 Merge tag 'v6.0.1' into develop
Bump version to 6.0.1
2022-05-17 19:23:31 +03:00
cb7148d018 Bump version to 6.0.1 2022-05-17 19:23:00 +03:00
38afa07dbe Use Marshmallow v3.14.1 for Python 3.6 2022-05-17 19:10:54 +03:00
92073a4ccd Deprecate "pio update", "pio lib", and "pio platform" commands 2022-05-17 18:57:40 +03:00
abf6304818 Fixed an issue when using "Interpolation of Values" and merging str+int options // Resolve #4271 2022-05-17 16:03:33 +03:00
9a86175701 Bump version to 6.0.1b1 2022-05-17 13:34:03 +03:00
b764a2220f Improved support for the renamed configuration options // Resolve #4270 2022-05-17 13:33:25 +03:00
3776233233 Rename "shared" module to the "public" 2022-05-16 16:56:01 +03:00
0d92e8fc17 Bump version to 6.0.0a1 2022-05-16 14:46:52 +03:00
40422eac2e Fixed an issue when calling built-in pio device monitor filter 2022-05-16 14:46:37 +03:00
0fb4b1e109 Merge tag 'v6.0.0' into develop
Bump version to 6.0.0
2022-05-16 14:22:08 +03:00
44ecc7c666 Merge branch 'release/v6.0.0' 2022-05-16 14:22:07 +03:00
26d659c433 Bump version to 6.0.0 2022-05-16 14:21:57 +03:00
58c4145809 Refactor library management docs 2022-05-16 14:18:45 +03:00
fe08ce7795 Implement shared API 2022-05-16 11:39:18 +03:00
9163e9e67d Rename pio project data to the pio project metadata command 2022-05-15 16:57:27 +03:00
7acae6461e Merge branch 'develop' of https://github.com/platformio/platformio-core into develop 2022-05-15 15:35:07 +03:00
e7a172b8dd qtcreator: add project-update makefile target (#4267)
* qtcreator: add project-update makefile target

* add prompt and delete .pio/

* formatting

* forced rm

* remove workaround of deleting .pio/
2022-05-15 15:34:57 +03:00
b90e89a791 no message 2022-05-15 14:54:07 +03:00
db11244f49 qtcreator IDE gitignore tweaks (#4266)
* add .gitignore to project files
  * exclude qtc_clangd
  * don't exclude user project config file
2022-05-15 13:52:59 +03:00
54f0748201 Cache a build metadata only for debugging // Resolve #4267 2022-05-15 13:52:11 +03:00
575f0ae300 Bump version to 6.0.0rc3 2022-05-15 13:47:32 +03:00
7a100fb0b0 Use device finder for automatic detection of upload port 2022-05-15 13:46:44 +03:00
d01d314f47 Pick the last USB device port 2022-05-15 13:13:45 +03:00
e5e2210768 Improved automatic detection of a testing serial port // Resolve #4076 2022-05-14 23:30:36 +03:00
d22b479bd3 Regroup device command 2022-05-14 18:21:44 +03:00
19853b0b66 Implement config.get_default_env() 2022-05-14 17:55:36 +03:00
ce62514a17 Resolve project dependencies with pio project init command 2022-05-14 16:31:08 +03:00
4a4ba5594b Rename "load_project_ide_data" to the "load_build_metadata" 2022-05-14 16:30:20 +03:00
af5a820862 Rename "load_project_ide_data" to the "load_build_metadata" 2022-05-14 16:29:41 +03:00
40e4e38e0c Do not override CWD when executing a package command 2022-05-14 16:23:36 +03:00
cb1c825747 Merge branch 'develop' of https://github.com/platformio/platformio-core into develop 2022-05-14 15:27:13 +03:00
8c27754045 qtcreator IDE template now generates a "generic" Qt project (#4262)
* Create qtcreator-generic IDE template.

* Fix case of #define in qtcreator-generic template .config file.

* follow directory move

* * fix includes output
  * fixup -mlong-calls for clang
  * add Makefile to files output

* fix escaping in config output

* Makefile improvements:
  * support any platformio run target
  * remove platformio deprecated -f option
  * remove explicit default target (first is always default)

* replace qtcreator rather than making another IDE target

Co-authored-by: Donna Whisnant <dewhisna@users.noreply.github.com>
2022-05-14 15:26:04 +03:00
3247e661e9 Regroup "pio project" command 2022-05-14 13:41:20 +03:00
7c93167d52 Docs: Document double hyphen for "pio debug" // Resolve #4260 2022-05-13 21:04:44 +03:00
79b2bfdefe Fix an issue with multiple symbol definitions when framework uses own Unity // Resolve #4259 2022-05-12 15:34:50 +03:00
de7d710943 Look for custom "unity_config.h" only in the "test" dir 2022-05-12 14:17:45 +03:00
b88a29e652 Bump version to 6.0.0rc2 2022-05-12 13:41:45 +03:00
ed0b12dcf9 Improve project config parser to resolve renamed options // Issue #4259 2022-05-12 13:24:27 +03:00
280bede0e9 Bump version to 6.0.0rc1 2022-05-10 20:22:36 +03:00
e6938f8f39 List available project tests with a new "pio test --list-tests" option 2022-05-10 20:21:49 +03:00
6d705172f5 Docs: Extend migration guide with Unit Testing solution 2022-05-10 19:18:36 +03:00
8fff7084db Rename pio test --output-{format} options to --{format}-output 2022-05-10 18:25:26 +03:00
e75bf27b5f Add "-pthread" to the LINKFLAGS 2022-05-10 17:23:03 +03:00
2c99607d3d Pass "-pthread" flag to GoogleTest only on Unix OS 2022-05-10 16:46:48 +03:00
c09af13b7f Add "-pthread" flag for GoogleTest 2022-05-10 16:13:30 +03:00
ee6b498ca9 Optimize unit testing report CLI 2022-05-10 15:25:30 +03:00
65f2f02d93 Add support for GoogleTest testing and mocking framework // Resolve #3572 2022-05-10 14:30:02 +03:00
960edb5611 Use full testing program path on Windows 2022-05-10 11:59:59 +03:00
cda7a97e67 Do not automatically generate JSON report 2022-05-09 22:32:16 +03:00
c520700276 Export testcase file & line to JUnit XML 2022-05-09 19:20:33 +03:00
a7654a6098 Move Unity code parts to the Unity runner 2022-05-09 18:58:43 +03:00
814679522a Do not override embedded std flag 2022-05-09 18:49:15 +03:00
4249349c2b Add hint about verbose output 2022-05-09 18:40:46 +03:00
d065646d3e Update SPDX license list to v3.17 2022-05-09 10:08:08 +03:00
0cf7aeeec9 Fix test on Github Actions 2022-05-08 14:42:07 +03:00
277ccdafb6 Bump version to 6.0.0b1 2022-05-07 17:58:42 +03:00
5b00f6fb95 Skip "test_doctest_framework" from Github Actions / Windows 2022-05-07 17:55:32 +03:00
3f46a97b6b Fix LDF lib resolving 2022-05-07 16:44:11 +03:00
3989979ca3 Pass extra arguments to the native program with a new "pio run --program-arg" option // Resolve #4246 2022-05-07 16:22:05 +03:00
50eda82e27 Fix test 2022-05-07 14:09:11 +03:00
daa3481862 Pass extra arguments to the testing program with a new "pio test --program-arg" option // Resolve # 3132 2022-05-07 13:31:19 +03:00
2d94000dd5 Rename source.file to source.file name and report project folder 2022-05-07 13:24:27 +03:00
e3eb155d76 Improve doctest results parser 2022-05-07 13:23:03 +03:00
f95e23118c Fix test 2022-05-06 21:57:39 +03:00
82778473fe New: "doctest" testing framework // Resolve #4240 2022-05-06 20:00:23 +03:00
dae3b9665b Implement TestCase.humanize 2022-05-06 19:56:39 +03:00
f19058df65 Try to resolve paths if the common part is not found 2022-05-06 19:40:00 +03:00
3c7bec7c61 Exclude SVG files by default 2022-05-06 19:39:21 +03:00
c4388a6904 Fixed an issue when LDF ignores build_src_flags in the “deep+” mode // Resolve #4253 2022-05-06 10:31:34 +03:00
6d1e637518 Add support for Semihosting and Unit Testing // Resolve #3516 2022-05-05 17:36:15 +03:00
bbd56d6eb0 Document using QEMU, Renode, SimAVR simulators with Unit Testing // Resolve #4238 2022-05-05 15:33:39 +03:00
0b317ef04b Implement buffering for the testing output 2022-05-05 13:02:27 +03:00
c0cfbe2ce0 Using hardware Simulators for Unit Testing // Issue #4238 2022-05-04 23:20:37 +03:00
3ed5d41df5 Strip ANSI codes from Unity output 2022-05-04 18:56:57 +03:00
517ee6532f Move "strip_ansi_codes" to the util 2022-05-04 18:55:34 +03:00
653f22f85b Fix issue with nested interpolation 2022-05-04 14:52:11 +03:00
38906478d3 Professional collaborative platform for safety-critical and declarative embedded development 2022-05-03 22:09:25 +03:00
e81d83b8c2 Added support for a Custom Unity Library // Resolve #3980 2022-05-03 21:47:20 +03:00
b12d9f62b9 Show list of failed tests in the summary // Resolve #4251 2022-05-03 19:30:15 +03:00
0849e5faad Rename "src_filter" and "src_build_flags" options // Resolve #4245 2022-05-03 18:39:49 +03:00
1a4419059d Added support for "socket://" and "rfc2217://" protocols using "test_port" option // Resolve #4229 2022-05-03 18:11:23 +03:00
4ef1333abc Refactor test runner mixins to the test output readers 2022-05-03 15:21:53 +03:00
2b11f64ef1 New Custom Testing Framework 2022-05-03 14:30:15 +03:00
5b98f432f2 Update deps 2022-05-03 14:25:29 +03:00
76779e6af4 Sync docs 2022-05-01 23:00:25 +03:00
738d537266 Docs: Sync Intel MCS51 dev-platform 2022-05-01 20:10:25 +03:00
327d5990d6 Docs: Minor improvements 2022-04-29 21:51:35 +03:00
16021d0df7 Added support for "Test Hierarchies" // Issue #4135 2022-04-29 20:46:43 +03:00
b37a74dfd9 Refactor Unit Testing documentation 2022-04-29 20:46:04 +03:00
d02f02731f Rename the "test_build_project_src" project configuration option to "test_build_src" 2022-04-29 20:44:28 +03:00
4295c54c67 Sync docs and examples 2022-04-29 14:50:15 +03:00
fb1e4fa02b Add "--filter" option to the pio remote test command 2022-04-28 22:02:16 +03:00
62b8a63b80 Add --filter to remote test (#4244) 2022-04-28 18:25:43 +03:00
ab3c832f5e Pylint fix 2022-04-27 21:15:08 +03:00
d380e7ea01 Update Cppcheck and PVS-Studio tools to the latest available 2022-04-27 20:47:13 +03:00
e69fd5e682 Minor improvements to check tools
- Better handling of unusual macro for PVS-Studio
- Fail the analysis if Cppcheck exited with an internal error
2022-04-27 20:45:21 +03:00
285f19e132 Properly handle cases when path to a file with a defect is unknown
Resolves #4237
2022-04-27 20:40:55 +03:00
4151f53e14 Rename unit testing module to "test" 2022-04-26 15:09:51 +03:00
5895fb9faf Bump version to 6.0.0a2 2022-04-25 22:11:50 +03:00
19e22d74f3 Fix unit testing case 2022-04-25 15:30:54 +03:00
26ed6a5548 Implement required setUp/tearDown functions for the latest Unity testing framework 2022-04-25 13:23:33 +03:00
05dd7dd811 Revert back showing test cases status before 2022-04-24 21:08:49 +03:00
8b694f3734 Unity: show test case status before stdout 2022-04-24 11:28:07 +03:00
c9026a1b9c Generate reports in JUnit and JSON formats // Resolve #2891 2022-04-23 19:19:25 +03:00
9b221a06c8 Unity: Avoid "weak" attributes on Windows 2022-04-23 11:05:28 +03:00
f88904e246 Export "ConfigureDebugFlags" to build env (bakward compatibility with Zephyr build script) 2022-04-22 18:14:28 +03:00
e3533dcb01 Added support for test hierarchies (nested test suites) // Resolve #4135 2022-04-22 15:19:12 +03:00
8edb5ffe20 Use unsigned long for unityOutputStart 2022-04-22 10:55:59 +03:00
90e6cd7b46 Fixed an issue when command line parameters do not override values // Resolve #3845 2022-04-21 20:23:30 +03:00
1fa73fb632 Typo fixes 2022-04-21 20:22:57 +03:00
a615af233a Provide more information when the native program crashed on a host (errored with a negative return code) // Resolve #3429 2022-04-21 19:32:12 +03:00
4817e13823 PyLint fixes 2022-04-21 19:30:55 +03:00
ee43b86742 Introduce a new PlatformIO Unit Testing engine 2022-04-21 18:11:49 +03:00
93bfc57dea Merge branch 'develop' of https://github.com/platformio/platformio-core into develop 2022-04-21 17:12:31 +03:00
a568a5c356 Keep recursive for the glob 2022-04-21 17:10:38 +03:00
0b21977e48 Sync docs 2022-04-21 17:07:21 +03:00
2f7668aef5 Improve src matcher for the symbolic links 2022-04-21 16:31:40 +03:00
72fa6eebba Switch to FS JSON loader 2022-04-21 16:30:55 +03:00
2f6a417168 Move test 2022-04-20 18:54:40 +03:00
faa63727ab Revert back to title() 2022-04-20 18:48:26 +03:00
a2b1a0a0a7 Use capitalize instead of title 2022-04-20 18:36:28 +03:00
0d7bc09c49 Cache DL requests 2022-04-20 18:33:46 +03:00
f57ca747a9 Add support for DL mirrors 2022-04-20 18:03:55 +03:00
624421e4b0 Memoize dev-platform instance cross the clonned build envs 2022-04-19 13:51:43 +03:00
943c6bc59c Move INO converter to a separate tool 2022-04-19 11:36:05 +03:00
9ce0b0e25b Use builtin "title()" 2022-04-19 11:33:56 +03:00
df3a13fc61 Move MISSING to the compat 2022-04-19 11:32:36 +03:00
5a0a215bfc Use PY3 super() zero-argument syntax 2022-04-15 14:44:30 +03:00
eaff7f307c Avoid RecursionError for circular_dependencies // Resolve #4228 2022-04-15 14:17:21 +03:00
8d63591ce8 Extend "library.json" with an example for passing flags to library dependencies // Resolve #1941 2022-04-13 18:55:44 +03:00
0e3aa29689 Introduce PlatformIO Core 6.0 2022-04-13 15:32:05 +03:00
a56b19ff65 Improve pio exec command on Windows 2022-04-13 13:58:31 +03:00
62b7ec271f Keep PY2 for backward compatibility with ESP8266/ESP32 // Resolve #4226 2022-04-13 12:51:13 +03:00
5515bef3d7 Add backward compatibility with ESP-IDF build script // Resolve #4225 2022-04-13 12:47:17 +03:00
092f5de231 Fix removing temporary debugging data on Windows 2022-04-12 18:17:38 +03:00
81fdd75aac Report problematic file before publishing package to the registry 2022-04-12 12:30:49 +03:00
f63b2f79e0 Fixed an issue when GCC preprocessor was applied to the ".s" assembly files on case-sensitive OS such as Window OS // Resolve #3917 2022-04-10 19:21:03 +03:00
0501d55c8f Fixed an issue with calling an extra script located outside a project // Resolve #4220 2022-04-10 19:09:29 +03:00
fe6f51369e Autoinstall dev-platform for the "clean" target 2022-04-10 13:56:44 +03:00
8f454c7e9c Bump version to 5.3.0b5 2022-04-09 20:31:40 +03:00
965feccfdc Extended Interpolation of Values with "${this}" pattern // Resolve #3953 2022-04-09 20:31:06 +03:00
5e18f9bbda Finally removed all tracks to the Python 2.7 2022-04-09 17:46:21 +03:00
541fcbf015 Added a new build variable (COMPILATIONDB_INCLUDE_TOOLCHAIN) to include toolchain paths in the compilation database // Resolve #3735 2022-04-09 12:53:22 +03:00
16f5374474 Typo fix 2022-04-08 21:58:29 +03:00
b414745aa1 Fixed an issue when LDF ignores the project "lib_deps" while resolving library dependencies // Resolve #3598 2022-04-08 18:37:16 +03:00
696d95bf1b Black formatter 2022-04-08 18:36:43 +03:00
1269ce064a Improved detection of a package type from the tarball archive // Resolve #3828 2022-04-08 13:58:40 +03:00
9097d455db Avoid working with detached / non-existent git branches when checking for updates (#4217)
* Avoid working with detached / non-existent git branches when checking for updates

b/c we can't use `pull` anyway in that situation
Otherwise, ask for the specific branch via `refs/heads/{branch}` and
also fail when it is not available

* Update vcsclient.py

Co-authored-by: Ivan Kravets <me@ikravets.com>
2022-04-08 13:15:35 +03:00
1615159014 Fix test 2022-04-08 12:03:31 +03:00
e4e1e72c30 Bump version to 5.3.0b4 2022-04-07 23:10:35 +03:00
43329b7748 Minor improvements for symlink support // Issue #3348 2022-04-07 23:03:40 +03:00
2280865936 Resovle symlink based on the saved cwd 2022-04-05 09:11:10 +03:00
fb2f3c8836 Resovle symlink based on the saved cwd 2022-04-05 09:07:44 +03:00
e2f21212b7 Added support for symbolic links allowing pointing the local source folder to the Package Manager // Resolve #3348 2022-04-04 23:14:19 +03:00
d7597d0992 Cache downloads cleanup 2022-04-04 22:45:25 +03:00
c21876ebe3 Typo fix in class name 2022-04-04 22:22:22 +03:00
76bea5b7a7 Cache downloads cleanup 2022-04-04 22:21:06 +03:00
a03d82ff1a Replace package meta URL with URI 2022-04-04 14:18:11 +03:00
f555656c92 Bump version to 5.3.0b3 2022-04-03 23:18:01 +03:00
f289ebd1f3 Revert back lib deps tree to ascii chars 2022-04-03 23:17:29 +03:00
41b3646012 Bump version to 5.3.0b2 2022-04-03 19:54:03 +03:00
8de5db4b48 Added support for “scripts” in package manifest // Resolve #485 2022-04-03 19:53:34 +03:00
d8be12dcdd PyLint fix 2022-04-03 10:54:23 +03:00
71f9401e23 Fixed an issue when manually removed dependencies were not uninstalled from the storage // Resolve #3076 2022-04-02 22:30:35 +03:00
cdd63dec65 Do not process package that was installed into the "env" storage // Resolve #2910 2022-04-02 16:38:54 +03:00
279fdfc47a Show project dependency licenses when building in the verbose mode 2022-04-02 16:28:40 +03:00
feda42f18f Added support for multi-licensed packages in library.json using SPDX Expressions // Resolve #4037 2022-04-02 14:19:24 +03:00
d86f7fc25e Added ability to override a tool version using the "platform_packages" option // Resolve #3798 2022-04-01 22:05:30 +03:00
e4fb675d5f Install only missed dependencies for the private libraries // Resolve #2910 2022-04-01 17:25:40 +03:00
25e786e6a5 Docs: Sync with dev-platforms 2022-04-01 14:29:38 +03:00
fd01e98cb1 Fix an issue with automatic installation of debug dependencies 2022-04-01 13:47:07 +03:00
2a88cdb8df Bump version to 5.3.0b1 2022-03-31 19:26:21 +03:00
be8f842061 Automatically install dependencies of the local (private) libraries // Resolve #2910 2022-03-31 19:25:44 +03:00
fcb81ae074 Update docs with the new Package Specifications // Resolve #3373 2022-03-31 15:44:16 +03:00
7d9c018b44 Implement Click logging handler for package manager 2022-03-30 21:40:59 +03:00
a6e12532f8 Implement pio pkg search command // Issue #3373 2022-03-30 17:32:05 +03:00
bd202f55ce Rename search "filters" to "qualifiers" 2022-03-30 14:43:02 +03:00
f7b5a7bed8 Added support for the custom Clang-Tidy configuration file // issue #4186 2022-03-30 12:01:17 +03:00
6123d6f9bf Don't append --checks=* when the --config or --config-file flags are set (#4210)
Appending --checks=* causes clang-tidy to ignore the flags --config
and --config-file, which breaks the ability to use a clang-tidy file
2022-03-30 11:47:14 +03:00
6c8173d1aa Implement pio pkg show command // Issue #3373 2022-03-29 16:39:48 +03:00
d2f857d176 Lock "click" dependency for Python 3.6 2022-03-28 20:56:23 +03:00
1e2afafbc4 Use parse_datetime API 2022-03-28 18:18:51 +03:00
927c5c5e36 Do not install any dependencies on the "clean" target 2022-03-28 00:05:20 +03:00
b2ea96b4a7 Resolve package path 2022-03-27 22:34:43 +03:00
6afb53dd7d PyLint fixes 2022-03-27 22:34:22 +03:00
d7477833d6 PyLint fixes 2022-03-24 14:29:32 +02:00
7624645626 Implement pio pkg list command // Issue #3373 2022-03-24 14:17:18 +02:00
53753c0127 Do not install dependencies that are built-in libraries 2022-03-23 18:01:23 +02:00
95604ff66a Minor enhancements 2022-03-23 18:00:31 +02:00
99e0d1071a Add package METAVAR for CLI 2022-03-23 17:57:18 +02:00
13aacbcc05 Dump only required toolchains 2022-03-23 17:56:15 +02:00
b137b25169 Enhance library dependency tree 2022-03-23 17:55:27 +02:00
b44fb101c4 Remove deprecated code 2022-03-21 18:38:36 +02:00
accc8ac254 Add test for "pio pkg outdated" command 2022-03-21 16:00:29 +02:00
435a526140 Implement pio pkg update command // Issue #3373 2022-03-20 15:40:44 +02:00
346580d955 Do not warn about unknown packages if they are built-in libraries 2022-03-19 18:13:29 +02:00
81f343dbe8 Cleanup dev-platform package installer 2022-03-19 18:12:36 +02:00
fa443f2e5f Strict PackageItem comparison 2022-03-19 18:08:34 +02:00
a25a86e42f Init dev-platform with autoinstallation 2022-03-19 18:07:19 +02:00
1ffa924483 Fix test 2022-03-16 18:17:21 +02:00
463a16a68f Implement "pio pkg uninstall" command // Issue #3373 2022-03-16 16:23:09 +02:00
d2adca8d68 Minor improvements 2022-03-16 16:18:59 +02:00
057bf89894 Sync "asrmicro650x" dev-platform 2022-03-16 12:36:22 +02:00
c9037982d7 Save tool deps into the "platformio.ini" // Issue #3373 2022-03-14 13:37:47 +02:00
ce1264564f Ensure default libs are saved 2022-03-14 12:31:48 +02:00
61ffab376d Split code 2022-03-14 12:18:05 +02:00
f3bcaae4e4 Update deps 2022-03-13 17:54:13 +02:00
2201214717 Allow to skip saving of package dependencies to the "platformio.ini" // Issue #3373 2022-03-09 19:07:11 +02:00
eba4231cdc Move test 2022-03-09 19:01:37 +02:00
de0a810fcf Update "wsproto" dependencies to the "1.1.*" 2022-03-09 14:18:09 +02:00
644fc36c32 Revert back to using TOX tmp dir for PyTest 2022-03-08 18:29:54 +02:00
41144bffeb Reset custom project config per command 2022-03-08 18:00:10 +02:00
c84709dd9d Switch to the new "pio pkg install" command 2022-03-08 15:57:25 +02:00
f28651eaf7 Ensure package dependencies are installed // Resolve #2573 2022-03-08 14:59:12 +02:00
9e40eb992e Implement unified "pio pkg install" CLI // Issue #3373 2022-03-08 14:58:01 +02:00
f445cb7895 Ignore Python3 "__pycache__" binaries 2022-03-06 16:00:01 +02:00
dfc0ecdf69 #StandWithUkraine (#4195) 2022-03-06 13:20:54 +02:00
6f11f812f8 Ignore files according to the patterns declared in ".gitignore" when using pio package pack // Resolve #4188 2022-02-23 18:46:53 +02:00
4191a9bc3c Fixed issue linked to package refactoring // Resolve #4189 2022-02-23 13:37:02 +02:00
f2fbdafe64 Use the latest PIO Remote dependencies on non-ARM platforms // Issue #3865 2022-02-22 13:36:11 +02:00
22a037b213 Better handling of the failed tests using "Unit Testing" solution 2022-02-22 13:02:10 +02:00
dbe3ab6c97 Docs: Fix platformio.ini contents for Zephyr and Nordic nRF52-DK tutorial 2022-02-21 19:27:05 +02:00
6bed610af3 Check for invalid version with leading zeros 2022-02-21 18:02:56 +02:00
4d9547066b Show package size before publishing to the registry 2022-02-21 15:00:13 +02:00
54c18ae0c6 Fix test on Win 2022-02-19 21:10:57 +02:00
e49fb9f0d0 Minor Py.Test fixes 2022-02-19 20:45:37 +02:00
33da2af31e Improve pio pkg exec test 2022-02-19 19:22:40 +02:00
bcb3678055 Add test for pio pkg exec command 2022-02-18 21:03:12 +02:00
28da2d245b Handle "BlockingIOError" when locking file resource 2022-02-18 18:51:03 +02:00
e6864adfb6 Minor improvements 2022-02-18 18:34:50 +02:00
8562319638 Do not handle built-in libraries when using package manager 2022-02-18 18:34:24 +02:00
6be17cec37 Added support for dependencies declared in a "tool" type package 2022-02-18 17:51:07 +02:00
f34e6e9c4c Port package management "print_message" to the Python logging system 2022-02-18 12:57:30 +02:00
e8051838a3 Dropped support for "pythonPackages" field in "platform.json" manifest in favor of "Extra Python Dependencies" 2022-02-17 17:25:21 +02:00
f1f5497d8d Fix test 2022-02-16 22:33:16 +02:00
1b44ba4ce0 Dropped automatic updates of global libraries and development platforms // Resolve#4179 2022-02-16 21:53:18 +02:00
a4d2dc856c Do not check for "system prune" for newest PlatformIO Core installation 2022-02-16 21:08:13 +02:00
7964d1c2bf Docs: Add community book "Developing IoT Projects with ESP32" 2022-02-15 20:49:26 +02:00
5df5dd155f Bump version to 5.3.0a3 2022-02-12 23:14:16 +02:00
89cce21161 Move "pio exec" command to "pio pkg exec" // Issue #4163 2022-02-12 23:13:17 +02:00
0bdef36e2a pio pkg outdated - check for project outdated packages // Issue #3373 2022-02-12 23:06:10 +02:00
e549a07901 Typo fix 2022-02-12 23:01:20 +02:00
98603dad66 Configure platform instance with project packages using "configure_project_packages" API 2022-02-12 21:59:27 +02:00
c37fbda7a8 Bump version to 5.3.0a2 2022-02-11 22:42:50 +02:00
34ea4d8f41 Move "debug" command to its main module 2022-02-11 22:42:02 +02:00
452a76105f Update command titles 2022-02-11 22:33:33 +02:00
4982676ca8 Rename "package" command to "pkg" 2022-02-11 22:24:37 +02:00
83d115acca Ensure that platform directory path is string or bytes 2022-02-11 22:22:20 +02:00
86bd0f7c37 Show current working directory, not a path to platformio.ini 2022-02-11 22:21:44 +02:00
83fe00a0cf Revert "Run library extra script only at a build process" (breaks mbed framework) // Issue #3915 2022-02-11 17:00:33 +02:00
526abc6a9f Improved PIO Remote setup on credit-card sized computers (Raspberry Pi, BeagleBon, etc) // Resolve #3865 2022-02-11 14:42:17 +02:00
63feda6efc Simplify dependency on "zeroconf" package // Resolve #4177 2022-02-11 12:15:47 +02:00
c9b3dedbb0 Merge tag 'v5.2.5' into develop
Bump version to 5.2.5

# Conflicts:
#	HISTORY.rst
#	docs
#	platformio/__init__.py
2022-02-10 21:02:47 +02:00
dae8dfe1fc Merge branch 'release/v5.2.5' 2022-02-10 20:59:25 +02:00
100def7609 Bump version to 5.2.5 2022-02-10 20:59:16 +02:00
8594012fa1 Update deps 2022-02-10 20:55:38 +02:00
27400f66a9 Strip the path to userhome dir on Linux // Resolve #4173 Issue #4158 2022-02-10 20:55:31 +02:00
bb1e590222 Update SPDX License List to 3.16 2022-02-10 20:55:18 +02:00
a4b414010d Removing inconsistent dot at README.rst, HISTORY.rst and CONTRIBUTING.md (#4172)
* Removing inconsistent dot at README list

* Removing inconsistent dot at HISTORY file

* Removing inconsistent dot at CONTRIBUTING file
2022-02-10 20:55:08 +02:00
1d72a96654 Merge tag 'v5.2.5' into develop
Bump version to 5.2.5

# Conflicts:
#	docs
#	platformio/__init__.py
2022-02-10 20:52:16 +02:00
9b85ed86a9 fix: Added udev rule for FireBeetle-ESP32. (#4168) 2022-02-10 20:50:55 +02:00
e36066a9a2 Move package's related commands to "package" sub-folder 2022-02-10 15:22:20 +02:00
8082158a16 Update deps 2022-02-08 17:40:50 +02:00
1a8567a6da Sync docs 2022-02-08 17:33:58 +02:00
b17cbe30e2 Strip the path to userhome dir on Linux // Resolve #4173 Issue #4158 2022-02-08 17:21:13 +02:00
8aadc88dd5 Update SPDX License List to 3.16 2022-02-07 13:46:47 +02:00
f3d26fae64 Removing inconsistent dot at README.rst, HISTORY.rst and CONTRIBUTING.md (#4172)
* Removing inconsistent dot at README list

* Removing inconsistent dot at HISTORY file

* Removing inconsistent dot at CONTRIBUTING file
2022-02-07 13:45:56 +02:00
828d6f5baf Fixed a "module 'asyncio' has no attribute 'run'" error when launching PIO Home using Python 3.6 // Resolve #4169 2022-02-05 20:00:37 +02:00
2003806481 fix: Added udev rule for FireBeetle-ESP32. (#4168) 2022-02-05 13:13:43 +02:00
362823c1e1 Bump version to 5.2.5b1 2022-02-04 19:15:55 +02:00
9c10e00234 Run command from a PlatformIO package with a new pio exec command // Resolve #4163 2022-02-04 19:15:31 +02:00
a4cef2fbd8 Bump version to 5.2.5a7 2022-02-03 15:33:30 +02:00
e5fca99b52 Run library extra script only at a build process // Resolve #3915 2022-02-03 15:33:03 +02:00
f4c692eed2 Bump PIO Home to 3.4.1 2022-02-02 17:42:28 +02:00
2e0688db5f Fix test 2022-02-02 12:42:31 +02:00
ac2b358f87 Docs: generate docs from the registry 2022-02-01 21:56:53 +02:00
251a2c9fa4 Docs: link packages with the registry 2022-02-01 15:38:15 +02:00
0064d4b2c5 Docs: remove deprecated links to "boards" page 2022-02-01 15:01:58 +02:00
ebbac6b483 Use "black" profile 2022-02-01 15:00:47 +02:00
d5373a62f4 Docs: Sync dev-platforms 2022-01-28 14:24:25 +02:00
681b91a6a4 Update deps 2022-01-23 14:17:22 +02:00
8c66352994 Fixed wrong path (#4158)
* Fixed wrong path

On linux, "Documents" doesn't have to be the right folder. It depends on the language selected when installing the operating system.

* Refactor code

* Update HISTORY.rst

Co-authored-by: Ivan Kravets <me@ikravets.com>
2022-01-20 12:19:30 +02:00
4e1ec1215a Bump version to 5.2.5a6 2022-01-19 17:16:44 +02:00
6981894060 Minor updates 2022-01-19 17:16:23 +02:00
57c92e877c Respect disabling debugging server from platformio.ini 2022-01-19 16:53:31 +02:00
e8c0b8504a Ignore annoying "ms-vscode.cpptools-extension-pack" for VSCode and C/C++ files 2022-01-15 22:27:30 +02:00
93bbe8f2a3 Update deps 2022-01-15 15:00:55 +02:00
c78bb1f572 Docs: Remove icons from navbar 2022-01-11 14:11:32 +02:00
7256102785 Unix line-endings for extensions.json (#4153) 2022-01-09 13:58:39 +02:00
fc907c568d Improved checking of available Internet connection for IPv6-only workstations // Issue #4151 2022-01-08 15:08:39 +02:00
9e078ff4d7 Sync docs 2022-01-08 15:00:35 +02:00
5658e7f718 _internet_on: try IPv4, if not acceptable — try IPv6 (#4151)
* _internet_on: try IPv4, if not acceptable — try IPv6

* _internet_on: replace IPv4 `socket.socket` + IPv6 `socket.socket` with one universal `socket.create_connection`
2022-01-08 14:59:47 +02:00
111eb55a9f Docs: Update "platformio.ini" examples 2022-01-05 15:00:41 +02:00
0630ec5503 Bump version to 5.2.5a5 2022-01-04 17:18:14 +02:00
38cc493eb7 Minor improvements 2022-01-04 17:17:51 +02:00
254507c3a3 Escape custom request arguments 2022-01-04 15:02:48 +02:00
7cdcc9099b Escape custom request arguments 2022-01-04 14:53:34 +02:00
fb046c43ea Require authorization for package downloading 2022-01-04 14:46:51 +02:00
73ddf80fc1 Refactor authentication part for clients 2022-01-04 14:45:14 +02:00
a5a224ac6f Sync docs 2022-01-03 13:05:53 +02:00
c56dfda833 Minor fixes 2022-01-02 23:08:21 +02:00
6081f9ff1b Switch to the universal Twisted 2022-01-02 23:08:12 +02:00
f3c7d71b3b Sync docs 2022-01-02 19:46:52 +02:00
5748bf9549 Extend packing filters 2021-12-29 15:03:43 +02:00
84a0a6a418 Update deps 2021-12-24 18:14:29 +02:00
1ee9f183cc Fix test 2021-12-24 18:14:18 +02:00
55e8523925 Improve docs for "dependencies" field of library.json 2021-12-24 15:04:54 +02:00
c9efe24959 Switch to the new registry 2021-12-22 22:36:32 +02:00
69aff39205 Warn about package publishing time 2021-12-20 20:57:18 +02:00
f6e9e15253 Bump version to 5.2.5a4 2021-12-20 19:28:28 +02:00
b7f685ed62 Fix a bug with expired account session 2021-12-20 19:27:56 +02:00
6e03eff303 Handle base AccountError 2021-12-20 19:05:12 +02:00
3e0b95e1e1 Fix tests 2021-12-18 14:17:22 +02:00
a32997ceba Bump version to 5.2.5a3 2021-12-18 13:54:09 +02:00
63674d85e8 Ignore private packages if user not authorized 2021-12-18 13:53:54 +02:00
56848ece7a Bump version to 5.2.5a2 2021-12-18 13:45:51 +02:00
449722f08c Improved support for private packages in PlatformIO Registry 2021-12-18 13:45:26 +02:00
949b4562c7 Packaging: exclude extras from Arduino libraries 2021-12-15 13:46:30 +02:00
75f68c8be1 Bump version to 5.2.5a1 2021-12-15 12:46:28 +02:00
1b117712cf Merge branch 'release/v5.2.4' 2021-12-15 12:19:59 +02:00
11356af502 Merge tag 'v5.2.4' into develop
Bump version to 5.2.4
2021-12-15 12:19:59 +02:00
9dbdf7fc8d Bump version to 5.2.4 2021-12-15 12:19:51 +02:00
dec38273b6 Cleanup code 2021-12-15 11:59:19 +02:00
5098f5f420 Minor improvements // Issue #3865 2021-12-14 22:55:48 +02:00
d32fd72d13 Bump version to 5.2.4rc1 2021-12-14 22:38:57 +02:00
a4692d5457 Improved PIO Remote setup on credit-card sized computers (Raspberry Pi, BeagleBon, etc) // Resolve #3865 2021-12-14 22:38:31 +02:00
24ea7aaede Update title to PlatformIO Core 2021-12-14 22:37:42 +02:00
b7f10982c3 Update PIO Remote deps // Issue #3865 2021-12-14 21:14:11 +02:00
8f28d1ad43 Update uvicorn to 0.16 2021-12-08 18:45:43 +02:00
d5db2f0eb7 Apply formatting 2021-12-08 18:45:29 +02:00
fe69f3de04 Bump version to 5.2.4b4 2021-12-08 18:40:37 +02:00
5534394b06 Fixed an issue with wrong detecting Windows architecture when Python 32bit is used // Resolve #4134 2021-12-08 18:40:07 +02:00
24fc2f7e14 Sync docs 2021-12-08 18:38:16 +02:00
5b23c9a294 Add basic test for CLion integration 2021-12-08 13:48:35 +02:00
7338a02b48 Do not pack Python bytecode by default 2021-12-07 15:05:42 +02:00
8555e83cb1 Sync docs 2021-12-07 15:05:25 +02:00
39494d18bf Revert "Revert "Lock "cryptography" to RUST-less 3.3.2 version""
This reverts commit 24e63e7a02.
2021-12-06 20:59:31 +02:00
aab42c3cff Skip library.properties "paragraph" if total len >= 1000 2021-12-03 20:05:37 +02:00
f5a23c3817 Bump version to 5.2.4b3 2021-12-03 17:02:05 +02:00
b3eb81c3b4 Typo fix 2021-12-03 17:01:42 +02:00
4f4c88aca9 Use SCons vars for deprecated variables 2021-12-02 22:16:37 +02:00
c3ad3ebb57 Properly replace Home Directory in CLion template on Windows
Issue #4071
2021-12-02 20:56:18 +02:00
f13734dda4 Convert Home Directory path into a cmake-style path on Windows
Resolve #4071
2021-12-02 20:05:35 +02:00
24e63e7a02 Revert "Lock "cryptography" to RUST-less 3.3.2 version"
This reverts commit 3828e6d15e.
2021-12-02 19:30:19 +02:00
a163048396 Bump version to 5.2.4b2 2021-12-02 16:34:35 +02:00
55f8471aff Improved tab completion support for Bash, ZSH, and Fish shells // Resolve #4114 2021-12-02 16:34:05 +02:00
04e9f38e0e Check for default core dir in run-time (solves issue with tests) 2021-12-02 15:06:58 +02:00
90972e9ce0 Sync docs 2021-12-02 14:55:48 +02:00
6e8f60a27a Bump version to 5.2.4b1 2021-12-02 14:20:46 +02:00
014090c407 Fixed an issue when referencing "*_dir" option from a custom project configuration environment // Resolve #4110 2021-12-02 14:19:54 +02:00
e40b251c06 Fixed a bug when the system environment variable does not override a project configuration option // Resolve #4125 2021-12-02 13:13:07 +02:00
414a194c9d Do not claim that library.properties packages is compatible with any dev-platform if "architectures" field is not defined 2021-11-29 20:02:53 +02:00
7bffe3993d Update deps 2021-11-29 20:01:27 +02:00
3828e6d15e Lock "cryptography" to RUST-less 3.3.2 version 2021-11-29 14:31:38 +02:00
85c582bc93 Use "/v3//search" endpoint when searching for packages in registry 2021-11-27 15:00:10 +02:00
ea1c9dec12 Typo fix 2021-11-26 14:21:06 +02:00
6753121a6a Better cleanup package manifest fields 2021-11-26 14:13:06 +02:00
f63d899c42 Ignore duplicated manifest values 2021-11-25 22:35:44 +02:00
7219c9f806 Ignore duplicated manifest values 2021-11-25 22:19:47 +02:00
df2f1d10fd Sync docs 2021-11-25 22:19:01 +02:00
3f71067b67 Update zeroconf deps to 0.37.* 2021-11-22 22:08:57 +02:00
8dc68a01fd Do not print empty errors 2021-11-22 22:08:10 +02:00
9e0ded958c Bump version to 5.2.4a4 2021-11-18 17:56:18 +02:00
68243aa95b Added support for a new "headers" field in "library.json" 2021-11-18 17:55:35 +02:00
507df1f507 Extend platform manifest test with a package owner 2021-11-18 13:31:49 +02:00
1800c29b44 Upgraded build engine to the SCons 4.3 2021-11-18 13:17:26 +02:00
0343548f6e Sync docs 2021-11-18 13:14:55 +02:00
5cb5c9713e Wrap the path to PlatformIO core in the NetBeans project template
This fixes a possible issue when the path to PlatformIO contains a whitespace

Resolve #4096
2021-11-15 19:22:41 +02:00
5e2c5c793f SPDX License List v3.15 2021-11-15 11:28:57 +02:00
3022cb6955 Bump version to 5.2.4a3 2021-11-12 15:17:55 +02:00
4687665ff3 Improved support for projects located on a network share // Resolve #3417 , Resolve #3926 , Resolve #4102 2021-11-12 15:17:25 +02:00
001f075a49 Bump version to 5.2.4a2 2021-11-09 22:49:21 +02:00
7d78e4a60a Fixed an issue with the CLion project generator when a macro contains a space // Resolve #4102 2021-11-09 22:49:00 +02:00
2786bfbeb8 Escape spaces in CLion CMakeListsPrivate template - FIXES #4085 (#4105)
This fix adds spaces to the regex substitutions on CMakeListsPrivate.txt add_definitions.

Fixes #4102
2021-11-09 22:45:12 +02:00
d3049a8d62 Fix test 2021-11-08 20:08:18 +02:00
831a2582ed Sync docs 2021-11-08 19:31:49 +02:00
0919019123 Bump version to 5.2.4a1 2021-11-05 23:19:22 +02:00
7dd9c99c91 Merge tag 'v5.2.3' into develop
Bump version to 5.2.3
2021-11-05 17:31:41 +02:00
326c24911a Merge branch 'release/v5.2.3' 2021-11-05 17:31:40 +02:00
133fa1495b Bump version to 5.2.3 2021-11-05 17:31:23 +02:00
7c040ed99f Normalize Windows path with Python's pathlib 2021-11-05 17:21:15 +02:00
f88a2de8a9 Filter duplicated recent projects on Windows 2021-11-05 17:05:30 +02:00
a24ec8b07a Grammar fixes 2021-11-05 16:57:44 +02:00
d6ad6f96e8 Bump version to 5.2.3rc1 2021-11-05 16:29:18 +02:00
411764854b Add support for custom device monitor filters located in package folders // Issue #3924 2021-11-05 16:28:49 +02:00
973f77012f Fixed an issue when VSCode's debugger does not honor default environment // Resolve #4098 2021-11-05 14:46:57 +02:00
1d80da2559 Add "inc" as sign that it's the root of the library (#4093)
* Add "inc" as sign that it's the root of the library

* Add "inc" and "Inc"

Co-authored-by: Ivan Kravets <me@ikravets.com>
2021-11-05 14:16:36 +02:00
00d298935a Bump version to 5.2.3b5 2021-11-05 12:58:12 +02:00
4a9a478243 Refactor PIO Home IDE RPC 2021-11-05 12:57:09 +02:00
9040bbb75a Update deps 2021-11-05 12:56:39 +02:00
abcc4c0a12 Bump version to 5.2.3b4 2021-11-02 20:06:08 +02:00
ceb3a19b81 Automatically synchronize active projects between IDE and PlatformIO Home 2021-11-02 20:05:40 +02:00
2a2f7825cc Sync docs 2021-11-01 16:21:47 +02:00
a0e9f6a92d Docs: Sync dev-platforms 2021-11-01 15:57:17 +02:00
dbc73f5086 Use Rust-less "cryptography" dependency for PIO Remote 2021-10-30 14:30:30 +03:00
78a67b754e Docs: Extend a project configuration example with the common "[env]" section 2021-10-26 16:01:50 +03:00
de4b02eaf1 Remove unused module 2021-10-26 15:52:16 +03:00
751c82fd29 Bump version to 5.2.3b3 2021-10-26 15:42:05 +03:00
8c8a94fc71 Run config option validation even in raw mode 2021-10-26 15:41:41 +03:00
1174958e8b Add project.helpers.get_project_all_lib_dirs API (used by platformio-node-helpers) 2021-10-26 14:36:18 +03:00
6399de7a66 Removed deprecated project.helpers API 2021-10-26 14:35:28 +03:00
c0f2275b61 Restore ProjectConfig.get_optional_dir API, "platformio-node-helpers" depends on it 2021-10-26 14:34:32 +03:00
256a9ee45d Revert "Pass system STDIN stream to SCons subprocess"
This reverts commit d7b7d2de6e.
2021-10-26 13:54:49 +03:00
c835ce780a Fixed "UnicodeEncodeError" when a build output contains non-ASCII characters // Resolve #3971 2021-10-25 22:01:11 +03:00
d7b7d2de6e Pass system STDIN stream to SCons subprocess 2021-10-25 21:12:29 +03:00
1dd0635e5e Use secured bitly 2021-10-25 20:25:23 +03:00
67506511c3 Update token for docs/deploy 2021-10-25 19:45:47 +03:00
3fbb4cde36 Bump version to 5.2.3b2 2021-10-25 18:45:04 +03:00
9aaa80a213 Cast Python warnings to errors when running "pytest" 2021-10-25 18:36:10 +03:00
acb6cbffa0 Add "arduplot" to the "Community Filters" // Resolve #4058 2021-10-25 15:54:06 +03:00
6a70ab74bc Update history 2021-10-25 15:24:24 +03:00
852c252302 Added support for custom device monitor filters // Resolve #3924 2021-10-25 15:18:18 +03:00
3a670b55b6 Update CMakeLists.txt.tpl (#4089) 2021-10-25 14:56:12 +03:00
d01435f4f2 Bump version to 5.2.3b1 2021-10-25 13:28:57 +03:00
f1638c9cd7 Fixed an issue when PIO Remote device monitor crashes on the first keypress // Resolve #3832 2021-10-25 13:24:36 +03:00
4943504898 Bump version to 5.2.3a3 2021-10-24 23:17:30 +03:00
7d7480c120 Show human-readable message when infinite recursion is detected while processing "Interpolation of Values" // Resolve #3883 2021-10-24 22:21:15 +03:00
78182fea0a Disabled resolving of SCons variables when preprocessing "Interpolation of Values" // Resolve #3933 2021-10-24 21:27:25 +03:00
947e57b5b4 Bump version to 5.2.3a2 2021-10-24 20:00:30 +03:00
e0e4a594e9 Fix conf tests on Windows 2021-10-24 19:59:52 +03:00
4839fe37a3 Improved PlatformIO directory interpolation (${platformio.***_dir}) in “platformio.ini” configuration file // Resolve #3934 2021-10-24 18:19:40 +03:00
9914b7ea38 Typo (#4087)
showed > shown
2021-10-23 13:01:48 +03:00
f86ed97820 Bump version to 5.2.3a1 2021-10-22 19:14:17 +03:00
8d8b0807e2 Fixed an issue when the "$PROJECT_DIR" gets the full path to "platformio.ini", not the directory name // Resolve #4086 2021-10-22 19:13:24 +03:00
e3c6237430 Remove unused files 2021-10-20 23:29:34 +03:00
e964c7fa5c Merge branch 'release/v5.2.2' 2021-10-20 18:44:28 +03:00
f1e84e145c Merge tag 'v5.2.2' into develop
Bump version to 5.2.2
2021-10-20 18:44:28 +03:00
2e2773fa6b Bump version to 5.2.2 2021-10-20 18:44:20 +03:00
a9c7a27d47 Fix CLion 2021.3 support (#4085)
New CMake behavior crashes CLion with apostrophe symbols in `add_definitions` clause
see https://youtrack.jetbrains.com/issue/CPP-26719
2021-10-20 18:08:22 +03:00
e41ecb19cf Resolve an issue with interrupting a running program 2021-10-20 16:21:48 +03:00
5b091b602f Fixed a “TypeError” issue when extending configuration option in “platformio.ini” with the multi-line default value // Resolve #4082 2021-10-20 15:35:01 +03:00
768681c4f2 Remove debugging code // Resolve #4083 2021-10-19 19:27:20 +03:00
2e4e5c1873 Temporary disable CI for Windows+Python 3.10 2021-10-19 19:26:13 +03:00
4a61806e60 Quote Python versions 2021-10-19 18:52:30 +03:00
883187f9ac Bump version to 5.2.2a1 2021-10-19 18:21:28 +03:00
2d9a5031e9 Test PlatformIO Core on Python 3.10 2021-10-19 18:21:21 +03:00
39c93f6512 Override debugging firmware loading mode using `--load-mode option for pio debug` command 2021-10-19 18:20:01 +03:00
a7905b373e Skip CI for macOS & Py 3.6 2021-10-11 16:00:09 +03:00
a7c82ff9b9 Merge branch 'release/v5.2.1' 2021-10-11 15:07:19 +03:00
5b4b4a4051 Merge tag 'v5.2.1' into develop
Bump version to 5.2.1
2021-10-11 15:07:19 +03:00
c348fec609 Bump version to 5.2.1 2021-10-11 15:07:04 +03:00
4af17356f3 Handle ".hpp" files when looking for a library root 2021-10-11 15:01:42 +03:00
384e5052bc Bump version to 5.2.1rc2 2021-10-10 14:09:59 +03:00
a5adae1491 Skip broken Click 8.0.2 release // Resolve #4078 2021-10-10 14:09:17 +03:00
fe62b810db Bump version to 5.2.1rc1 2021-10-08 19:03:12 +03:00
ee78496058 Clean a build environment and installed library dependencies using a new `cleanall` target // Resolve #4062 2021-10-08 19:02:45 +03:00
8afe4bae87 Typo fix 2021-10-08 15:31:26 +03:00
b04bb2b740 Fix Click's "DeprecationWarning: 'resultcallback' has been renamed to 'result_callback'" // Resolve #4075 2021-10-08 15:18:34 +03:00
3d46f0d72f Drop support for Click < 7.1.2 2021-10-08 15:18:19 +03:00
a65d973660 Extend library root signs with "include" and "src" dirs // Resolve #4073 2021-10-08 15:00:05 +03:00
df83d90c06 Handle upper-cased "Include" & "Src" folders 2021-10-08 14:58:41 +03:00
a1d55f2529 Ignore telemetry on "idedata" target 2021-10-08 14:40:23 +03:00
aa097f3fd6 Update Cppcheck to v2.6.0 // Resolve #3942 2021-10-07 16:43:06 +03:00
e0b72202fd Bump version to 5.2.1b4 2021-09-29 19:21:55 +03:00
e8769fff7d Improved handling of a library root based on "Conan" or "CMake" build systems // Resolve #3887 2021-09-29 19:21:31 +03:00
ed33652534 Handle "test" folder as a part of CLion project // Resolve #4005 2021-09-29 15:44:52 +03:00
d1c1f972a6 Propagate agent option to remote device monitor command (#4065)
Signed-off-by: Christophe PAVOT <christophe.pavot@wiifor.com>
2021-09-29 14:47:11 +03:00
6008275aae Properly handle in-progress C++ standards when invoking Cppcheck // Resolve #3944 (#4070) 2021-09-29 14:46:02 +03:00
edf8bb3945 Bump version to 5.2.1b3 2021-09-27 22:59:58 +03:00
dd7d133263 Dump "embedded_result.output" 2021-09-27 22:59:36 +03:00
b6f783674b Allowed to override a default library builder via a new `builder field in a build group of library.json` // Resolve #3957 2021-09-26 15:27:41 +03:00
eab70fae3b Properly handle "--keep-build-dir" option in platformio ci command (#4061)
This fixes #4011 and possible "FileExists" errors when the "platformio ci"
command by safely copying sources to the build folder
2021-09-23 23:26:42 +03:00
fed40ef104 Add debug information when a test fails on Win/Py3.8 2021-09-17 21:06:08 +03:00
6d087f5a38 Bump version to 5.2.1b2 2021-09-16 22:07:01 +03:00
0edcf33547 Use "ubuntu-18.04" for project examples (CI) 2021-09-16 22:06:45 +03:00
443417b0f4 PyLint fix 2021-09-16 21:56:09 +03:00
369e994b0d Check for "build.mcu" and "build.cpu" when looking for precompiled library // Issue #405 2021-09-16 21:51:53 +03:00
55469327c6 Bump version to 5.2.1b1 2021-09-16 21:16:21 +03:00
27f326673c Fixed a "KeyError: Invalid board option 'build.cpu'" when using a precompiled library with a board that does not have a CPU field in the manifest // Resolve #405 2021-09-16 21:13:54 +03:00
e6fd766fff Bump version to 5.2.1a1 2021-09-14 13:03:47 +03:00
7da3ccfacb Merge tag 'v5.2.0' into develop
Bump version to 5.2.0
2021-09-13 19:00:10 +03:00
624d6b3b0b Merge branch 'release/v5.2.0' 2021-09-13 19:00:09 +03:00
9528083a66 Bump version to 5.2.0 2021-09-13 18:59:53 +03:00
55408f6ccb Fixed an issue when PlatformIO archives a library that does not contain C/C++ source files // Resolve #4019 2021-09-13 14:56:24 +03:00
dce5a39b10 Process "precompiled" and "ldflags" properties of the "library.properties" manifest // Resolve #3994 2021-09-13 14:48:48 +03:00
03a23876a7 Fixed an issue when PlatformIO archives a library that does not contain C/C++ source files // Resolve #4019 2021-09-13 14:04:33 +03:00
775357dd94 Better error handling if git is not installed // Resolve #4013 2021-09-13 13:31:53 +03:00
d10cbb2823 Fix link to clang-tidy (#4049) 2021-09-13 12:36:56 +03:00
63a2465bac Update check tools to the latest available // Resolve #4041 2021-09-10 18:11:48 +03:00
d97ed52e91 Sync docs 2021-09-07 15:17:59 +03:00
e1dc12c14d Docs: Document "platformio-ide.pioHomeServerHttpHost" setting for VSCode 2021-09-02 12:47:17 +03:00
7c755d4e2d Sync docs 2021-08-31 16:23:24 +03:00
55b786d9f0 Use byte-mode for writing binary file 2021-08-28 13:21:46 +03:00
131f4be4ea Fix PyLint's "use-dict-literal" and "use-list-literal" 2021-08-28 13:14:40 +03:00
d819617d2b Specify encoding for "open()" functions 2021-08-28 13:10:07 +03:00
b9219a2b62 Update "zeroconf" deps to 0.36 2021-08-28 12:31:02 +03:00
554e378dd6 Sync docs 2021-08-28 12:30:38 +03:00
cc11402bc9 Sync docs 2021-08-14 15:41:44 +03:00
40220f92c1 Sync docs 2021-08-14 15:25:25 +03:00
8c4d9021c2 Update deps 2021-08-14 12:53:49 +03:00
efefb02d86 Sync docs 2021-08-14 12:53:30 +03:00
3ee281aaf9 Update SPDX License List to 3.14 2021-08-09 17:46:56 +03:00
097b6d5097 PyLint fixes 2021-08-05 18:13:22 +03:00
6cdaf05f98 Sync docs 2021-08-05 18:13:00 +03:00
3be0f58c30 Sync docs 2021-08-04 14:58:54 +03:00
f3489a3b01 Sync docs 2021-08-02 13:52:06 +03:00
173dbeb24a Bump version to 5.2.0b1 2021-08-02 13:11:23 +03:00
0607b86818 Upgraded build engine to the SCons 4.2 2021-08-02 13:10:37 +03:00
1282a65bcb Update Arduino udev rule to include latest Portenta board
Resolves #4014
2021-08-02 12:12:52 +03:00
45d3207dfe Docs: Sync dev-platforms 2021-07-31 18:48:08 +03:00
76b46f59e9 Fix lib test 2021-07-30 20:13:53 +03:00
19fa108f61 Docs: Add "Copy" button to CODE blocks 2021-07-30 17:32:22 +03:00
2372d06591 Sync docs 2021-07-26 19:26:33 +03:00
7015375892 Docs: Revert "html_favicon" path 2021-07-23 15:32:02 +03:00
e9bf2b361f Update deps and sync docs 2021-07-23 15:05:01 +03:00
51b790b767 Bump version to 5.2.0a9 2021-07-12 15:06:42 +03:00
ac84431361 Take into account package's "system" when checking for duplicates 2021-07-12 15:06:06 +03:00
7dc8463da9 Fix charmap error (#3998)
* Fix charmap error

Fix charmap error on cyrilic in platformio.ini file #3493

* Update config.py

Co-authored-by: Ivan Kravets <me@ikravets.com>
2021-07-07 18:25:55 +03:00
71ae579bc0 PyLint fix 2021-07-05 16:06:02 +03:00
5036d25b60 Enable Python version auto-detection for Black formatter 2021-07-05 13:31:23 +03:00
ff6d169862 Fix PyLint for v2.9.3 2021-07-05 13:30:37 +03:00
dde8898aae Bump zeroconf to 0.32.* (#3991) 2021-07-05 12:57:30 +03:00
72cc23ef46 Fix PyLint warning with "No exception type(s) specified (bare-except)" 2021-06-29 18:25:20 +03:00
5390b4ed42 Add Github token for Slack notification 2021-06-29 18:24:47 +03:00
17c7d90d52 Sync docs 2021-06-29 18:11:08 +03:00
5c3b5be613 Fix TypeError: 'NoneType' object is not callable 2021-06-29 18:07:45 +03:00
5ab7769745 Bump version to 5.2.0a8 2021-06-24 16:43:00 +03:00
05374d1145 Match buffered data from debugging server 2021-06-24 16:42:45 +03:00
311e10f91e Ensure all patterns are replaces in debug init script 2021-06-24 16:00:13 +03:00
2b94791387 Bump version to 5.2.0a7 2021-06-22 14:28:40 +03:00
fbcae11cd0 Fix project generator 2021-06-22 14:28:04 +03:00
0d6eff2a9a Syn docs 2021-06-22 14:27:33 +03:00
6a9b7fdb6d Update SPDX License List to 3.13 2021-06-03 16:32:53 +03:00
e8f703648a Docs: Use Python 3 for CI integration 2021-06-01 18:24:17 +03:00
710f82de0f Up uvicorn to 0.14 & click to 8.0 2021-06-01 17:59:18 +03:00
bee35acfa6 Sync docs 2021-06-01 17:56:55 +03:00
90fdaf80e4 Sync docs 2021-05-31 18:25:54 +03:00
27feb1ddd7 Added support for Click 8.0; updated other deps 2021-05-19 19:43:41 +03:00
2be7e0f7e6 Docs: Promote PlatformIO Labs blog posts 2021-05-13 15:28:09 +03:00
186ab70bf9 Add udev rule for Raspberry Pi Pico boards 2021-05-10 11:38:05 +03:00
0fa9006e45 Sync docs: CircleCI updates 2021-05-03 22:34:43 +03:00
60c83bae93 Docs: Sync dev-platforms 2021-05-01 13:44:28 +03:00
553c398c8e Show package "system" info before publishing 2021-04-30 18:06:35 +03:00
1c90bb383f Sync docs 2021-04-29 19:46:17 +03:00
4281225b02 Sync docs 2021-04-29 19:24:44 +03:00
14dc9c6c43 Sync docs 2021-04-29 18:38:44 +03:00
c9e10b1a3e Fix issue with broken redirect 2021-04-29 14:43:27 +03:00
915c850760 Docs: Fix JS redirect URL 2021-04-29 12:47:57 +03:00
2c3f430203 Tidy up Docs CI 2021-04-28 20:59:01 +03:00
1a152ed7fa Add deploy step to CI configuration 2021-04-28 20:18:23 +03:00
5953480807 Docs: Fix broken link for RTD page 2021-04-28 20:16:01 +03:00
b5c1a195be Fix PyLint issues: consider-using-with 2021-04-28 19:59:37 +03:00
310cc086c6 Docs: Minor fixes to "redirect" page generator 2021-04-28 19:59:12 +03:00
61d6cd3c18 Apply black formatter 2021-04-28 19:58:50 +03:00
cccabf5330 Add missed "sphinx-notfound-page" package for docs 2021-04-28 13:19:49 +03:00
6f33460afd Remove debugging code 2021-04-28 13:17:22 +03:00
603d524aaf Refactor docs to be deployed as a static content 2021-04-28 13:10:19 +03:00
eb2cd001b6 Use private "_idedata" target when fetching data for debugging 2021-04-24 18:01:35 +03:00
b5b57790be Validate package manifest when packing archive or publishing a package 2021-04-23 22:02:07 +03:00
286f4ef961 Bump version to 5.2.0a6 2021-04-21 20:52:27 +03:00
ad28d1906c Improve a package publishing process 2021-04-21 20:51:54 +03:00
dfdccac67d Remove unnecessary "ensure_python3()" blocks 2021-04-20 20:28:49 +03:00
b8c2752237 Dccs: Add information how to avoid extra script running when IDE fetches metadata 2021-04-16 13:36:53 +03:00
834c7b0def Bump version to 5.2.0a5 2021-04-12 22:38:56 +03:00
5bfe70142e Switch to project directory before starting debugging process 2021-04-12 22:38:21 +03:00
b35c5a22bb Fix a broken support for custom configuration file for pio debug command // Resolve #3922 2021-04-11 22:21:01 +03:00
eecc825c90 PyLint 2021-04-11 22:20:09 +03:00
3823c22dad Update Release Notes 2021-04-07 21:30:06 +03:00
551bd3dbfe Explicitly specify PROGSUFFIX when compiling final binary (#3918)
Resolves #3906
2021-04-02 17:09:38 +03:00
7e9956963a Remove a note with using pio ci for uploading // Resolve #3903 2021-04-02 15:23:34 +03:00
80c24a1993 Fixed an issue when "main.cpp" was generated for a new project for 8-bit development platforms // Resolve #3872 2021-04-02 15:19:18 +03:00
66091bae24 Disable GDB "startup-with-shell" only on Unix platform 2021-04-02 14:44:38 +03:00
73d4f10f4b Bump version to 5.2.0a4 2021-04-01 21:16:42 +03:00
ee7ea77fc3 Fixed an error "Unknown development platform" when running unit tests on a clean machine // Resolve #3901 2021-04-01 21:15:14 +03:00
32e1cbe2a3 Provide solution for issue #3417 2021-03-31 18:28:06 +03:00
3539724843 Update "zeroconf" dependency to 0.29 2021-03-31 17:33:26 +03:00
940b25f158 Sync docs & examples 2021-03-31 17:32:57 +03:00
37e601e5b5 Ensure that a serial port is ready before running unit tests on a remote target // Resolve #3742 2021-03-24 19:07:40 +02:00
0230374709 Document new VSCode settings: activateProjectOnTextEditorChange & autoOpenPlatformIOIniFile 2021-03-24 13:04:20 +02:00
86db237e5d Update Cppcheck and PVS-Studio packages // Resolve #3898 2021-03-23 21:17:32 +02:00
1542b1cebb Bump version to 5.2.0a3 2021-03-20 10:32:14 +02:00
990071af5c Fix issue with missed compat.path_to_unicode // Resolve #3894 2021-03-20 10:31:55 +02:00
f543e00307 Bump version to 5.2.0a2 2021-03-19 20:26:26 +02:00
34b4f8265a Debug unit tests created with PlatformIO Unit Testing solution // Resolve #948 2021-03-19 20:25:30 +02:00
a366d1af2a Use "target remote" for mpsdebug 2021-03-19 18:26:09 +02:00
ebe5785a91 Allow overriding default debugging flags from dev-platform 2021-03-19 17:11:25 +02:00
887d46725b Debug native (desktop) application on a host machine // Resolve #980 2021-03-19 17:02:11 +02:00
a326b718f2 Handle legacy $LOAD_CMD "init_cmds" 2021-03-19 16:09:38 +02:00
c14b298cb9 Fixed an issue with silent hanging when a custom debug server is not found // Resolve #3756 2021-03-19 15:55:42 +02:00
9cca8f3f55 Split debugging client to base and GDB // Resolve #3757 2021-03-19 15:47:20 +02:00
f5cee56740 Fix issue when disabling "debug_init_break" did not work 2021-03-19 14:09:43 +02:00
972d183d85 Use a cached build configuration 2021-03-19 13:46:54 +02:00
eebdf04357 Load "idedata" configuration from a dumped file 2021-03-19 13:46:27 +02:00
9ede20a367 Disable checking for "__PLATFORMIO_BUILD_DEBUG__" that is not available in g2 mode 2021-03-19 13:10:29 +02:00
b0c3e22a52 Configure a custom pattern to determine when debugging server is started with a new debug_server_ready_pattern option 2021-03-19 12:30:16 +02:00
a78db17784 Drop support for Python 2 2021-03-19 00:21:44 +02:00
dbb9998f69 Refactor debugging configuration, add support for server_ready_pattern // Resolve #3401 2021-03-18 23:42:54 +02:00
2745dbd124 PyLint fix 2021-03-17 23:14:22 +02:00
c0357daf01 Remove Python 2 code 2021-03-17 21:08:06 +02:00
064fa6027d Bump version to 5.2.0a1 2021-03-17 20:07:26 +02:00
779e02a05e Use "connect_read_pipe" on Unix 2021-03-17 20:06:52 +02:00
e222d0356a Merge branch 'feature/debug-async' into develop 2021-03-17 18:25:47 +02:00
d2ae333bb8 Merge branch 'release/v5.1.1' 2021-03-17 18:17:46 +02:00
764c42a810 Merge tag 'v5.1.1' into develop
Bump version to 5.1.1
2021-03-17 18:17:46 +02:00
18b18f1c3d Bump version to 5.1.1 2021-03-17 18:17:40 +02:00
b54a8b40a4 Refactor Unified Debugger to native Python Asynchronous I/O stack // Resolve #3793 , Resolve #3595 2021-03-17 17:42:11 +02:00
edf724d20d Sync docs 2021-03-15 17:01:44 +02:00
622a190a61 Avoid "rustup" when building cryptography for contrib-pysite // Resolve #3865 2021-03-15 17:00:16 +02:00
5b4a78ba20 Bump version to 5.1.1b1 2021-03-11 14:49:20 +02:00
44b85f6e4b Switch Cppcheck to analyze project per file // Issue #3797
Cppcheck doesn't provide a proper report when one of the files in the check list is broken.
If we run the analysis on a per-file basis, then Cppcheck will be able report at least defects
from valid source files.
2021-03-11 13:49:27 +02:00
7f1f760645 Preserve user-specified debug configurations in VSCode integration (#3878)
* Preserve user-specified debug configurations in VSCode integration

Issue #3824

* Tidy up Python code
2021-03-10 14:54:52 +02:00
54d8c96c30 Update SPDX license list to 3.12 2021-03-09 22:01:58 +02:00
c6ab7827e7 Fixed incorrect size of unnecessary data // Resolve #3830 2021-03-09 19:26:22 +02:00
ae26079e2e Fixed an issue when code inspection fails with "Bad JSON" // Resolve #3790 2021-03-09 19:20:30 +02:00
3e993156f2 Suppress printing unnecessary info in silent mode // Resolve #3837 2021-03-08 12:16:53 +02:00
3b2fafd789 Add new test for check command and project with whitespace 2021-03-04 22:27:00 +02:00
72ebaddcb8 Handle possible whitespaces in project path for PVS-Studio (#3849) 2021-03-04 22:22:09 +02:00
5a9950cc19 Sync docs 2021-03-04 18:52:12 +02:00
cf29d7e400 Typo fix 2021-03-04 18:52:02 +02:00
244dba3614 JFrog shutdowns Bintray 2021-03-03 21:31:42 +02:00
21886517e1 Bump version to 5.1.1a3 2021-03-01 17:59:58 +02:00
3996236729 Report detailed server error to PIO Home frontend 2021-03-01 17:59:40 +02:00
560cb3ac82 Sync docs 2021-02-27 19:57:40 +02:00
81c7e23ae9 Bump version to 5.1.1a2 2021-02-27 19:44:11 +02:00
0b8bd6d4fc Migrate to Async JSON-RPC package 2021-02-27 19:43:43 +02:00
7c271c8207 Better detecting of native dev-platform for unit testing // Resolve #3851 2021-02-27 18:53:26 +02:00
58947d91a6 PyLint fixes 2021-02-27 17:13:30 +02:00
20096be990 Sync docs 2021-02-26 13:39:13 +02:00
7c8508b651 Fixed an issue with device monitor when the “send_on_enter” filter didn’t send EOL chars // Resolve #3787 2021-02-10 14:43:50 +02:00
b56d0fdd9b Sync docs & examples 2021-02-10 14:43:12 +02:00
d0cc06f766 Move isort setttings to "tox.ini" 2021-02-06 16:56:44 +02:00
d8d2b215d1 Minor improvement 2021-02-03 23:11:47 +02:00
c478d383b4 Sync docs 2021-02-03 23:10:01 +02:00
e01cd1c037 Bump version to 5.1.1a1 2021-02-01 13:01:31 +02:00
e63019c469 Fixed a "The command line is too long" issue with a linking process on Windows // Resolve #3827 2021-02-01 12:52:00 +02:00
90a325a1b2 Merge branch 'release/v5.1.0' 2021-01-28 19:23:14 +02:00
698594525f Merge tag 'v5.1.0' into develop
Bump version to 5.1.0
2021-01-28 19:23:14 +02:00
fd540148f3 Bump version to 5.1.0 2021-01-28 19:23:06 +02:00
078a024931 Configure default debug_speed 2021-01-28 13:52:11 +02:00
f8193b2419 Bump version to 5.1.0rc3 2021-01-27 23:06:42 +02:00
808ba603c5 Fixed an issue when "pio device monitor –eol" and “send_on_enter” filter do not work properly // Resolve #3787 2021-01-27 23:06:18 +02:00
61d70fa688 Include Unity framework for IDE data only if there are tests in project 2021-01-27 22:40:19 +02:00
493a33e754 Drop support for Python 2 2021-01-27 22:25:42 +02:00
bd75c3e559 Bump version to 5.1.0rc2 2021-01-27 20:58:13 +02:00
cb9e72a879 Dump build flags using SCons.Subst.SUBST_CMD 2021-01-27 20:57:53 +02:00
9d2fd4982f Cleanup code 2021-01-27 20:40:25 +02:00
eed9a0e376 Merge branch 'feature/3792-maxleng-cmd' into develop 2021-01-27 20:30:39 +02:00
d77dbb2cca Use "TEMPFILEARGESCFUNC" for GCC workaround on Windows 2021-01-27 20:30:28 +02:00
7810946484 Use project build folder for tempfile workaround with command maxlen 2021-01-27 18:47:54 +02:00
e2906e3be5 Refactored a workaround for a maximum command line character limitation // Resolve #3792 2021-01-27 16:10:13 +02:00
0a8b66ee95 Configure a custom debug adapter speed using a new debug_speed option // Resolve #3799 2021-01-26 21:21:41 +02:00
8ff270c5f7 Skip non-existing package when checking for update// Resolve #3818 2021-01-26 17:05:37 +02:00
4012a86cac Fixed a "ValueError: Invalid simple block" when uninstalling a package with a custom name and external source // Resolve #3816 2021-01-26 16:15:11 +02:00
dd4fff3a79 Bump version to 5.1.0rc1 2021-01-25 23:50:41 +02:00
0ed99b7687 Added a new `--session-id option to pio home` // Resolve #3397 2021-01-25 23:44:26 +02:00
2c389ae11e Added new check_prune_system_threshold setting 2021-01-24 17:21:22 +02:00
15ff8f9d2a Bump version to 5.0.5b5 2021-01-24 15:58:07 +02:00
bd4d3b914b Revert "lib_compat_mode" changes // Resolve #3811 Resolve #3806 2021-01-24 15:49:56 +02:00
59b02120b6 New options for system prune command: remove unnecessary core and development platform packages // Resolve #923 2021-01-23 23:20:53 +02:00
92655c30c1 Disabled automatic removal of unnecessary development platform packages // Resolve #3708 , Resolve #/3770 2021-01-23 22:34:48 +02:00
484567f242 Project's "lib_compat_mode" has higher priority than "library.json" 2021-01-23 15:54:52 +02:00
ef6e70a38b Fixed an issue when unnecessary packages were removed in `update --dry-run` mode // Resolve #3809 2021-01-23 15:24:32 +02:00
e695e30a9b Fixed an issue with compiler driver for ".ccls" language server // Resolve #3808 2021-01-23 14:44:53 +02:00
65e67b64bd Remove unnecessary dependencies from contrib-pysite 2021-01-22 22:55:45 +02:00
ddbe339541 Update to iSort 5.0 2021-01-22 22:55:02 +02:00
b2c0e6a8c2 Sync docs 2021-01-22 22:46:09 +02:00
f9384ded27 Fixed an issue when “strict” compatibility mode was not used for a library with custom “platforms” field in library.json manifest // Resolve #3806 2021-01-22 22:45:36 +02:00
4488f25ce0 Bump version to 5.0.5b4 2021-01-20 23:26:22 +02:00
52b22b5784 Fixed a "UnicodeDecodeError: 'utf-8' codec can't decode byte" // Resolve #3804 , Resolve #3417 2021-01-20 20:45:23 +02:00
5a356140d6 Sync examples and docs 2021-01-20 20:44:43 +02:00
e79de0108c Upgraded build engine to the SCons 4.1 2021-01-20 16:15:05 +02:00
985f31877c Automatically install tool-unity when there are tests and "idedata" target is called 2021-01-20 15:14:45 +02:00
11a71b7fbb Bump version to 5.0.5b3 2021-01-20 14:37:19 +02:00
7f26c11c9d Fix an issue with "coroutine' object has no attribute 'addCallback'" 2021-01-20 14:36:45 +02:00
9b93fcd947 Do not install tool-unity for even non-test proejct 2021-01-20 14:27:03 +02:00
733ca5174b Bump version to 5.0.5b2 2021-01-18 21:19:57 +02:00
bd897d780b Implement "__shutdown__" endpoint for PIO Home server 2021-01-18 21:19:15 +02:00
429065d2b9 Legacy support for PIO Home "__shutdown__" query request 2021-01-18 20:53:19 +02:00
b90734f1e2 List multicast DNS services only when PY3 2021-01-18 20:51:50 +02:00
db97a7d9d3 Bump version to 5.0.5b1 2021-01-18 18:21:27 +02:00
6ff67aeadf Significantly speedup PlatformIO Home loading time by migrating to native Python 3 Asynchronous I/O 2021-01-18 18:20:26 +02:00
dd7d282d17 Improved listing of multicast DNS services 2021-01-18 18:17:10 +02:00
4e637ae58a Drop Python 2 from PIO Core test 2021-01-18 18:15:15 +02:00
1ec2e55322 Add udev rule for Atmel AVR Dragon (#3786) 2021-01-04 13:46:09 +02:00
556eb3f8c1 Docs: Update "Wiring Connections" section for ST-Link debugging probe 2020-12-31 13:47:05 +02:00
76b49ebc95 Increase timeout to 60sec when starting debug server and "ready_pattern" is used 2020-12-30 14:38:18 +02:00
e82443a302 Bump version to 5.0.5a1 2020-12-30 14:29:41 +02:00
5de86a6416 Check for debug server's "ready_pattern" in "stderr" 2020-12-30 14:29:19 +02:00
3f3c8cabb8 Merge branch 'release/v5.0.4' 2020-12-30 13:23:11 +02:00
cd59aa9afb Merge tag 'v5.0.4' into develop
Bump version to 5.0.4
2020-12-30 13:23:11 +02:00
34e12e575b Bump version to 5.0.4 2020-12-30 13:23:04 +02:00
4c8c261ab4 Raise an exception when trying to pack a package from tar.gz on Windows // Resolve #3776 2020-12-28 20:12:53 +02:00
099bb3b9ff Sync dev-platforms: docs + examples 2020-12-28 13:51:34 +02:00
c623a6aacc Fixed an issue with package publishing on Windows when Unix permissions are not preserved // Resolve // #3776 2020-12-28 13:08:12 +02:00
ce7356794d Test examples from the official dev-platforms 2020-12-26 21:43:41 +02:00
523494f9cf Ignore CI tests from tokisaki dev-platform 2020-12-26 20:18:15 +02:00
0edc867d45 Bump version to 5.0.4rc1 2020-12-26 16:10:44 +02:00
ce4c45a075 Show a warning message about deprecated support for Python 2 and Python 3.5 2020-12-26 16:10:07 +02:00
e29941e3eb Update release notes with check tools updates 2020-12-22 21:30:01 +02:00
86ce3595f6 Update check tools packages // Resolve #3758
Updated tools: Cppcheck v2.3, PVS-Studio v7.11
2020-12-22 00:44:09 +02:00
6e958b8415 Handle possible issues when check tool cannot be executed // Resolve #3753
Now, each tool individually decides under what conditions the check is considered failed.
2020-12-22 00:21:32 +02:00
d485703768 Use "Updating to X.Y.Z" instead of "Outdated" when doing a real package updating 2020-12-11 17:53:48 +02:00
109e2107d1 Sync docs 2020-12-11 16:14:08 +02:00
3469905365 Decode subprocess output only for byte-strings 2020-12-02 15:15:17 +02:00
75b3846f8f Sync docs & examples 2020-12-02 15:15:02 +02:00
a9ec38208c Bump version to 5.0.4b1 2020-11-30 20:24:45 +02:00
c38b9a4144 Fixed a "git-sh-setup: file not found" error when installing project dependencies from Git VCS // Resolve #3740 2020-11-30 20:23:30 +02:00
b6128aeaa1 Apply formatting 2020-11-22 22:32:03 +02:00
881782be05 Allow spaces and dots in example's name ([package manifest) 2020-11-22 21:42:25 +02:00
0c05930501 Sync docs 2020-11-22 21:41:47 +02:00
b96f2a19b5 Bump version to 5.0.4a2 2020-11-14 20:10:45 +02:00
c1906714ee Give a constant "PlatformIO" name for the C/C++ configuration 2020-11-14 20:10:22 +02:00
32181d1bd2 Improved `.ccls` configuration file for Emacs, Vim, and Sublime Text integrations // Issue #3735 2020-11-14 19:55:24 +02:00
7dfb413d87 Typo fix 2020-11-12 21:42:53 +02:00
7934a96ad1 Added "Core" suffix when showing PlatformIO Core version using `pio --version` command 2020-11-12 20:42:27 +02:00
abddbf9c7d Bump version to 5.0.4a1 2020-11-12 18:56:55 +02:00
77e66241f7 Do not provide "intelliSenseMode" option when generating configuration for VSCode C/C++ extension 2020-11-12 18:56:34 +02:00
4b3f2e19a4 Merge branch 'release/v5.0.3' 2020-11-12 17:57:30 +02:00
b29c6485a8 Merge tag 'v5.0.3' into develop
Bump version to 5.0.3
2020-11-12 17:57:30 +02:00
f4dba7a68c Bump version to 5.0.3 2020-11-12 17:56:12 +02:00
2817408db3 Fixed an issue when pio package pack ignores some folders // Resolve #3730 2020-11-12 16:06:54 +02:00
9ff3c758eb Fix tests 2020-11-12 15:35:37 +02:00
3dcc189740 Use custom Pre-Debug task only for multi-env project 2020-11-12 15:35:19 +02:00
4a12d1954e Fixed an issue when the package manager tries to install a built-in library from the registry // Resolve #3662 2020-11-12 15:27:34 +02:00
e4d645110a Merge branch 'develop' of https://github.com/platformio/platformio-core into develop
# Conflicts:
#	HISTORY.rst
2020-11-12 15:25:51 +02:00
01a32067d5 Print ignored environments and test suites in only in verbose mode
Resolve #3726
2020-11-12 15:22:47 +02:00
fc5ce4739c Added an error selector for Sublime Text build runner // Resolve #3733 2020-11-12 15:05:01 +02:00
ae7b8f9ecf Fix tests 2020-11-11 20:52:23 +02:00
0f5d2d6821 Sync docs 2020-11-11 19:44:39 +02:00
48eca22a00 Force VSCode's intelliSenseMode to "gcc-x64" when GCC toolchain is used 2020-11-11 14:19:58 +02:00
5e164493a8 Sync docs 2020-11-09 11:39:26 +02:00
ead99208f2 Increase example name in manifest to 255 chars 2020-11-09 11:38:46 +02:00
4f5ad05792 Docs: Document "Introducing Strict SSL/TLS" in migration 2020-11-04 14:07:40 +02:00
bc52e72605 Bump version to 5.0.3a2 2020-11-03 15:11:52 +02:00
038674835a Workaround for a broken locale 2020-11-02 12:27:17 +02:00
00f21c17ca Merge branch 'develop' of https://github.com/platformio/platformio-core into develop 2020-11-01 21:06:47 +02:00
818a1508a0 Docs: Use native ProjectConfig in the advanced scripting examples 2020-11-01 21:06:23 +02:00
2d9480a6a7 Support for GitPod environment 2020-11-01 21:05:03 +02:00
0bec4e25c8 Add support for C++ language standard in QtCreator template
Resolve #3719
2020-11-01 19:03:14 +02:00
950a540df4 Bump version to 5.0.3a1 2020-10-31 19:07:45 +02:00
2e66c5f807 Generate a working "projectEnvName" for PlatformIO IDE's debugger for VSCode 2020-10-31 19:07:04 +02:00
7033c2616b Docs: Add info how to access PlatformIO Core CLI in VSCode 2020-10-31 12:44:37 +02:00
7292024ee6 Merge branch 'release/v5.0.2' 2020-10-30 18:10:54 +02:00
8d4cde4534 Merge tag 'v5.0.2' into develop
Bump version to 5.0.2
2020-10-30 18:10:54 +02:00
d6df6cbb5d Bump version to 5.0.2 2020-10-30 18:10:47 +02:00
344e94d8a1 Bump version to 5.0.2rc2 2020-10-30 17:51:02 +02:00
5cf73a9165 Remove all hooks when dumping data to JSON and Python 3 is used 2020-10-30 17:50:43 +02:00
96b1a1c79c Fixed an issue with a "wrong" timestamp in device monitor output using "time" filter // Resolve #3712 2020-10-30 14:11:27 +02:00
0bbe7f8c73 Sync docs 2020-10-29 23:48:44 +02:00
e333bb1cca Tests: skip dev-plalform without examples 2020-10-29 23:42:15 +02:00
454cd8d784 Bump version to 5.0.2rc1 2020-10-29 23:18:39 +02:00
743a43ae17 Fixed an issue when multiple pio lib install command with the same local library results in duplicates in `lib_deps` // Resolve #3715 2020-10-29 23:17:47 +02:00
5a1b0e19b2 Initialize a new project or update existing passing working environment name and its options // Resolve #3686 2020-10-29 22:59:48 +02:00
da6cde5cbd Sync docs 2020-10-29 18:09:08 +02:00
5ea864da39 Add py39 env 2020-10-29 18:08:58 +02:00
175448deda Fix tests on PY2 2020-10-29 14:37:50 +02:00
16f90dd821 Ignore possible empty defines when exporting IDE data // Resolve #3690 2020-10-29 12:22:26 +02:00
9efac669e6 Bump version to 5.0.2b5 2020-10-28 22:53:29 +02:00
adf9ba29df Fixed an issue when "pio package publish" command removes original archive after submitting to the registry // Resolve #3716 2020-10-28 22:52:48 +02:00
cacddb9abb Support package packing on the Python 3+ only 2020-10-28 22:33:24 +02:00
edbe213410 Sync docs 2020-10-28 22:32:48 +02:00
891f78be37 Use "ensure_python3" util 2020-10-28 22:32:27 +02:00
175be346a8 Extend package filters 2020-10-28 20:57:26 +02:00
9ae981614f Add pack/sdist target 2020-10-28 20:56:53 +02:00
16f5f3ef46 Do not pack binary files and docs to the package source archive 2020-10-28 14:18:09 +02:00
2cd19b0273 Bump version to 5.0.2b4 2020-10-27 23:00:33 +02:00
e158e54a26 Fix issue with data decoding when calling PIO Core via PIO Home 2020-10-27 22:57:51 +02:00
63a6fe9133 Improved "core.call" RPC for PlatformIO Home // Resolve #3671 2020-10-27 21:07:02 +02:00
779eaee310 Bump version to 5.0.2b3 2020-10-26 22:25:47 +02:00
0ecfe8105f Docs: Unify CLI commands to use "pio" short version command 2020-10-26 22:24:05 +02:00
b8cc867ba4 Allow dev-platform to provide extra debug configuration using BsePlatform::configure_debug_options API 2020-10-26 18:24:46 +02:00
7230556d1b Move extra IDE data to "extra" section 2020-10-26 18:23:28 +02:00
afd79f4655 Improve initiating manifest parser from a package archive 2020-10-22 19:08:20 +03:00
5d87fb8757 Add "Articles" section to Zephyr RTOS 2020-10-22 19:07:44 +03:00
23e9596506 Automatically build PlatformIO Core extra Python dependencies on a host machine if they are missed in the registry // Resolve #3700 2020-10-20 21:06:53 +03:00
428f46fafe Typo test 2020-10-16 17:05:19 +03:00
ee847e03a6 Fix an issue with "'NoneType' object has no attribute 'status_code'" 2020-10-16 14:23:10 +03:00
a870981266 Docs: Fix custom "platform_packages" for ESP8266/32 2020-10-14 23:21:59 +03:00
411bf1107d Disable "lattice_ice40" examples for macOS 2020-10-14 22:33:04 +03:00
5b74c8a942 Minor fixes 2020-10-14 19:53:30 +03:00
a24bab0a27 Fix badge 2020-10-14 17:55:45 +03:00
1cb7764b0e Highlight PlatformIO Labs Technology 2020-10-14 17:53:41 +03:00
d835f52a18 Sync docs 2020-10-10 20:48:56 +03:00
9c20ab81cb fix quoting of defines in ccls template (#3692) 2020-10-02 13:28:02 +03:00
14de3e79c5 Sync docs 2020-09-26 22:52:43 +03:00
21c12030d5 Bump version to 5.0.2b2 2020-09-19 19:30:40 +03:00
2370e16f1b Fixed an "AssertionError: ensure_dir_exists" when checking library updates from simultaneous subprocesses // Resolve #3677 2020-09-19 19:29:51 +03:00
a384411a28 Bump version to 5.0.2b1 2020-09-17 20:41:10 +03:00
1e0ca8f79c Fixed an issue with GCC linker when "native" dev-platform is used in pair with library dependencies // Resolve #3669 2020-09-17 20:40:11 +03:00
2b5e590819 Docs: Explain how to install custom Python packages // Resolve #3673 2020-09-17 19:21:12 +03:00
bf57b777bf Docs: Update docs for PlatformIO IDE 2.0 for VSCode 2020-09-16 19:33:55 +03:00
f656d19ed5 Docs: Added new section about Arduino STM32L0 core 2020-09-14 22:31:11 +03:00
eb09af06ed Bump version to 5.0.2a2 2020-09-12 23:21:33 +03:00
687c339f20 Fixed a "PermissionError: [WinError 5]" on Windows when external repository is used with lib_deps option // Resolve #3664 2020-09-12 23:20:46 +03:00
7bc170a53e Fixed an issue with "KeyError: 'versions'" when dependency does not exist in the registry // Resolve #3666 2020-09-11 21:16:18 +03:00
65297c24d4 Merge branch 'release/v5.0.1' 2020-09-10 17:46:56 +03:00
ea21f3fba0 Merge tag 'v5.0.1' into develop
Bump version to 5.0.1
2020-09-10 17:46:56 +03:00
b515a004d3 Bump version to 5.0.1 2020-09-10 17:46:49 +03:00
7d3fc1ec1a Catch exception if folder already exists 2020-09-09 18:38:55 +03:00
6987d6c1c6 Fixed an issue when can not remove update or remove external dev-platform using PlatformIO Home // Resolve #3663 2020-09-09 17:53:04 +03:00
de2b5ea905 Bump version to 5.0.1b1 2020-09-09 16:27:47 +03:00
f946a0bc08 Reformat code with black==20.8b1 2020-09-09 16:27:36 +03:00
4f47ca5742 Fixed an issue with "Invalid simple block (semantic_version)" from library dependency that refs to an external source (repository, ZIP/Tar archives) // Resolve #3658 2020-09-09 16:13:39 +03:00
54b51fc2fd Merge branch 'develop' of https://github.com/platformio/platformio-core into develop
# Conflicts:
#	HISTORY.rst
2020-09-09 14:38:29 +03:00
1f284e853d Fixed an issue when the package manager tries to install a built-in library from the registry // Resolve #3662 2020-09-09 14:36:01 +03:00
2a30ad0fdf Allow in-progress language standards in IDE templates // Resolve #3653
Note: VS Code only supports finalized names
2020-09-09 13:56:00 +03:00
c454ae336d Added support for "owner" requirement when declaring `dependencies using library.json` 2020-09-09 13:10:42 +03:00
cd59c829e0 Fixed an issue when pio package unpublish command crashes // Resolve #3660 2020-09-09 12:17:09 +03:00
429f416b38 Generate current date for a custom contrib-pysite package 2020-09-07 16:38:20 +03:00
0a881d582d Docs: Add info how to list publish packages 2020-09-07 16:37:37 +03:00
65b1029216 Host SPDX licenses on Bintray, Github is blocked in multiple countries 2020-09-07 13:16:08 +03:00
c7758fd30e Docs: Minor fixes 2020-09-06 21:06:16 +03:00
46f300d62f Docs: Add "Publishing" section to the instruction on how to create own dev-platform 2020-09-06 21:00:45 +03:00
4234dfb6f9 Fixed an issue with "ImportError: cannot import name '_get_backend' from 'cryptography.hazmat.backends'" when using Remote Development // Resolve #3652 2020-09-06 18:37:27 +03:00
9695720343 Bump version to 5.0.1a1 2020-09-04 22:48:21 +03:00
1f28056459 Fixed an issue when using a custom git/ssh package with platform_packages // Resolve #3624 2020-09-04 22:47:49 +03:00
7dacceef04 Exclude tests from python package (#3650) 2020-09-04 18:55:30 +03:00
39883e8d68 Docs: Document "--without-testing" option for pio test command 2020-09-04 18:39:52 +03:00
949ef2c48a Merge tag 'v5.0.0' into develop
Bump version to 5.0.0
2020-09-03 14:43:11 +03:00
ada3f8b270 Merge branch 'release/v5.0.0' 2020-09-03 14:43:10 +03:00
cf4b835b0c Bump version to 5.0.0 2020-09-03 14:42:59 +03:00
fec4569ada Docs: Update docs with new owner-based dependency form 2020-09-03 14:37:24 +03:00
083edc4c76 Refactor to os.path 2020-09-02 20:52:11 +03:00
fe4112a2a3 Follow SemVer complaint version constraints when checking library updates // Resolve #1281 2020-09-02 20:36:56 +03:00
c8ea64edab Fix link to FAQ sections (#3642)
* Fix link to FAQ sections

Use consistently the same host and url and fix one unmatched anchor.

* Update HISTORY.rst

Co-authored-by: Ivan Kravets <me@ikravets.com>
2020-09-02 19:13:20 +03:00
6e5198f373 Minor improvements 2020-09-02 18:49:00 +03:00
44c2b65372 Show ignored project environments only in the verbose mode // Resolve #3641 2020-09-02 17:31:32 +03:00
5cc21511ad Show owner name for packages 2020-09-02 16:07:16 +03:00
2edd7ae649 Update PVS-Studio to the latest v7.09 2020-08-31 15:40:25 +03:00
7a49a74135 Bump version to 5.0.0b3 2020-08-28 21:55:55 +03:00
be487019f5 Fix a broken handling multi-configuration project // Resolve #3615 2020-08-28 21:54:47 +03:00
5dee0a31e6 Do not test for package owner if resource is external 2020-08-28 21:40:17 +03:00
9f2c134e44 Do not detach a new package even if it comes from external source 2020-08-28 21:24:48 +03:00
cdbb837948 Minor fixes 2020-08-28 18:45:52 +03:00
80c1774a19 Docs: PlatformIO Core 5.0: new commands, migration guide, other improvements 2020-08-28 14:08:26 +03:00
1aaa9b6707 Update changelog with static analysis section 2020-08-26 17:44:01 +03:00
4a7f578649 Sync docs and history 2020-08-26 15:40:24 +03:00
d59416431d Parse npm-like "repository" data from a package manifest // Resolve #3637 2020-08-26 15:40:03 +03:00
8625fdc571 Minor imperovements 2020-08-26 14:51:53 +03:00
3c91e3c1e1 Move build dir to the disk root (should fix issue with long path for Zephyr RTOS on WIndows) 2020-08-26 14:51:01 +03:00
1560fb724c Bump version to 5.0.0b2 2020-08-26 06:40:46 +03:00
0db39ccfbd Automatically accept PIO. Core 4.0 compatible dev-platforms 2020-08-26 06:40:22 +03:00
5086b96ede Bump version to 5.0.0b1 2020-08-25 22:22:35 +03:00
210cd76042 Rename "idedata" sub-command to "data" 2020-08-25 22:01:22 +03:00
f77978a295 Apply formatting 2020-08-25 22:01:08 +03:00
3e72f098fe Updates for PIO Check (#3640)
* Update check tools to the latest versions

* Use language standard when exporting defines to check tools

* Buffer Cppcheck output to detect multiline messages

* Add new test for PIO Check

* Pass include paths to Clang-Tidy as individual compiler arguments

Clang-tidy doesn't support response files which can exceed command
length limitations on Windows

* Simplify tests for PIO Check

* Update history

* Sync changelog
2020-08-25 21:19:21 +03:00
b9fe493336 Sync docs 2020-08-25 19:18:26 +03:00
79bfac29ba Update history and sync docs 2020-08-25 18:57:20 +03:00
2ea80d91f8 Minor fixes 2020-08-25 15:55:17 +03:00
fa90251714 Fixed an issue when Unit Testing engine fails with a custom project configuration file // Resolve #3583 2020-08-25 14:35:01 +03:00
ff19109787 Fix test 2020-08-25 14:34:03 +03:00
091ba4346d Bump version to 4.4.0b6 2020-08-24 23:11:43 +03:00
e43176e33a Typo fix 2020-08-24 23:11:24 +03:00
655e2856d1 Bump version to 4.4.0b5 2020-08-24 23:05:01 +03:00
c6a37ef880 Get real path of just installed core-package 2020-08-24 23:04:17 +03:00
6af2bad123 Make PIO Core 4.0 automatically compatible with dev-platforms for PIO Core 2.0 & 3.0 // Resolve #3638 2020-08-24 22:56:31 +03:00
3e7e9e2b3d Remove unused data using a new `pio system prune // Resolve #3522 2020-08-24 15:22:05 +03:00
13db51a556 Install/Uninstall dependencies only for library-type packages // Resolve #3637 2020-08-24 15:10:38 +03:00
d6d95e05e8 Rename "fs.format_filesize" to "fs.humanize_file_size" 2020-08-24 15:09:37 +03:00
b44bc80bd1 PyLint fix for PY2 2020-08-23 21:41:53 +03:00
f39c9fb597 Bump version to 4.4.0b4 2020-08-23 21:07:40 +03:00
24f85a337f Fix "AttributeError: module 'platformio.exception' has no attribute 'InternetIsOffline'" 2020-08-23 21:07:14 +03:00
a069bae1fb Fix a bug with package updating when version is not in SemVer format // Resolve #3635 2020-08-23 15:26:58 +03:00
1c8aca2f6a Check ALL possible version for the first matched package 2020-08-23 15:25:03 +03:00
620241e067 Move package "version" related things to "platformio.package.version" module 2020-08-23 15:24:31 +03:00
da179cb33f Enhance configuration variables 2020-08-23 14:29:31 +03:00
8ea10a18d3 Bump version to 4.4.0b3 2020-08-23 13:22:38 +03:00
e2bb81bae4 Restore legacy util.cd API 2020-08-23 13:22:11 +03:00
dcf91c49ac Remove debug code 2020-08-22 22:56:26 +03:00
c2caf8b839 Bump version to 4.4.0b2 2020-08-22 22:53:41 +03:00
95151062f5 Implement mirroring for HTTP client 2020-08-22 22:52:29 +03:00
7e4bfb1959 Move CacheContent API to "cache.py" module 2020-08-22 20:05:14 +03:00
abae9c7e77 Cache base registry requests 2020-08-22 17:52:12 +03:00
102aa5f22b Port legacy API requests to the new registry client 2020-08-22 17:49:29 +03:00
d92c1d3442 Refactor HTTP related operations 2020-08-22 17:48:49 +03:00
aa186382a8 Upgraded to SCons 4.0 2020-08-22 14:22:37 +03:00
70366d34b9 Sync docs 2020-08-22 13:57:18 +03:00
49b70f44ca Ignore legacy tmp pkg folders 2020-08-22 13:56:57 +03:00
f79fb4190e Sync docs 2020-08-21 14:25:59 +03:00
d980194600 Bump version to 4.4.0b1 2020-08-17 15:34:02 +03:00
fb6e1fd33c PyLint fixes 2020-08-17 15:33:08 +03:00
6f7fc638c7 Fix PyLint errors in tests 2020-08-17 12:56:57 +03:00
2459e85c1d Fix a bug with the custom platform packages // Resolve #3628 2020-08-17 12:13:25 +03:00
74e27a2edc Enable "cyclic reference" for GCC linker only for the embedded dev-platforms // Resolve #3570 2020-08-16 20:26:59 +03:00
808852f4cc Set default timeout for http requests // Resolve #3623 2020-08-16 20:21:30 +03:00
67e6d177b4 Minor fixes for dev-platform factory 2020-08-16 18:48:05 +03:00
04694b4126 Switch legacy platform manager to the new 2020-08-15 23:11:01 +03:00
bb6fb3fdf8 Fix bug with parsing detached packages 2020-08-15 15:24:35 +03:00
4ec64f8980 Fix a test for examples 2020-08-14 17:00:18 +03:00
332874cd4b Fix relative import of platform module on Py27 2020-08-14 16:48:12 +03:00
276ca61cde Refactor dev-platform API 2020-08-14 16:39:15 +03:00
5f3ad70190 Rename meta.PackageSourceItem or PackageItem 2020-08-14 16:38:46 +03:00
ff8ec43a28 Ensure tool-type package is compatible with a host system 2020-08-13 21:46:46 +03:00
ecc369c2f8 Minor fixes 2020-08-13 20:19:27 +03:00
26fdd0a62c Bump version to 4.4.0a8 2020-08-13 18:30:33 +03:00
64ff6a0ff5 Switch legacy core package manager to the new 2020-08-13 18:30:04 +03:00
fd7dba1d74 Package Manifest: increase package author.name field to the 100 chars 2020-08-13 17:50:44 +03:00
38ec517200 Update history 2020-08-12 21:09:42 +03:00
20a74d1654 Merge branch 'feature/pkg-next' into develop 2020-08-12 20:09:18 +03:00
d5451756fd Minor improvements 2020-08-12 20:09:10 +03:00
893ca1b328 Switch library manager to the new package manager 2020-08-12 13:27:05 +03:00
2dd69e21c0 Implement package removing with dependencies 2020-08-01 20:17:07 +03:00
a01b3a2473 Do not raise exception when package is not found (404), return None 2020-08-01 19:58:59 +03:00
6ac538fba4 Remove unused import 2020-08-01 15:49:10 +03:00
41c2d64ef0 Fix "PermissionError: [WinError 32] The process cannot access the file" on Windows 2020-08-01 15:36:28 +03:00
a1970bbfe3 Allow a forced package installation with removing existing package 2020-08-01 14:38:28 +03:00
d329aef876 Initial version of a new package manager 2020-07-31 15:42:26 +03:00
abc0489ac6 Update changelog 2020-07-28 15:59:02 +03:00
2bc47f4e97 PyLint fix 2020-07-28 15:55:25 +03:00
933a09f981 Update unit testing support for mbed framework
- Take into account Mbed OS6 API changes
- RawSerial is used with Mbed OS 5 since Serial doesn't support putc with baremetal profile
2020-07-28 15:22:36 +03:00
adc2d5fe7c Update VSCode template
Starting with cpptools v0.29 escaped paths in compilerArgs field don't work on Windows.
2020-07-28 15:10:52 +03:00
def149a29e Use updated registry API 2020-07-25 17:13:05 +03:00
39cb23813f Allow ignoring "platforms" and "frameworks" fields in "library.json" and treat a library as compatible with all 2020-07-25 11:51:47 +03:00
85f5a6a84a Bump version to 4.4.0a7 2020-07-24 21:00:58 +03:00
6ace5668b8 Update the registry publish endpoints 2020-07-24 20:57:18 +03:00
c193a4ceb7 Handle proxy environment variables in lower case // Resolve #3606 2020-07-23 19:07:29 +03:00
1abc110f8a Merge branch 'develop' of https://github.com/platformio/platformio-core into develop 2020-07-23 17:57:00 +03:00
73740aea89 Sync docs and examples 2020-07-23 17:56:41 +03:00
83110975fa Docs: Sync 2020-07-23 17:42:46 +03:00
881c5ea308 Remove unused code 2020-07-23 17:37:23 +03:00
22f1b94062 Bump version to 4.4.0a6 2020-07-21 12:42:26 +03:00
ea30d94324 Automatically enable LDF dependency chain+ mode (evaluates C/C++ Preprocessor conditional syntax) for Arduino library when “library.properties” has “depends” field // Resolve #3607 2020-07-21 12:41:38 +03:00
1ed462a29a PyLint fix 2020-07-16 01:00:38 +03:00
a2efd7f7c5 Bump version to 4.4.0a5 2020-07-15 23:18:07 +03:00
ca33058637 New commands for the registry package management (pack, publish, unpublish) 2020-07-15 23:16:46 +03:00
a6f143d1ca Dump data intended for IDE extensions/plugins using a new platformio project idedata command 2020-07-15 14:20:29 +03:00
1368fa4c3b Implement new fields (id, ownername, url, requirements) for PackageSpec API 2020-07-14 21:07:09 +03:00
cca3099d13 Ensure that module.json keywords are lowercased 2020-07-14 18:55:29 +03:00
368c66727b Fix issue with package packing when re-map is used and manifest is missed in "include" (copy it now) 2020-07-12 22:39:32 +03:00
a688edbdf1 Fix an issue with manifest parser when "new_from_archive" API is used 2020-07-09 21:53:46 +03:00
e570aadd72 Docs: Sync 2020-07-09 17:17:34 +03:00
f85cf61d68 Revert back max length of author name to 50 chars 2020-07-08 23:23:14 +03:00
f27c71a0d4 Increase author name length to 100 chars for manifest 2020-07-08 22:56:14 +03:00
940682255d Lock Python's isort package to isort<5 2020-07-08 22:16:52 +03:00
a00722bef4 Ignore maintainer's broken email in library.properties manifest 2020-07-08 21:53:28 +03:00
84132d9459 Fix tests 2020-07-08 21:52:34 +03:00
42fd284560 Improve parsing "author" field of library.properties manfiest 2020-07-08 20:21:10 +03:00
40d6847c96 Add option to pass a custom path where to save package archive 2020-07-08 13:46:36 +03:00
abd3f8b3b5 Docs: Remove legacy library dependency syntax for github 2020-07-07 22:53:01 +03:00
3c986ed681 Remove recursively .pio folders when packing a package 2020-07-07 16:28:51 +03:00
8b24b0f657 Sync docs & examples 2020-07-06 23:37:28 +03:00
0f8042eeb4 Implement PackagePacker.get_archive_name API 2020-07-06 15:57:49 +03:00
f97632202b Fix issue with KeyError 2020-07-06 15:57:10 +03:00
a79e933c37 Ignore author's broken email in a package manifest 2020-07-06 14:22:35 +03:00
ef53bcf601 Ignore empty fields in library.properties manifest 2020-07-06 14:17:00 +03:00
08a87f3a21 Do not allow [;.<>] chars for a package name 2020-07-03 19:14:58 +03:00
b3dabb221d Allow "+" in a package name 2020-07-03 16:07:36 +03:00
899a6734ee Add .ccls to .gitignore (vim and emacs) (#3576)
* Add .ccls to .gitignore (vim)

* Add .ccls to .gitignore (emacs)
2020-06-30 21:48:44 +03:00
7f48c8c14e Fix PyLint for PY 2.7 2020-06-30 15:06:40 +03:00
2c24e9eff6 Fall back to latin-1 encoding when failed with UTF-8 while parsing manifest 2020-06-30 14:28:37 +03:00
5cdca9d490 Optimize tests 2020-06-29 21:14:34 +03:00
1ac6c50334 Update multi-environment test for PIO test command 2020-06-29 20:52:15 +03:00
4cbad399f7 Remove mbed framework from several tests 2020-06-29 19:22:22 +03:00
2b8aebbdf9 Extend test for parsing package manifest when "system" is used as a list 2020-06-29 15:06:21 +03:00
e9a15b4e9b Parse package.json manifest keywords 2020-06-27 21:42:13 +03:00
dd18abcac3 Fix tests 2020-06-27 12:59:12 +03:00
b046f21e0d Fix "RuntimeError: dictionary keys changed during iteration" when parsing "library.json" dependencies 2020-06-27 12:46:04 +03:00
29fb803be1 Enable PIO Core tests on Python 3.8 2020-06-27 12:36:57 +03:00
bc2eb0d79f Parse dev-platform keywords 2020-06-26 19:49:25 +03:00
0bec1f1585 Extend system info with "file system" and "locale" encodings 2020-06-26 18:38:17 +03:00
a1ec3e0a22 Remove "vendor_url" and "docs_url" from Platform API 2020-06-25 23:23:55 +03:00
7bc22353cc Docs: Sync dev-platforms 2020-06-25 18:04:04 +03:00
efc2242046 Remove empty data from board information 2020-06-25 14:51:53 +03:00
5dadb8749e Change slogan to "PlatformIO is a professional collaborative platform for embedded development" 2020-06-23 12:33:00 +03:00
82735dd571 Fixed an issue with improper processing of source files added via multiple Build Middlewares // Resolve #3531 2020-06-23 11:46:00 +03:00
9fb4cde2a5 Do not generate ".travis.yml" for a new project, let the user have a choice 2020-06-23 11:26:22 +03:00
164ae2bcbc Extend system info with Python and PIO Core executables // Issue #3521 2020-06-23 11:20:29 +03:00
a172a17c81 Bump version to 4.4.0a4 2020-06-22 23:09:28 +03:00
5ee90f4e61 Display system-wide information using platformio system info command // Resolve #3521 2020-06-22 23:04:36 +03:00
3aae791bee Change slogan to "collaborative platform" 2020-06-22 20:02:43 +03:00
9f05519ccd List available project targets with a new "platformio run –list-targets" command // Resolve #3544 2020-06-22 19:53:31 +03:00
f19491f909 Docs: Sync articles 2020-06-22 17:55:02 +03:00
967a856061 Do not allow ":" and "/" chars in a package name 2020-06-22 15:25:02 +03:00
87d5997b46 Add a test that ensures setUp and tearDown functions can be compiled 2020-06-22 14:42:45 +03:00
c20a1f24cd Don't print relative paths with double-dot 2020-06-18 20:36:59 +03:00
260c36727c fix pio access urn format 2020-06-17 23:56:22 +03:00
03d9965758 Replace urn with prn (#3565)
* Replace urn with prn

* fix

* fix text
2020-06-17 23:46:50 +03:00
e853d61e16 Add orgname filter for access list (#3564)
* add orgname filter for access list

* fix

* fix namings
2020-06-17 18:55:40 +03:00
42e8ea29ff CLI to manage access level on PlatformIO resources. Resolve #3534 (#3563) 2020-06-17 13:53:53 +03:00
1e90c821dc Disable package upload test (#3562) 2020-06-17 00:24:55 +03:00
cad0ae0113 Update slogan to "No more vendor lock-in!" 2020-06-16 15:06:04 +03:00
21f3dd11f4 Fix printing relative paths on Windows // Resolve #3542
Fixes "ValueError" when running "clean" target if "build_dir"
points to a folder on a different logical drive
2020-06-16 12:27:49 +03:00
a9c13aa20e Implement "ManifestParserFactory.new_from_archive" API 2020-06-15 22:05:59 +03:00
d3fd115743 Black format 2020-06-15 22:05:28 +03:00
df0e6016bb Handle possible NodeList in source files when processing Middlewares // Resolve #3531
env.Object() returns a list of objects that breaks the processing of
subsequent middlewares since we only expected File nodes.
2020-06-15 21:25:24 +03:00
cb70e51016 Update changelog for Custom Targets 2020-06-13 16:21:15 +03:00
cf2fa37e56 Bump version to 4.4.0a3 2020-06-13 13:18:54 +03:00
28d9f25f9a Added a new "-e, --environment" option to "platformio project init" command 2020-06-12 23:47:12 +03:00
fdb83c24be Clean autogenerated files before running tests // Resolve #3523
Fixes possible conflicts between auxiliary test transport files when
project contains multiple environments with different platforms
2020-06-11 23:53:52 +03:00
660b57cdd3 Update PIO Home front-end to 3.2.3 2020-06-11 21:16:06 +03:00
405dcda824 Feature/update account tests (#3556)
* update account tests

* change second user

* refactoring

* clean

* fix tests email receiving

* fix
2020-06-11 16:02:38 +03:00
266612bbdf Run CI on pull requests 2020-06-11 15:27:51 +03:00
2722e27415 Sync docs 2020-06-11 15:15:46 +03:00
f571ad9d47 Sync docs 2020-06-11 11:03:48 +03:00
ef8a9835b0 Bump version to 4.4.0a2 2020-06-10 14:26:48 +03:00
b71b939307 Rename "AddSystemTarget" to "AddPlatformTarget" 2020-06-10 14:25:53 +03:00
9e3ba11e8a skip account tests 2020-06-10 12:36:07 +03:00
91e9406304 cleaning 2020-06-10 12:22:28 +03:00
0d8272890c merge account, org and team tests into one file 2020-06-10 12:02:34 +03:00
a182cca5e9 tests fix (#3555)
* replace timestamp with randint in tests

* replace pop3 with imap
2020-06-10 11:07:19 +03:00
e6fbd6acf1 Remove debug code 2020-06-09 23:26:49 +03:00
062a82c89e Sync docs 2020-06-09 20:59:23 +03:00
89cc6f9bf3 Bump version to 4.4.0a1 2020-06-09 18:44:49 +03:00
3c8e0b17a7 Added support for custom targets 2020-06-09 18:43:50 +03:00
e0023bb908 increase tests email receiving time 2020-06-09 17:05:11 +03:00
a5547491ed Add account and org destroy commands. Fix tests (#3552)
* Add account and org destroy commands. Fix tests

* fix tests

* fix

* fix texts
2020-06-09 15:50:37 +03:00
78546e9246 Docs: Add "TensorFlow, Meet The ESP32" to articles list 2020-06-08 19:26:48 +03:00
7457ef043b Docs: Sync ASR Micro dev-platform 2020-06-08 12:00:19 +03:00
e0e97a3629 Cache the latest news in PIO Home for 180 days 2020-06-05 18:29:11 +03:00
f5e6820903 Bump version to 4.3.5a2 2020-06-05 14:18:24 +03:00
27fd3b0b14 Improve detecting if PlatformIO Core is run in container 2020-06-05 14:17:19 +03:00
ced244d30a Sync docs 2020-06-05 11:30:15 +03:00
6fa7cb4af5 Add new dev-platform "ASR Microelectronics ASR605x" 2020-06-04 22:59:05 +03:00
94cb808285 CLI to manage teams. Resolve #3533 (#3547)
* CLI to manage teams.Minor fixes. Resolve #3533

* fix teams tests

* disable org and team tests

* minor fixes. fix error texts

* fix split compatibility
2020-06-04 19:31:30 +03:00
42df3c9c3f Sync docs 2020-06-04 15:27:46 +03:00
0c4c113b0a Fix account shpw command when PLATFORMIO_AUTH_TOKEN is used 2020-06-04 14:09:42 +03:00
3c1b08daab Ignore empty PLATFORMIO_AUTH_TOKEN 2020-06-04 13:57:56 +03:00
d7f4eb5955 Minor grammar fix 2020-06-03 22:40:37 +03:00
87b5fbd237 More cosmetic changes to Org CLI 2020-06-03 22:34:37 +03:00
6c97cc6192 Cosmetic changes to Org CLI 2020-06-03 22:22:13 +03:00
cbcd3f7c4d Fix cmd.org test 2020-06-03 21:40:03 +03:00
f7dceb782c Fix PY2.7 when PermissionError is not avialable 2020-06-03 21:24:01 +03:00
140fff9c23 CLI to manage organizations. Resolve #3532 (#3540)
* CLI to manage organizations. Resolve #3532

* fix tests

* fix test

* add org owner test

* fix org test

* fix invalid username/orgname error text

* refactor auth request in clients

* fix

* fix send auth request

* fix regexp

* remove duplicated code. minor fixes.

* Remove space

Co-authored-by: Ivan Kravets <me@ikravets.com>
2020-06-03 17:41:30 +03:00
8c586dc360 Sync docs 2020-06-03 17:16:59 +03:00
fe52f60389 Bypass PermissionError when cleaning the cache 2020-06-03 14:33:53 +03:00
9064fcbc77 Sync docs 2020-06-03 14:33:03 +03:00
9a1d2970cc Sync docs 2020-05-30 01:10:04 +03:00
26ba6e4756 Add new option to package publishing CLI which allows to disable email notiication 2020-05-28 17:06:36 +03:00
ae58cc74bd Rename checksum header to X-PIO-Content-SHA256 2020-05-28 16:08:37 +03:00
37e795d539 Send package checksum when publishing 2020-05-28 16:07:20 +03:00
49960b257d Implement fs.calculate_file_hashsum 2020-05-28 16:07:02 +03:00
25a421402b fix package type detector 2020-05-28 12:49:32 +03:00
8e72c48319 fix datetime validation in package publish command 2020-05-27 22:30:16 +03:00
c1965b607b Add binary stream to package publishing request 2020-05-27 17:27:05 +03:00
d38f5aca5c Fix metavar for package CLI 2020-05-27 16:20:02 +03:00
c06859aa9f Add package type to unpublish command 2020-05-27 14:30:27 +03:00
e706a2cfe2 Refactor pio account client. Resolve #3525 (#3529) 2020-05-27 13:39:58 +03:00
0c301b2f5d Fix order of arguments 2020-05-27 01:14:07 +03:00
deb12972fb Implement "package unpublish" CLI 2020-05-27 01:10:35 +03:00
8346b9822d Implement "package pack" command 2020-05-26 22:17:55 +03:00
19cdc7d34a Initial support for package publishing in to the registry 2020-05-26 22:01:32 +03:00
49cc5d606b Sync docs 2020-05-26 21:58:58 +03:00
58470e8911 PY2 lint fix 2020-05-26 14:30:43 +03:00
38699cca8f Bump version to 4.3.5a1 2020-05-26 14:26:42 +03:00
0eb8895959 Add support for “globstar/**” (recursive) pattern 2020-05-26 14:25:28 +03:00
99d4e0c390 Merge branch 'release/v4.3.4' 2020-05-23 20:35:59 +03:00
6d32aeb310 Merge tag 'v4.3.4' into develop
Bump version to 4.3.4	81843087	Ivan Kravets <me@ikravets.com>	23 May 2020, 20:33
Bump version to 4.3.4
2020-05-23 20:35:59 +03:00
8184308755 Bump version to 4.3.4 2020-05-23 20:33:13 +03:00
b68953b733 Bump version to 4.3.4b1 2020-05-23 20:01:25 +03:00
7dce494ad6 Rename "misc" command to "system", do not append completion code for Fish shell // Resolve 3435 2020-05-23 20:00:56 +03:00
4921bf8b6a PyLint fix 2020-05-22 14:22:41 +03:00
32cb0d6e4d Handle possible issue on Python 2.x when writing to thread buffer
The problem happens when value has type "unicode" that shouldn't be decoded
2020-05-22 14:17:17 +03:00
e2c5a3c498 Add Python 3.8 for Tox 2020-05-22 14:12:27 +03:00
ec34a65cff Bump version to 4.3.4a5 2020-05-21 15:40:38 +03:00
9296615dbf Merge branch 'develop' of https://github.com/platformio/platformio-core into develop 2020-05-21 15:39:59 +03:00
56795940b9 Sync teensy dev-platform 2020-05-21 15:39:24 +03:00
09a5952248 Add new record to history log
Mention issues about permission error on Windows when cloning
package from Git repository
2020-05-20 21:51:13 +03:00
735435306d Copy and remove cloned package instead of moving // Resolve #2844, Resolve #3328
On Windows, it’s not possible to move a file which is used by another
process (e.g. Git extension in VSCode)
2020-05-20 21:32:55 +03:00
bdd57bf356 Ensure that copytree preserves symlinks 2020-05-20 20:57:55 +03:00
8840b28968 Handle possible issue on Python 2.x when writing to thread buffer
The problem happens when value has type "unicode" that shouldn't be decoded
2020-05-20 17:04:50 +03:00
e31591a35e Print warning about an issue with mapped network drives on Windows // Issue #3417
Starting with Python 3.8 paths to mapped network drives are resolved
to their real path in the system, e.g.: "Z:\path" becomes "\\path" which
causes weird errors in the default terminal with a message that UNC
paths are not supported
2020-05-19 22:37:05 +03:00
457a218723 Sync docs 2020-05-19 13:27:54 +03:00
9724660dda Update SPDX licenses to 3.9 2020-05-19 13:27:44 +03:00
eac6c1c552 Handle error when internet is offline. Resolve # 3503 (#3505)
* Handle error when internet is offline.

* Fix

* minor fix
2020-05-17 22:44:27 +03:00
54d73e834b Github Actions: Checkout submodules recursive 2020-05-14 18:08:51 +03:00
099e3c7198 Use original MongoDB license for "compilation_db.py" 2020-05-13 00:48:11 +03:00
96a68c6b14 Docs: Sync Atmel AVR dev-platform 2020-05-11 22:10:32 +03:00
2a0a1247e3 Revert "Add initialization config for new simavr tool"
This reverts commit 16966a4957.
2020-05-11 18:21:48 +03:00
7555d66748 Revert "Add special debug port for simavr tool"
This reverts commit 7b43444d81.
2020-05-11 18:21:26 +03:00
c76940f7ce PyLint fix 2020-05-10 19:11:06 +03:00
b2ed027bc3 Bump version to 4.3.4a4 2020-05-10 18:36:16 +03:00
01a1981ca1 Added PlatformIO CLI Shell Completion for Fish, Zsh, Bash, and PowerShell // Resolve #3435 2020-05-10 18:35:50 +03:00
03228c528e Bump version to 4.3.4a3 2020-05-09 16:36:05 +03:00
ac510c1553 fix summary caching (#3500) 2020-05-09 16:35:21 +03:00
a1ff5e1a4f Save summary data to local session. (#3497)
* Save summary data to local session.

* naming

* fix account summary test

* add ttl for summary cache

* refactoring get_account_info

* fix
2020-05-08 21:34:52 +03:00
7b43444d81 Add special debug port for simavr tool 2020-05-08 12:31:48 +03:00
16966a4957 Add initialization config for new simavr tool 2020-05-08 01:14:15 +03:00
7e7a6d7807 Skip account tests if env variables not presented (#3494)
* added skip if env variables not presented. fix exception texts

* fix texts

* fix texts
2020-05-06 19:25:24 +03:00
f32dbeeb6d Bump version to 4.3.4a2 2020-05-06 12:30:41 +03:00
f78ffaded0 Remove local PIO Account session from PIO Remote when token is broken 2020-05-06 12:29:01 +03:00
8480ebde89 Rename "authenticating" to "authorizing" wording for PIO Account 2020-05-06 12:27:29 +03:00
44ee7d6a6b Docs: Sync ESP8266 dev-platform 2020-05-04 15:50:11 +03:00
2ab47b7968 Remove account state item if refreshing token failed (#3487) 2020-05-04 13:14:52 +03:00
7181b7632b Docs: Increase content width 2020-05-03 11:06:26 +03:00
b82eaca45e Enable caching for PIP when building contrib-pysite 2020-05-02 15:29:24 +03:00
fd04f31c5f Update link to CLA provider 2020-05-01 23:37:38 +03:00
75abe8a0af Sync docs 2020-05-01 23:36:29 +03:00
f7995ce49a PyLint fix 2020-04-29 12:56:54 +03:00
2c2309acac Bump version to 4.3.4a1 2020-04-29 12:41:56 +03:00
5f79ab34f5 Automatically build `contrib-pysite` package on a target machine when pre-built package is not compatible // Resolve #3482 2020-04-29 12:40:04 +03:00
5bcbee7423 Merge branch 'release/v4.3.3' 2020-04-28 18:06:53 +03:00
961049cf9b Merge tag 'v4.3.3' into develop
Bump version to 4.3.3
2020-04-28 18:06:53 +03:00
72e7492a78 Bump version to 4.3.3 2020-04-28 18:06:46 +03:00
5e4b4bbacd Fix "UnicodeDecodeError: 'utf-8' codec can't decode byte" when non-Latin chars are used in project path // Resolve #3481 2020-04-28 18:05:08 +03:00
a64d368de2 Merge branch 'release/v4.3.2' 2020-04-28 13:27:23 +03:00
6146b58520 Merge tag 'v4.3.2' into develop
Bump version to 4.3.2
2020-04-28 13:27:23 +03:00
f35e6e99af Bump version to 4.3.2 2020-04-28 13:25:52 +03:00
5d8440fdd1 PyLint fixes 2020-04-28 12:48:15 +03:00
d1b394b20a Bump version to 4.3.2rc2 2020-04-27 23:42:22 +03:00
520d6decac Nominate some exceptions to UserSideException 2020-04-27 23:42:02 +03:00
4a251f0ab0 Fix JSONDecodeError when bottle.SimpleTemplate is used 2020-04-27 23:41:36 +03:00
c215abb50c Bump version to 4.3.2rc1 2020-04-26 19:46:33 +03:00
31ca47837d Disable build cache for Github Actions 2020-04-26 12:58:32 +03:00
560699fc6b Apply formatting 2020-04-26 12:58:05 +03:00
51ec94f78c Add new test for PIO Check with --skip-packages option 2020-04-26 01:38:25 +03:00
ac1210fbea Add -imacros files to forcedInclude field in VSCode template 2020-04-26 00:35:22 +03:00
c03f93521b Refactor PIO Check feature (#3478)
* Add new option --skip-packages for check command

Check tools might fail if they're not able to preprocess source
files, for example, Cppcheck uses a custom preprocessor that is
not able to parse complex preprocessor code in zephyr framework).
Instead user can specify this option to skip headers included from
packages and only check project sources.

* Fix toolchain built-in include paths order
C++ and fixed directories should have higher priority

* Refactor check feature

The main purpose is to prepare a more comprehensive build environment.
It's crucial for cppcheck to be able to check complex frameworks like
zephyr, esp-idf, etc. Also detect a special case when cppcheck fails to check
the entire project (e.g. a syntax error due to custom preprocessor)

* Add new test for check feature

Tests ststm32 platform all tools and the main frameworks

* Update check tools to the latest available versions

* Test check tools and Zephyr framework only with Python 3

* Tidy up code

* Add history entry
2020-04-26 00:10:41 +03:00
62ede23b0e Bump version to 4.3.2b1 2020-04-25 15:48:55 +03:00
60f28599d9 Echo what is typed when "send_on_enter" device monitor filter is used // Resolve #3452 2020-04-25 15:48:37 +03:00
629f23c4f3 Bump version to 4.3.2a4 2020-04-25 13:20:56 +03:00
27db344739 Bump version to 4.3.2a3 2020-04-25 13:15:55 +03:00
777a47fd99 Minor improvements 2020-04-25 13:14:54 +03:00
e913159cb4 Sync docs 2020-04-24 21:48:57 +03:00
b285c3137a Extend remote hosts with PlatformIO when checking internet connection 2020-04-24 16:25:02 +03:00
f0576ddcd9 Docs: Fix incorrect type for library.json "libCompatMode" field 2020-04-24 13:14:03 +03:00
6e2cc333f2 disable pio account change password and username update tests 2020-04-24 11:57:17 +03:00
18c7c5a9be Refactor pio account tests. (#3473) 2020-04-24 11:25:09 +03:00
01945716d3 Sync docs 2020-04-24 00:43:32 +03:00
2f5b231dc3 Disable pio account tests (#3472)
* minor fix pio account test

* disable pio account change password and username update tests
2020-04-24 00:13:46 +03:00
75c1aafaef fix pio account tests 2020-04-23 20:45:51 +03:00
b9714d0ac1 Add pio account tests (#3470)
* add pio account tests

* update tests
2020-04-23 16:05:00 +03:00
5774654582 Switch to Github Actions (#3471) 2020-04-23 16:04:15 +03:00
0a46b8ab6a add login with code method for account client. add new account rpc handler. (#3468) 2020-04-21 22:44:32 +03:00
a556573a4f Move env dependent directories to appropriate CMAKE_BUILD_TYPE // Issue #3460
This will allow to dynamically populate list of sources depending on
selected environment. At the same time "src" and "lib" folders remain
common for all environments
2020-04-21 22:01:07 +03:00
fd91819b2c Fix missing include paths for check tools
Includes are now split by scopes and imported as a dictionary
2020-04-21 19:26:00 +03:00
24c04057e9 CLion: Add paths to libraries specified via lib_extra_dirs option (#3463)
* Add paths to libraries specified via lib_extra_dirs option

Besides, global folders in SRC_LIST seem a bit unnecessary
since there might be unused libraries in these folders

* Refactor processing of includes when exporting IDE/Editor projects

Split includes according to their source. That will help export includes in a more flexible way.
For example some IDEs don't need include paths from toolchains

* Add new record to history log

* Typo fix
2020-04-21 17:37:55 +03:00
2960b73da5 Fix an issue when PIO Remote agent was not reconnected automatically 2020-04-21 12:32:03 +03:00
c4645a9a96 Sync docs 2020-04-21 10:43:34 +03:00
877e84ea1d Bump version to 4.3.2a2 2020-04-19 20:05:21 +03:00
cb1058c693 New PIO Account with "username" and profile support 2020-04-19 20:03:46 +03:00
be6bf5052e Open source PIO Remote client 2020-04-19 19:26:56 +03:00
7780003d01 New Account Management System (#3443)
* add login for PIO account to account cli

* Remove PyJWT lib. Fixes.

* Add password change for account

* Refactoring. Add Account Client.

* Fixes.

* http -> https.

* adding error handling for expired session.

* Change broker requests from json to form-data.

* Add pio accoint register command. fixes

* Fixes.

* Fixes.

* Add username and password validation

* fixes

* Add token, forgot commands to pio account

* fix domain

* add update command for pio account

* fixes

* refactor profile update output

* lint

* Update exception text.

* Fix logout

* Add custom user-agent for pio account

* add profile show command. minor fixes.

* Fix pio account show output format.

* Move account related exceptions

* cleaning

* minor fix

* Remove try except for account command authenticated/non-authenticated errors

* fix profile update cli command

* rename first name and last name vars to 'firstname' and 'lastname'
2020-04-19 19:06:06 +03:00
445ca937fd Sync docs 2020-04-18 22:40:27 +03:00
1f4aff7f27 Sync docs 2020-04-16 16:07:02 +03:00
788351a0cd Fixed an incorrect node path used for pattern matching when processing middleware nodes 2020-04-13 16:41:03 +03:00
5ba7753bfa Sync docs 2020-04-12 17:43:27 +03:00
ae57829190 Generate user agent based on PIO Core environment 2020-04-10 17:59:58 +03:00
030ddf4ea1 Apply black formatting 2020-04-10 17:08:16 +03:00
ccc43633b7 Support for a new dev-platform NXP i.MX RT 2020-04-10 13:14:10 +03:00
aba2ea9746 Temporary disable "infineonxmc" from CI due to a broken dev-platform 2020-04-09 12:44:52 +03:00
d5ebbb99a7 Dynamically choose extension for file with unit test transports (#3454)
C file should be used by default as only Arduino and mbed require C++ files.
There might be a lot of legacy projects so custom transport is also set to use C++.
2020-04-09 12:02:38 +03:00
a636a60e00 Sort examples 2020-04-08 22:34:04 +03:00
ad7e3f83aa Fix tests/commands/test_init.py 2020-04-08 17:18:59 +03:00
baa7aab1d7 Specify C++ as the language for .ino files when preprocessing them for PVS-Studio // Resolve #3450 2020-04-07 11:35:17 +03:00
2e320c01b3 Fix test 2020-04-06 18:19:34 +03:00
3cd6c618a4 Docs: Sync STM32 dev-platform 2020-04-06 16:56:05 +03:00
5ea759bc3e Document PIO Core: Integration with custom applications (extensions, plugins) 2020-04-05 19:48:50 +03:00
11cb3a1bf7 Docs: Add info about stm32pio tool for STM32Cube framework 2020-04-04 00:45:45 +03:00
7412cf586b Update docs for Zephyr RTOS 2.2 2020-04-02 00:59:35 +03:00
f976cf7ae5 Docs: Extend tutorials list 2020-03-30 17:15:18 +03:00
e92b498b68 Fixed an issue when saving libraries in new project results in error "No option 'lib_deps' in section" // Resolve #3442 2020-03-27 13:34:14 +02:00
1b0810ec87 Docs: Fix broken link for creating dev-platform // Resolve #123 2020-03-26 22:31:15 +02:00
45e523a468 Docs: Sync with Atmel SAM dev-platform 2020-03-25 17:01:12 +02:00
d42481d196 Sync docs 2020-03-24 18:03:23 +02:00
11c946bfe4 Sync Espressif 32 dev-platform 2020-03-23 19:52:57 +02:00
589d6f9e12 Docs: Sync Espressif 32 dev-platform 2020-03-23 19:35:18 +02:00
79b3a232fc Move debug client and server implementations to "process" folder 2020-03-21 22:00:14 +02:00
f95230b86e Fixed UnicodeDecodeError on Windows when network drive (NAS) is used // Resolve #3417 2020-03-21 21:53:42 +02:00
fc9a16aa81 Merge branch 'feature/issue-3417-unicodeerror-nas' into develop 2020-03-21 21:44:13 +02:00
81a4d28918 Docs: Remove duplicate demo image of PlatformIO for CLion 2020-03-21 16:39:17 +02:00
fd137fe054 Bump version to 4.3.2a1 2020-03-21 13:28:31 +02:00
efd3b244e1 Force PIPE reader to UTF-8 on Windows // Issue #3417 2020-03-21 13:27:46 +02:00
dbeaaf270c fix typo in URL (#3432) 2020-03-21 00:02:50 +02:00
32642b7ec8 Fix broken link to Renode in history 2020-03-20 17:16:49 +02:00
096c2f6165 Typo fix in docs 2020-03-20 17:11:31 +02:00
91ae8b4cc7 Fixed typo in history 2020-03-20 15:15:30 +02:00
cc52890d45 Merge branch 'release/v4.3.1' 2020-03-20 15:13:46 +02:00
5a12f1f56e Merge tag 'v4.3.1' into develop
Bump version to 4.3.1
2020-03-20 15:13:46 +02:00
b7b9ee5a80 Bump version to 4.3.1 2020-03-20 15:13:40 +02:00
97a0cbdd18 Skip Click 7.1 and 7.1.1 on Windows due to broken releases 2020-03-20 15:11:14 +02:00
b8f43732fe Docs: update What's PlatformIO and PIO IDE pages 2020-03-20 14:44:24 +02:00
658b3df123 Fixed an TypeError "super(type, obj): obj must be an instance or subtype of type" when device monitor is used with a custom dev-platform filter // Resolve #3431 2020-03-20 13:56:30 +02:00
d32312e738 Fixed an issue when lib_archive = no was not honored in "platformio.ini" 2020-03-20 13:34:35 +02:00
20023f8d8a Bump version to 4.3.1a1 2020-03-20 13:02:11 +02:00
6b2ff04bbf Fixed an error "SyntaxError: 'return' with argument inside generator" for PIO Unified Debugger when Python 2.7 is used 2020-03-20 13:01:33 +02:00
d80a9c820d Merge branch 'release/v4.3.0' 2020-03-19 22:38:05 +02:00
4b62af1675 Merge tag 'v4.3.0' into develop
Bump version to 4.3.0
2020-03-19 22:38:05 +02:00
6414e1d9e3 Bump version to 4.3.0 2020-03-19 22:37:16 +02:00
a55f04dc28 Warn that can't allocate socket for PIO Home 2020-03-19 22:36:55 +02:00
2d68e28a70 Fix auto-ready logic for debugging server 2020-03-19 21:33:23 +02:00
4c2a157dce Bump version to 4.3.0rc1 2020-03-19 19:28:13 +02:00
d9647dec95 Add support for debugging server "ready_pattern" 2020-03-19 19:17:54 +02:00
15647c81f0 New standalone (1-script) PlatformIO Core Installer 2020-03-19 18:26:30 +02:00
24a0d9123e Update history with initial support for Renode 2020-03-19 17:04:05 +02:00
720c29350d Add docs for Renode debugging tool // Issue #3401 2020-03-19 16:58:18 +02:00
aa939b07b1 Update default init config for Renode 2020-03-19 16:17:51 +02:00
0e3c3abf73 GDB init commands for Renode simulation framework // Issue #3401 2020-03-19 15:16:55 +02:00
a8606f4efa Refactor debug GDB initial configurations 2020-03-19 14:49:25 +02:00
475f898222 Replace installer script with a new one // Resolve #3420 (#3428)
* Replace installer script with a new one. Resolve #3420

* temp file name fix

* get-platformio.py script update.

* small fix
2020-03-19 13:26:51 +02:00
69f5fdf8e1 Remove debug code 2020-03-19 01:05:12 +02:00
fe1ad35cad Merge branch 'feature/issue-3401-renode-support' into develop 2020-03-19 00:50:21 +02:00
352a0b7377 Wait for an output from debug server 2020-03-19 00:46:23 +02:00
52689bc5e8 Wait until debug server is ready 2020-03-19 00:19:59 +02:00
3dd3ea1c35 Show a hexadecimal representation of the data (code point of each character) with `hexlify` filter 2020-03-18 18:55:54 +02:00
fff33d8c29 Do not send CR+NL for "send_on_enter" device monitor filter 2020-03-18 17:25:40 +02:00
db9829a11e Sync docs 2020-03-18 00:36:07 +02:00
9a1b5d869d Bump version to 4.3.0b2 2020-03-18 00:13:03 +02:00
605cd36e27 Send a text to device on ENTER with `send_on_enter` filter // Resolve #926 2020-03-18 00:09:40 +02:00
24a23b67dd Fix formatting issue 2020-03-17 23:10:06 +02:00
0df72411a0 Device Monitor Filter API, implement "time" and "log2file" filters // Resolve #981 Resolve #670 2020-03-17 23:08:57 +02:00
5a72033622 Fixed an issue when unknown transport is used for PIO Unit Testing // Resolve #3422 2020-03-17 17:42:54 +02:00
4e6095ca13 Update docs and history 2020-03-17 17:39:11 +02:00
f81b0b2a84 Ensure all commands in compilation_commands.json use absolute paths. (#3415)
* Fix resolving of absolute path for toolchain

By placing the `where_is_program` call into this function, all references to the compiler will be made absolute, instead of just ones in the top environment. Previously, all references to the compiler for user source code would not use the full path in the compilation database, which broke `clangd`'s detection of system includes.

* Linting issue
2020-03-17 16:30:28 +02:00
314f634e16 Docs: Improvements for CLion docs. 2020-03-15 00:41:16 +02:00
ba040ba2ba Docs: Workaround for ReadTheDocs bug 2020-03-14 20:32:42 +02:00
a22ed40256 Added initial support for an official "PlatformIO for CLion IDE" plugin // Resolve #2201 2020-03-14 19:31:00 +02:00
58a4ff8246 Skip broken Click 7.1 & 7.1.1, see Click's issue #1501 2020-03-14 12:18:00 +02:00
9a5ebfb642 Bump version to 4.3.0b1 2020-03-12 15:10:25 +02:00
5d0faaa5a8 Refactor docs structure 2020-03-12 15:09:20 +02:00
108b892e30 Control device monitor output with filters and text transformations 2020-03-12 14:28:54 +02:00
0ff37c9999 Implement universal "get_object_members" helper 2020-03-12 14:24:20 +02:00
8c3de609ab Add ESP crash trace decoding to monitor (#3383)
* Implement mechanism for adding platform filters into miniterm

Updates platformio/platform-espressif8266#31

* DeviceMonitorFilter: fixes for Windows and Python2
2020-03-11 13:22:01 +02:00
073efef2a1 Explicitly use Python-x64 with Appveyor CI 2020-03-10 15:54:01 +02:00
b9fd97dae4 Changes required for CLion PlatformIO plugin (#3298) 2020-03-09 15:47:41 +02:00
60a7af6a8c Docs: Update recent articles 2020-03-09 14:58:35 +02:00
0f02b3b653 Improved support for Arduino "library.properties" `depends` field 2020-03-07 17:44:28 +02:00
620335631f Bump version to 4.2.2b1 2020-03-06 22:08:38 +02:00
3ef96cb215 Minor fixes 2020-03-06 00:43:57 +02:00
59e1c88726 Fixed an issue when `"libArchive": false` in "library.json" does not work // Resolve #3403 2020-03-06 00:37:48 +02:00
3a27fbc883 Fixed an issue when Python 2 does not keep encoding when converting .INO file // Resolve #3393 2020-03-05 23:52:46 +02:00
ce6b96ea84 Use native open/io.open for file contents reading/writing 2020-03-05 23:52:13 +02:00
3275bb59bf Fix test 2020-03-04 18:14:51 +02:00
fbb62fa8a6 Bump version to 4.2.2a3 2020-03-03 23:10:54 +02:00
261c46d4ef Add support for Arm Mbed "module.json" `dependencies` field // Resolve #3400 2020-03-03 23:10:19 +02:00
0c0ceb2caa Sync docs 2020-03-03 23:03:14 +02:00
de60f20c21 Sync docs 2020-03-03 14:59:03 +02:00
314fe7d309 Initial support for menuconfig target 2020-03-03 00:58:07 +02:00
a271143c52 Sync docs 2020-03-02 23:25:28 +02:00
2d4a3db250 Fixed an issue with expanding $WORKSPACE_DIR for library manager 2020-02-29 23:08:08 +02:00
7fba6f78d6 Bump version to 4.2.2a2 2020-02-29 21:59:58 +02:00
eee12b9b66 Fixed an issue "the JSON object must be str, not 'bytes'" when PIO Home is used with Python 3.5 // Resolve #3396 2020-02-29 21:59:10 +02:00
d3e151feeb Sync docs 2020-02-29 18:44:37 +02:00
dd1fe74956 PyLint fix 2020-02-21 15:44:55 +02:00
49aed34325 Rename PIO Plus to Professional 2020-02-21 15:44:24 +02:00
81ba2a5a74 Sync docs 2020-02-20 18:22:12 +02:00
1c87f83463 Parse package dependencies declared as a list of strings 2020-02-18 21:55:01 +02:00
e15f227c48 Docs: Sync Atmel SAM dev-platform 2020-02-18 14:45:54 +02:00
ea5f2742f8 Bump version to 4.2.2a1 2020-02-18 00:05:20 +02:00
9fd0943b75 Fixed an issue when quitting from PlatformIO IDE does not shutdown PIO Home server 2020-02-18 00:03:23 +02:00
80acd52fc2 Merge branch 'release/v4.2.1' 2020-02-17 14:25:27 +02:00
b8312d545c Merge tag 'v4.2.1' into develop
Bump version to 4.2.1
2020-02-17 14:25:27 +02:00
82f36a1ac3 Bump version to 4.2.1 2020-02-17 14:25:20 +02:00
9f7c827572 Resolve absolute path of toolchain when generating compilation database 2020-02-17 13:52:25 +02:00
6328206e78 Fixed an issue when generating of compilation database "compile_commands.json" does not work with Python 2.7 // Resolve #3378 2020-02-17 13:05:01 +02:00
154be7fa81 Improve VSCode template structure (#3385)
* Switch to click argument parser

* Typo fix

* Tidy up VSCode template

Co-authored-by: Ivan Kravets <me@ikravets.com>
2020-02-17 12:19:00 +02:00
b8c9eee8af Force docs to HTTPS 2020-02-16 21:25:30 +02:00
43664672fc Bump version to 4.2.1a3 2020-02-14 22:59:16 +02:00
5cc9a328ab Fixed an issue when Library Dependency Finder (LDF) ignores custom "libLDFMode" and "libCompatMode" options in library.json 2020-02-14 22:57:51 +02:00
6556c37e58 Bump version to 4.2.1a2 2020-02-14 20:57:40 +02:00
292049199a Add new record to history log 2020-02-14 17:24:52 +02:00
ed4452b115 Get rid of direct imports 2020-02-14 17:09:48 +02:00
fbfbf340c1 Add "forceInclude" field to VSCode template
VScode doesn't recognize header files included via "-include" flag in "compilerArgs" field.
Instead, absolute paths to these files should be specified in a special section "forceInclude".
2020-02-14 16:43:20 +02:00
a57ea79bf8 Froze "marshmallow" dependency to 2.X for Python 2 // Resolve #3380 2020-02-14 13:49:41 +02:00
22e8e02f3d Automatically rebuild contrib-pysite package when import fails // Resolve #3313 2020-02-13 22:06:46 +02:00
a10625a052 Automatically rebuild contrib-pysite package when import fails // Issue #3313 2020-02-13 15:53:42 +02:00
42020e2498 Bump version to 4.2.1a1 2020-02-13 13:35:38 +02:00
36a2228220 Fixed "TypeError: unsupported operand type(s)" when system environment variable is used by project configuration parser // Resolve #3377 2020-02-13 13:34:34 +02:00
206054b35f Docs: Sync dev-platforms 2020-02-12 23:58:39 +02:00
b87048020d Add warning that overriding board data will not work for device monitor command // Issue #3349 2020-02-12 21:08:08 +02:00
f7d4bf5fa8 Merge branch 'release/v4.2.0' 2020-02-12 16:42:13 +02:00
f0bf531e1b Merge tag 'v4.2.0' into develop
Bump version to 4.2.0
2020-02-12 16:42:13 +02:00
176cf17f9f Bump version to 4.2.0 2020-02-12 16:42:06 +02:00
b41262a20e Fix broken "init" command 2020-02-12 16:34:38 +02:00
d0a6861369 Fix "TypeError: TypeError: write() argument 1 must be unicode" when generating project on Windows/Python 2 2020-02-12 15:14:58 +02:00
0bc872eafd Remap command before calling Click 2020-02-12 13:47:42 +02:00
edc2d10574 Update SPDX License List to 3.8 2020-02-11 18:59:35 +02:00
a033e2d1fe Docs: Update supported upload/debug protocols by Nuclei dev-platform 2020-02-11 18:37:48 +02:00
c0aefe4c62 Add support for Nuclei RISC-V Processor development platform // Resolve #3340 2020-02-10 18:52:31 +02:00
86069ab7c6 Typo fix 2020-02-08 21:37:18 +02:00
86f2dde6f3 Do not overwrite a custom items in VSCode's "extensions.json" // Resolve #3374 2020-02-08 21:36:32 +02:00
96f60aab66 Bump version to 4.2.0rc2 2020-02-08 20:35:43 +02:00
2763853d8d Fixed an issue when no error is raised if referred parameter (interpolation) is missing in a project configuration file // Resolve #3279 2020-02-08 19:10:48 +02:00
a78b461d45 Code formatting 2020-02-08 19:10:15 +02:00
2fa20b5c52 Typo fix 2020-02-07 11:28:32 +02:00
0b0b63aa7d Update templates for Atom, VSCode, CLion (#3371)
* Wrap flags with whitespace chars when exporting data for IDEs

* Update IDEs templates

Take into account compiler flags that can contain whitespace characters (e.g. -iprefix)

* Update template for VSCode

* Add history record
2020-02-07 11:26:45 +02:00
fe174e35c8 Suppress warnings from packages dir instead of core dir for CppCheck 2020-02-06 23:48:13 +02:00
88e40e28fc Bump version to 4.2.0rc1 2020-02-06 23:33:27 +02:00
73ce3c94e9 Initial support for `Project Manager // Resolve #3335 2020-02-06 23:32:43 +02:00
d2033aacea Remove the entire folder with temp files used by pvs-studio tool 2020-02-06 23:21:27 +02:00
dfb47a089b Add license file to sdist using MANIFEST.in (#3325) 2020-02-06 17:48:08 +02:00
81960ce051 Fix test 2020-02-06 17:41:35 +02:00
2ecceb8ed2 Generate absolute path for compilation DB item 2020-02-06 17:30:55 +02:00
00a9a2c04d Generate `compilation database "compile_commands.json" // Resolve #2990 2020-02-06 17:19:48 +02:00
7716fe1d1c Autodetect monitor port for boards with specified HWIDs // Resolves #3349 (#3369)
* Autodetect serial port for boards with specified hwids

* Add new record to history log
2020-02-05 22:33:05 +02:00
09b3df5520 Fixed a "UnicodeDecodeError" when listing built-in libraries on macOS with Python 2.7 // Resolve #3370 2020-02-05 22:25:06 +02:00
ee2e4896d2 Fixed an issue when Project Inspector crashes when flash use > 100% // Resolve #3368 2020-02-05 18:15:44 +02:00
390f1935d6 Fix parsing dependency in a legacy format 2020-02-05 15:43:39 +02:00
365c3eaf4b Fixed an issue when invalid CLI command does not return non-zero exit code 2020-02-05 15:31:32 +02:00
b83121a951 Fix package parser test 2020-02-05 14:34:40 +02:00
efe8e599fd Added support for Arduino's library.properties `depends` field // Resolve #2781 2020-02-05 00:04:16 +02:00
bc69259dd1 Update tool-unity package to v2.5.0 // Resolve #3362 2020-01-31 15:10:45 +02:00
607e8eb477 Improve detecting of active Internet connection // Resolve #3359 2020-01-29 18:54:30 +02:00
139171a79f Sync docs 2020-01-29 18:53:33 +02:00
848e525919 Bumo PIO Home to 3.1.0-rc.2 2020-01-26 00:31:55 +02:00
b805822eea Remove debug code 2020-01-25 20:51:20 +02:00
13e9306753 Bump version to 4.1.1b9 2020-01-25 20:50:26 +02:00
880d5bb8b0 Fix project saving 2020-01-25 20:47:10 +02:00
f9de23b16f Bump version to 4.1.1b8 2020-01-25 15:48:14 +02:00
e5aa71e4e1 Fix config saving when PY2 is used 2020-01-25 15:47:45 +02:00
ba441ca77c Remove double blank lines when saving project config // Resolve #3293 2020-01-24 22:15:33 +02:00
decf482367 Use io.DEFAULT_BUFFER_SIZE as default chunk size 2020-01-24 22:05:24 +02:00
253e4b13b5 Disable buffering file calculating checksum for downloaded file 2020-01-24 21:40:12 +02:00
04ca6621f1 Verify downloaded package checksum with native Python's hashlib and support all OS 2020-01-24 20:43:05 +02:00
20334772b5 Install a dev-platform with ALL declared packages using a new `--with-all-packages` option // Resolve #3345 2020-01-24 20:20:56 +02:00
a62bc3846e Update IPs when checking for Internet 2020-01-24 19:50:55 +02:00
3b092f28c3 Added support for "pythonPackages" in platform.json 2020-01-24 19:47:47 +02:00
2de46f545f Formatter 2020-01-24 19:47:20 +02:00
8fce660afa Add notice about VID:PID pairs // Resolve #3349 2020-01-24 14:47:23 +02:00
dbeffe426f Update docs for CI 2020-01-23 22:48:22 +02:00
d4c42bd546 Added support for `PVS-Studio static code analyzer 2020-01-23 20:51:34 +02:00
fad5d1d744 Sync docs 2020-01-23 14:06:36 +02:00
46a9c1b6b2 Add initial support for PVS-Studio check tool (#3357)
* Add initial support for PVS-Studio check tool

* Enable all available PVS-Studio analyzers by default

* Add tests for PVS-Studio check tool

* Improve handling check tool extra flags that contain colon symbol
2020-01-23 12:57:54 +02:00
5ac1e9454f pio-test: pass --verbose to the run command context (#3338)
* pio-test: pass --verbose to the run command context

* restore old output behavior
2020-01-23 12:56:08 +02:00
17f9d57207 Control debug flags and optimization level with a new "debug_build_flags" option 2020-01-22 22:20:24 +02:00
5bdec19f31 Add new debug_build_flags option (#3355)
This will allow users to override default debug flags for example in cases when
the final binary built in debug mode is too large to be loaded on target
2020-01-22 20:41:42 +02:00
90b80083e8 Sync docs 2020-01-22 12:58:16 +02:00
8d02e8b8f7 Docs: Update FAQ for installing Python 2020-01-16 11:55:58 +02:00
7e41841a74 Allow to call Downloader API in silent mode 2020-01-11 15:23:36 +02:00
0f296e7e37 Skip broken example definitions in package manifest 2020-01-10 21:28:19 +02:00
9c32ff278c Sync docs 2020-01-09 23:32:55 +02:00
60139035d8 Include hidden files by default in a package 2020-01-05 18:29:19 +02:00
5ab34436ec Cleanup package file name when packing 2020-01-04 23:48:06 +02:00
178080fd12 Improve boards search 2020-01-04 13:53:08 +02:00
915b9145f6 Filter boards by ID+Name 2020-01-04 11:46:25 +02:00
6020faf970 Docs: Add "v" suffix to SparkFun RISC-V board ids 2020-01-04 11:38:13 +02:00
ec82fc82a2 Support packages with nested folders and with a custom "root" 2020-01-03 22:55:56 +02:00
8d7b775875 Implement package packer 2020-01-03 15:52:54 +02:00
682114d6f1 Bump version to 4.1.1b7 2019-12-31 20:11:14 +02:00
0ac5cd6789 Skip empty "export" values when parsing library.json manifest 2019-12-31 10:21:20 +02:00
209040fdc1 Initial support for Zephyr framework // Issue #1613 2019-12-30 14:11:27 +02:00
643f290057 Fix issue with library.properties manifest parser when author email is not specified 2019-12-29 17:43:50 +02:00
ea0b462d0b PyLint fixes 2019-12-29 14:18:43 +02:00
442a7e3576 Made package ManifestSchema compatible with marshmallow >= 3 // Resolve #3296 2019-12-29 13:13:04 +02:00
f7385e8e88 Bump version to 4.1.1b6 2019-12-25 00:44:01 +02:00
20a10c7fc5 Fixed an issue "Import of non-existent variable 'projenv''" // Resolve #3315 2019-12-24 23:43:21 +02:00
2f05040081 Fixed an issue with LDF when header files not found if "libdeps_dir" is within a subdirectory of "lib_extra_dirs" // Resolve #3311 2019-12-24 14:36:44 +02:00
7e0fb43dbe Normalise repository url when parsing package manifest 2019-12-22 23:45:12 +02:00
26e7069099 Fixed default PIO Unified Debugger configuration for J-Link probe 2019-12-22 12:33:08 +02:00
7d90c468ae Updated SCons tool to 3.1.2 2019-12-22 01:27:51 +02:00
f9494c940e Add support for "downloadUrl" in package manifest 2019-12-20 20:20:09 +02:00
135ef8701c Better representation of dependent packages 2019-12-20 01:19:23 +02:00
1bd6e898ad Fix tests 2019-12-18 14:03:10 +02:00
b15ddc00a5 Pass extra files with compiler options to VSCode IntelliSense tool 2019-12-17 22:40:28 +02:00
b4088a6d00 Drop support for Samsung Artik dev/platform // Resolve #3309 2019-12-17 22:39:15 +02:00
c57f68aee3 Change order between board/framework for configuration file 2019-12-17 15:22:02 +02:00
31eed6c5e5 Improve detecting of a run PIO Home Server 2019-12-09 14:47:00 -08:00
09852dcada Sync docs 2019-12-09 14:46:28 -08:00
5768fcd429 Inform that PlatformIO Home server is already started in another process 2019-12-02 19:34:19 +02:00
d901cc875a Minor improvements for docs 2019-12-02 19:28:21 +02:00
4f1ccfe58f Bump version to 4.1.1b5 2019-11-28 18:58:09 +02:00
f852f9fa89 Small refacoring 2019-11-28 18:23:00 +02:00
5c388d4271 Fix issue with invalid checking used port for PIO Home server 2019-11-28 18:14:53 +02:00
f9cae60225 Fix tests 2019-11-28 18:14:10 +02:00
49ceadc6ad Move exceptions to their components 2019-11-28 16:15:54 +02:00
47469e8759 Fix issue when None value is passed to config.set 2019-11-27 18:08:32 +02:00
742f60b48d Bump version to 4.1.1b4 2019-11-26 18:00:33 +02:00
0615ff6dd8 Docs: Change "Global/Local scope" configuration to "Common/Environment" 2019-11-26 17:40:09 +02:00
2fbe33bca0 Move "Board" Options to "Platform 2019-11-26 14:44:54 +02:00
fdd73552ea Docs for Zephyr // Issue #1613 2019-11-26 14:44:29 +02:00
17b4f0b4dd Docs: Sync Atmel AVR dev/platform 2019-11-25 13:56:33 +02:00
f87322591d Bump version to 4.1.1b3 2019-11-22 20:49:44 +02:00
47099190f4 Bump PIO Home version to 3.1.0-beta.2 2019-11-22 20:49:09 +02:00
9cf777b4e5 Fixed an issue with "start-group/end-group" linker flags on Native development platform // Resolve #3282 2019-11-21 14:19:32 +02:00
8675d3fa46 Use proper CMake variables for setting compilation flags 2019-11-21 00:39:05 +02:00
2b9d8dba5f Bump version to 4.1.1b2 2019-11-20 23:32:19 +02:00
b37814976c Fix project generator for CLion 2019-11-20 23:31:35 +02:00
895aa0cb34 Update PlatformIO slogan 2019-11-19 20:01:50 +02:00
18a9866a02 An example with custom debug flags in advanced scripting 2019-11-19 19:56:10 +02:00
88ead0aed1 Catch all debug errors when killing debug server 2019-11-19 18:55:21 +02:00
f19c7dc575 Support for Atmel megaAVR 2019-11-18 17:59:19 +02:00
7eab5d567e Fix CLion generator when one env is used 2019-11-17 00:35:56 +02:00
5b1c6daa2a Fix a space in config header 2019-11-16 23:09:18 +02:00
464e1a509f Add PIO Home "os.get_file_mtime" RPC method 2019-11-16 22:57:56 +02:00
c1394b290d Fix issue with unknown dev/platform when symlink is used 2019-11-16 22:43:25 +02:00
0029c7fe09 Advanced Serial Monitor with UI 2019-11-16 17:45:57 +02:00
e9f9871c1e Show to user the last exception when can't install a package 2019-11-16 17:25:27 +02:00
d1b46c838e Revert back "Flash" instead of "ROM" 2019-11-16 14:09:16 +02:00
a7b9187234 Bump version to 4.1.1b1 2019-11-15 20:05:52 +02:00
c7202154de Project Manager and Project Configuration UI for "platformio.ini" 2019-11-15 20:05:09 +02:00
6809da0353 Replace os.path.abspath by realpath 2019-11-15 16:02:15 +02:00
fbdcbf17c7 Rename Data/Flash to RAM/ROM 2019-11-15 15:52:39 +02:00
44a9de6dcb Pass -m and -i flags to VSCode Intellisense analyzer 2019-11-15 15:11:13 +02:00
a077081e46 Init generic C/C++ SCons tools by default 2019-11-15 15:10:43 +02:00
728fd7f5b9 Catch exception when can not get a default locale 2019-11-13 16:48:04 +02:00
053160a6eb Sync docs 2019-11-13 16:47:39 +02:00
9bbaba3d59 Bump version to 4.1.1a2 2019-11-13 15:35:32 +02:00
b1577d101c Update PIO Home to 3.0.1 2019-11-13 15:32:57 +02:00
53e6cf3e4a Drop support for "project_dirs" argument to Project RPC 2019-11-13 15:32:14 +02:00
a9f9f4ef04 Fixed an issue when `env.BoardConfig()` does not work for custom boards in extra scripts of libraries // Resolve #3264 2019-11-12 23:52:43 +02:00
15f142fc70 Ensure content cache key does not contain path separators 2019-11-12 23:48:39 +02:00
6e9429dbbf Split BuildProgram into ProcessProgramDeps and ProcessProjectDeps 2019-11-12 18:52:25 +02:00
be628051a7 Fix typo 2019-11-12 18:35:07 +02:00
f0eb177a8e Check if directory exists before fetching project info 2019-11-12 18:32:10 +02:00
7c481291dc Warn about about broken library manifest when scanning dependencies // Resolve #3268 2019-11-12 18:14:06 +02:00
f1d20f591a Sync docs 2019-11-12 13:41:54 +02:00
c6a8e03367 Fixed an issue when `env.BoardConfig()` does not work for custom boards in extra scripts of libraries // Resolve #3264 2019-11-12 13:41:39 +02:00
cbb7869da1 Fixed an issue with the broken latest news for PIO Home 2019-11-12 13:09:35 +02:00
1f796ca0e5 Bump version to 4.1.1a1 2019-11-11 23:22:17 +02:00
703b29a05e Fixed missed descriptions for project options 2019-11-11 23:19:47 +02:00
56ceee220b Fix invalid build status for unit test when remote is used 2019-11-11 22:48:29 +02:00
0328037b49 Handle project configuration (monitor, test, and upload options) for PIO Remote commands // Resolve #2591 2019-11-11 22:38:16 +02:00
3c796ca7c8 Cosmetic fixes 2019-11-08 17:40:11 +02:00
e6e14be528 Fix framework name shakti-sdk 2019-11-07 16:58:57 +02:00
f42d1a89f2 Merge tag 'v4.1.0' into develop
Bump version to 4.1.0
2019-11-07 16:54:21 +02:00
5a89388fb0 Merge branch 'release/v4.1.0' 2019-11-07 16:54:20 +02:00
d043412e0f Bump version to 4.1.0 2019-11-07 16:54:12 +02:00
71168b1a5f Replace IoT with Embedded 2019-11-07 16:49:34 +02:00
95c1b0214c Rename "check_pattern" to "check_patterns" 2019-11-07 15:24:47 +02:00
2408c0a4c7 Fix incorrect info about build_type 2019-11-06 23:53:38 +02:00
4b3f593df9 Bump version to 4.1.0rc9 2019-11-06 23:24:49 +02:00
67aea4db3f Fix issue with GDB/MI Stream Records for PIO Debugger 2019-11-06 22:30:58 +02:00
6b44a8ae75 Use BuildAsyncPipe only if TTY stream 2019-11-06 22:25:14 +02:00
70f4fa2665 Remove platformio.description if none value is passed 2019-11-06 20:06:30 +02:00
17ff3250c9 Export uppercased driver name in sizedata report on Windows 2019-11-06 12:34:43 +02:00
2cce47a13d Fix "pio_reset_run_target" for JLink debug probe 2019-11-06 12:20:42 +02:00
c1f62f8ead Bump version to 4.1.0rc8 2019-11-06 01:01:07 +02:00
e0c174b9b6 Improve PIO Home Misc RPC 2019-11-06 00:48:28 +02:00
e5ec4de3a4 Extend PIO Home RPC with "project.config_update_description(path, text)" method 2019-11-06 00:05:17 +02:00
bcf09964ab Better formatting for multi-line values in config option 2019-11-06 00:03:08 +02:00
f3992f8e53 Create dummy target for CLION 2019-11-05 15:59:06 +02:00
66cc557d2f Export SVD Path to CLion 2019-11-05 15:16:50 +02:00
9786b3e1b9 Fix CLion integration when project name contains a space 2019-11-05 15:16:35 +02:00
30bc691c95 Fix test with a missed library 2019-11-05 12:08:29 +02:00
83110326f4 Rename "check_pattern" option 2019-11-05 12:02:12 +02:00
182835fabf Rename check_patterns option to check_pattern 2019-11-05 11:36:20 +02:00
7345d3ea19 Improve dump of config data 2019-11-05 00:17:39 +02:00
3f4aa320c2 Sync docs 2019-11-04 21:52:42 +02:00
dfd853fa87 Update tests for check command with a new flag "pattern" that supersedes "filter" 2019-11-04 21:34:39 +02:00
3289e84b21 Refactor PIO Check from "check_filters" to "check_patterns" 2019-11-04 18:22:28 +02:00
39639d45fe Bump version to 4.1.0rc7 2019-11-04 15:36:45 +02:00
b45abf67a5 Fix broken debug configuration 2019-11-04 15:36:23 +02:00
e57871cab7 Print a building mode 2019-11-03 22:22:40 +02:00
484ea15959 Bump version to 4.1.0rc6 2019-11-02 23:14:16 +02:00
40109263f0 Fix initial debug configuration for J-Link 2019-11-02 23:09:56 +02:00
b45261c3dc Change initial debug configuration to: reset/halt, load, init break points 2019-11-02 22:56:11 +02:00
73bcf18498 Fix broken debugger 2019-11-02 22:54:57 +02:00
0dcc6f350d Bump version to 4.1.0rc5 2019-11-02 19:49:34 +02:00
0488cc4086 Typo fix 2019-11-02 19:48:41 +02:00
7784743cb1 Switch to default values from project configuration options 2019-11-02 19:44:28 +02:00
0a4bc1d4e3 Add "description" for project config options, configure "default" values 2019-11-02 19:41:39 +02:00
3630084a64 Docs: Sync Kendryte K210 dev/platform 2019-11-01 18:53:00 +02:00
53c561e895 Bump version to 4.1.0rc4 2019-11-01 18:33:21 +02:00
88db253515 Ignore duplicate library storages 2019-11-01 18:28:20 +02:00
da928efb43 Added "--shutdown-timeout" option to PIO Home Server 2019-11-01 14:40:03 +02:00
cd3d638337 Disable parsing of extra configs for PIO Home Project RPC load/dump methods 2019-11-01 12:05:13 +02:00
3de2d84e2b Fixed an issue with a GCC Linter for PlatformIO IDE for Atom // Resolve #3218 2019-10-31 22:42:22 +02:00
1d5d09feab Fixed an issue when Project Config Parser does not remove in-line comments when Python 3 is used // Remove #3213 2019-10-31 22:04:57 +02:00
2c2b419685 Docs: Sync nRF52 dev/platform 2019-10-31 18:52:26 +02:00
a7f8838d9a Format code 2019-10-31 18:52:13 +02:00
a18f8b2a4c Use default values from project options 2019-10-31 15:28:02 +02:00
9b65a091da Export config dump/load and schema to PIO Home Project.RPC 2019-10-31 15:27:34 +02:00
8ccf9d2e53 Implement project config "update" with "clear" option 2019-10-31 15:26:34 +02:00
cd6137bdb0 Bump version to 4.1.0rc3 2019-10-31 00:43:44 +02:00
6d69c25a2f Use locale encoding to decode subprocess output // Resolve #2890 2019-10-30 20:43:37 +02:00
7b6bab7f4e Update memory usage banner 2019-10-30 20:40:26 +02:00
257a8c63d2 Sync docs 2019-10-30 20:28:38 +02:00
3146ab5d12 Allow export project config data as Tuple 2019-10-30 19:09:32 +02:00
2d4722477e Automatically shutdown PIO Home server when no clients for 1 hour 2019-10-30 18:58:49 +02:00
d815daed29 Allow specifying defect level that will cause failure 2019-10-30 13:38:46 +02:00
c4e7674585 Don't pass header files to Cppcheck 2019-10-30 12:23:33 +02:00
94f565db84 Show warning about restart IDE to affect PIO Home changes 2019-10-29 18:11:09 +02:00
6e03aa3a3d Bump version to 4.1.0rc2 2019-10-29 18:03:07 +02:00
737c29b510 Update PIO Home to 3.0.0-beta.2 2019-10-29 18:02:32 +02:00
0222c56c4d Use file system encoding when decoding subprocess output // Resolve #2890 2019-10-29 17:43:48 +02:00
8d0584aa59 Add new IDE RPC "open_text_document" method for PIO Home 2019-10-29 17:37:09 +02:00
7dbeab11a5 Add new OS.RPC "open_file" method for PIO Home 2019-10-29 17:36:36 +02:00
7cad06ea18 Minor test fixes 2019-10-29 17:12:18 +02:00
3236fb6b3d Return file+line for sizedata instead of "location" 2019-10-29 17:01:20 +02:00
0194e09410 Use simple abspath to get absolute path to file with defect 2019-10-28 18:37:14 +02:00
187e30d055 Export full path to file with defect 2019-10-28 18:30:22 +02:00
39a7062503 Fix types of defect fields column and line 2019-10-28 18:12:39 +02:00
4ff7c868ef Sync docs 2019-10-28 16:34:26 +02:00
5573c3871c Allow cppcheck suppress individual defects by default 2019-10-28 13:38:46 +02:00
d620579247 Fix tests for check command according to updated exit codes 2019-10-25 21:04:30 +03:00
48651286b6 Automatically detect C++ standard version when invoking cppcheck 2019-10-25 20:59:36 +03:00
0e7a2b3141 Automatically detect source files language when invoking cppcheck 2019-10-25 20:08:04 +03:00
f3b8ae4224 Bump version to 4.1.0rc1 2019-10-25 20:02:01 +03:00
a2451a716d PIO Home 3.0 with Project Inspect 2019-10-25 20:01:31 +03:00
2e5dabb913 Fix issue with custom board_ options 2019-10-25 19:33:22 +03:00
4e43e7d3c3 Fix code formatting 2019-10-25 17:43:52 +03:00
49acf4bdb9 Minimum supported version of PIO Plus Core is 2.5.8 2019-10-25 17:27:51 +03:00
f3d8c30f95 Skip ignored environments when exporting check report in JSON format 2019-10-25 15:50:19 +03:00
4486a85d4c Introduce new flag --fail-on-defect to pio check 2019-10-25 15:40:50 +03:00
8a6892bf3c Fixed an issue with invalid encoding when generating project for Visual Studio // Issue #3183 2019-10-25 14:33:22 +03:00
087a8f6dd0 Fix Visual Studio template files encoding // Resolve #3183 2019-10-25 14:27:47 +03:00
5e681ec03c ProjectRPC.config_call accepts first argument as dict/kwargs for Config.init 2019-10-25 14:01:46 +03:00
784a5cd349 Add support for "Build Middlewares" 2019-10-25 00:33:04 +03:00
5345dd2674 Give a proper name to method that converts defect item to dict 2019-10-24 21:35:04 +03:00
8127fd9960 Export correct stats for each check tool 2019-10-24 20:44:34 +03:00
3177aaf591 Fixed an issue when booleans in "platformio.ini" are not parsed properly // Resolve #3022 2019-10-24 19:43:13 +03:00
70b484a2c2 Escape "\" char in GDB console output 2019-10-24 17:34:49 +03:00
ed6c9a08ce Add custom "PLATFORMIO_BUILD_DEBUG" target for CLion 2019-10-24 17:21:02 +03:00
601989c5ff Escape "\" char in GDB console output 2019-10-24 16:56:28 +03:00
234585dc97 Fixed an issue with project generator when `src_build_flags` were not respected // Resolve #3137 2019-10-24 16:39:11 +03:00
2388b2a62b Fixed security issue when extracting items from TAR archive // Issue #2995 2019-10-24 16:24:53 +03:00
69d9438c71 Temporary disable security checking for Tar items 2019-10-24 15:39:41 +03:00
0b500dba54 Handle legacy "system": "all" for package manifest 2019-10-24 15:10:11 +03:00
798b12ce7b Fixed security issue when extracting items from TAR archive // Resolve #2995 2019-10-24 14:55:45 +03:00
334d50c367 Use package parser for package manager and LDF 2019-10-24 13:42:46 +03:00
dd1da95a40 Fix issue when wrong library was picked up by LDF when framework is not declared 2019-10-24 00:28:03 +03:00
6684ac5a57 LDF: Check project include dirs before looking for dependencies 2019-10-23 22:55:02 +03:00
b533d7a1dd LDF: Check global CPPPATH when looking for dependencies 2019-10-23 22:31:26 +03:00
95d1f43799 Sync docs with ST STM32 dev/platform 2019-10-23 18:49:08 +03:00
9c7cc87c5f Move command related modules to "commands" package 2019-10-23 16:05:27 +03:00
374379ba03 Skip .debug sections when generating memory use report 2019-10-22 21:52:55 +03:00
56ac577b0a Fix case with empty arguments when generating sizedata report 2019-10-22 12:10:48 +03:00
941c0f4297 Improve the speed of memory use report generation 2019-10-21 23:26:28 +03:00
f34745bef9 Parse device frequency in int format for size data 2019-10-21 15:57:34 +03:00
9fef7f0ba9 Docs: Sync TI MSP430 dev/platfom 2019-10-21 15:53:25 +03:00
971cd2ca0f Export device info in pair with sizedata 2019-10-21 00:12:04 +03:00
6bf8bec22d Bump version to 4.1.0b5 2019-10-19 12:43:43 +03:00
d771816b02 Automatically change dir to project for RPC "config_call"; add "envs" and "descrption" for project entities 2019-10-19 12:42:43 +03:00
f78a1a7b15 Show encoding error when can't read a file // Issue #2796 2019-10-18 22:00:28 +03:00
77f8414c63 Better explanation about encoding error // Resolve #2796 2019-10-18 15:56:50 +03:00
4d84d03a63 Black 2019-10-18 15:56:41 +03:00
065607b68c Disable PyLint's "import-outside-toplevel" 2019-10-18 15:41:52 +03:00
f5807364e8 Force to "backslashreplace" when UnicodeEncodeError arises when writing file // Issue #2796 2019-10-18 15:20:52 +03:00
92d86192aa Substitute LDSCRIPT with real value 2019-10-18 15:05:11 +03:00
d44c60614d Use direct LDSCRIPT_PATH only if script resolves 2019-10-17 23:40:30 +03:00
19a8326f0f Fix test for package manifest 2019-10-17 21:19:04 +03:00
be9aaf8902 Be compatible with Python 3.8, on Windows skip HOME and check for USERPROFILE 2019-10-17 20:57:40 +03:00
5cfa2b7fdd Fix typo with UnicodeEncodeError // Issue #2796 2019-10-17 19:28:57 +03:00
6218b773fd Better support for file contents writing // Issue #2796 2019-10-17 18:48:59 +03:00
7bcfea13fb Fixed an issue with linking process when `$LDSCRIPT` contains a space in path 2019-10-17 16:52:18 +03:00
89843c0d65 Fix issue with parsing library.properties when export field is used 2019-10-17 15:48:18 +03:00
31d4a5c72e Add collective stats info about project components to check report 2019-10-17 13:42:00 +03:00
83f25cbc16 Fix tests 2019-10-17 12:38:35 +03:00
27fc19d6b3 Switch to Marshmallow ODM framework 2019-10-17 00:17:16 +03:00
9cfccc5cd4 Minor fixes to manifest parser 2019-10-16 13:58:50 +03:00
9da19fbf54 Use isolated SCons sign DB per Python interpreter 2019-10-16 12:09:53 +03:00
a481a5deda Fix issue with "remote test" // Resolve #3127 2019-10-15 23:30:02 +03:00
e8692334f6 Replace deprecated in python3: iteritems with items and basestr with str (#3119) 2019-10-15 22:00:48 +03:00
239befa4ee New Shakti dev/platform 2019-10-15 13:05:56 +03:00
2e9b0066de Capture manifest parser exceptions 2019-10-14 23:36:15 +03:00
55d905a0d0 Add a new RPC method "project.config_call" for Home API 2019-10-12 20:00:12 +03:00
181adb277f Sync docs 2019-10-12 19:58:34 +03:00
82ec0164b0 Update docs on how to install Python 3.7 on Windows 2019-10-10 23:35:59 +03:00
c8354b100e Bump version to 4.1.0b4 2019-10-10 14:51:14 +03:00
4366719ed2 Restore missed project helpers needed by "platformio-node-helpers" 2019-10-10 14:50:34 +03:00
971eb8e35c Revert back unix style directory separator in sizedata report 2019-10-09 17:37:24 +03:00
a785c238b1 Use OS-native directory separator in sizedata report 2019-10-09 00:39:57 +03:00
eda02750ae Export files as list instead of dict for sizedata target 2019-10-08 13:45:36 +03:00
e5d50eb45c Docs: RV-LINK debug tool, sync GDV32 dev/platform 2019-10-08 11:49:04 +03:00
b66bf5f4c0 Ignore symbolic links for package examples 2019-10-07 20:35:01 +03:00
d1c8cc38f2 Cast semver to string when validating version 2019-10-05 23:40:27 +03:00
10bada0bcc ManifestPaser: handle examples from "Examples" folder 2019-10-05 20:21:39 +03:00
5d7e7b1796 DataModel: capture exceptions from failed models in non-strict mode 2019-10-04 23:52:06 +03:00
0f7fe260d1 Docs: Sync ESP32 dev platform 2019-10-04 21:15:37 +03:00
46be56af43 Bump version to 4.1.0b3 2019-10-04 20:51:05 +03:00
dce2655004 Fix broken serial monitor called via run target while uploading // Resolve #3081 2019-10-04 20:50:39 +03:00
36acdd7797 DataModel: allow valid values in non-strict mode for TypeOfList and TypeOfDict 2019-10-04 18:30:48 +03:00
47e297fecb Use less verbose debug output 2019-10-04 13:27:02 +03:00
9ce19c7e83 Skip debug sections when calculating sizedata 2019-10-04 10:52:55 +03:00
9954900a0e Return back LINKFLAGS for debug mode 2019-10-03 18:16:55 +03:00
a7855ae664 ManifestParser: init from dir using name of file in remote url if provided 2019-10-03 16:14:51 +03:00
76865a1730 ManifetPatrser fixes (#3080)
* Skip broken examples declaration

* Allow dots in keywords

* Allow "+" in keywords
2019-10-03 14:55:04 +03:00
8febdc19ea ManifestParser: normalize example names 2019-10-03 12:47:41 +03:00
85a814c21a Allow dot in manifest example name 2019-10-03 10:33:11 +03:00
ab5650f84b Use max line length hooks for all systems 2019-10-02 23:46:42 +03:00
77c591ce81 Fix RTD conf 2019-10-02 21:35:13 +03:00
dc067642b2 Fix RTD conf 2019-10-02 21:33:40 +03:00
d0ee0c2919 Sync docs 2019-10-02 21:32:31 +03:00
6d50aa2e25 Remove RTD confs 2019-10-02 20:54:36 +03:00
b68b9794ec Fix docs with "htmlzip" format 2019-10-02 20:51:39 +03:00
e6ea4cb613 PackageManifest: Ignore hidden files for examples 2019-10-02 20:42:01 +03:00
47ba127733 Add ReadTheDocs config 2019-10-02 18:15:17 +03:00
bbd694c5ea ManifestParse: automatically generate examples from package dir 2019-10-02 17:54:59 +03:00
7ba2a7cd3d Bump version to 4.1.0b2 2019-10-02 13:33:12 +03:00
a1ed99962c Better handling of non-dict values passed to DataModel 2019-10-02 12:34:50 +03:00
c2970631a5 Add "--force" for git update // Issue #3060 2019-10-02 12:34:20 +03:00
d38c843574 Fixed an issue when installing a package using custom Git tag and submodules were not updated correctly // Resolve #3060 2019-10-02 11:52:14 +03:00
a2213a1aa4 Change "examples" field in package manifest to ListOf(ExampleModel) 2019-10-02 11:04:29 +03:00
dee2d2c538 Add manifest parsers for platform.json and package.json 2019-10-01 22:03:23 +03:00
fec19849b5 Docs: Add info about ignoring individual parts of mbed framework 2019-10-01 22:02:55 +03:00
5b77adccb1 DataModels: fix issue when traversing using model fields 2019-10-01 18:10:48 +03:00
a82c4666d4 DataModel: add support for DictOfType, extend base manifest with ExampelsModel 2019-10-01 17:37:11 +03:00
df6a8da290 DataModel: add support for silent validation and "get_exceptions" API 2019-10-01 16:13:25 +03:00
39c8996093 Fix docs typos 2019-10-01 16:11:55 +03:00
af1a0f3587 Allow to build a manifest parser from directory 2019-10-01 00:11:31 +03:00
703912fdc9 Strict manifest validation when submitting to Registry, more tests for manifest model 2019-09-30 23:45:03 +03:00
744881da59 Refactor DataModel with a strict type declaration 2019-09-30 19:44:03 +03:00
5f55c18373 Introduce DataModel, package manifest parser and base manifest model 2019-09-30 17:59:06 +03:00
2137eb1794 Do not append debug flags to linker stage 2019-09-30 13:27:34 +03:00
3dcf1784fb Update PIO Remote to 2.5.5 2019-09-27 19:36:49 +03:00
9a3dcd3daa PY2 fix with absolute import 2019-09-27 18:53:58 +03:00
1b74f380a6 Refactor appending of debugging flags 2019-09-27 17:22:21 +03:00
cd2a4ea535 Update copyrights 2019-09-27 17:21:35 +03:00
536a9566da Feature/pio size data (#3056)
* Add initial support for detailed memory usage report

* Tidy up sizedata target

* Add toolchain to environment paths

* Make sizedata target a bit more readable
2019-09-27 14:18:35 +03:00
d2abac9b18 Fixed an issue when configuration file options partly ignored when `--project-conf` // Resolve #3034 (#3055)
* Fixed an issue when configuration file options partly ignored when using custom ``--project-conf`` // Resolve #3034

* Py2 compatible makedirs

* Fix circle dependency

* Fix broken import in test examples

* Fix history

* Remove YAPF markers

* PyLint fix

* Fix invalid project conf path

* Move PIO Core to the root on Windows, issue with long CPPPATHs

* Respect global PLATFORMIO_BUILD_CACHE_DIR env var

* Fix Appveyor paths

* Minor changes
2019-09-27 14:13:53 +03:00
94f8afec38 udev: Add GD32V DFU Bootloader (#3032) 2019-09-24 11:02:26 +03:00
3d5c1411c0 Fix PyLint for PY2 2019-09-24 00:28:23 +03:00
9a7e5d86fc Install Black only for Python 3.6+ 2019-09-24 00:21:16 +03:00
ca29b4e370 Fixed "DeprecationWarning: the imp module is deprecated in favour of importlib" PY2/PY3 2019-09-24 00:17:08 +03:00
392fe1cbd0 Move Run to the root 2019-09-24 00:12:21 +03:00
aa955819b0 Move PIO Check to the root 2019-09-23 23:44:42 +03:00
b1f190a7f8 Move PIO Unit Testing to the root 2019-09-23 23:44:28 +03:00
5453df94e4 Move PIO Unified Debugger to the root 2019-09-23 23:27:55 +03:00
7b314b58a4 Move PIO Home to the root of source code 2019-09-23 23:23:11 +03:00
7c41c7c2f3 Introduce Black to automate code formatting 2019-09-23 23:13:48 +03:00
5e144a2c98 Add PIO Check to changelog 2019-09-23 21:57:31 +03:00
61b6eea52c New "--no-ansi" flag for PIO Core 2019-09-23 20:51:02 +03:00
cd8dc24454 Docs: Sync Espressif32 dev/platform 2019-09-18 18:47:55 +03:00
6531dcbc78 Allow to skip checking of unpacked data 2019-09-16 21:38:47 +03:00
123963f760 UTF8 decoding should ignore invalid characters (#3026)
Some boards, like ESP32 based boards, give some unintelligible data when connecting to them via Serial. This is sometimes data that is send with the wrong baud rate (hard baked into the boot loader), or something else. It's hard to prevent this from happening. When a build is uploaded to the ESP board for unit testing, the decoding of the incoming stream should not fail the test due to some garbled content. Since the read data is validated on line 95, any garbage is automatically ignored and only outputted to the console.
2019-09-16 21:02:07 +03:00
08a94b6f7c New article "Arduino In-circuit Debugging with PlatformIO" 2019-09-16 18:58:29 +03:00
43ae62afd8 Sync Aceinna and GD32V dev/platforms. 2019-09-13 16:01:42 +03:00
e08dc5f0d7 Docs: Sync Microchip PIC32 dev/platform 2019-09-10 17:48:47 +03:00
1e26feb566 Bump version to 4.1.0b1 2019-09-09 23:34:44 +03:00
96567dea4d PyLint fix 2019-09-08 23:44:18 +03:00
c720933d34 Refactor PIO Check 2019-09-08 23:33:25 +03:00
f61d03ec8f PIO Check (#2982) 2019-09-08 18:04:41 +03:00
b7bc4401eb Use isolated SCons DB per build environment 2019-09-08 14:01:41 +03:00
7a07a2e63e Generate `.ccls` LSP file for Emacs 2019-09-03 15:31:33 +03:00
2c242944c7 Fixed default PIO Unified Debugger configuration for J-Link probe 2019-09-02 16:48:33 +03:00
6265233903 Optimize udev rules 2019-09-02 16:01:15 +03:00
be3e26c202 Cleanup UDEV rules 2019-09-02 14:24:35 +03:00
9f76293684 Cleanup Segger UDEV rules 2019-09-02 14:13:58 +03:00
1be2e510da Sync nRF52 dev/platform 2019-09-02 12:50:55 +03:00
af049eecc9 Bump version to 4.1.0a1 2019-08-31 23:40:28 +03:00
fe237f15aa Implement "extends" for project configuration // Resolve #2953 2019-08-31 23:39:41 +03:00
bdce78ba6f Stop ModemManager corrupting Arduino uploads (#2966)
On boards like the Arduino Micro, when in bootloader mode it appears ModemManager interferes with the programming process and result in a catastrophic failure with no end of different errors including, but not limited to:
```
error: programmer did not respond to command: write block
error: butterfly programmer uses avr_write_page() but does not provide a cmd() method.
error: programmer did not respond to command: set addr
```
After this, the device could appear to be completely non-functional, refusing to enumerate or appear for programming, but thankfully a double-reset will usually recover it, but the underlying ModemManager issue will still prevent successful programming. Hence the additional rules. 

This affects not only PlatformIO, but also the Arduino IDE (on linux).
2019-08-31 11:47:32 +03:00
f26e3c42dd Sync docs 2019-08-31 11:40:16 +03:00
92cd03cf2a Sync docs 2019-08-30 18:12:26 +03:00
e7da3d7f5f Bump version to 4.0.4a1 2019-08-30 16:41:17 +03:00
f966eeb604 Fixed an issue with project generator for CLion IDE when 2 environments were used // Resolve #2824 2019-08-30 16:40:44 +03:00
34176f974b Fix generator for CLion when project is empty // Issue #2824 2019-08-30 15:45:21 +03:00
60f0f775ef Merge branch 'release/v4.0.3' 2019-08-30 15:41:59 +03:00
5f044a7948 Merge tag 'v4.0.3' into develop
Bump version to 4.0.3
2019-08-30 15:41:59 +03:00
9f1dd3dd5d Bump version to 4.0.3 2019-08-30 15:41:49 +03:00
db6f983364 Fix issue for CLion project generator when environment contains space // Issue #2824 2019-08-30 10:55:13 +03:00
386883fbe5 Bump version to 4.0.3rc1 2019-08-29 17:18:36 +03:00
e08527a0af Cleanup CLion project generator 2019-08-29 16:58:18 +03:00
4a6d5e8395 Added support for multi-environment PlatformIO project for CLion IDE // Resolve #2824 Resolve #2944 2019-08-29 16:26:51 +03:00
83bf34fb77 Extend "load_project_ide_data" API to return IDE data for more than one environment 2019-08-29 16:01:36 +03:00
1c8666e946 Clion integration, resolves #2824 (#2944)
* Better environement integration :
 - Environement can be selected in the build target menu of CLion
 - Platformio target runs on the selected environment
 - Changing environment changes defined preprocessor variables and includes accordingly
 - Added 'All' build profile that runs targets on all environment if there are multiple of them (Original behaviour)

* Calling get_project_dir() only once.

* Fixed include path not being converted to unix style.
Removed duplicate and not normalized  definition
2019-08-29 15:01:50 +03:00
0440b7a2f7 Disable TTY coloring with "PLATFORMIO_DISABLE_COLOR" system environment // Resolve #2956 2019-08-29 14:34:51 +03:00
223a85baca CCLS LSP for VIM // Resolve #2952 2019-08-29 14:20:24 +03:00
ed39a755bc Update to semantic_version 2.8.0 2019-08-29 13:49:52 +03:00
519156512c Strict versions for "semantic_version" and "tabulate" 2019-08-28 23:01:39 +03:00
9fa424ea9b Remove ProjectConfig from cache on saving 2019-08-28 22:43:34 +03:00
883a97a38c Fixed an issue when --upload-port CLI flag does not override declared upload_port option in "platformio.ini" 2019-08-28 19:56:09 +03:00
c671a8e235 Bump version to 4.0.3b1 2019-08-27 20:35:25 +03:00
55a44aecc3 Remove debug code 2019-08-27 20:26:44 +03:00
81fc1c9010 Fixed an issue with PIO Unified Debugger on Windows when debug server is piped 2019-08-27 20:23:03 +03:00
8037bef847 Move "to_unix_path" helper to FS module 2019-08-27 20:21:53 +03:00
98ec287797 Docs: Remove non-existing project examples 2019-08-27 16:28:38 +03:00
bc2765eb1f Fix issue with SemVer when library version has incompatible format // Resolve #2950 2019-08-27 14:05:01 +03:00
94644c2863 Update SCons tool to 3.1.1 2019-08-27 00:15:58 +03:00
fa090131ae Do not parse visited source files for LDF 2019-08-27 00:15:12 +03:00
48b46d74cf PIO Home: Improve description for project examples // Resolve #2713 2019-08-25 20:40:28 +03:00
66b22a218a Update PIO Home to 2.3.0 // Resolve #2614 Resolve #2819 2019-08-25 19:27:44 +03:00
3d18d4f9ce Sync docs 2019-08-25 18:37:54 +03:00
cba2f4d7b6 Remove ProjectConfig cache when "platformio.ini" was modified outside 2019-08-25 18:37:14 +03:00
54f14c64b5 Merge branch 'release/v4.0.2' 2019-08-23 16:24:28 +03:00
785be3cb26 Merge tag 'v4.0.2' into develop
Bump version to 4.0.2
2019-08-23 16:24:28 +03:00
20a9522542 Bump version to 4.0.2 2019-08-23 16:17:11 +03:00
f8d957a705 Sync docs 2019-08-23 16:10:47 +03:00
2eecbf966c Fixed an issue with a broken LDF when checking for framework compatibility // Resolve #2940 2019-08-23 15:45:45 +03:00
cef778731e Merge branch 'release/v4.0.1' 2019-08-22 14:25:40 +03:00
adde5e6a7e Merge tag 'v4.0.1' into develop
Bump version to 4.0.1
2019-08-22 14:25:40 +03:00
37863df67e Bump version to 4.0.1 2019-08-22 14:25:27 +03:00
0e56a155f8 Fixed an issue when printing settings and file path contains non-ASCII chars // Resolve #2934 2019-08-22 14:21:54 +03:00
c6de3ebea0 Refactor "humanize_duration_time" to "00:00:00.000" format 2019-08-20 16:49:18 +03:00
a25c1155c2 Docs: Add support for Teensy 4.0 2019-08-19 18:16:53 +03:00
42ee6fe96e Fixed an issue when library.json had priority over project configuration for LDF // Resolve #2867 2019-08-19 15:54:07 +03:00
a33fd6de27 Bump version to 4.0.1rc2 2019-08-19 14:44:04 +03:00
a2830dd527 Automatically normalize file system paths to UNIX-style for Project Generator // Resolve #2857 2019-08-19 14:43:39 +03:00
f46e1b7a3a Fix broken reference to VSCode Settings docs 2019-08-19 12:57:40 +03:00
bf59dda01b Better handling of fs.rmtree errors on Windows // Issue #2916 2019-08-19 12:48:57 +03:00
1dc15326c9 Export ProjectConfig instance to templates generator // Issue #2824 2019-08-18 11:06:52 +03:00
1a3720cfb9 Ability to set "databaseFilename" for VSCode and C/C++ extension // Resolve #2825 2019-08-18 00:40:59 +03:00
5ea3f2bbc6 Use board ID when InternetIsOffline for getting resent projects // Resolve #2866 2019-08-17 23:58:05 +03:00
08103cfc59 Improve settings printing 2019-08-17 23:57:12 +03:00
78e88b6115 Update changelog 2019-08-17 22:31:41 +03:00
26bb74afd5 Bump version to 4.0.1rc1 2019-08-17 22:03:52 +03:00
0587f5b964 Add __attribute__((unused)) to generated test code (#2906)
Without this, the compiler will generate unused parameter warnings in
the native version:

test/output_export.cpp: In function ‘void output_start(unsigned int)’:
test/output_export.cpp:6:32: error: unused parameter ‘baudrate’ [-Werror=unused-parameter]
 void output_start(unsigned int baudrate)
                                ^~~~~~~~
cc1plus: all warnings being treated as errors
2019-08-17 21:07:37 +03:00
e0ec4ff435 Encode PIO Core version before hashing // Resolve #2916 2019-08-17 21:06:15 +03:00
0677bcecb9 Improve printing of tabulated results 2019-08-17 20:55:16 +03:00
9023358d9e YAPF=0.28.0 2019-08-17 17:54:31 +03:00
3edf7e6ca8 Fixed an issue with PIO Home's "No JSON object could be decoded" // Resolve #2823 2019-08-15 21:44:07 +03:00
59114bbd86 Fixes for creating dev/platform 2019-08-15 17:13:45 +03:00
fac45d37f8 Article by Tech Explorations 2019-08-13 20:48:19 +03:00
d0c73af459 Fix docs when only Python 2 was mentioned for PIO Core 2019-08-13 20:44:52 +03:00
fcd1862f40 Add FT231XS ids for Sparkfun ESP32 Thing (#2886)
Signed-off-by: Yusuf Soyipek's ysoyipek@iora.com.tr
2019-08-12 23:22:55 +03:00
a6d42bedc1 Minor fix 2019-08-12 23:00:25 +03:00
04ebdf428b Move "match_src_files" to FS module 2019-08-12 20:32:26 +03:00
6a90388649 Move FS related helpers to fs.py module 2019-08-12 19:44:37 +03:00
1b2e410f12 New article by Jean-Claude Wippler about PlatformIO CLI 2019-07-24 13:08:51 +03:00
f7647438ef Docs: Fix case sensitive files 2019-07-24 12:15:08 +03:00
436a6bc521 Updated contributing guidelines // Resolve #2820 2019-07-24 12:08:21 +03:00
8ea3909a64 Updated contributing guidelines // Resolve #2820 2019-07-24 12:03:28 +03:00
ba0ab796c6 Updated contributing guidelines // Resolve #2820 2019-07-23 19:11:22 +03:00
0e61020652 Docs: Sync Atmel AVR boards 2019-07-22 20:03:54 +03:00
c51c35018d Fix test 2019-07-22 00:57:01 +03:00
5505c6c0e3 Switch Energia's projects to Arduino framework 2019-07-21 22:31:39 +03:00
d6a8360b29 Fix platformio ide search query for VSCode 2019-07-19 14:57:00 +03:00
0687ceb8a4 Bump version to 4.0.1b3 2019-07-19 13:00:52 +03:00
6d7854d113 Session based IDE integration with PIO Home 2019-07-19 12:59:50 +03:00
aebe891895 Skip modified homeState 2019-07-18 14:17:30 +03:00
e69d5e5873 Sync docs and examples 2019-07-18 13:16:23 +03:00
6ea49910d5 Fixed an issue when "debug", "home", "run", and "test" commands were not shown in "platformio --help" CLI 2019-07-18 00:19:30 +03:00
b17e318373 Add Gitlab CI to known list 2019-07-17 14:03:48 +03:00
b0aa4c6682 Renamed "enable_ssl" setting to "strict_ssl" 2019-07-17 00:53:40 +03:00
4d6c452d79 add telemetry / privacy policy reference (#2798) 2019-07-17 00:20:14 +03:00
d06d5def72 Docs: Use renamed "default_envs" option 2019-07-16 16:55:23 +03:00
aa3c943651 Fix typo in docs 2019-07-16 16:50:44 +03:00
1369b10e76 Bump version to 4.0.1b2 2019-07-16 15:48:06 +03:00
8059e04499 Improved computing of project check sum (structure, configuration) and avoid unnecessary rebuilding 2019-07-16 15:47:33 +03:00
71c4201487 Do not save unnecessary data for PIO Home 2019-07-16 14:15:48 +03:00
425c1fb0a8 Do not shutdown PIO Home Server for "upgrade" operations // Resolve #2784 2019-07-15 18:19:40 +03:00
bbf829fe92 Bump version to 4.0.1b1 2019-07-15 14:56:18 +03:00
6f2779fe5d Remove unnecessary code 2019-07-15 14:46:23 +03:00
b51f2ae722 Fixed an issue with incorrect escaping of Windows slashes for PIO Unified Debugger 2019-07-15 14:20:14 +03:00
d5dd4d4b3a Add global "env" group to extra_configs example 2019-07-13 13:51:04 +03:00
eaecad3d49 Add docs for Kendryte FreeRTOS SDK 2019-07-12 15:21:04 +03:00
a8a0cbbbf3 Remove PIO Plus link 2019-07-12 14:16:27 +03:00
94e21bf8a1 Update badges 2019-07-12 14:12:38 +03:00
02c3d870ff Sync Kendryte dev/platform 2019-07-12 13:57:12 +03:00
91f0217d39 Make scripts compatible with Python 3 // Resolve #2779 2019-07-12 13:38:37 +03:00
5e73348263 Print debug tool name in debugging session 2019-07-11 14:09:15 +03:00
2f871db3ae Add docs about configuring MCUdude's cores 2019-07-11 12:12:54 +03:00
28972b838b Add "publish" target 2019-07-10 16:52:04 +03:00
0473405b92 Merge tag 'v4.0.0' into develop
Bump version to 4.0.0
2019-07-10 16:22:53 +03:00
0d00d0534a Merge branch 'release/v4.0.0' 2019-07-10 16:22:52 +03:00
fe210aadcf Bump version to 4.0.0 2019-07-10 16:22:37 +03:00
6fcc76e199 Docs for VSCode: Proxy Server Support 2019-07-10 16:07:13 +03:00
e927669632 Document how to override board configuration 2019-07-10 13:49:59 +03:00
24d2b94e79 Drop Python 2.7 limitation from a docs // Resolve #1991 2019-07-10 13:17:42 +03:00
f81b1089c1 Control a number of parallel build jobs with a new -j, --jobs option 2019-07-10 13:00:51 +03:00
fee748d384 Bump version to 4.0.0rc6 2019-07-10 00:20:43 +03:00
d003dffc5a Fixed an issue with broken internal call for PIO Account // Resolve #2748 2019-07-10 00:20:23 +03:00
a300168658 Bump version to 4.0.0rc5 2019-07-09 00:14:46 +03:00
0a638b7ea5 Fix issues with Unicode arguments when calling inline PIO Core 2019-07-09 00:14:11 +03:00
ffcf6b873a Use native Windows API for getting My Documents folder path 2019-07-08 17:21:28 +03:00
c69e80249d Append system PATH to overridden in CDT project // Resolve #810 2019-07-04 22:56:54 +03:00
2a4b25705c More pre-configured target for Eclipse IDE 2019-07-04 22:53:36 +03:00
412a1f78cd Fixed an issue when generating invalid "Eclipse CDT Cross GCC Built-in Compiler Settings" if a custom PLATFORMIO_CORE_DIR is used // Resolve #806 2019-07-04 20:07:44 +03:00
73dacd9418 Add "make profile" hotkey 2019-07-04 19:02:13 +03:00
caf5159002 Fixed an issue when Ctrl+C(SIGINT) terminates debugging session instead of halting // Resolve #2733 2019-07-04 17:47:26 +03:00
d9b6842b6a Update history with refactored PIO Home back-end 2019-07-04 16:49:29 +03:00
affa54e5fc Fix an issue when lib_compat_mode = strict does not ignore libraries incompatible with a project framework 2019-07-04 16:46:54 +03:00
c3ac10fe29 Update docs and examples for SiFive dev/platform 2019-07-03 22:58:27 +03:00
0a907627be Bump version to 4.0.0rc4 2019-07-03 15:22:22 +03:00
26dda104dd Remove debug code 2019-07-03 15:22:04 +03:00
7c6fabaee2 Fix an issue with unhandled warnings from PIO Core when calling it internally // Resolved #2727 2019-07-03 15:10:37 +03:00
dc07ea56d2 Bump version to 4.0.0rc3 2019-07-03 14:01:14 +03:00
b68e5db46b Fix broken example when using custom uploader // Resolve #2735 2019-07-03 12:37:00 +03:00
fd9ca0cd15 Ensure buffer is created for thread stream 2019-07-02 22:35:35 +03:00
6c47c7506e Do not remove thread buffers, reset them instead 2019-07-02 22:26:01 +03:00
18d93dfcc9 Use StringIO for PY3 2019-07-02 21:04:43 +03:00
900a4d463f Bump version to 4.0.0rc2 2019-07-02 20:49:06 +03:00
4b24d6e3e4 Minor changes 2019-07-02 20:48:43 +03:00
2988724456 Setup MultiThreadingStdStreams from child threads 2019-07-02 20:44:33 +03:00
c79d5f0cf1 Fix an issue saving modified State 2019-07-02 15:52:12 +03:00
148b7dccfd Refactor ThreadSafeStdBuffer 2019-07-02 15:47:03 +03:00
83f64cebbd Remove test code 2019-07-02 12:23:35 +03:00
69de40c409 Fix an issue when empty multiple values for project option were not casted to list // Resolve #2734 2019-07-02 12:21:06 +03:00
bf9552bd56 Free lock when state is deleted 2019-07-02 00:45:35 +03:00
5afaa6d0ee Merge branch 'feature/performance-fixes' into develop 2019-07-02 00:42:04 +03:00
d2c86ab71c Refactor state to a proxied dictionary 2019-07-02 00:41:47 +03:00
6d9de80f12 Better comparison for app state changes 2019-07-01 20:42:23 +03:00
bf77d70d82 Thread safe internal PIO Core calling for PIO Home 2019-07-01 20:39:52 +03:00
8525fd6ae8 Docs: Sync Atmel SAMD boards 2019-07-01 18:33:05 +03:00
dfca7f0b68 Speedup PIO Home via internal calling of PIO Core CLI 2019-07-01 15:55:42 +03:00
500b3e08fe Docs: Fix default OTA port for ESP32 2019-06-29 13:29:10 +03:00
6739d5a570 In the current version of this template all build targets result (#2714)
in

   pio -c -f eclipse debug run target <mytarget>

The commit fixes this to be

   pio -c -f eclipse run target <mytarget>

See also discussion in forum:
   https://community.platformio.org/t/pio-4-0-0b3-potential-bug-in-cprojet-tpl/8390
2019-06-29 12:48:24 +03:00
f8dd90c9a9 Docs: Fix invalid references to Sipeed boards 2019-06-28 23:34:08 +03:00
8d459d86d3 Bump version to 4.0.0rc1 2019-06-28 19:09:47 +03:00
f30bd18bdc Skip async output when empty byte is given 2019-06-28 19:07:59 +03:00
0035f56e15 Sync docs and examples 2019-06-28 19:07:44 +03:00
4123aa4c23 Look in for "lib_deps" in all declared library storages // Resolve #2708 2019-06-28 13:27:05 +03:00
1bff3c6615 Use isolated Core folder for test_maintenance 2019-06-28 13:21:11 +03:00
936b04e075 Remove upgrade hooks from Core 2.0 to Core 3.0 2019-06-28 13:04:34 +03:00
4d23ad03c3 Remove upgrade hooks from Core 2.0 to Core 3.0 2019-06-28 13:03:49 +03:00
a75823227d Use :1234 as default GDB port for QEMU 2019-06-27 15:13:16 +03:00
96d337388b Debug: Initial configuration for QEMU 2019-06-27 15:07:13 +03:00
c89793eab9 Use piped openOCD for RISC-V 2019-06-27 15:06:12 +03:00
e27b40390d Look for project dir in sys env variables (hooks for Eclipse, CLion) 2019-06-27 14:57:05 +03:00
1d80914070 Remove upgrade hooks from Core 2.0 to Core 3.0 2019-06-27 14:56:21 +03:00
e61caa37a8 Fix issue when CMakeListsUser.txt is not included // Resolve #2712 2019-06-27 14:04:16 +03:00
d07a1d265e Log stdout of GDB client 2019-06-27 13:38:46 +03:00
54921c5dbd Bump version to 4.0.0b3 2019-06-26 01:02:08 +03:00
5cb2a970fa Suppress IOError 2019-06-26 00:52:22 +03:00
89b951e7d5 Switch to news from registry 2019-06-26 00:29:49 +03:00
6daf387c90 Missing parentheses and depreciated syntax (#2700)
Fixes
```
  File "get-platformio.py", line 93
    print r['out']
          ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(r['out'])?
```

and 

```
  File "get-platformio.py", line 146
    except Exception, e:
                    ^
SyntaxError: invalid syntax
```
2019-06-25 23:50:06 +03:00
2c3d8ce695 Bump version to 4.0.0b2 2019-06-23 21:23:44 +03:00
17fa5f77d5 Fix LDF recursive behaviour 2019-06-23 21:23:19 +03:00
c0a9ae5c70 Better handling of library.properties "architectures" meta data 2019-06-23 21:21:34 +03:00
4b7916c2af Bump version to 4.0.0b1 2019-06-21 17:50:18 +03:00
6d968a7093 Docs: Add info about using custom targets with mbed framework 2019-06-21 15:11:51 +03:00
634afdcf8a Update FUNDING.yml 2019-06-20 19:11:50 +03:00
3ebeb1bab2 Create FUNDING.yml 2019-06-20 19:10:21 +03:00
5ab564a6d0 Add doc page about ULP programming 2019-06-20 17:41:06 +03:00
04dc6230e7 Open source PIO Unified Debugger and Unit Testing 2019-06-19 00:29:21 +03:00
51115c1254 Ignore vscode-cpptools cache (#2623)
One of the recent updates to the vscode-cpptools extension made it start caching in .vscode/ipch, and this cache can be quite big for even small projects. Since they're cache files, they should be ignored by default. This may be a short-lived suggestion, as there is already some mention that the IntelliSense cache folder may be moved to workspace storage, rather than 'per project' storage... although the 'when' is anyone's guess. 

See here for more: https://github.com/microsoft/vscode-cpptools/issues/3347
2019-06-16 12:37:32 +03:00
40c8046546 Fix Teensy serial lockout (#2676)
Fixes `[Errno 16] Device or resource busy: '/dev/ttyACM0` issue on Teensy 3.2 and 3.5 (at minimum) due to ModemManager probing the devices and making them unavailable. Updated rules sourced from current https://www.pjrc.com/teensy/49-teensy.rules configuration.
2019-06-16 12:36:41 +03:00
fa761f9616 Use build cache for AppVeyor CI examples 2019-06-15 22:06:55 +03:00
5fabadd059 Use build cache for CI examples 2019-06-15 21:12:40 +03:00
38408c1e1f Use only 1 example per framework for CI 2019-06-15 21:09:52 +03:00
fbdfe31f17 Shared cache directory for the build derived files // Resolve #2674 2019-06-15 18:53:13 +03:00
bd8ba738cf Improve docs how to enable PIO Core dev/version in PIO IDE 2019-06-13 23:46:53 +03:00
8b8b6c3b9e Bump version to 4.0.0a23 2019-06-13 22:57:53 +03:00
bd3b29c304 Fix converting to real version 2019-06-13 20:24:55 +03:00
1339924c2e Print installation progress for "lib_deps" after LDF banner 2019-06-13 19:54:40 +03:00
46eab99888 Typo fix 2019-06-13 18:31:03 +03:00
461d71c2c7 Look firstly in built-in library storages for a missing dependency instead of PlatformIO Registry // Resolve #1654 2019-06-13 18:22:36 +03:00
1ccc526960 Revert "Revert back "Look firstly in built-in library storages""
This reverts commit 4ae302762a.
2019-06-13 13:08:53 +03:00
5338a9caa3 Bump version to 4.0.0a22 2019-06-13 00:42:24 +03:00
4ae302762a Revert back "Look firstly in built-in library storages" 2019-06-13 00:42:10 +03:00
98513c9967 Fix nested import 2019-06-12 23:47:22 +03:00
b6688db8b7 Bump version to 4.0.0a21 2019-06-12 22:03:28 +03:00
d5c98e4f27 Look firstly in built-in library storages for a missing dependency instead of PlatformIO Registry // Resolve #1654 2019-06-12 22:02:59 +03:00
b7e9bcb609 Do not check udev rules for gdb --version 2019-06-11 20:30:06 +03:00
9de7297d38 Fix "UnicodeEncodeError: 'ascii' codec can't encode characters" // Resolve #2644 2019-06-10 19:44:18 +03:00
97acf23a6d Docs: Add info how to enable built-in PIO Core for VSCode 2019-06-10 16:58:34 +03:00
80718ebb95 Fix "UnicodeEncodeError: 'ascii' codec can't encode characters" // Resolve #2644 2019-06-10 15:25:59 +03:00
643d118062 Sync docs 2019-06-07 17:42:33 +03:00
15b5a14995 Bump version to 4.0.0a20 2019-06-07 17:24:07 +03:00
68a3b3f9e7 Custom platform_packages per a build environment with an option to override default // Resolve #1367 2019-06-07 17:22:02 +03:00
5f1bd286c7 Fix "ValueError: invalid literal for int() with base 10: '0.0'" // Resolve #2646 2019-06-07 15:12:24 +03:00
d18b4f12d0 Sync docs 2019-06-07 15:01:52 +03:00
d9010230a4 Make internal in-memory cache for package manager to be instance related 2019-06-07 15:01:27 +03:00
686d615639 Cast env_name to string // Resolve #2644 2019-06-07 13:14:14 +03:00
d205370e9b Docs: Minor changes to migration guide 2019-06-07 01:06:16 +03:00
ce66033190 Docs: update migration from 3.0 to 4.0 2019-06-07 00:18:34 +03:00
bcff26d4d7 Refactor using "@util.memoized" 2019-06-06 00:13:04 +03:00
898d79956d Bump version to 4.0.0a19 2019-06-05 18:28:23 +03:00
522f814811 Show detailed info about a platform when is installed from local folder or VCS // Resolve #2081 2019-06-05 18:26:39 +03:00
394d272324 Fix numerous issues related to "UnicodeDecodeError" and international locales, or when project path contains non-ASCII chars // Resolve #143, Resolve #1342, Resolve #1959, Resolve #2100 2019-06-05 17:57:22 +03:00
84ce7db3e3 Fixed an issue when library keeps reinstalling for non-latin path // Resolve #1252 2019-06-05 17:53:02 +03:00
f873bd41f8 Better printing of relative path for removed objects 2019-06-05 16:47:02 +03:00
5c8c10e7d3 Do not check that lib_extra_dirs exist // Resolve #2624 2019-06-04 13:55:11 +03:00
a504a13fa8 Fix broken example with ConfigParser using // Resolve #2616 2019-06-04 00:50:45 +03:00
d09964a897 Use common IDE data loading for IDE and DEBUG 2019-06-03 19:20:10 +03:00
4416c12747 Fix numerous issues related to "UnicodeDecodeError" and international locales, or when project path contains non-ASCII chars // Resolve #2100 2019-06-03 17:44:41 +03:00
80a1b95887 Sync docs 2019-06-03 14:48:05 +03:00
9eb18ca72d PyLint fix 2019-06-03 14:29:22 +03:00
37653d8446 Better decoding SCons arguments 2019-06-03 13:57:58 +03:00
e269c91d26 Improve compatibility with hashlib Py2/Py3 2019-06-03 13:30:35 +03:00
ac3236693f Bump version to 4.0.0a18 2019-06-03 01:14:02 +03:00
d0b3c5ee86 Switch between Build Configurations (release and debug) with a new project configuration option build_type // Resolve #2184 2019-06-02 14:11:31 +03:00
23a2022f04 Add support for PLATFORMIO_DEFAULT_ENVS system environment variable // Resolve #1967 2019-06-01 22:43:44 +03:00
c5177efd0b Minor fixes 2019-06-01 22:24:38 +03:00
d51cd9c277 Bump version to 4.0.0a17 2019-06-01 19:48:21 +03:00
6257480d0d Print platform package details, such as version, VSC source and commit // Resolve #2155 2019-06-01 19:44:45 +03:00
4af615a49c Maintain renamed options when reading configuration file 2019-06-01 16:58:14 +03:00
6186b425d4 Typo fix 2019-06-01 15:38:55 +03:00
c038074489 Override default development platform upload command with a custom // Resolve #2599 2019-06-01 14:36:07 +03:00
d25f1ddc21 Add project folder prefix to $PROJECT_HASH 2019-05-31 21:47:50 +03:00
5011e47709 Added support for "shared_dir" 2019-05-31 21:18:37 +03:00
33d16bfcf0 Use named context meta vars for unit testing 2019-05-31 15:47:25 +03:00
bae21f1cdd Allow to pass multiple load commands to PIO Unified Debugger 2019-05-31 14:45:48 +03:00
5f9fd9260e New project configuration parser with a strict options typing 2019-05-31 14:45:01 +03:00
61db0f1d6a YAPF 0.27.0 2019-05-30 23:42:15 +03:00
1598c8197e Fix "clean" target 2019-05-30 23:33:57 +03:00
01db26f204 Add a link to PIO Unified Debugger options 2019-05-30 22:26:42 +03:00
12876c5c2b Merge branch 'feature/refactor-project-options' into develop 2019-05-30 22:15:16 +03:00
5c60d922ca Skip "arduino-mock" from CI 2019-05-30 22:15:06 +03:00
0570fc6c48 Don't override custom "core_dir" on Windows platform 2019-05-30 21:56:55 +03:00
f3c8277572 Fix broken tests 2019-05-30 21:27:12 +03:00
1dbaed5beb Implement "silent" mode for config.validate() 2019-05-30 21:26:51 +03:00
19c1574993 Use the latest TOX for Travis.CI 2019-05-30 17:37:48 +03:00
346579b93c Improve type converting for config options 2019-05-30 17:34:44 +03:00
0ce2343836 Do not pass project settings as SCons arguments // Resolve #1637 2019-05-30 17:08:00 +03:00
d5e277b7cc Minor improvements to unit testing engine 2019-05-30 16:39:17 +03:00
3cc4af1723 Refactor project config options 2019-05-30 16:38:04 +03:00
8d05903bf3 Log THE ONLY non sensitive data (used board, platform, and framework) 2019-05-30 14:36:04 +03:00
7f845ab943 Sync docs and examples 2019-05-30 14:32:49 +03:00
ddc8a353cb Sync docs 2019-05-28 12:53:54 +03:00
9ce9171a36 Fix typo 2019-05-28 01:19:51 +03:00
dec43bec9d Fix test 2019-05-28 00:09:20 +03:00
99377130eb Enhance unit testing summary 2019-05-27 22:25:48 +03:00
3df01405a1 Remove unused Python imports 2019-05-27 22:25:22 +03:00
3adcf66453 Docs: Use native Python ConfigParser for extra scripting examples 2019-05-27 19:03:31 +03:00
b88c262a9d Use the latest version of tox for AppVeyor CI 2019-05-27 18:49:35 +03:00
5999bcee3f Update history 2019-05-27 18:45:24 +03:00
078b0af312 Test only 1 project example per dev/platform for AppVeyor CI 2019-05-27 18:17:57 +03:00
a0fb88e28a Implement "envLibdepsDirs" per project for PIO Home 2019-05-27 17:57:46 +03:00
3cd4b005d8 Open sourcing PIO Unified Debugger, PIO Unit Testing Engine, and PIO Home Server 2019-05-27 17:19:33 +03:00
0a523fc06c Docs: Minor tweak 2019-05-27 14:33:38 +03:00
16864509af Document "Override package files" 2019-05-27 14:21:48 +03:00
cb8af5add9 Print "No items found" when there are no packages for llisting 2019-05-27 12:28:04 +03:00
3f96dc1432 Fixed an issue when package cache (Library Manager) expires too fast // Resolve #2559 2019-05-27 12:24:20 +03:00
e1aa29cb36 Bump version to 4.0.0a16 2019-05-25 22:18:23 +03:00
6e87089ded Add support for Unix shell-style wildcards for "monitor_port" option // Resolve #2541 2019-05-25 22:14:38 +03:00
a84195bb5a Add user-definable monitor options to platformio.ini // Resolve #2165 2019-05-25 21:49:51 +03:00
70a0bd72c0 Sync "include" directory for PIO Remote // Resolve #2210 2019-05-25 21:06:08 +03:00
fea7e97112 Fix an issue with hardcoded C stadard version when generating project for CLion IDE // Resolve #2527 2019-05-25 20:47:39 +03:00
7beb332b31 Support custom CMake configuration for CLion IDE using `CMakeListsUser.txt` file 2019-05-25 20:46:56 +03:00
7b2c1f27fc Sync docs 2019-05-25 20:46:23 +03:00
67f7b6cda3 Bump version to 4.0.0a15 2019-05-25 01:18:28 +03:00
4266cba53b Cleanup ".piolibdeps" 2019-05-25 01:10:35 +03:00
19725fec04 Add options to override default locations used by PlatformIO Core // Resolve #1615 2019-05-24 20:49:05 +03:00
a6e5a0c7f5 Fix an issue for Project Generator when include path search order is inconsistent to what passed to the compiler // Resolve #2509 2019-05-24 16:06:27 +03:00
2baea815fe Update history 2019-05-24 15:06:33 +03:00
b38c57bcf9 Fix an issue when `-U in build_flags does not remove macro previously defined via -D` flag // Resolve #2508 2019-05-24 14:57:59 +03:00
e6d1805f0b Save library requirements when using --save option // Issue #1028 2019-05-24 14:09:25 +03:00
9a95b0df56 Fix handling custom includeDir and srcDir for library.json // Resolve #2518 2019-05-24 01:15:47 +03:00
70a5d32925 Add "--save" flag to "platformio lib install" command // Resolve #1028 2019-05-23 19:39:04 +03:00
c2a549b0c2 Install all project dependencies declared via "lib_deps" option using "platformio lib install" command // Resolve #2147 2019-05-23 18:37:08 +03:00
0fda79a075 Switch to Click meta context for lib CLI 2019-05-23 13:05:44 +03:00
21e2ac6695 Use isolated library dependency storage per project build environment // Resolve #1696 2019-05-23 00:23:24 +03:00
e7d75d1412 Remove debug code 2019-05-21 21:47:20 +03:00
4386dc56ea Move "in_silence" to PlatformioCLI 2019-05-21 13:18:11 +03:00
a30b79c5fc Sync docs 2019-05-21 12:01:14 +03:00
f29a74042f Drop support for "lib_extra_dirs" in "platformio" section 2019-05-20 21:12:45 +03:00
c46643f0fd Custom project "***_dir" options declared in “platformio” section of “platformio.ini” have higher priority than Environment variables 2019-05-20 17:07:59 +03:00
5fe4de626b Implement unified project workspace storage ".pio" // Resolve #1778 2019-05-20 17:01:54 +03:00
774380c2ef Bump version to 4.0.0a14 2019-05-20 12:38:49 +03:00
8643f0454e Move "glob_escape" and "get_file_contents" helpers to "compat" module 2019-05-17 13:18:15 +03:00
f844d9cb47 Remove line-buffering from "platformio run" command which was leading to omitting progress bar from upload tools // Resolve #856, Resolve #857 2019-05-17 12:53:51 +03:00
f94fbb951a Typo fix 2019-05-16 21:27:32 +03:00
899de600e4 Fix broken "util.string_types" 2019-05-16 21:11:21 +03:00
971049b41c Move process related helpers to "proc" module 2019-05-16 21:03:15 +03:00
aaf61082c1 Replace "--only-check" CLI option by "--dry-run" 2019-05-16 20:02:45 +03:00
b14abeff48 Bump version to 4.0.0a13 2019-05-13 22:37:45 +03:00
f26553b451 ESP8266, docs for "SSL Support" 2019-05-13 22:37:24 +03:00
8b93ad00a2 Docs: ESP32: Implement "espota" protocol 2019-05-11 22:18:35 +03:00
5e1a931145 Switch Python or Platform dependent code to "compat" module 2019-05-10 17:50:08 +03:00
abfee8308e Switch Python or Platform dependent code to "compat" module 2019-05-10 17:47:02 +03:00
d2449762c2 Move Python or Platform dependent code to "compat" module 2019-05-10 17:27:04 +03:00
59848c3115 Check unknown build environment passed by user 2019-05-10 17:26:47 +03:00
834206ff20 Move Python or Platform dependent code to "compat" module 2019-05-10 17:26:10 +03:00
ce4ed18ceb Check unknown build environment passed by user 2019-05-10 15:49:01 +03:00
b710bbd80e Allow to skip ProjectConfig option validation with new "validate_options" argument 2019-05-10 15:47:45 +03:00
446176bf5e Allow to skip ProjectConfig option validation with new "validate_options" argument 2019-05-10 15:47:17 +03:00
0b2d780618 Switch to the new ProjectConfig API 2019-05-10 15:45:52 +03:00
d9b0364aa8 Allow overriding a default project "platformio.ini" configuration file 2019-05-10 13:12:41 +03:00
76818448e2 Ensure PIO Home mimetypes are known 2019-05-10 13:01:52 +03:00
131144ec34 Resolve PyLint "import-error" 2019-05-10 13:00:53 +03:00
a21d75b273 Merge branch 'develop' into feature/pio-plus-oss 2019-05-10 01:10:51 +03:00
c79b3ff7f1 Override default “platformio.ini” with a custom using "-c, --project-conf" option // Resolve #1913 2019-05-10 00:01:10 +03:00
2b5ac57fd0 Bump version to 4.0.0a12 2019-05-09 18:40:19 +03:00
32d317d3cb Fix PlatformIO CLI 2019-05-09 18:39:27 +03:00
71f606912a Implement ProjectConfig.getlist() 2019-05-09 14:14:19 +03:00
62b80c396b Added support for the latest Python "Click" package (CLI Builder) // Resolve #349 2019-05-09 00:51:28 +03:00
7687a0a929 Fix PyLint "not-an-iterable" error 2019-05-08 21:02:23 +03:00
f63fe1699b Bump version to 4.0.0a11 2019-05-08 20:20:56 +03:00
4f98a3fd42 Share common (global) options between declared build environments using "[env]" section // Resolve #1643 Resolve #790 2019-05-08 20:19:39 +03:00
693304590c Fix PyLint "not-an-iterable" error 2019-05-08 12:41:11 +03:00
947e31ca8d Fix some PyLint errors 2019-05-07 23:51:46 +03:00
45d4b92678 Export get_projectdata_dir for util, fix riscv_gap dev/platform 2019-05-07 23:00:01 +03:00
07a2a49d93 Refactor project helpers 2019-05-07 22:13:21 +03:00
7ddd22209f Enable PyLint "import-error" 2019-05-07 21:16:42 +03:00
6cd4484be9 Init new project using new ProjectConfig API 2019-05-07 19:57:24 +03:00
c235974eb6 Switch to the new ProjectConfig API 2019-05-07 17:51:50 +03:00
1b4f945907 Remove support for renamed dev/platforms 2019-05-07 15:59:09 +03:00
4fdd51e190 Docs: Sync MCS51 boards 2019-05-07 13:26:10 +03:00
95b9ae9f24 Docs: Sync Atmel SAM boards 2019-05-06 13:38:48 +03:00
94e580bf4e Override default source and include directories for a library via "library.json" manifest using "includeDir" and "srcDir" fields 2019-05-04 13:36:27 +03:00
e4dca37874 Bump version to 4.0.0a10 2019-05-04 12:23:51 +03:00
7f607b742f Fix issue when handling dynamic variables 2019-05-04 12:23:23 +03:00
2c0e0b2619 Bump version to 4.0.0a9 2019-05-03 21:14:08 +03:00
8e55c9e4d0 Include external configuration files with "extra_configs" option // Resolve #1590 2019-05-03 21:03:36 +03:00
41ff1b0188 Support for Kendryte K210 // Resolve #2233 2019-05-03 16:56:44 +03:00
48c1aeae03 Fix "systemd-udevd" warnings in 99-platformio-udev.rules // Resolve #2442 2019-05-03 13:11:03 +03:00
eab2fd91fd Lowercase SHA sum for package manager 2019-04-25 12:49:22 +03:00
ba6d120cf4 Docs: Sync Atmel AVR dev/platform 2019-04-24 00:14:53 +03:00
e9df6166ee Update SCons to 3.0.5 2019-04-24 00:07:27 +03:00
9bdc85fd52 Bump version to 4.0.0a8 2019-04-23 12:49:36 +03:00
fa48a6460f Merge tag 'v3.6.7' into develop 2019-04-23 12:49:10 +03:00
f07854879a Merge branch 'hotfix/v3.6.7' 2019-04-23 12:47:27 +03:00
9ca53c57f4 Bump version to 3.6.7 2019-04-23 12:32:18 +03:00
ee420cc35e Bump version to 3.6.7 2019-04-23 12:31:58 +03:00
d49d91269d Update history with upcoming 3.6.7 release 2019-04-23 12:29:29 +03:00
a59efc2fc0 Update history with upcoming 3.6.7 release 2019-04-23 12:29:16 +03:00
20f28383a0 Fix links in changelog 2019-04-23 01:07:36 +03:00
d3c3491a91 Fix links in changelog 2019-04-23 01:07:21 +03:00
e6a7cc2036 Update core package dependencies 2019-04-23 01:05:11 +03:00
4d615416f3 Improve debugging in debug_load_mode = modified and fix an issue with useless project rebuilding 2019-04-23 00:50:32 +03:00
137a5d1c42 Improve debugging in debug_load_mode = modified and fix an issue with useless project rebuilding 2019-04-23 00:49:53 +03:00
65354e995d Initial commit of PIO Home 2019-04-22 21:07:28 +03:00
3032cade17 PyLint fixes 2019-04-19 20:46:28 +03:00
948a977fa5 Initial commit of PIO Unit Testing 2019-04-19 20:33:31 +03:00
c7d8b50474 Use generic GDB_MSPDEBUG_INIT_CONFIG 2019-04-19 19:58:34 +03:00
f1da544279 Initial commit of PIO Unified Debugger 2019-04-19 19:56:16 +03:00
40d1bb204c Docs: New boards by ESP32 dev/platform 2019-04-19 13:26:25 +03:00
21a36f8ee9 Fix UnicodeEncodeError when converting INO to CPP 2019-04-18 16:20:01 +03:00
be24c6ab4d Fix an issue when invalid "env_default" results into unhandled errors // Resolve #2265 2019-04-18 14:18:27 +03:00
3d96e584fb Fix an issue when invalid "env_default" results into unhandled errors // Resolve #2265 2019-04-18 14:17:22 +03:00
963eabc3f5 Docs: Rename "Download" button to INSTALL 2019-04-18 01:01:26 +03:00
f63041a402 Add get_original_version to public utils API 2019-04-17 23:20:45 +03:00
c084db1619 Enable AppVeyor CI only for Windows x64 2019-04-17 20:09:05 +03:00
4edfb8f6cc Cleanup PING_INTERNET_IPS 2019-04-17 20:06:01 +03:00
6501c1f171 Cleanup PING_INTERNET_IPS 2019-04-17 20:05:51 +03:00
41ab97203a Docs: Add community video tutorials 2019-04-16 13:55:47 +03:00
a51a03843d Docs: Use jQuery from Sphinx theme (fix search) 2019-04-16 00:33:21 +03:00
e9b8478942 Sync docs 2019-04-07 00:52:20 +03:00
29cf1c8596 Fix "ValueError: invalid literal for int() with base 10" for click.get_terminal_size 2019-04-05 19:49:36 +03:00
e992e156bf Fix "ValueError: invalid literal for int() with base 10" for click.get_terminal_size 2019-04-05 19:48:04 +03:00
cf13ec4035 Fix an "IndexError: list index out of range" for Arduino sketch preprocessor // Resolve #2268 2019-04-01 18:50:40 +03:00
c1d01dbe34 Update info about PIO IDE for VSCode 2019-04-01 18:35:00 +03:00
ff5da3c3cc Use stable dev/platforms for CI 2019-03-30 13:54:29 +02:00
7d9e10095e Set manifest version of VSCode C/C++ configuration file 2019-03-30 13:00:27 +02:00
bb17630571 Set manifest version of VSCode C/C++ configuration file 2019-03-30 13:00:10 +02:00
7746f7eeee Project Generator: fixed a VSCode C/C++'s "Cannot find" warning when CPPPATH folder does not exist 2019-03-29 21:27:08 +02:00
e089c4a546 Project Generator: fixed a VSCode C/C++'s "Cannot find" warning when CPPPATH folder does not exist 2019-03-29 21:26:45 +02:00
8f29d951cb YAPF 0.26.0 2019-03-29 12:55:05 +02:00
f182a6dcae Bump version to 3.6.7a1 2019-03-29 12:46:24 +02:00
0c76116948 Merge tag 'v3.6.6' into develop 2019-03-29 12:44:54 +02:00
6b17183cff Merge branch 'hotfix/v3.6.6' 2019-03-29 12:43:41 +02:00
8cd35fb537 Bump version to 3.6.6 2019-03-29 12:43:16 +02:00
2d4421e8e5 New article "Automated unit testing in the metal" 2019-03-25 16:04:05 +02:00
760499c095 Append configuration settings from "mbed_lib.json" to "mbed_config.h" // Resolve #2164 2019-03-24 23:55:06 +02:00
c141189883 Append configuration settings from "mbed_lib.json" to "mbed_config.h" // Resolve #2164 2019-03-24 23:54:53 +02:00
00b162608e Fix an issue with incorrect order of project "include" and "src" paths in `CPPPATH` // Resolve #1914 2019-03-23 17:45:28 +02:00
51cb87bc6f Bump version to 4.0.0a7 2019-03-23 17:44:30 +02:00
cae708f2d7 Fix an issue with incorrect order of project "include" and "src" paths in `CPPPATH` // Resolve #1914 2019-03-23 17:44:01 +02:00
e33b0fe291 Fix an issue when PlatformIO Build System does not pick up "mbed_lib.json" files from libraries // Resolve #2164 2019-03-23 14:33:34 +02:00
3a77bed0d4 Fix an issue when PlatformIO Build System does not pick up "mbed_lib.json" files from libraries // Resolve #2164 2019-03-23 14:24:43 +02:00
06fe557a20 Fix "SameFileError" when CI is used in pair with --keep-build-dir // Resolve #2227 2019-03-22 21:25:12 +02:00
10a7367b33 Fix "SameFileError" when CI is used in pair with --keep-build-dir // Resolve #2227 2019-03-22 21:24:43 +02:00
9c1cc97776 Project Generator: fixed a warning "Property !!! WARNING !!! is not allowed" for VSCode // Resolve #2243 2019-03-22 21:17:26 +02:00
dea6551841 Bump version to 4.0.0a6 2019-03-22 21:16:33 +02:00
4ca71e7df1 Project Generator: fixed a warning "Property !!! WARNING !!! is not allowed" for VSCode // Resolve #2243 2019-03-22 21:16:02 +02:00
d7e2d05f60 Fix error with conflicting declaration of a prototype (Arduino sketch preprocessor) 2019-03-20 18:58:06 +02:00
d9e6111ac3 Fix error with conflicting declaration of a prototype (Arduino sketch preprocessor) 2019-03-20 18:49:20 +02:00
86e4641101 Bump version to 3.6.6a1 2019-03-14 20:16:15 +02:00
326eb4a681 Fix "FileExistsError" when "platformio ci" command is used in pair with "--keep-build-dir" option 2019-03-14 20:14:55 +02:00
d4af985eb8 Bump version to 4.0.0a5 2019-03-14 20:12:52 +02:00
0d904ad1cc Fix "FileExistsError" when "platformio ci" command is used in pair with "--keep-build-dir" option 2019-03-14 20:12:18 +02:00
b3ac567b53 Docs: New article "Getting started with the STM32F407VG and STM32Cube" 2019-03-14 14:46:44 +02:00
03aec79cc1 Drop mbed OS support for Adafruit boards 2019-03-13 22:22:48 +02:00
9a6d148bdc Update docs for PIO Plus products 2019-03-08 18:01:35 +02:00
a9288e5a5b Docs: Cosmetic changes to PIO Unified Debugging and Unit Testing 2019-03-07 17:26:22 +02:00
8280fd557b Bump version to 4.0.0a4 2019-03-07 14:12:45 +02:00
15a1cbf95a Tag docs with v3.6.5 2019-03-07 14:09:50 +02:00
775797b4e5 Merge tag '3.6.5' into develop 2019-03-07 14:02:35 +02:00
e37d34b92f Merge branch 'release/3.6.5' 2019-03-07 14:00:57 +02:00
b562541f20 Bump version to 3.6.5 2019-03-07 13:57:32 +02:00
736a1404b4 YAPF 0.26.0 2019-03-07 12:55:03 +02:00
9639626ab3 Fix an issue when `$PROJECT_HASH template was not expanded for the other directory ***_dir` options in "platformio.ini" // Resolve #2170 2019-03-07 12:54:40 +02:00
4c8df44a5a Fix an issue when `$PROJECT_HASH template was not expanded for the other directory ***_dir` options in "platformio.ini" // Resolve #2170 2019-03-07 12:40:55 +02:00
3f52a6d5ba YAPF 0.26.0 2019-03-07 12:36:17 +02:00
237d55208c Fix "Unnecessary "else/elif" after "raise"" by PyLint 2019-03-07 12:35:34 +02:00
b99494671a Update "dl.bintray.com" IP address 2019-03-06 22:39:38 +02:00
5a72e3f2a1 Update "dl.bintray.com" IP address 2019-03-06 22:39:24 +02:00
1ce913ea74 Sync docs 2019-03-06 21:04:01 +02:00
9911a04232 Sync docs 2019-03-06 12:29:03 +02:00
f1549e1f0e Docs: Sync new boards by STM32 2019-03-05 13:20:19 +02:00
4659a44bd6 New boards: Adafruit Bluefruit nRF52832 Feather, Feather nRF52840 Express, and Nordic nRF52840-DK (Adafruit BSP) 2019-03-04 13:50:34 +02:00
e39d4f5c32 Sync docs 2019-03-04 13:12:16 +02:00
fb9fe8c77c Document upload_protocol = espota option 2019-03-04 13:03:22 +02:00
9778778830 PyLin fix 2019-02-24 11:45:29 +02:00
ab914e1566 PyLin fix 2019-02-24 11:45:14 +02:00
d2c2171ef9 Project Generator: add new targets for CLion IDE "BUILD_VERBOSE" and "MONITOR" (serial port monitor) // Resolve #359 2019-02-23 22:43:30 +02:00
856798488b Fix an issue when platformio ci recompiles project if `--keep-build-dir` option is passed // Resolve #2109 2019-02-23 22:41:45 +02:00
00ba88911f Fix an issue with slow updating of PlatformIO Core packages on Windows 2019-02-23 22:41:15 +02:00
e0b9d080fa Project Generator: add new targets for CLion IDE "BUILD_VERBOSE" and "MONITOR" (serial port monitor) // Resolve #359 2019-02-23 22:34:36 +02:00
42c22758bb Use NodeMCUv2 as default board for wiring example 2019-02-23 21:04:43 +02:00
522b42c2a9 Fix an issue when platformio ci recompiles project if `--keep-build-dir` option is passed // Resolve #2109 2019-02-23 18:39:54 +02:00
5a707a4849 CI only for Python 2.7 & 3.6 2019-02-23 16:00:24 +02:00
1bed2650f3 Sync docs 2019-02-23 14:44:13 +02:00
65f30dd7b4 Sync docs 2019-02-23 01:10:41 +02:00
59b27d5d0a Document switching between Arduino cores 2019-02-21 22:53:33 +02:00
6575ddab26 Improve docs for pio ci command when multiple --project-option are used 2019-02-21 00:25:14 +02:00
dc4a5df2af Drop support for RFduino 2019-02-20 00:13:56 +02:00
2e4c9411af Docs: Update VSCode Custom Task example 2019-02-20 00:00:41 +02:00
e477d1fbcf Docs: Move images from root of _static to _static/images 2019-02-19 23:25:13 +02:00
6059e0dce6 Fix an issue with slow updating of PlatformIO Core packages on Windows 2019-02-19 20:12:07 +02:00
234bb75b9b Sync docs & examples 2019-02-19 18:11:21 +02:00
38dfa40e32 Docs: Sync Atmel SAM boards 2019-02-18 18:57:37 +02:00
5add5f1cfb Document lwIP profiles for EPS8266 2019-02-18 15:51:35 +02:00
f1b809f8dd Improve debugging instruction for ESP32 tutorial // Resolve #1871 2019-02-09 19:11:51 +02:00
47aa63fc04 Update docs for mbed framework 2019-02-07 20:36:45 +02:00
08000a6f62 Sync docs & examples 2019-02-07 19:01:51 +02:00
31d4706abd Debug: Update wiring scheme for Mini-Module 2019-02-02 19:21:12 +02:00
e23ca2c109 Docs: Allow to control firmware optimization for Teensy 2019-01-31 16:42:44 +02:00
17efa89047 Disable STM8 from CI tests 2019-01-30 18:00:40 +02:00
527efe3359 RISV-GAP, document AutoTiler 2019-01-30 18:00:12 +02:00
5aed0efd61 Docs: Add Alorium Hinj board 2019-01-29 22:20:41 +02:00
27ac17e8c3 Release docs to 3.6.4 2019-01-23 21:24:29 +02:00
639c086728 Bump version to 3.6.5a1 2019-01-23 21:08:39 +02:00
d2c545eb27 Bump version to 4.0.0a3 2019-01-23 20:55:18 +02:00
035ab14202 Merge tag 'v3.6.4' into develop
Bump version to 3.6.4

# Conflicts:
#	HISTORY.rst
#	platformio/__init__.py
2019-01-23 20:54:21 +02:00
4504080027 Merge branch 'release/v3.6.4' 2019-01-23 20:51:48 +02:00
367e4d663c Bump version to 3.6.4 2019-01-23 20:47:18 +02:00
28bca48eca Ignore examples for ststm8 on Linux 2019-01-23 17:55:07 +02:00
eb57e14ac1 Fix "ValueError: invalid literal for int() with base 10" // Resolve #2061 2019-01-23 17:54:45 +02:00
69065d8bd6 Fix "ValueError: invalid literal for int() with base 10" // Resolve #2058 2019-01-22 22:16:58 +02:00
3cc996d89f Fix "ValueError: invalid literal for int() with base 10" // Resolve #2058 2019-01-22 21:59:26 +02:00
d7d981f522 Add "Variable Format" section to VSCode 2019-01-22 21:05:38 +02:00
eedc1c3ccd Bump version to 4.0.0a2 2019-01-17 18:18:28 +02:00
db0bbcc043 CLion: Improve project portability using "${CMAKE_CURRENT_LIST_DIR}" instead of USER_HOME 2019-01-17 18:05:05 +02:00
63075c9607 CLion: Improve project portability using "${CMAKE_CURRENT_LIST_DIR}" instead of USER_HOME 2019-01-17 18:04:52 +02:00
b594c11718 Fix cmd_lib test 2019-01-17 17:56:35 +02:00
b6ccda3568 Fix cmd_lib test 2019-01-17 17:56:21 +02:00
35f96a534a Drop "do-not-modify-files-here.url" from build_dir 2019-01-17 02:07:46 +02:00
7e8349d45e Docs: Sync Atmel AVR boards 2019-01-16 15:34:31 +02:00
88d06b4437 Ignore examples for ststm8 on Linux 2019-01-12 01:08:13 +02:00
3019e35724 Initial support for STM8 2019-01-11 16:52:01 +02:00
38bb2c61c1 Docs: Sort upload protocols for board 2019-01-11 14:35:54 +02:00
c7949ecd07 Temporary disable checking for PlatformIO Core engine (allow PIO Core 3 dev/platforms for PIO Core 4) 2019-01-11 14:11:54 +02:00
d627a42268 Fix PyLint warning 2019-01-11 14:07:46 +02:00
2b467f3fee Fix PyLint warning 2019-01-11 14:07:35 +02:00
f058b8f18f Fix PY3 Lint "consider-using-set-comprehension" 2019-01-11 13:02:12 +02:00
a750b06fc8 Fix PY3 Lint "consider-using-set-comprehension" 2019-01-11 13:01:53 +02:00
13430aa628 Use GCC C++ compiler for Eclipse project indexer // Issue #1010 2019-01-11 12:52:17 +02:00
286a53991c Use GCC C++ compiler for Eclipse project indexer // Issue #1010 2019-01-11 12:52:00 +02:00
b92a8467c9 Update SCons to 3.0.3 2019-01-10 23:47:43 +02:00
56cd55ba7d Eclipse: Provide language standard to a project C/C++ indexer // Resolve #1010 2019-01-10 21:57:52 +02:00
a092f87c50 Eclipse: Provide language standard to a project C/C++ indexer // Resolve #1010 2019-01-10 21:57:39 +02:00
19b5285d50 Fix "TypeError : startswith first arg" when checking udev rules with PY3 // Resolve #2000 2019-01-10 19:34:09 +02:00
d5d95092c4 Fix an error "Could not extract item..." when extracting TAR archive with symbolic items on Windows platform // Resolve #2015 2019-01-10 19:33:45 +02:00
02937216b0 Fix "TypeError : startswith first arg" when checking udev rules with PY3 // Resolve #2000 2019-01-10 19:33:15 +02:00
e02d7528ad Fix an error "Could not extract item..." when extracting TAR archive with symbolic items on Windows platform // Resolve #2015 2019-01-10 19:14:03 +02:00
68e3f9dc00 Fix "Runtime Error: Dictionary size changed during iteration" // Resolve #2003 2019-01-09 16:34:55 +02:00
2ae41c8434 Fix "Runtime Error: Dictionary size changed during iteration" // Resolve #2003 2019-01-09 16:34:39 +02:00
aa2bc4a63b Implement "get_file_contents" helper 2018-12-27 14:48:22 +02:00
74218f4f93 Fix PyLint warning for Windows 2018-12-26 22:33:21 +02:00
a60c57ac58 Initial support for Python 3.5+ // Resolve #895 Resolve #1365 2018-12-26 20:54:29 +02:00
fabaadec60 Fix an issue with incorrect detecting of compatibility (LDF) between generic library and Arduino or ARM mbed frameworks 2018-12-22 22:30:23 +02:00
7f697961ec Sync docs 2018-12-21 17:26:13 +02:00
9334f31ff2 Docs: Sync boards 2018-12-20 20:51:34 +02:00
579de32d4e Docs: Remove examples with ESP8266 LD scripts, they can change 2018-12-14 18:38:41 +02:00
c3702391ea Docs: Add RISC-V ASM Video Tutorial 2018-12-13 20:45:35 +02:00
826418a443 Bump version to 3.6.4b1 2018-12-13 17:30:49 +02:00
4dfa885a85 CLion: Improve project portability using "${CMAKE_CURRENT_LIST_DIR}" instead of full path 2018-12-13 17:30:10 +02:00
9f4dde4b5e Use full path to PlatformIO CLI when generate project for IDE 2018-12-13 17:24:08 +02:00
3748219cac Document system PATH for a custom VSCode task 2018-12-12 21:46:28 +02:00
4b55767fb9 Docs: "Custom Build Task" for VSCode 2018-12-12 21:01:13 +02:00
5aef182652 Merge tag 'v3.6.3' into develop
Bump version to 3.6.3
2018-12-12 16:19:26 +02:00
6db47cec2b Merge branch 'release/v3.6.3' 2018-12-12 16:19:25 +02:00
6f8b9d70bc Bump version to 3.6.3 2018-12-12 16:19:14 +02:00
d8cbe99f2c Fix an issue with a broken headers list when generating ".clang_complete" for Emacs // Resolve #1960 2018-12-12 15:50:34 +02:00
a690b8c085 Bump version to 3.6.3b2 2018-12-12 02:51:24 +02:00
b874359482 Ignore *.asm and *.ASM files when building Arduino-based library (compatibility with Arduino builder) 2018-12-12 02:49:42 +02:00
3a18e668c2 Docs: Better explanation about "PlatformIO IDE" 2018-12-12 01:55:54 +02:00
3ca9527da4 Bump version to 3.6.3b1 2018-12-12 01:29:43 +02:00
f539513376 Fixed spurious project's "Problems" for PlatformIO IDE for VSCode when ARM mbed framework is used 2018-12-12 01:28:37 +02:00
afdfaeec68 Check if "_lockfile" attribute exists 2018-12-03 18:31:12 -08:00
676c87d081 Allow to override platform "package_repositories" 2018-11-30 01:36:50 +02:00
db3b0499c9 Merge branch 'release/v3.6.2' 2018-11-29 18:02:58 +02:00
98032ec548 Merge tag 'v3.6.2' into develop
Bump version to 3.6.2
2018-11-29 18:02:58 +02:00
8ef6ea8053 Bump version to 3.6.2 2018-11-29 18:02:49 +02:00
d87ee0b286 Bump docs 2018-11-29 18:00:52 +02:00
6f01f10f59 YAPF 2018-11-29 17:59:29 +02:00
59a0d2b618 Bump version to 3.6.2rc2 2018-11-29 16:02:59 +02:00
16df5474e4 VSCode IntelliSense config: Typo fix with useless bracket 2018-11-29 15:59:22 +02:00
33ea6ef123 Be in silence when debug interpreter is run 2018-11-29 15:21:06 +02:00
a485e563f0 Bump version to 3.6.2rc1 2018-11-29 00:52:36 +02:00
cf35f9dbf8 Only patch versions are allowed for "contrib-pysite" 2018-11-28 21:32:37 +02:00
710b150fcd Switch PIO Home to native WebSockets (next step to PY3) 2018-11-28 17:28:14 +02:00
13731b4461 Switch PIO Home to native WebSockets (next step to PY3) 2018-11-28 17:23:33 +02:00
3d52710935 Bump version to 3.6.2b6 2018-11-27 00:55:30 +02:00
d475f44e49 Escape string when generating manifest for VSCode C/C++ IntelliSense service 2018-11-27 00:54:59 +02:00
7574798a3a Document "erase" target 2018-11-24 15:51:50 +02:00
9ef8d4cfe0 Docs: Grammar fixes 2018-11-24 14:30:21 +02:00
b42d0efa73 Bump version to 3.6.2b5 2018-11-21 15:00:52 +02:00
4a17a9b5b3 Improved IntelliSense for PlatformIO IDE for VSCode via passing extra compiler information for C/C++ Code Parser 2018-11-21 15:00:13 +02:00
d3909bdfa2 Bump version to 3.6.2b4 2018-11-21 00:52:54 +02:00
a2b0b2893b LDF: Stop handling "define" and "undef" when condition fails; handle CPP files in "chain+" and "deep+" modes // Resolve #1930 2018-11-21 00:52:34 +02:00
9d2499ab98 Bump version to 3.6.2b3 2018-11-20 01:23:55 +02:00
579a973512 Handle CWD when searching for a file // Resolve #1930 2018-11-20 01:23:34 +02:00
b861e9c192 Document in library.json how to pass flags to a global build environment 2018-11-20 00:50:52 +02:00
375006ee65 Bump version to 3.6.2b2 2018-11-19 22:30:52 +02:00
23af9c9027 Fix an issue when Library Dependency Finder (LDF) finds spurious dependencies in `chain+ and deep+` modes // Resolve #1930 2018-11-19 22:29:53 +02:00
7322df26ad Fix an issue when Library Dependency Finder (LDF) does not handle project src_filter // Resolve #1905 2018-11-19 19:06:56 +02:00
32bb9c9d83 Bump version to 3.6.2b1 2018-11-19 17:46:19 +02:00
b22ca10f8c Prepend CPPATH of library dependencies instead of appending // Resolve #1914 2018-11-19 17:45:53 +02:00
95beb03aad Bump version to 3.6.2a3 2018-11-18 23:54:42 +02:00
f65ab58c88 Go over 8010-8100 TCP ports when shutting down PIO Home server 2018-11-18 23:53:47 +02:00
c06a018d88 Docs: Add support for OLIMEX ESP32-PRO 2018-11-05 18:32:58 +02:00
7789e3bc62 Rename "System" to "Hardware" for board spec 2018-11-04 17:24:39 +02:00
1287e51bf8 Add info about "EN" pin for ESP32 and debug probes 2018-11-04 13:13:34 +02:00
151823f80e Fix pinouts for oddWires IOT-Bus JTAG 2018-11-02 15:48:12 +02:00
09d58d0d49 Update docs for ESP8266 lwIP profiles 2018-11-02 12:54:09 +02:00
0a6fb68840 Bump version to 3.6.2a2 2018-10-30 06:40:36 +02:00
38fb5b2234 Typo fix 2018-10-30 06:40:11 +02:00
ab6a323aca Fixed an issue with VSCode IntelliSense warning about the missed headers located in "include" folder 2018-10-30 00:27:29 +02:00
50ed828e7a Bump version to 3.6.2a1 2018-10-30 00:14:58 +02:00
692af90161 Fix incorrect wording when initializing/updating project 2018-10-30 00:14:06 +02:00
543a1dddae Sync docs 2018-10-29 22:38:20 +02:00
fce84b5a48 Add debugging support using TIAO USB Multi-Protocol adapter (TUMPA) 2018-10-29 22:27:47 +02:00
67a6f66a35 Add support for oddWires IoT-Bus Io debug tool 2018-10-29 19:23:06 +02:00
fdbebb178c Merge tag 'v3.6.1' into develop
Bump version to 3.6.1
2018-10-29 14:10:57 +02:00
0747fe9dea Merge branch 'release/v3.6.1' 2018-10-29 14:10:56 +02:00
331cd0aa0d Bump version to 3.6.1 2018-10-29 14:10:42 +02:00
8b74b12990 Don't recreate git ignore and travis configs when project is already inited 2018-10-29 14:02:29 +02:00
7a0c1e13f3 Bump version to 3.6.1rc7 2018-10-28 00:39:42 +03:00
e94d758131 Use "items" instead of "iteritems" (PY2/3) // Issue #895 2018-10-27 20:51:55 +03:00
080369f597 Make "print" compatible between Py2 & Py3 2018-10-27 20:22:11 +03:00
729178731c Improve a loading speed of PIO Home "Recent News" 2018-10-27 20:07:07 +03:00
5c278b54f7 Use "super" when calling parent class // Issue #895 2018-10-27 15:24:10 +03:00
2007491be9 Don't override existing ".gitignore" file 2018-10-27 14:20:33 +03:00
e96078b4e3 Exclude upcoming ".pio" from VCS 2018-10-27 14:18:47 +03:00
118f22bed3 PyLint fix 2018-10-26 01:27:57 +03:00
2134022565 Print board's configuration URL 2018-10-26 01:27:06 +03:00
cf2a2395e5 Sync new Atmel AVR boards 2018-10-25 19:52:55 +03:00
8947b63e41 Better formatting when asking to remove a file 2018-10-25 14:12:09 +03:00
fc8bffdd81 Ask user to remove manually a file on exception 2018-10-25 14:03:52 +03:00
75105e18ba Wait 1 seconds on Windows when PIO Home shuts down 2018-10-25 13:48:47 +03:00
3507290a20 Shutdown PIO Home server before updating tool-pioplus; Update tool-pioplus to 1.4.11 2018-10-25 13:44:41 +03:00
7cc4e8ce15 Bump version to 3.6.1rc6 2018-10-24 01:21:02 +03:00
08dc5dec89 Revert "Cache loaded project config"
This reverts commit bfee896378.
2018-10-24 01:19:54 +03:00
d92349c8f7 Add "reset" support for "memoized" 2018-10-24 01:19:39 +03:00
92289d373b Add example with $PROJECT_HASH for Windows 2018-10-24 00:23:10 +03:00
4b9e8f0ba4 Added $PROJECT_HASH template variable for build_dir 2018-10-23 22:55:26 +03:00
bfee896378 Cache loaded project config 2018-10-23 22:27:18 +03:00
e4c112608b Docs: Move "Custom target" to upper level 2018-10-23 19:21:25 +03:00
04eb531ac2 Add more example with a custom target 2018-10-23 19:12:02 +03:00
8e3020c0f8 Sync docs 2018-10-23 18:09:43 +03:00
51acd02421 Bump version to 3.6.1rc5 2018-10-22 16:49:08 +03:00
8a1b94b48c Process `build_unflags` for cloned environment when building a static library 2018-10-22 16:33:30 +03:00
e11013189b Docs: Move library manager CLI to userguide 2018-10-19 22:07:00 +03:00
98deefc4f5 Bump version to 3.6.1rc4 2018-10-19 17:48:00 +03:00
058a5e854d Skip aceinna_imu from linux builds 2018-10-19 16:50:51 +03:00
7b998c8cda Fix an issue with incorrect handling of a custom package name 2018-10-19 16:37:15 +03:00
98a1fd79b6 Revert back "Handle first part for package name" 2018-10-19 16:13:55 +03:00
e344194f86 Handle first part for package name 2018-10-19 15:58:43 +03:00
05b656e6b0 Update README for "include", "lib", and "test" directories 2018-10-17 21:56:27 +03:00
9c30472777 Generate "test" directory per project 2018-10-17 21:16:09 +03:00
016caa731d Rename "readme.txt" to README for "include" and "lib" project folder; don't create these folders if they were delated before 2018-10-17 19:58:38 +03:00
5b0befef45 Drop support for Freescale Kinetis FRDM-KL26Z, include Aceinna in platforms list 2018-10-17 14:48:53 +03:00
4b588a589d Add Aceinna dev/platform 2018-10-17 14:11:54 +03:00
1598b0632a Sync docs 2018-10-17 14:03:19 +03:00
a32c67a0ce Bump version to 3.6.1rc3 2018-10-17 01:47:08 +03:00
1183105557 Revert back an clang includes list without quotes for Atom 2018-10-17 01:46:16 +03:00
d1e4f22e7f Add docs for JTAG and SWD connectors 2018-10-16 23:01:40 +03:00
8a5b3a90cb Bump version to 3.6.1rc2 2018-10-13 19:32:54 +03:00
2b53ecb111 Improve PIO Unified Debugger for "mbed" framework and fix issue with missed local variables 2018-10-13 19:32:31 +03:00
0159b1cf7f Fixed an issue with broken includes when generating `.clang_complete` and space is used in path // Issue #1873 2018-10-12 23:04:12 +03:00
d9dd83e327 Solved issues with vim whitespaces in paths (#1873)
When a library has whitespaces in the name the path
will contain whitespace too. When vim tries to decode
path it will fail.

This fix wrap each path with quotes.
2018-10-12 22:41:13 +03:00
05fe52bda9 Bump version to 3.6.1rc1 2018-10-12 22:31:11 +03:00
6294580e25 Show a valid error when Internet is off-line while initializing a new project // Resolve #1784 2018-10-12 22:30:28 +03:00
69d01c4bc1 Fix an issue when `pio run -t monitor always uses first monitor_port` even with multiple environments // Resolve #1841 2018-10-12 21:57:57 +03:00
d4e553fb5a Generate an "include" directory with a README file when initializing a new project 2018-10-12 21:49:02 +03:00
ff8fefb797 Report about outdated 99-platformio-udev.rules // Resolve #1823 2018-10-12 19:35:58 +03:00
b77fb79cd6 Sync docs 2018-10-12 16:02:35 +03:00
00b173f13f Fix an issue when dynamic build flags were not handled correctly // Resolve #1799 2018-10-12 15:09:54 +03:00
13ff30788e Sync docs 2018-10-12 15:06:09 +03:00
842db2643d Docs: Typos in VSCode Watchpoints 2018-10-10 16:20:28 +03:00
aee0c7b9c2 Docs: Fix invalid COMPONENT_EMBED_TXTFILES macro for ESP32 2018-10-10 12:58:16 +03:00
f67cc1770d Document "Watchpoints" for VSCode 2018-10-10 02:19:03 +03:00
159cd7c073 Better explanation about overriding settings for board 2018-10-05 01:25:33 +03:00
e83a11d02a More detailed info about debug per board 2018-10-05 00:36:23 +03:00
ba2275fbba Test windows builds on x86 & x64 2018-10-04 20:20:16 +03:00
59a3a7dd55 Minor tweak to docs 2018-10-04 01:51:21 +03:00
0a7d6fb814 Revert back initial white-space for docs tables 2018-10-04 01:46:30 +03:00
94bf067639 Refactor docs for boards 2018-10-04 01:33:15 +03:00
4cd13b9d47 Bump version to 3.6.1a5 2018-10-02 00:12:29 +03:00
34325dbc4c Support in-line comments for multi-line value in platformio.ini 2018-10-02 00:11:41 +03:00
ec9fbca181 Docs: tutorial for ESP32 2018-09-30 23:32:53 +03:00
e9f2334e59 Fix lib test 2018-09-26 15:25:38 +03:00
c10b8633ab Sync docs 2018-09-23 01:47:35 +03:00
18a8b05214 Rename "fixed" to "detached" for LDF 2018-09-21 19:23:08 +03:00
22ceae0149 * Do not re-create ".gitignore" and ".travis.yml" files if they were removed from a project 2018-09-20 14:57:42 +03:00
e6fa8654ad YAPF 2018-09-20 14:55:55 +03:00
24f97ef768 Introduce RISC-V GAP dev/platform 2018-09-20 13:56:42 +03:00
f0a91df2cf Fix incorrect activation commands for PIO Core Installation (Virtual Environment) 2018-09-19 16:12:57 +03:00
a3e3c30d0d Docs: Add "Configuration" group to Library Manager 2018-09-19 16:03:43 +03:00
421694ce0c Sync docs 2018-09-10 22:37:25 +03:00
3c4d978c1c Document URL Handlers for device port monitor // Resolve #1838 2018-09-10 21:20:28 +03:00
e5fc18fddb Sync docs 2018-09-06 22:50:59 +03:00
535048c420 Bump version to 3.6.1a4 2018-09-06 22:26:43 +03:00
b7ac59066f Revert back "PIO Debug (skip Pre-Debug)" debug configuration for VSCode 2018-09-06 22:21:46 +03:00
4b2a63db1f Bump version to 3.6.1a3 2018-09-06 16:35:03 +03:00
a477e8cb23 Default VSCode Debug configuration without Pre-Debug 2018-09-06 16:34:27 +03:00
7108b2fdd4 Introduce "Release" and "Debug" Build Configurations 2018-09-06 14:42:37 +03:00
e6e629d2c5 Bump version to 3.6.1a2 2018-09-06 02:26:14 +03:00
f54d32843a Add "debug" target, update docs for "uploads" option // Resolve #1833 2018-09-06 02:25:28 +03:00
ce47b6f69f Docs: update tutorials 2018-09-06 01:26:08 +03:00
4f0c60edfa Clean cache on PIO Core update 2018-09-02 19:32:45 +03:00
6caa7f30ac Fix typos (#1819) 2018-08-30 20:22:36 +03:00
b43f243f6a Sync docs 2018-08-28 22:08:28 +03:00
abbe30ef97 Docs: Add info about drivers to the tutorial requirements // Resolve #1802 2018-08-27 19:21:12 +03:00
8d1ff91af1 Bump version to 3.6.1a1 2018-08-27 18:56:06 +03:00
78c383eb68 Use Pre-Debug task by its VSCode defination 2018-08-27 18:55:08 +03:00
476a878733 Skip Intel MCS-51 tests for Linux 2018-08-20 20:54:07 +03:00
d109e4756d Initial support for Intel MCS-51 (8051) 2018-08-20 19:37:34 +03:00
d448a0ec5c Switch docs to HTTPS 2018-08-15 19:44:02 +03:00
d009b997bc Auto-dropdown navigation; move "Docs" to the right side 2018-08-15 19:12:41 +03:00
9258763491 Correct docs for SemVer/Deps syntax 2018-08-15 14:38:19 +03:00
79e6df7263 Temporary hook for ReadTheDocs #2971 with a broken "edit" link 2018-08-14 14:36:03 +03:00
4ff013c0fe Improve docs for advanced scripting 2018-08-14 14:24:03 +03:00
71cdc9fe78 Docs: Add compatible platforms, frameworks, and boards per debug tool 2018-08-11 15:34:33 +03:00
e3d17d132a Docs: Improve "Drivers" section for debugging tools 2018-08-10 14:33:36 +03:00
70eedfbeec Merge branch 'release/v3.6.0' 2018-08-06 18:46:23 +03:00
c3d598f488 Merge tag 'v3.6.0' into develop
Bump version to 3.6.0 (issues #1594 #1412 #1462 #1735)
2018-08-06 18:46:23 +03:00
6d5dc60b47 Bump version to 3.6.0 (issues #1594 #1412 #1462 #1735) 2018-08-06 18:43:58 +03:00
129146e82e Bump version to 3.6.0rc1 2018-08-03 21:44:41 +03:00
df923bf17e Add package "lib" folder to LD_PATH 2018-08-03 21:43:40 +03:00
8f19dd50fe Docs: Fix "build_flags" examples with a macro where special chars are used 2018-08-02 17:57:57 +03:00
ab1d1f248c Refactor docs for PIO Unified debug tools 2018-07-30 19:39:31 +03:00
617f51b9ea Improve docs for PIO Unified Debugger 2018-07-30 18:13:04 +03:00
41432d4075 Merge branch 'hotfix/v3.5.5' into develop
* hotfix/v3.5.5:
  Fixed an issue with PIO Remote  when upload process depends on the source code of a project framework
2018-07-30 14:26:35 +03:00
ae964fa729 Fixed an issue with PIO Remote when upload process depends on the source code of a project framework 2018-07-30 14:26:24 +03:00
9a5f9843b9 Bump version to 3.6.0a11 2018-07-28 12:51:52 +03:00
44175f87b1 Merge branch 'hotfix/v3.5.5' into develop
* hotfix/v3.5.5:
  Fix broken unit testing when mbed framework is used
2018-07-28 12:49:33 +03:00
2f2cfc2d84 Fix broken unit testing when mbed framework is used 2018-07-28 12:49:22 +03:00
d9e908fceb Test 3 random examples from each dev/platform 2018-07-27 15:45:51 +03:00
98aa47c885 Drop support for codecov.io 2018-07-27 15:38:46 +03:00
c777b0095d Merge branch 'hotfix/v3.5.5' into develop
* hotfix/v3.5.5:
  Fix an issue when "srcFilter" field in "library.json" breaks a library build // Resolve #1735
  Fix "test_lib" test
2018-07-27 01:27:17 +03:00
9191ea97fe Fix an issue when "srcFilter" field in "library.json" breaks a library build // Resolve #1735 2018-07-27 01:27:05 +03:00
fedf3162f1 Fix "test_lib" test 2018-07-27 00:48:13 +03:00
89fc77d87a Docs: Add Community link in TOP menu 2018-07-26 20:46:43 +03:00
2004c9b079 Fix "test_lib" test 2018-07-26 20:46:21 +03:00
5aaa9cf205 Fix "Home: Internal Store Exception" // Resolve #1756 2018-07-25 22:25:47 +03:00
9b15ec417b Document solution for "ImportError: cannot import name _remove_dead_weakref" 2018-07-25 15:58:47 +03:00
42540d4207 Docs: Fix broken example for "Dynamic build flags" 2018-07-23 22:49:25 +03:00
72bfa4a1e2 Bump version to 3.6.0a10 2018-07-20 13:35:52 +03:00
7b8342cd9a Merge branch 'hotfix/v3.5.5' into develop
* hotfix/v3.5.5:
  Typo fix
2018-07-20 13:35:22 +03:00
a206b2e4fd Typo fix 2018-07-20 13:35:06 +03:00
6e8ce56206 Disable requirements status temporary 2018-07-20 02:10:50 +03:00
7c2c0ba1aa Bump version to 3.6.0a9 2018-07-20 02:09:40 +03:00
f130b5bfb6 Disable requirements status temporary 2018-07-20 02:07:07 +03:00
bf23d85005 Merge branch 'hotfix/v3.5.5' into develop
* hotfix/v3.5.5:
  Add "test_build_project_src" option for PIO Unit Testing
2018-07-20 02:05:01 +03:00
903b41b336 Add "test_build_project_src" option for PIO Unit Testing 2018-07-20 02:04:40 +03:00
ab24ca4ff6 Cleanup 2018-07-20 00:33:24 +03:00
fd8b603910 Update README 2018-07-19 19:00:09 +03:00
e4462d7546 Add Infineon XMC dev/platform // Resolve #471 2018-07-19 16:19:10 +03:00
aa796959c9 Merge branch 'hotfix/v3.5.5' into develop
* hotfix/v3.5.5:
  Fix PIO Unit Testing issue when ``UNIT_TEST`` macro was not set in a build environment
  Append __PLATFORMIO_DEBUG__ macro in debug session
  Add udev rules for J-Link devices
  Disable exec command for Sublime Text debugger

# Conflicts:
#	HISTORY.rst
2018-07-19 15:28:58 +03:00
ff3ce2d69e Fix PIO Unit Testing issue when `UNIT_TEST` macro was not set in a build environment 2018-07-19 15:27:00 +03:00
ff59dcefe0 Append __PLATFORMIO_DEBUG__ macro in debug session 2018-07-19 01:44:12 +03:00
3f2f79ade4 Add udev rules for J-Link devices 2018-07-19 01:43:31 +03:00
bc380714bd Disable exec command for Sublime Text debugger 2018-07-19 01:43:15 +03:00
2ba41cddc4 Disable exec command for Sublime Text debugger 2018-07-17 20:58:20 +03:00
4a14cc686c Add udev rules for J-Link devices 2018-07-17 20:57:41 +03:00
734cb5c7aa Bump version to 3.6.0a8 2018-07-17 16:24:38 +03:00
da89f57046 PIO Home 1.0.0; PIO Plus 1.4.0 2018-07-17 16:24:02 +03:00
4a3b616b0f Sync docs 2018-07-16 17:45:52 +03:00
a14f2d291e Improve checking of package structure after unpacking // Issue #1462 2018-07-15 01:06:59 +03:00
72d260c295 Fix file locking of package installer // Issue #1594 2018-07-15 00:43:12 +03:00
e1578dabac Lock interprocess requests to PlatformIO Package Manager for install/uninstall operations // Resolve #1462 2018-07-14 22:10:56 +03:00
f2c4ba1895 Check item after unpacking only if not symbolic link 2018-07-13 13:10:24 +03:00
695a850979 Bump version to 3.6.0a7 2018-07-13 12:16:44 +03:00
1d7d518ec5 Temporary disable checking of extracted item from archive 2018-07-13 12:15:07 +03:00
44a926b30a Check package structure after unpacking and raise error when antivirus tool blocks PlatformIO package manager // Resolve #1462 2018-07-13 01:54:37 +03:00
735cfbf850 Fix "Cannot uninstall 'pyparsing'" for macOS CI build 2018-07-13 00:25:50 +03:00
6b6c60e82c Fix "Cannot uninstall 'pyparsing'" for macOS CI build 2018-07-13 00:04:16 +03:00
cb7717eaf6 Update docs for creating a custom dev/platform 2018-07-12 20:52:25 +03:00
28a76eb389 Update ISSUE_TEMPLATE.md 2018-07-12 01:26:02 +03:00
0fdfb273c6 Update ISSUE_TEMPLATE.md 2018-07-12 01:23:59 +03:00
eced1c4c2a Update ISSUE_TEMPLATE.md 2018-07-12 01:23:24 +03:00
7d6192b069 Update ISSUE_TEMPLATE.md 2018-07-12 01:22:18 +03:00
23f0ffdfeb Append __PLATFORMIO_DEBUG__ macro in debug session 2018-07-10 15:54:46 +03:00
f7ac71d48e Docs: `projenv` is available only for POST-type scripts 2018-07-10 00:59:01 +03:00
9af715e872 Improve docs for Advanced Scripting section 2018-07-08 18:58:04 +03:00
dae50a32c0 Docs: Info about connection Vbus [CN3-1] to Vcc [CN3-3] of FT2232H Mini-Module 2018-07-07 20:34:34 +03:00
ca37190da4 Update docs for PIO Unified Debugger; add wiring connections and debug probes pictures 2018-07-07 01:35:52 +03:00
7c5c5b5f70 Bump version to 3.6.0a6 2018-07-06 15:26:45 +03:00
83ccf96f36 Merge branch 'hotfix/v3.5.5' into develop
* hotfix/v3.5.5:
  Export extra flash images for IDE
  Update core dependencies
2018-07-06 15:26:01 +03:00
c1f4b729ea Export extra flash images for IDE 2018-07-06 15:25:51 +03:00
1c8ac97073 Update core dependencies 2018-07-06 15:25:26 +03:00
fd88a249b4 Update core dependencies 2018-07-06 15:23:23 +03:00
d8329a6868 ThingForward: First steps with PlatformIO’s Unified Debugger 2018-07-05 18:53:47 +03:00
5c48233259 Docs: Install PIO Core into Virtual Environment 2018-07-05 17:49:27 +03:00
5efe0e4f8c Merge branch 'hotfix/v3.5.5' into develop
* hotfix/v3.5.5:
  Shorten a name for VSCode debug launch configurations
2018-07-04 00:06:54 +03:00
8f88939aa0 Shorten a name for VSCode debug launch configurations 2018-07-04 00:06:44 +03:00
a58535d95c Bump version to 3.6.0a5 2018-07-03 15:15:44 +03:00
a4173f5de1 Merge tag 'v3.5.4' into develop
Bump version to 3.5.4

# Conflicts:
#	HISTORY.rst
#	platformio/__init__.py
2018-07-03 15:14:28 +03:00
dc3973b046 Merge branch 'hotfix/v3.5.4' 2018-07-03 15:11:32 +03:00
7a5af4b180 Bump version to 3.5.4 (issues #1712, #1705, #1023, #1254, #1658, #1054, #1683, #1343, #1665) 2018-07-03 15:10:39 +03:00
25b562e1c1 Added workaround for Python SemVer package's issue 61 with caret range and pre-releases 2018-07-03 14:55:48 +03:00
6dada01e70 Disable macOS frameworks for VSCode IntelliSense 2018-07-03 14:17:38 +03:00
3956dae01e Sync docs 2018-07-02 18:02:00 +03:00
19711d75e0 Merge branch 'hotfix/v3.5.4' into develop
* hotfix/v3.5.4:
  Typo fix
2018-06-30 21:05:40 +03:00
5b1b05cd09 Typo fix 2018-06-30 21:05:20 +03:00
3e0feeabb4 Bump version to 3.6.0a4 2018-06-30 19:48:30 +03:00
e21ac05e71 Merge branch 'hotfix/v3.5.4' into develop
* hotfix/v3.5.4:
  Improve removing of default build flags using `build_unflags` option // Resolve #1712
  Export ``LIBS``, ``LIBPATH``, and ``LINKFLAGS`` data from project dependent libraries to the global build environment
  Replace "env" pattern by "sysenv" in "platformio.ini" // Resolve #1705
2018-06-30 19:36:02 +03:00
4adc73ebe2 Improve removing of default build flags using build_unflags option // Resolve #1712 2018-06-30 19:34:24 +03:00
357e70e5bb Export `LIBS, LIBPATH, and LINKFLAGS` data from project dependent libraries to the global build environment 2018-06-30 18:24:50 +03:00
ca3567df1e Replace "env" pattern by "sysenv" in "platformio.ini" // Resolve #1705 2018-06-29 19:55:29 +03:00
9bd033e288 Update ESP32 boards flash size // Resolve #30 2018-06-29 19:29:32 +03:00
7564e00fc4 Introduce Premium Support 2018-06-29 17:01:13 +03:00
f1a8add795 Merge branch 'hotfix/v3.5.4' into develop
* hotfix/v3.5.4:
  Switch to PIO Plus support
2018-06-28 23:57:38 +03:00
d6ca30a920 Switch to PIO Plus support 2018-06-28 23:57:16 +03:00
c8f6907d02 Merge branch 'hotfix/v3.5.4' into develop
* hotfix/v3.5.4:
  Export PIOCOREPYSITEDIR to system environment
2018-06-26 01:34:37 +03:00
369868624e Export PIOCOREPYSITEDIR to system environment 2018-06-26 01:34:26 +03:00
dfecc04901 Merge branch 'hotfix/v3.5.4' into develop
* hotfix/v3.5.4:
  Export PIOPYSITEDIR to system environment
2018-06-26 01:33:30 +03:00
e9fe2856ec Export PIOPYSITEDIR to system environment 2018-06-26 01:33:12 +03:00
0ba9b341cd Add new Olimex debug tools for ESP32: ARM-USB-OCD and ARM-USB-TINY 2018-06-26 01:01:37 +03:00
9cff2d3206 Sync docs 2018-06-25 15:52:57 +03:00
ab8497e7ce [VIDEO OVERVIEW] ThingForward - Intro to PIO Unified Debugger using ARM mbed OS and PlatformIO IDE for VSCode 2018-06-25 15:47:01 +03:00
f0cd122952 Merge branch 'hotfix/v3.5.4' into develop
* hotfix/v3.5.4:
  Fix broken history
2018-06-25 15:46:32 +03:00
b83acf4297 Fix broken history 2018-06-25 15:46:21 +03:00
89d403879e Docs: Reorder TOP menu 2018-06-23 19:32:58 +03:00
b7ad64226e Merge branch 'hotfix/v3.5.4' into develop
* hotfix/v3.5.4:
  Fix issue when "platformio lib uninstall" removes initial source code // Resolve #1023
2018-06-21 21:34:07 +03:00
2725d8da8b Fix issue when "platformio lib uninstall" removes initial source code // Resolve #1023 2018-06-21 21:33:56 +03:00
08759700b6 Add udev rule for Maple Leaf board (#1699) 2018-06-21 13:45:43 +03:00
7cac351d25 Bump version to 3.6.0a3 2018-06-20 16:33:13 +03:00
f62bde0e38 Merge branch 'hotfix/v3.5.4' into develop
* hotfix/v3.5.4:
  Handle ConfigParser erros
2018-06-20 16:32:48 +03:00
a9577bc0ba Handle ConfigParser erros 2018-06-20 16:32:38 +03:00
ee69c13b2d Handle ConfigParser erros 2018-06-20 16:31:03 +03:00
3c6f57ac5c Custom tasks for VScode 2018-06-20 15:48:14 +03:00
4d48c365f5 Autogenerate examples for platforms and frameworks 2018-06-16 21:11:31 +03:00
a3cda59d70 Refactor docs menu 2018-06-16 18:41:46 +03:00
22b5e4e5c0 Remove examples with cart range for SemVer (issue with dependent Python package) 2018-06-15 17:53:04 +03:00
19844c89c1 Merge branch 'hotfix/v3.5.4' into develop
* hotfix/v3.5.4:
  Fix preprocessor for Arduino sketch when function returns certain type // Resolve #1683
2018-06-15 15:55:30 +03:00
c055ed4850 Fix preprocessor for Arduino sketch when function returns certain type // Resolve #1683 2018-06-15 15:55:17 +03:00
6f905e319f Merge branch 'hotfix/v3.5.4' into develop
* hotfix/v3.5.4:
  Removed "date&time" when processing project with "platformio run" command // Resolve #1343
  Improve documentation for advanced scripting
2018-06-15 15:03:15 +03:00
389783adae Removed "date&time" when processing project with "platformio run" command // Resolve #1343 2018-06-15 14:53:48 +03:00
46a62de14c Improve documentation for advanced scripting 2018-06-15 14:33:05 +03:00
38c74b3f78 Merge branch 'hotfix/v3.5.4' into develop
* hotfix/v3.5.4:
  Handle "architectures" data from "library.properties" manifest in `lib_compat_mode = strict`
2018-06-12 13:47:29 +03:00
92fc308590 Handle "architectures" data from "library.properties" manifest in lib_compat_mode = strict 2018-06-12 13:47:16 +03:00
0f9c213796 Bump version to 3.6.0a2 2018-06-11 22:55:28 +03:00
a6831d9783 Merge branch 'hotfix/v3.5.4' into develop
* hotfix/v3.5.4:
  Isolate build environment for "BuildSources" nodes
  Append a main LD script at the beginning
  Bump version to 3.5.4a1
  Fixed issue with invalid LD script if path contains space
  Don't export ``CPPPATH`` of project dependent libraries to frameworks // Resolve #1665
  YAPF

# Conflicts:
#	HISTORY.rst
#	platformio/__init__.py
#	platformio/builder/tools/pioupload.py
2018-06-11 18:41:39 +03:00
2ba7c47603 Temporary disable raising error when program data size excesses declared in board manfiest 2018-06-10 01:56:48 +03:00
786d505ecb Isolate build environment for "BuildSources" nodes 2018-06-10 01:27:50 +03:00
00c0eaed8a Append a main LD script at the beginning 2018-06-09 14:50:54 +03:00
46c904e67d Bump version to 3.5.4a1 2018-06-09 01:37:38 +03:00
f9fde5d627 Fixed issue with invalid LD script if path contains space 2018-06-09 00:48:42 +03:00
75754a4750 Don't export `CPPPATH` of project dependent libraries to frameworks // Resolve #1665 2018-06-08 21:38:41 +03:00
a584ac1da2 YAPF 2018-06-08 21:37:57 +03:00
2ff88837ec Sync docs 2018-06-08 18:37:05 +03:00
4528ca0365 Bump version to 3.6.0a1 2018-06-04 16:38:53 +03:00
bfc94d36e3 Introduce "Program Memory Usage" 2018-06-04 14:09:48 +03:00
2fb8128791 YAPF 2018-06-02 16:14:58 +03:00
20c1ce40d3 Check maximum allowed firmware size for uploading with "pio run --target checkprogsize" // Resolve #1412 2018-06-01 18:07:47 +03:00
ecaa9d90b3 Continue work on PIO Core 3.5.4 2018-06-01 17:02:49 +03:00
c0b069c920 Merge branch 'release/v3.5.3' 2018-06-01 17:01:46 +03:00
551f0c1514 Merge tag 'v3.5.3' into develop
Bump version to 3.5.3
2018-06-01 17:01:46 +03:00
7db04b1c3f Bump version to 3.5.3 (issue #1641 issue #1612 issue #1473 issue #1528 issue #1546 issue #1282 issue #1516 issue #1381 issue #1474) 2018-06-01 17:01:32 +03:00
32dbf22d44 ESP32: Calculate an absolute path for a custom partitions table 2018-05-31 20:03:03 +03:00
3243a84dba Fix incorrect handling of C/C++ standards passed via build_flags 2018-05-31 16:38:33 +03:00
f465befa68 Rename "Standalone" to "Desktop" for IDE 2018-05-31 16:11:22 +03:00
f4b4f5c434 Improve docs for lib_ignore option 2018-05-31 15:21:39 +03:00
ffc94a88fe Sync dccs 2018-05-31 14:31:28 +03:00
fb29c9c0f6 Support old version of monitor_baud option for device monitor 2018-05-30 20:25:59 +03:00
df437995df Enable C++ exceptions for ESP32 and ESP-IDF 2018-05-30 19:12:30 +03:00
e4440ed94c Bump version to 3.5.3rc2 2018-05-30 14:16:46 +03:00
b213a302e3 Handle _MCU and _F_CPU variables for AVR native // Resolve #1641 2018-05-30 14:14:42 +03:00
d50dfe19d9 Bump version to 3.5.3rc1 2018-05-26 01:04:38 +03:00
9ba5dc0a60 Override any option from board manifest in Project Configuration File "platformio.ini" // Resolve #1612 2018-05-26 01:02:52 +03:00
5011c3e21c API to update BoardConfig manifest 2018-05-25 21:18:08 +03:00
e48e15b014 Fix "memoized" helper when "expire" is not used 2018-05-25 21:13:47 +03:00
357c932a88 Fix broken link 2018-05-25 19:06:23 +03:00
2f07a58e4f Split stable/upstream docs for dev/platforms 2018-05-25 16:17:02 +03:00
4a2594c12e Docs: revert back to 'sphinx' theme for Pygments 2018-05-25 15:31:31 +03:00
8cda6db02d Rename LDF compatibility mode from "light" to "soft" 2018-05-25 01:46:53 +03:00
f7053928f0 Better explanation how to switch between stable/upstream dev/platforms 2018-05-15 17:22:03 -07:00
e22335984f Default debugging configuration for ESP-WROVER-KIT 2018-05-15 15:23:09 -07:00
6a1a1956c8 Docs: add ft2232h as debug tool 2018-05-15 15:13:11 -07:00
98852caefa Bump version to 3.5.3b5 2018-05-15 14:06:12 -07:00
e399c6b363 Fix issue with monitor_speed option 2018-05-15 14:05:29 -07:00
cb2c3b1b63 Bump version to 3.5.3b4 2018-05-14 22:14:10 -07:00
19003ea51b Simplify configuration for PIO Unit Testing 2018-05-14 22:13:42 -07:00
29064b6c63 Rename "monitor_baud" option to "monitor_speed" 2018-05-14 18:53:16 -07:00
ba352454ed RISC-V dev/platform; Debug for ESP32 2018-05-11 20:02:33 +03:00
5ee194b2b9 Document "Debug Level" for ESP32 2018-05-11 03:06:28 +03:00
9d566d8905 Add debugger to env PATH 2018-05-11 03:06:18 +03:00
b310c57136 Document the missed "--project-dir" and "--environment" options for pio device monitor 2018-05-09 15:35:06 +03:00
9aa5f16b49 Update link to PIO Unified Debugger / Community 2018-05-08 21:31:55 +03:00
4fac523811 Bump version to 3.5.3b3 2018-05-08 18:24:13 +03:00
2bb22a86d7 New UI for PIO Unified Debugger and VSCode 2018-05-08 18:23:27 +03:00
39aaae303f Use "debug_init_break" for Eclipse 2018-05-08 18:22:56 +03:00
1310b7b07b Add OTA demo for ESP32 2018-05-05 23:51:59 +03:00
18f6f23271 Fix default OTA port for ESP32 2018-05-05 21:30:18 +03:00
366efacd81 Prepend upload flags instead of "append" 2018-05-05 21:15:50 +03:00
7be1af4241 Do not check if a custom SVD file exists 2018-05-02 12:37:51 +03:00
d0bc40bc24 Update history 2018-05-01 21:16:32 +03:00
73b1d9ccd5 Configure a custom path to SVD file using "debug_svd_path" option 2018-05-01 21:09:32 +03:00
94c27ae30f Update PIO Core deps 2018-05-01 00:58:36 +03:00
b476e298d3 Bump version to 3.5.3b2 2018-04-30 16:50:23 +03:00
c9fa2206ef Normalize SVD path 2018-04-30 12:33:19 +03:00
b1caaa2208 Export path to SVD file for IDEs 2018-04-27 20:37:41 +03:00
f46072f769 Generate beta configuration for the new PIO Debugger for VSCode 2018-04-27 18:01:08 +03:00
7de4d6aeef PyLint fix 2018-04-27 12:57:11 +03:00
31f14274af Ignore idedata event 2018-04-27 01:41:28 +03:00
50c568c232 Fix "RuntimeError: maximum recursion depth exceeded" for library manager // Resolve #1528 2018-04-26 01:49:16 +03:00
3bcc3e07ae Respect a custom "lib_dir" option in platformio.ini // Resolve #1473 2018-04-25 17:15:40 +03:00
2ae169d210 Fix "RuntimeError: maximum recursion depth exceeded" for library manager // Resolve #1528 2018-04-25 16:57:43 +03:00
1c68409a08 Improve support for Black Magic Probe in "uploader" role 2018-04-23 17:30:05 +03:00
f981916f1d Docs: ESP8266 VTables 2018-04-21 01:00:55 +03:00
0a9031e448 Switch to shutil.move instead of os.rename // Resolve #1584 2018-04-20 21:27:52 +03:00
2d1daa756d Docs: Custom lwIP Variant and debug levels for ESP8266 2018-04-20 21:02:52 +03:00
6b6860196a Fix issue with "build_unparse" for string items 2018-04-20 19:10:20 +03:00
ccb63a9ecc Bump version to 3.5.3b1 2018-04-20 15:55:29 +03:00
3ce62fbafe Escape compiler path for Win 2018-04-20 14:00:40 +03:00
b77160d363 Upgrade VSCode CPP manifest to v3 2018-04-20 13:56:04 +03:00
6a04f52620 Add info about "library.json" to README instruction 2018-04-15 06:28:02 +03:00
aa28beddd8 Handle broken JSON files 2018-04-15 06:08:29 +03:00
d0cc3a045e Handle unknown packages when do cleaning // Resolve #1282 2018-04-15 05:48:38 +03:00
02efe4f7f3 Bump version to 3.5.3a9 2018-04-12 18:47:12 -07:00
2c0ca3e437 Update PIO Home and PIO Core+ 2018-04-12 18:46:11 -07:00
aa8de4ff4b Export "docs" from platform manifest 2018-04-12 18:44:38 -07:00
59fe190f20 Better handling of VSCode Terminal IOError 2018-04-05 22:10:28 -07:00
e0fc44aa42 Reinit download session when IOError 2018-04-05 13:08:23 -07:00
e7b5a14e11 Temporary workaround for VSCode's "IOError: PackageManager" issue 2018-04-05 11:06:23 -07:00
0710c094e7 Bump version to 3.5.3a8 2018-04-01 10:31:47 -07:00
1410dd093a Revert back g++ macro from dump list // Issue #1546 2018-04-01 10:28:25 -07:00
d1362c3751 Article: Building a Web Of Things REST-API on an Arduino MKR1000 with PlatformIO 2018-03-27 22:29:26 +03:00
2299383b03 Docs: Update example "J-Link as debugger and uploader" 2018-03-24 15:31:08 +02:00
622e4033c1 Dump g++ macros for IDE 2018-03-24 12:45:00 +02:00
ec9a2b02ea Verify mDNS devices before dumping // Issue #1381 2018-03-23 17:51:45 +02:00
275648a882 Check for non-ASCII chars mDNS service // Issue #1381 2018-03-23 13:54:33 +02:00
5214b32ee3 Print request URL when package fails 2018-03-23 13:50:33 +02:00
c1c2be0b58 Bump version to 3.5.3a7 2018-03-23 12:14:40 +02:00
44fc500c93 Fix issue with incorrect API result 2018-03-23 12:13:59 +02:00
b6d2e1b243 Bump version to 3.5.3a6 2018-03-23 00:09:05 +02:00
d54327f1a9 Refactor @memoized decorator with expiration feature; cache installed boards per platform 2018-03-23 00:08:07 +02:00
0f4ab5b50b Update Unity tool to 2.4.3 2018-03-22 18:18:03 +02:00
ca34da51aa PIO Home: sort folders by name (ignore case), catch ServerError exceptions // Resolve #1454 Resolve #1302 2018-03-22 17:37:51 +02:00
f937eabc1a Handle error connections to the latest news for PIO Home // Resolve #1470 Resolve #1474 Resolve #1478 Resolve #1480 2018-03-22 16:14:11 +02:00
e019341e59 Bump version to 3.5.3a5 2018-03-22 12:11:46 +02:00
50b2bc07dc Add PlatformIO IDE as recommended extension for VSCode's workspace 2018-03-22 12:10:16 +02:00
8f7206b186 Use absolute path for CPP includes when exporting data to IDE 2018-03-22 12:09:36 +02:00
1461953341 Process "unflags" after frameworks 2018-03-21 19:49:45 +02:00
cd3245960b ThingForward, Webinar: Unit Testing for Embedded with PlatformIO and Qt Creator 2018-03-21 19:49:06 +02:00
580c0601cf Add example with POST scripting and changing of build flags in runtime 2018-03-20 19:32:00 +02:00
979a6a80f0 Fix issue which did not allow to override runtime build environment using extra POST script 2018-03-20 19:24:05 +02:00
6f9fac5663 YAPF for test 2018-03-20 16:10:11 +02:00
85730619f4 Ignore ".pytest_cache" from sources 2018-03-20 16:08:22 +02:00
61374f15f1 Fix issue with `build_unflags` option when a macro contains value 2018-03-20 16:06:39 +02:00
ad52f618cf Save data in UTF-8 by default 2018-03-20 01:14:29 +02:00
bbb32607ed Catch UnicodeError when saving content cache 2018-03-20 01:06:05 +02:00
669ef3cc93 Bump version to 3.5.3a4 2018-03-20 00:42:37 +02:00
d47022b8c3 PIO Home: Recent news 2018-03-20 00:42:10 +02:00
c20cd1b464 Do not load automaically JSON from cached resources 2018-03-19 17:16:51 +02:00
3161e5f606 Bump version to 3.5.3a3 2018-03-16 14:13:00 +02:00
233d48fac0 Describe a project with "description" option for "platformio.ini" 2018-03-16 14:12:05 +02:00
218a1dccf6 Fix issue with installing only the one platform package by specified type 2018-03-16 13:33:59 +02:00
02bad10652 Do not show duplicated upload protocols 2018-03-15 20:53:23 +02:00
7495160374 Bump version to 3.5.3a2 2018-03-15 19:53:47 +02:00
3663dc3470 Fix issue with useless project rebuilding for case insensitive file systems (Windows) 2018-03-15 19:53:05 +02:00
d2b34d42f7 Docs: Fix missed "s" for "99-platformio-udev.rules" 2018-03-14 11:36:30 +02:00
b78a151706 Update requirements for PIO Home and PIO Core+ contribs 2018-03-13 22:59:02 +02:00
6a49df7dfe Start a work on PIO Core 3.5.3 2018-03-13 12:02:25 +02:00
f79e2e38ef Merge branch 'release/v3.5.2' 2018-03-13 12:00:28 +02:00
bc323252e8 Bump version to 3.5.2 (issue #1301 issue #1313 issue #1323 issue #1303 issue #1029 issue #1310 issue #1390 issue #1312 issue #1433) 2018-03-13 12:00:01 +02:00
f63a6d73ee Add "include_dir" to known options list // Resolve #1433 2018-03-12 19:22:55 +02:00
5e6d1d9361 Fix CLion not recognizing includes in lib and .piolibdeps (#1429) 2018-03-12 16:58:08 +02:00
7e875553c2 Allow to control maximum depth of nested includes for conditional PreProcessor 2018-03-08 16:29:09 +02:00
105cd0fa71 Use custom object suffix only for Arduino/Energia frameworks 2018-03-07 23:35:03 +02:00
8676f471f1 Docs: Update url for Sanguino boards 2018-03-07 22:48:21 +02:00
93d524a392 Bump version to 3.5.2rc4 2018-03-07 20:47:09 +02:00
e5b73dcd2b Fix issue when custom board is used with the same ID 2018-03-07 20:46:31 +02:00
ade6c25056 Docs: Arduino Core ESP32 Wiki 2018-03-07 17:01:53 +02:00
e0ce40d6b3 Ability to specify a name for new project 2018-03-07 16:30:21 +02:00
90993ec69f Docs: Show onboard debug tools before 2018-03-07 13:48:59 +02:00
3269d243a8 Firmware memory size explanation: text, data and bss 2018-03-06 12:06:52 +02:00
ef861ed702 Use workspace folder for VSCode CPP tool DB files 2018-03-06 10:38:41 +02:00
b1c9eb9022 Bump version to 3.5.2rc3 2018-03-05 15:51:23 +02:00
3d300414ac Multiple themes (Dark & Light) for PlatformIO Home 2018-03-05 15:50:49 +02:00
3a16ecbaa1 Typo fix 2018-03-04 11:29:03 +02:00
9415b369e1 Bump version to 3.5.2rc2 2018-03-03 14:37:08 +02:00
6ec1890f52 Fix GitHub's "TLSV1_ALERT_PROTOCOL_VERSION" issue when upgrading PIO Core to development version 2018-03-03 14:36:17 +02:00
d1c7f56950 Add example with a custom name for library dependency 2018-03-02 14:40:35 +02:00
2ccb30b0f0 Print VCS version if available in LDF Graph 2018-03-02 14:31:24 +02:00
e95354afeb Bump version to 3.5.2rc1 2018-02-24 01:51:07 +02:00
cfb9ec77ce Keep VSCode CPP DB in workspace 2018-02-24 01:40:49 +02:00
3a52f35fe5 Add "udev" to FAQ 2018-02-20 15:06:35 +02:00
ba0e87b978 Fix issue with mDNS lookup service // Resolve #1310 2018-02-20 14:38:47 +02:00
1cb1af3375 Revert back caching for Travis.CI 2018-02-20 14:29:20 +02:00
7c0cd12f80 Builder: append target suffix to the filename instead of replacing 2018-02-20 01:15:52 +02:00
a3457dfca6 Bump version to 3.5.2b5 2018-02-20 01:11:25 +02:00
cdee242333 Builder: append target suffix to the filename instead of replacing 2018-02-20 01:10:27 +02:00
aa0b6c2071 Sync boards from ST STM32 2018-02-19 20:37:57 +02:00
be306224e3 Document creating of a "Custom build target" 2018-02-17 17:13:30 +02:00
1fce214a6b Bump version to 3.5.2b4 2018-02-16 14:53:00 +02:00
f1f42c6888 Fix issue with PIO Unified Debugger and "debug_load_mode = always" 2018-02-16 14:52:36 +02:00
1d6dcb1c5a Bump version to 3.5.2b3 2018-02-15 19:44:51 +02:00
6b36a29858 Control PIO Unified Debugger and its firmware loading mode using "debug_load_mode" option 2018-02-15 19:44:29 +02:00
18c6fe98ee Search for a library using PIO Library Registry ID 2018-02-15 02:00:12 +02:00
f86885a523 Typo fix 2018-02-13 23:21:19 +02:00
0c2f973412 Mark project source and library directories for CLion IDE // Resolve #1359 Resolve #897 Resolve #1345 2018-02-13 19:24:02 +02:00
591e876660 Move http://platformio.org to https://platformio.org 2018-02-13 01:34:24 +02:00
acefc8d276 Remove debug code 2018-02-13 00:19:07 +02:00
0763a54af3 Add Atmel-ICE debugging tool 2018-02-12 19:32:02 +02:00
d7f7418812 Sync docs with hardware changes 2018-02-12 18:31:31 +02:00
06cce20707 Minor formatting to the system info 2018-02-12 17:27:20 +02:00
b553b8f9df Sort debug tools by name 2018-02-10 18:09:23 +02:00
8736e7bfb0 Bump version to 3.5.2b2 2018-02-10 17:00:45 +02:00
231bd8b294 Implement autodetecting of default debug tool 2018-02-09 21:47:59 +02:00
cc08bb0fd0 Document how to switch between stable release and upstream dev/platform 2018-02-09 14:31:22 +02:00
46cca359e7 Bump version to 3.5.2b1 2018-02-09 01:30:35 +02:00
aac0b29929 Dump only "platform, board and framework" by default when processing environment 2018-02-09 01:23:02 +02:00
f7023aa8ff Print platform information while processing environment 2018-02-07 19:44:02 +02:00
904c5464c3 Add user libraries before built-in (frameworks, toolchains) 2018-02-07 15:28:34 +02:00
31edb2a570 Minor fix 2018-02-06 11:27:44 +02:00
d428d18fae Bump version to 3.5.2a8 2018-02-06 11:26:26 +02:00
e7e80ff152 Fix issue when no environment is specified 2018-02-06 11:25:38 +02:00
1362630ed6 Raise an error when invalid environment name was set for env_default option 2018-02-06 01:54:34 +02:00
e5543b2aee Fix broken RST 2018-02-06 00:36:52 +02:00
53afdc5e02 Fix project generator for Qt Creator IDE // Resolve #1303 Resolve #1323 2018-02-05 21:44:37 +02:00
20641bb4ff Sync docs 2018-02-05 17:30:44 +02:00
33a05fa7ca Update README 2018-02-05 13:16:12 +02:00
f358a4ff57 Ignore unit-testing/calculator from CI test 2018-02-05 12:25:24 +02:00
aa57924488 Fix command:ci test 2018-02-04 01:46:57 +02:00
c5af85f123 Fix issue with multiple OneWire libs and infinite pause 2018-02-04 01:04:53 +02:00
55b8ff7e74 Fold install dev/platform output for CI 2018-02-04 00:08:28 +02:00
8913f1b1ea Don't install desktop dev/platforms 2018-02-03 23:04:46 +02:00
4360ff7463 Use examples from dev/platforms for test 2018-02-03 22:59:41 +02:00
718d1f2de1 Use examples from development platforms 2018-02-03 21:08:45 +02:00
195444b253 Refactor dev/platforms and frameworks docs 2018-02-03 01:34:01 +02:00
17dc5f594f VSCode: Show debug console for each session 2018-02-02 17:51:54 +02:00
3b99dabbf4 Add example with executing of a custom script before upload action 2018-02-01 22:20:26 +02:00
c9e578f977 Do not show debug console by default for VSCode 2018-01-31 01:11:25 +02:00
00782fc624 Cosmetic changes 2018-01-30 23:31:21 +02:00
19d2dfdad0 Bump version to 3.5.2a7 2018-01-30 21:34:10 +02:00
1890162f3f VSCode: add a new "Pre-Debug" task and run it before debugging session 2018-01-30 21:33:56 +02:00
4980d3e4bb Bump version to 3.5.2a6 2018-01-30 15:25:17 +02:00
fc53cb4489 Revert back to SCons 2.0, a lot of issues with non-unicode locales // Issue #895 2018-01-30 15:14:55 +02:00
640aa72cff Minor fix 2018-01-30 14:49:10 +02:00
6235328194 Bump version to 3.5.2a5 2018-01-28 00:28:21 +02:00
332472e84b Save temporary file in unicode for INO2CPP 2018-01-28 00:17:55 +02:00
59fb4b103f Fix issue when project without a specified board can't be uploaded // Resolve #1313 2018-01-27 01:16:37 +02:00
8186aed8d9 Bump version to 3.5.2a4 2018-01-27 00:52:45 +02:00
31700c6bfc Fix issue with detecting media disk when mbed upload protocol is specified 2018-01-27 00:18:32 +02:00
316c2c6e1a Improve calculating of project hash 2018-01-26 22:24:49 +02:00
b6ad672f6a Use SCons "gas" tool instead of "as" 2018-01-26 20:50:33 +02:00
59337c71c1 Upgrad build system to SCons 3.0 // Issue #895 2018-01-26 20:04:43 +02:00
7a40992cc1 Add aliases for LDF compatibility modes 2018-01-26 19:53:07 +02:00
1412f085b8 Minor improvements 2018-01-25 18:12:36 +02:00
6b826abce0 Bump version to 3.5.2a3 2018-01-25 18:03:10 +02:00
f8dafbca80 Show device system information (MCU, Frequency, RAM, Flash, Debugging tools) in a build log 2018-01-25 17:58:52 +02:00
dabe9ba2a7 Show all available upload protocols before firmware uploading 2018-01-25 14:26:15 +02:00
b8fde283fd Use util.get_systype when checking for system 2018-01-24 18:33:41 +02:00
fa738650da Add special prefix for BlackMagic probe for Windows COM ports >= COM10 2018-01-24 17:22:28 +02:00
717a699546 Bump version to 3.5.2a2 2018-01-24 16:10:14 +02:00
f512ccbe68 Fix issue with duplicated "include" records when generating data for IDE // Resolve #1301 2018-01-24 15:53:28 +02:00
de523493b2 Improve support for old mbed libraries without manifest 2018-01-24 14:56:44 +02:00
c0b277d9c8 Handle "os.mbed.com" URL as Mercurial (hg) repository 2018-01-24 14:56:15 +02:00
e615e7529e Fix issue with downloader when dependency URL ends with "/" 2018-01-24 14:34:08 +02:00
86667c5664 Bump version to 3.5.2a1 2018-01-18 22:13:36 +02:00
dcb299e9b9 Use dynamic "build_dir" when checking project for structure chnages 2018-01-18 22:12:32 +02:00
2b4b2eb571 Pass a list iterator directly to "any" or "all" functions 2018-01-18 22:04:43 +02:00
3caa2a9e8d Merge branch 'release/v3.5.1' into develop 2018-01-18 15:12:25 +02:00
0b5769dc57 Merge branch 'release/v3.5.1' 2018-01-18 15:12:24 +02:00
9b9b05439b Bump version to 3.5.1 (issue #1273 issue #1280 issue #1286 issue #1247 issue #1284 issue #1299 issue #1290) 2018-01-18 15:11:38 +02:00
93d4e68378 Bump docs to 3.5.1 2018-01-18 15:04:15 +02:00
2c79de971e Show full library version in "Library Dependency Graph" including VCS information // Issue #1274 2018-01-18 14:49:01 +02:00
bc18941eb0 Fix project generator for Qt Creator IDE // Resolve #1299 Resolve #1290 2018-01-18 01:30:39 +02:00
23ecce297a Update docs for custom slash size for ESP8266 2018-01-17 13:18:14 +02:00
cc646b19bf Extend example with a custom program name using extra scripting 2018-01-17 01:00:09 +02:00
4b08dbd602 Bump version to 3.5.1a7 2018-01-16 13:40:59 +02:00
d822334fdd Drop "python-dateutil" dependency, implement light-weight "parse_date" 2018-01-16 00:57:06 +02:00
3289b36450 Refactore code without "arrow" dependency (resolve issue with "ImportError: No module named backports.functools_lru_cache") 2018-01-16 00:06:24 +02:00
affd53eb27 Use "python_requires" for setuptools and depend on Python 2.7+ <3 2018-01-15 23:02:40 +02:00
06a6822173 Minor fix to history 2018-01-13 19:45:54 +02:00
6380d6c3ea Bump version to 3.5.1a6 2018-01-13 19:44:55 +02:00
24f314d73d Improve a work in off-line mode 2018-01-13 19:44:05 +02:00
6cddaf9eb7 Ignore VSCode launch.json for VCS 2018-01-13 19:01:27 +02:00
ec419f3d0e Refactor CMD:LIB tests 2018-01-13 17:02:08 +02:00
a6c84da83a Check cached API result before Internet 2018-01-13 01:21:53 +02:00
7cad113f0a Cleanup tests 2018-01-13 01:19:41 +02:00
712155243c Add "lib" and ".piolibdeps" to CLion project index 2018-01-12 14:20:53 +02:00
2091a33fb9 Show full version of the current interpreter 2018-01-12 02:23:55 +02:00
1d5245edbd Add "lib_ldf_mode = chain+" for example with C/C++ Preprocessor conditional syntax 2018-01-11 14:14:35 +02:00
cfb22f2a36 Add FAQ:Package Manager for PackageInstallError 2018-01-11 02:10:51 +02:00
16eb41b84e Document "[Error 5] Access is denied" for Package Manager 2018-01-11 02:02:59 +02:00
ae38d17b7f Ignore packages with TMP_FOLDER_PREFIX 2018-01-10 15:23:56 +02:00
7bbb850c2f Bump version to 3.5.1a5 2018-01-10 03:33:51 +02:00
fda439841e Restore PY2/3 ConfigParser 2018-01-10 03:07:17 +02:00
c558584640 Fix importing of ConfigParser 2018-01-10 02:58:50 +02:00
cfb04b31a4 Bump version to 3.5.1a4 2018-01-10 02:12:26 +02:00
1090c414f5 Update PIO Core+ and PIO Home // Resolve #1247 Resolve #1280 Resolve #1284 Resolve #1286 2018-01-10 02:06:05 +02:00
5b64bf1f7c Set default build environment for each example 2018-01-09 22:26:33 +02:00
61eb989edd Fix project generator for CLion // Issue #1287 2018-01-09 22:15:03 +02:00
23ae8e0d3e Additional fix to 7354515 (#1287)
* Additional fix to 7354515

* Update CMakeListsPrivate.txt.tpl

Also perform `replace('"', '\\"')`
2018-01-09 22:07:57 +02:00
e4f8a1877c Fix library updates when a version is declared in VCS format (not SemVer) 2018-01-09 21:56:21 +02:00
61872dd734 Improve support of PIO Unified Debugger for Eclipse Oxygen 2018-01-06 01:04:43 +02:00
16b307d1b3 Sync docs 2018-01-05 19:08:16 +02:00
a4770a27f4 Bump version to 3.5.1a3 2018-01-05 00:18:08 +02:00
ba858989f2 Fix PIO Unified Debugger for mbed framework 2018-01-05 00:17:45 +02:00
93c055a2ec Bump version to 3.5.1a2 2018-01-04 17:14:04 +02:00
2b3bc05f2b Option which allows to specify custom test_speed // Resolve #1273 2018-01-04 16:14:56 +02:00
5260217537 Sync docs with new boards 2018-01-03 19:46:44 +02:00
62235ef32d Sync examples 2018-01-03 18:59:41 +02:00
ec40dcada7 Custom firmware/program name in build directory 2018-01-03 18:35:25 +02:00
5e666492c3 Rename envs_dir option to build_dir in platformio.ini 2018-01-03 15:47:02 +02:00
82246a837e Change wording 2017-12-31 00:07:12 +02:00
2758e99295 Bump version to 3.5.1a1 2017-12-29 20:51:20 +02:00
7354515845 Fix project generator for CLion IDE 2017-12-29 20:50:17 +02:00
d58c392930 Typo fix in docs 2017-12-28 20:38:08 +02:00
86cb2efd64 Sync docs 2017-12-28 20:36:57 +02:00
b307855207 Fix typo in docs 2017-12-28 20:35:24 +02:00
3ad4ff02e8 Typo fix 2017-12-28 18:57:17 +02:00
4ef3818482 Merge branch 'release/v3.5.0' 2017-12-28 17:26:12 +02:00
0082dc43a3 Merge branch 'release/v3.5.0' into develop 2017-12-28 17:26:12 +02:00
755ade05c6 Bump version to 3.5.0 (issue #1260, issue #781, issue #778, issue #463, issue #1236, issue #1235, issue #953, issue #1118, issue #1107, issue #1196, issue #1179, issue #1161, issue #1126, issue #104, issue #1033, issue #1034, issue #1175, issue #1173, issue #1155, issue #1188, issue #1111, issue #1153, issue #1150, issue #1145, issue #1139, issue #1137, issue #1170, issue #1157, issue #1102, issue #1105, issue #1140, issue #1154, issue #1066, issue #1038, issue #1054, issue #1055, issue #1061, issue #1017) 2017-12-28 17:25:49 +02:00
12e4318de7 Don't follow redirects when checking internet connection 2017-12-28 17:15:34 +02:00
34e9063ddd Use "paged" links for docs 2017-12-28 16:58:15 +02:00
2315b08909 PIO Home docs 2017-12-28 16:51:18 +02:00
9c9a40a531 Add GitHub to PING_INTERNET_IPS list 2017-12-28 15:01:18 +02:00
ac4b485521 Fix issue with non-ascii path when printing LDF Tree in verbose mode 2017-12-28 14:27:08 +02:00
f13bf35dbd Bump version to 3.5.0rc17 2017-12-28 01:11:54 +02:00
012cb85e31 Allow libraries with the same folder name 2017-12-28 00:19:17 +02:00
62ee8066c2 Handle incompatibility between PIO Core and PIO Core+ 2017-12-27 22:05:56 +02:00
fc064aaf05 Support the latest arrow package 2017-12-27 21:38:03 +02:00
0516cd74e1 Check system compatibility for package 2017-12-27 21:36:45 +02:00
5b7a0e6997 Bump version to 3.5.0rc16 2017-12-27 19:57:57 +02:00
ad08ed8d12 Improve support for partial package versions 2017-12-27 19:37:26 +02:00
55d4fc23d0 Use "path" instead of "device" for logical devices 2017-12-27 16:02:36 +02:00
e29ecb47a5 Skip mDSN services with wrong encoding 2017-12-23 22:59:49 +02:00
c96c1f2b2f Bump version to 3.5.0rc15 2017-12-23 21:05:05 +02:00
fab4f00ad4 Reformat exceptions 2017-12-23 19:48:16 +02:00
adaa3757ac Switch to newly created "contrib-pysite" 2017-12-23 13:06:38 +02:00
2eb7d0e8be temporary switch to old "pysite-pioplus" 2017-12-19 17:59:49 +02:00
d16d715898 Bump version to 3.5.0rc14 2017-12-19 17:22:16 +02:00
1171cb204c Fix broken syntax 2017-12-19 16:50:09 +02:00
d70a90f1d5 Explain that no need to use sudo pio ... 2017-12-19 15:49:44 +02:00
06574e3066 Do not update automatically Core packages while upgrading PIO Core 2017-12-19 15:38:32 +02:00
39dfbbdd87 Don't create "packages" directory when there are no packages isntalled 2017-12-19 15:24:23 +02:00
7b8c68c934 Show error information when permissions are broken to PIO home dir 2017-12-19 15:05:41 +02:00
6d81c230a5 Bump version to 3.5.0rc13 2017-12-19 14:48:07 +02:00
a6c1869eb2 Depend on "zeroconf" from "contrib-pysite" 2017-12-19 14:47:31 +02:00
0c3f2b54ed Bump version to 3.5.0rc12 2017-12-19 12:42:18 +02:00
c6abdf8206 Check zeroconf installation before adding to setuptools 2017-12-19 12:41:56 +02:00
9f2875fcd7 Update changelog with missed records 2017-12-19 01:55:51 +02:00
78b296f2ec Update changelog 2017-12-19 01:49:25 +02:00
903ad6c6f8 Bump version to 3.5.0rc11 2017-12-19 01:42:10 +02:00
9441f776cc Handle missed dependency and provide a help how to find it using PlatformIO Library Registry // Resolve #781 2017-12-19 01:41:18 +02:00
5dd97a35cc Reinstall/redownload package with a new `-f, --force` option // Resolve #778 2017-12-19 00:51:35 +02:00
31814b5122 Extend "pio device list" command with new options to list logical devices and multicast DNS services // Resolve #463 2017-12-18 21:31:49 +02:00
724135f40e Docs: Simplify solution for "PackageManager is unable to install tool" 2017-12-17 01:58:43 +02:00
cbb7db552a Add contents for "FAQ: Install PIO Core Shell Commands" 2017-12-17 01:23:40 +02:00
cdf4639c97 Remove duplicate package versions from result 2017-12-16 20:50:25 +02:00
170917a927 Sync supported boards and frameworks 2017-12-16 19:19:08 +02:00
efceb5db72 Explain that we need Internet connection to install all dependencies 2017-12-16 17:40:56 +02:00
cee2da7448 Bump version to 3.5.0rc10 2017-12-16 16:16:07 +02:00
3d8183a2e1 LDF: handle "include" folder per project; fix issue with header files // Resolve #1235 2017-12-16 15:38:13 +02:00
25341d1ec7 Bump version to 3.5.0rc9 2017-12-16 01:07:18 +02:00
05081561c3 Minor fixes 2017-12-16 01:07:03 +02:00
abbba7fe2e Don't use PIOBUILDFILES for LDF 2017-12-15 23:51:13 +02:00
269935726d Check all URL parsed args before installing a package 2017-12-15 23:36:23 +02:00
56aeff87dd Typo fix 2017-12-15 22:31:35 +02:00
42fb589369 Refactor PyLint "inconsistent-return-statements" 2017-12-15 22:16:37 +02:00
bff590e207 Search for libraries used in test // Resolve #953 2017-12-15 21:48:20 +02:00
0933e46a58 Update history 2017-12-15 14:09:07 +02:00
1a7429a1ef Fix "get-platformio.py" script which hangs on Windows 10 // Resolve #1118 2017-12-15 13:47:44 +02:00
fd0b45afdb Use short version of a link for IOError exception 2017-12-15 02:42:38 +02:00
3d67535a9e Bump version to 3.5.0rc8 2017-12-15 02:12:04 +02:00
0eb67a7b61 Handle unknown platform when uninstall/update 2017-12-15 02:01:03 +02:00
75774ad9fa Compress exception report 2017-12-15 01:39:10 +02:00
7b6ecf4e45 Fix broken authentication via PIO Home // Resolve #1229 Resolve #1230 Resolve #1231 2017-12-15 00:22:40 +02:00
ca8bc3819f Add "include" folder for project’s header files // Resolve issue #1107 2017-12-14 22:02:41 +02:00
0bd103a46d YAPF 2017-12-14 22:01:59 +02:00
736c6a9a1e Sort all package versions using SemVer rules 2017-12-14 21:20:08 +02:00
ef00ecd7f1 Test IPs which used for testing internet connection 2017-12-14 20:18:19 +02:00
70b63d8618 Bump version to 3.5.0rc7 2017-12-14 20:05:50 +02:00
a632583f89 Catch IOError for VSCode Terminal 2017-12-14 20:05:06 +02:00
15bb626e78 Docs: explain about VSCode known issue: "PackageManager is unable to install tool" 2017-12-14 18:26:45 +02:00
bc0d1f06e0 Ensure that PIO Home works without Internet connection // Resolve #1179 2017-12-14 16:52:44 +02:00
bd611bbee8 Allow to change default projects location // Resolve #1161 2017-12-14 16:52:13 +02:00
2522d19453 Fix issue when API cache is turned off 2017-12-14 14:55:04 +02:00
5c4b5c2270 Don't export PIO Core Python's PATH 2017-12-13 22:15:37 +02:00
2d0ac1a9c2 Export PYTHONPATH to PIO Core+ 2017-12-13 20:05:39 +02:00
0f37e15b6c Improve off-line mode // Resolve #1126 2017-12-13 18:14:01 +02:00
3d0f0659ae Rename --develop to --dev option for upgrade command 2017-12-13 13:42:16 +02:00
02a263fdce Bump version to 3.5.0rc6 2017-12-13 01:32:19 +02:00
f7815d6c9b Check PIO Core updates after reset of time counter // Issue #1126 2017-12-13 01:31:41 +02:00
786dd8fe18 Implement "--develop" option for "upgrade" command // Resolve #104 2017-12-13 01:23:18 +02:00
f9b9ed317d Export built-in GCC macros for IDEs 2017-12-13 00:59:51 +02:00
0394e43ba4 Remove caching from TravisCI template 2017-12-12 21:35:48 +02:00
3b1fa572fa Handle unicode errors 2017-12-04 16:18:45 +02:00
ea99701172 Bump version to 3.5.0rc5 2017-12-03 02:29:14 +02:00
e329688954 Update PIO Home to 0.4.0 // Resolve #1034 2017-12-03 02:25:49 +02:00
18b10a7fbf Raise exception when try to load non-PIO project 2017-12-03 02:15:49 +02:00
05069f7ac6 Bump version to 3.5.0rc4 2017-12-01 20:53:39 +02:00
1b1453808f Merge branch 'feature/travis-ci' into develop 2017-11-30 14:06:05 +02:00
d0e32ebcb5 CI OSX: Don't upgrade system Python packages 2017-11-30 02:05:14 +02:00
ad48b85a44 Fix sudo command for OSX CI 2017-11-30 00:18:11 +02:00
75160bb231 Better handling of errors from VCS GIT 2017-11-29 22:46:57 +02:00
4b1716e42b CI: Install PIP for macOS build 2017-11-29 22:27:03 +02:00
10d21595c6 Fix issue when board is not specified and "idedata" target is called 2017-11-29 22:22:31 +02:00
f922fac9d9 Handle espressif as espressif8266 dev/platform for LDF 2017-11-29 18:30:00 +02:00
5846566bbb Bump version to 3.5.0rc3 2017-11-29 16:24:47 +02:00
8f97181ea7 Add "__GNUC__" macro by default for VSCode
https://github.com/platformio/platformio-vscode-ide/issues/54
2017-11-29 16:07:11 +02:00
3c6bd9824e Handle old "espressif" platform name for LDF 2017-11-29 15:32:38 +02:00
1b0776167c Bump version to 3.5.0rc2 2017-11-27 21:05:40 +02:00
f5f3cd85d8 Add support for Git scp-like syntax 2017-11-27 21:04:51 +02:00
79b7974f35 Strip SHA1 sum because @bintray returns wrong value 2017-11-27 14:05:04 +02:00
32c92eec95 Add link to LDF docs 2017-11-27 01:32:36 +02:00
7ec90ac23b Bump version to 3.5.0rc1 2017-11-27 00:20:31 +02:00
bab8ad088e Parse library source file in pair with a header when they have the same name // Resolve #1175 2017-11-27 00:01:24 +02:00
46acad952e Parse source files by header name in default LDF mode // Issue #1175 2017-11-26 20:17:38 +02:00
200cbae177 Experimental support for parsing source file in pair with a header when they have the same name // Issue #1175 2017-11-26 18:51:08 +02:00
d8ee64a545 Fix tests 2017-11-26 01:02:21 +02:00
7b324ebc3c Bump version to 3.5.0b6 2017-11-25 23:55:13 +02:00
02d9272d2a Depend on Arrow 0.10.0 (issue with "backports.functools-lru-cache" for PIO Core+) 2017-11-25 23:54:50 +02:00
9fc5aecb64 Add option to configure library Compatible Mode using library.json 2017-11-25 21:51:16 +02:00
5ca472050c Typo fix 2017-11-25 20:16:37 +02:00
dcab855d2c Fix PyLint 2017-11-25 19:59:03 +02:00
0c9c6d1092 Remove debug code 2017-11-25 19:25:07 +02:00
301b8dc649 Bump version to 3.5.0b5 2017-11-25 19:22:47 +02:00
547e983a86 Improved handling of library dependencies defined as VCS or SemVer in platformio.ini // Resolve #1155 2017-11-25 19:22:00 +02:00
9b514ba194 Remove temporary hook for Arrow deps 2017-11-25 19:06:38 +02:00
37a2ccedbd Temporary fix for Arrow with a missing deps to backports.functools-lru-cache 2017-11-25 15:11:06 +02:00
a983f60fa0 Bump version to 3.5.0b4 2017-11-25 01:12:49 +02:00
fc96806e68 Update docs for ESP32 with custom options 2017-11-25 01:02:27 +02:00
53b37216cc Improve support for VCS packages 2017-11-25 00:31:16 +02:00
d07833e010 Include TizenRT to docs 2017-11-24 20:04:18 +02:00
5b5387d97b Sync docs with the latest added hardware/software 2017-11-24 15:36:37 +02:00
1c20efe9d1 Improve support for dependency with scp-like syntax 2017-11-22 21:38:14 +02:00
8b4104bf5b YAPF 2017-11-22 21:09:16 +02:00
448e0f27b6 Merge branch 'feature/debug-blackmagic' into develop 2017-11-08 11:34:22 +02:00
02db510048 Check serial device description when looking for GDB port 2017-11-08 11:22:44 +02:00
ce9c563c9f Bump version to 3.5.0b3 2017-11-08 00:39:25 +02:00
4c170b7934 Ensure real dev/platform name before build process // Resolve #1170 2017-11-08 00:38:19 +02:00
d1a2dba68c Integration with Jenkins CI 2017-11-07 23:47:23 +02:00
5d2867d8a9 Automatically detect BlackMagic probe GDB port 2017-11-07 00:10:48 +02:00
4504a65b92 Add Black Magic Probe rules 2017-11-04 00:38:49 +02:00
25f52917ef Override VSCode IntelliSense mode with clang-x64 2017-11-03 23:38:09 +02:00
75770bcedf Bump version to 3.5.0b2 2017-11-03 23:11:44 +02:00
1c9fe4561a Terminate PIO Home servers when upgrade PIO Core // Issue #1132 2017-11-03 23:10:39 +02:00
909b773f6d Bump version to 3.5.0b1 2017-11-03 00:51:28 +02:00
0343dc0785 Drop flake8 2017-11-03 00:47:00 +02:00
b670ab4888 Initial support for non-ascii locales 2017-11-02 23:14:32 +02:00
f85202d64c Bump version to 3.5.0a17 2017-11-01 14:14:03 +02:00
e5e5ebb7db YAPF formatter 2017-11-01 14:10:32 +02:00
86de58b9e1 Fix missing toolchain include paths for project generator // Resolve #1154 2017-11-01 14:09:06 +02:00
675cd456b6 New development platform - Samsung ARTIK 2017-09-27 19:28:53 +03:00
9fe581e425 Update release notes 2017-09-27 19:03:04 +03:00
a0626ac958 Hint user to delete file manually when exception is raised 2017-09-24 01:28:41 +03:00
1fab2a5bec Bump version to 3.5.0a16 2017-09-24 00:33:35 +03:00
d9ae367281 Improve archive unpacker 2017-09-24 00:33:12 +03:00
837b040761 Bump version to 3.5.0a15 2017-09-22 01:22:41 +03:00
71afea8d80 Expand user folder for lib_extra_dirs 2017-09-22 01:22:21 +03:00
7c9989d999 Fix tests for "platform" command 2017-09-21 23:57:55 +03:00
2e2b1fda9c Bump version to 3.5.0a14 2017-09-21 21:58:37 +03:00
25da978fee Add support for "author" field in library.json manifest // Resolve #1055 2017-09-21 15:07:38 +03:00
c677f24d8e Sync docs 2017-09-20 18:49:19 +03:00
77fe1e8184 Use -ggdb3 instead of -ggdb by default 2017-09-18 14:06:16 +03:00
377008ee08 New Microchip PIC32 boards 2017-09-17 02:21:59 +03:00
22fb89e56a Fix tests 2017-09-17 02:18:35 +03:00
68c56e042c Bump version to 3.5.0a13 2017-09-17 01:33:29 +03:00
16c242e7fa Better parsing of F_CPU 2017-09-17 01:33:04 +03:00
c9e1ae2548 Bump version to 3.5.0a12 2017-09-16 16:36:09 +03:00
fc7f1c0728 Fix platforms, packages, and libraries updating behind proxy // Resolve #1061 2017-09-16 16:35:35 +03:00
aa1c7609d2 Bump version to 3.5.0a11 2017-09-16 01:00:29 +03:00
998f4ed6e6 Use VCS directly with "platform" option in configuration file 2017-09-16 00:57:36 +03:00
33242a02ce Bump version to 3.5.0a10 2017-09-13 17:39:41 +03:00
7963ce2cdd Do not warn about "custom_" options in configuration file 2017-09-13 17:38:42 +03:00
b4159f9144 Docs: Update instruction how to install Espressif staging version 2017-09-09 23:03:15 +03:00
674aa5c4d8 Decrease API cache timeouts 2017-09-09 20:57:25 +03:00
e176e9922a Sync docs 2017-09-07 20:30:48 +03:00
fd98aa0ff8 Fix PyLint warning 2017-09-06 20:57:56 +03:00
f24e97e933 Skip missing package when checking for updates 2017-09-06 14:37:04 +03:00
a934efa90a Sync docs 2017-09-06 02:04:06 +03:00
a0cae2b1a6 Update docs for PIO IDE for Atom 2017-09-05 19:40:11 +03:00
274c1a40a5 Bump version to 3.5.0a9 2017-09-05 14:42:56 +03:00
059a408e95 Merge branch 'feature/prepend-python-pioplus' into develop 2017-09-05 14:42:02 +03:00
f4c6919800 Don't verify SSL certificates for Python < 2.7.9 2017-09-05 14:23:49 +03:00
7301b9e808 Prepend Python's binary folder before calling PIO Core+ 2017-09-05 14:13:00 +03:00
113746dc74 Introduce "get_all_boards" API to PlatformManager 2017-09-03 22:40:00 +03:00
95aaca5e02 Do not skip fixed packages with custom requirements 2017-09-03 20:58:48 +03:00
ed6b196459 Bump version to 3.5.0a8 2017-09-02 18:33:56 +03:00
34ed4678d7 Moved configuration code to a separate function, re-use it for PIO Core+ 2017-09-02 18:02:24 +03:00
a127251107 Catch click's IOError for VSCode Terminal 2017-09-02 17:58:35 +03:00
b55b80ecc8 Better catching of IOError for VSCode/Colorama 2017-09-02 16:23:24 +03:00
68c75735f4 Bump version to 3.5.0a7 2017-09-02 15:39:53 +03:00
9b66abf5ef Fix issue with "IOError" in VSCode when processing a project 2017-09-02 15:39:32 +03:00
ccd650dda0 Fix invalid params order when installing PIO Core without PIP Cache 2017-09-02 14:43:08 +03:00
3afac476e5 Docs: Remove Crisp chat 2017-09-01 20:27:24 +03:00
8f7483cddf Update VSCode docs 2017-09-01 14:31:11 +03:00
3b5c73b1a3 Bump version to 3.5.0a6 2017-09-01 00:39:17 +03:00
04ec65df3e Minor fixes 2017-08-31 23:12:02 +03:00
49244072c4 Improve fetching of logical disks 2017-08-31 20:56:25 +03:00
3fe9ea1b01 Bump version to 3.5.0a5 2017-08-31 18:35:15 +03:00
a55ccb2b28 Docs: Add CI for GitLab 2017-08-31 18:33:17 +03:00
01a6ae656f Depend on new PIO Home 0.2.0 2017-08-31 18:32:52 +03:00
2b7b852a68 Update VSCode docs 2017-08-29 14:16:30 +03:00
b12c4d171e Sync docs 2017-08-26 16:51:27 +03:00
3ce7104542 Fix broken links 2017-08-23 21:46:31 +03:00
297c173418 Docs: Fix invalid hotkey for VSCode Tasks 2017-08-23 17:05:11 +03:00
22733ea110 Docs: Minor fix 2017-08-22 19:52:12 +03:00
845991f1d3 J-Link as debugger and uploader 2017-08-18 22:41:11 +03:00
e6faed5dd9 Update history 2017-08-18 01:26:31 +03:00
44909f9ce8 Switch to "develop" version of PIO Core Installer while it isn't merged to "master" // Resolve #1017 2017-08-18 01:23:15 +03:00
4ff1d640b3 Minor fixes 2017-08-17 23:55:42 +03:00
743de42484 Add "test_ignore" to known options list 2017-08-17 17:18:23 +03:00
04c381d440 Sync docs and examples 2017-08-17 15:33:24 +03:00
bda4b5d264 Docs: Create Advanced Scripting section for platformio.ini 2017-08-16 15:33:36 +03:00
3f13821c43 Update history 2017-08-16 15:12:45 +03:00
e60e076d16 Better explanation about lib_extra_dirs 2017-08-16 15:10:56 +03:00
541993c06b Implement throttle for API calls 2017-08-15 22:57:20 +03:00
3d5114655f Docs: Embedded Testing with PlatformIO - Part 2 2017-08-15 19:33:35 +03:00
3229933ed0 Minor improvements 2017-08-14 23:58:12 +03:00
d7d66fd4a6 Improve fetching logical disks 2017-08-14 15:27:12 +03:00
4a7cd5be6a Update docs for VSCode 2017-08-13 00:08:49 +03:00
fd56e5cec9 Docs: New boards, typo fixes 2017-08-12 19:16:36 +03:00
2cb7fcca9a Bump version to 3.5.0a4 2017-08-10 16:04:51 +03:00
9b2e7bf927 Fix broken installer script 2017-08-09 23:43:31 +03:00
d913fb5600 Call pip as module 2017-08-09 23:02:33 +03:00
6bf42f90ed Docs: Short titles in menu 2017-08-09 17:59:28 +03:00
51ff2b65f4 Bump version to 3.5.0a3 2017-08-08 14:44:25 +03:00
c05e1f7c9b Ignore missed packages in new development platform 2017-08-07 19:33:13 +03:00
4700419590 Bump version to 3.5.0a2 2017-08-07 17:38:21 +03:00
5f320cc5c8 Introduce PIO Home 2017-08-07 17:38:05 +03:00
351aaa3974 Sync submodules 2017-08-05 19:19:43 +03:00
327d42d02d Sync docs 2017-08-03 16:56:25 +03:00
bbcc79208c Bump version to 3.5.0a1 2017-08-02 22:17:21 +03:00
578dfa40aa Ignore only C/C++ properties for VSCode extension 2017-08-02 22:16:41 +03:00
a43c6c6b9e Merge branch 'release/v3.4.1' into develop 2017-08-02 16:51:46 +03:00
5f99dd620d Merge branch 'release/v3.4.1' 2017-08-02 16:51:45 +03:00
e959710d6d Version bump to 3.4.1 (issues #891, #982, #993, #1000, #1001, #1003 ) 2017-08-02 16:51:19 +03:00
f0f1d0a61a Bump version to 3.4.1rc1 2017-08-02 01:08:07 +03:00
7f63928d21 New lib_archive option to control library archiving and linking behaviour // Resolve #993 2017-08-02 01:06:06 +03:00
b929e452b0 Add "inc" folder automatically to CPPPATH when "src" is available (works for project and library) // Resolve #1003 2017-08-01 14:45:42 +03:00
b4f927a84d Sync docs: add new boards 2017-08-01 01:45:48 +03:00
fe4a72edd0 Bump version to 3.4.1b1 2017-08-01 00:35:16 +03:00
5f4a10086f Merge branch 'feature/samba-due-issue' into develop 2017-08-01 00:34:01 +03:00
d5baa153a5 Fix an issue when can not upload firmware to SAM-BA based board (Due) 2017-08-01 00:33:51 +03:00
3f96530c32 Sync docs: Add example how to build a custom HEX from ELF 2017-08-01 00:21:57 +03:00
861659e890 Wait for 400ms after touching serial port (fix SAM-BA issue) 2017-08-01 00:12:05 +03:00
cd5b88dd1f Automatically update PIO Core packages when it is possible 2017-07-31 19:38:42 +03:00
06b49ec3ec Some improvements 2017-07-31 19:05:03 +03:00
4944731dc6 Sync docs: Split build flags into multiple lines 2017-07-31 18:25:57 +03:00
5d31d6825b Export board's connectivity 2017-07-28 00:56:02 +03:00
0099b037f3 Refactor docs for Unit Testing 2017-07-27 19:07:46 +03:00
9994ed8b5e Check context arguments before comparison // Resolve #1000 2017-07-27 15:50:54 +03:00
954357bdd2 Update links to ESP8266 docs 2017-07-25 20:00:27 +03:00
c7f5629f82 Fix links in docs 2017-07-25 19:19:52 +03:00
dfe769c92e Add support for Controllino PLC 2017-07-25 13:22:55 +03:00
53017b24d1 VSCode configuration 2017-07-24 17:37:16 +03:00
f13537cabb YAPF 2017-07-24 17:35:41 +03:00
16ea8f29a1 Update docs with new boards 2017-07-21 22:07:11 +03:00
e708b74507 Document Task Runner for VSCode 2017-07-20 13:36:13 +03:00
f61c7f6030 Sync examples 2017-07-19 13:53:58 +03:00
1260859c42 Sync examples 2017-07-18 23:15:09 +03:00
ec9324d77f Sync examples with mbed 5.5 2017-07-18 22:47:39 +03:00
d66b1780ce Bump version to 3.4.1a6 2017-07-17 13:13:42 +03:00
35cab82605 Remove static tasks for VSCode 2017-07-16 21:28:54 +03:00
12222c0f42 Improve docs for advanced scripting 2017-07-14 23:56:45 +03:00
12ec11c7e2 Sync docs 2017-07-14 14:22:38 +03:00
c926ca389c Sync examples 2017-07-14 14:05:38 +03:00
e01c0a1eff Sync docs 2017-07-14 02:10:12 +03:00
8008f87ffa Manage project libraries with "--storage-dir" option 2017-07-13 00:51:04 +03:00
91d3a8ffad Improve docs for PIO Debugger 2017-07-10 01:28:19 +03:00
309d3a45d6 New "forceUploadAndMonitor" option for PlatformIO IDE for VSCode 2017-07-05 21:22:33 +03:00
ebe0d41b77 Bump version to 3.4.1a5 2017-07-05 20:38:55 +03:00
6403cf0c8b New task "PlatformIO: Monitor" for VSCode 2017-07-05 20:38:28 +03:00
7964aed453 New boards by RushUp 2017-07-04 19:30:39 +03:00
97866cf44d Correct default values for auto_update_libraries/platforms 2017-07-04 14:24:40 +03:00
4eb92ff2e3 Refactor pioNav for docs 2017-07-04 01:17:56 +03:00
0e8fb1ba83 Bump version to 3.4.1a4 2017-07-03 13:36:51 +03:00
8741f37831 Minor improvements 2017-07-03 13:35:39 +03:00
68ccabda56 Update history 2017-07-01 22:17:37 +03:00
a0cd0bc189 Fix an issue with a custom unit testing transport 2017-07-01 22:00:25 +03:00
aadb186054 Escape spaces in task command for VSCode Task Runner 2017-07-01 21:54:04 +03:00
2c232f2f3f Standalone IDEs Integration 2017-07-01 20:34:34 +03:00
f85c894b52 Move Pricing before Docs 2017-07-01 20:24:03 +03:00
fb432da26b Bump version to 3.4.1a3 2017-07-01 19:24:41 +03:00
e8da7b4673 Depend on PIO Core Plus v0.9.1 2017-07-01 19:24:10 +03:00
53906c49cb Refactor PIO Account docs 2017-07-01 14:16:26 +03:00
b774bd6a55 Improve platformio.ini example 2017-06-30 22:07:04 +03:00
cefc2fa21c Cosmetic improvements 2017-06-30 01:35:54 +03:00
546993b12c Fix PyLint Warning 2017-06-30 01:23:52 +03:00
08ab80187c Mode PIO Core Dev installation on upper level 2017-06-30 00:24:35 +03:00
bf48643865 Bump version to 3.4.1a2 2017-06-30 00:20:27 +03:00
35a91dbd57 Pre/Post extra scripting for advanced control of PIO Build System // Resolve #891 2017-06-30 00:15:49 +03:00
7a56ec614c Added monitor_* options to white-list for Project Configuration File “platformio.ini” // Resolve #982 2017-06-29 21:27:38 +03:00
7d2728845e Use a root of library when filtering source code using library.json and srcFilter field 2017-06-29 21:23:06 +03:00
94a834ecc4 Use a root of library when filtering source code using library.json and srcFilter field 2017-06-29 21:22:44 +03:00
46774466db Fix contact url 2017-06-29 19:32:38 +03:00
671eff5012 Library Manager in PlatformIO IDE for Atom 2017-06-29 01:13:20 +03:00
a3e7535db5 Simplify index page of docs 2017-06-28 19:33:53 +03:00
f7ee7e2e8c Add Changelog for PIO IDE for Atom and VSCode 2017-06-28 18:29:56 +03:00
7a04061d6d Typo fix 2017-06-28 14:05:28 +03:00
7827994791 Do not ask for board ID when initialize project for desktop platform 2017-06-28 01:38:20 +03:00
dae290ad2d Bump version to 3.4.1a1 2017-06-28 01:01:27 +03:00
61fc7d8589 Fix issue when can not load broken PIO Core state 2017-06-28 01:01:03 +03:00
0deb623ad5 Add link to PIO IDE packages 2017-06-27 01:56:03 +03:00
ef8aeeb5f0 Add support for Adafruit Feather M0 Express & Metro M0 Expresss boards 2017-06-27 01:17:34 +03:00
2695c985a4 Remove platforms related history from the Core 2017-06-27 01:03:26 +03:00
fcfdc5c206 Sync docs 2017-06-27 00:05:23 +03:00
3a96b460df Merge branch 'release/v3.4.0' 2017-06-26 19:58:30 +03:00
78616bf06f Merge branch 'release/v3.4.0' into develop 2017-06-26 19:58:30 +03:00
43ebff2a84 Bump version to 3.4.0 2017-06-26 19:58:21 +03:00
7afbbadef1 Fix URL for PIO Unified Debugger 2017-06-26 19:53:51 +03:00
e26372075d Update README 2017-06-26 19:51:57 +03:00
d0f6c69135 Minor cleanups 2017-06-26 19:18:41 +03:00
b1780c54db Depend on PIO Core+ v0.9 2017-06-26 19:16:44 +03:00
7cc51035aa Add "Upload and Monitor" task for VSCode 2017-06-26 18:13:09 +03:00
820efaeb21 Switch to stable PlatformIO 2017-06-26 18:04:40 +03:00
1ee53137ec Update udev rules guide 2017-06-26 17:51:11 +03:00
01afcb1c9e New monitor target which allows to launch Serial Monitor automatically after successful “build” or “upload” operations // Resolve #788 2017-06-26 17:14:38 +03:00
574bbd1692 Update custom J-Link debug configuration 2017-06-24 19:45:47 +03:00
0c06982d75 Filter PIO Unit Testing tests using a new test_filter option in "platformio.ini" or platformio test –filter command // Resolve #934 2017-06-24 18:40:30 +03:00
8f4c09a600 Better escaping for package file names 2017-06-24 16:07:40 +03:00
1c5b08de59 Fixed cloning a package (library) from a private Git repository with custom user name and SSH port // Resolve #925 2017-06-24 15:45:48 +03:00
d8a0272bec Escape non-valid file name characters when installing a new package (library) // Resolve #985 2017-06-24 15:20:33 +03:00
f6960a0f98 Update docs for Segger J-Link Tool 2017-06-24 14:26:14 +03:00
2849d78ece Add requirements for Python and PIO Core+ 2017-06-24 02:13:03 +03:00
954ff8dca0 Bump version to 3.4.0rc1 2017-06-24 01:32:05 +03:00
93db0fa064 Improve WaitForNewSerialPort for atmega32u4 based boards 2017-06-24 01:29:53 +03:00
839fe8e02f Integrate PIO Unified Debugger with Sublime Text 2017-06-24 00:06:58 +03:00
60b668342f Integrate PIO Unified Debugger with Eclipse 2017-06-23 22:00:58 +03:00
178cf35a43 Improve docs for CLion 2017-06-23 16:06:22 +03:00
adf30f3640 Reorganize Tutorials and Demo for PIO Core 2017-06-23 15:38:24 +03:00
2793059c70 Refactor library manager navigation 2017-06-23 14:48:01 +03:00
6e7de3a01c Sort platforms and frameworks by name 2017-06-23 14:08:46 +03:00
77a14f3c7b Note about "dialout" group for Ubuntu/Debian users; udev rule for USBasp V2.0 // Resolve #979 2017-06-23 13:53:36 +03:00
a9543037b2 Add default environment to each example 2017-06-23 00:14:16 +03:00
902b8e0a52 Add example with using pyOCD for CMSIS-DAP based boards 2017-06-22 23:23:44 +03:00
613d92c32f Add source code to STM32Cube tutorial 2017-06-22 14:23:09 +03:00
ebf9607c99 Cosmetic changes 2017-06-22 01:26:24 +03:00
89dc767a1c Introduce Tutorials 2017-06-22 01:14:23 +03:00
cb54910529 Add configuration section for Unit Testing 2017-06-21 01:03:09 +03:00
f78837d467 Custom transport for Unit Testing 2017-06-20 18:48:52 +03:00
6ad1ce5239 Improve docs for Platforms and Framworks 2017-06-20 16:57:47 +03:00
707384aeed Cosmetic updates for "Contents" 2017-06-20 15:41:43 +03:00
e3b976e189 Split docs for Project Configuration File into multiple subpages 2017-06-20 15:24:20 +03:00
8c7fa61f62 Fix broken image for VSCode installation 2017-06-19 11:39:31 +03:00
0bdb877fe1 Temporary use development version of PIO Core 3.4 2017-06-14 19:55:44 +03:00
fddcc3c965 Fix SSL SNI issue for Python < 2.7.9 2017-06-14 19:41:36 +03:00
8dde7e2efb Cosmetic changes to icons 2017-06-14 19:03:52 +03:00
2f40f32988 Remove Project IDE examples 2017-06-14 14:34:15 +03:00
bb0063d5cf Fix url for logo in docs 2017-06-13 21:07:58 +03:00
dcdd552856 Fix tests after examples reorganization 2017-06-13 21:01:23 +03:00
c4f23be1dc Fix tests after examples reorganization 2017-06-13 20:39:21 +03:00
571fe4dc04 Reorganize examples 2017-06-13 16:25:55 +03:00
1827223b1c Update docs for Atom/VSCode; other improvements 2017-06-11 01:57:58 +03:00
b2c37311b9 Minor updates 2017-06-09 11:45:42 +03:00
70e4181b17 Bump version to 3.4.0b12 2017-06-09 01:40:50 +03:00
e8d7aae53c Use Terminal Runner for VSCode 2017-06-09 01:40:23 +03:00
41312ef86d Bump version to 3.4.0b11 2017-06-07 02:33:37 +03:00
b04fc327c0 Configure Serial Port Monitor from platformio.ini // Resolve #787 2017-06-07 02:32:25 +03:00
a37eb9868f Skip broken PySerial 3.3 2017-06-06 21:06:05 +03:00
4d1a135d76 Apply YAPF 2017-06-05 16:05:05 +03:00
45e75f7473 Copyright (c) 2014-present PlatformIO <contact@platformio.org>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
2017-06-05 16:02:39 +03:00
8127e8b2ff Update docs for VSCode 2017-06-05 01:46:31 +03:00
d30b8fffa1 Bump version to 3.4.0b10 2017-06-02 02:34:52 +03:00
52f0e556e2 Do not overwrite workspace settings for VSCode 2017-06-02 02:34:10 +03:00
0376a92ebb FAQ: UnicodeDecodeError: Non-ASCII characters found in build environment 2017-06-01 21:35:26 +03:00
5da5bd43e4 Ensure that package exists 2017-06-01 19:53:05 +03:00
e2811a4a28 Check PIO download storage for "Internet ON" 2017-06-01 19:47:50 +03:00
a53a38b5dd FAQ: ‘platformio’ is not recognized as an internal or external command 2017-06-01 19:21:32 +03:00
6502cf5552 Fix issue with INO to CPP converter and multiline strings 2017-06-01 15:14:52 +03:00
aed6d9a91b Nordic nRF52 & Maxim Integrated development platforms 2017-05-31 22:21:25 +03:00
ff6353a1ea VSCoe task as external program 2017-05-31 00:56:05 +03:00
b6f9220f3f Minor improvements to docs 2017-05-30 22:11:09 +03:00
0c9e6ef577 Close serial port after verification 2017-05-30 19:42:32 +03:00
198dadc209 Verify that serial port is ready for connection before uploading 2017-05-30 14:06:25 +03:00
f6a3d9f474 Add link to PIO IDE for VSCode extension in marketplace 2017-05-29 20:23:12 +03:00
232a735dde Improve VSCode docs 2017-05-29 20:17:22 +03:00
2ea9af8151 Update VSCode main picture 2017-05-29 19:00:18 +03:00
1e14792ea0 Update docs for VSCode 2017-05-29 15:59:02 +03:00
908f0ba833 Bump 3.4.0b9 2017-05-29 15:41:56 +03:00
466d1b1c14 Remove C_CPP settings from VSCode 2017-05-29 13:07:25 +03:00
68d7630b44 Better path escaping 2017-05-28 13:12:59 +03:00
641c981c4b Add VSCode to PlatformIO IDE section 2017-05-28 02:59:43 +03:00
50ec9e48bf Specify particular platform for c_cpp configuration 2017-05-28 02:34:32 +03:00
801ac28c11 Update docs for VSCode 2017-05-28 02:24:14 +03:00
7637e1ad69 Normalize Windows PATHs for VSCode 2017-05-28 02:06:58 +03:00
fa24d61680 Project generator for VSCode IDE // Issue #619 Resolve #960 2017-05-28 00:30:23 +03:00
1bd159e60d Notify about multiple installations of PIO Core // Resolve #961 2017-05-27 18:43:56 +03:00
959dab4dc2 Remove requests.packages.urllib3 tracks 2017-05-27 13:20:54 +03:00
20086b0816 Note about Clang 3.9 2017-05-27 13:14:54 +03:00
e21b8a841b Merge branch 'hotfix/v3.3.1' into develop
# Conflicts:
#	HISTORY.rst
#	platformio/__init__.py
2017-05-27 12:59:06 +03:00
074e262e66 Use BinTray when checking Internet connection // Resolve #968 2017-05-27 02:35:48 +03:00
021f0323cb Bump version to 3.4.0b5 2017-05-27 01:21:56 +03:00
bb55e5bc58 Add chat button to docs 2017-05-27 01:20:32 +03:00
5d6d49f7e1 Implement “debug_load_cmd” 2017-05-27 01:10:07 +03:00
548d0692ba Bump version to 3.4.0b4 2017-05-26 01:25:46 +03:00
5d87fc3461 Project generator for VIM 2017-05-26 01:25:03 +03:00
0a254c52c0 Updated mbed framework to 5.4.5/142 2017-05-26 01:24:23 +03:00
eafa586fdc Implement a delete functionality for State & ContentCache 2017-05-26 00:45:56 +03:00
1e36731076 Update top navigation 2017-05-24 17:24:19 +03:00
d5d3bb19de Typo fix 2017-05-22 21:14:05 +03:00
d367f726ba New boards 2017-05-21 01:54:47 +03:00
cb241b703a Preload debugging firmware before debug session 2017-05-20 02:17:00 +03:00
c02d180e11 Update custom J-Link GDB example 2017-05-20 01:18:49 +03:00
90fc207bf2 Add missed “debug_tool” options 2017-05-18 21:59:42 +03:00
41f1806009 Bump version to 3.4.0b3 2017-05-18 21:52:22 +03:00
6941b822b6 Custom debugging configuration 2017-05-18 21:51:38 +03:00
5eb2fc67e5 Skip network driver when searching for mbed disk 2017-05-11 14:49:44 +03:00
c14ba16297 Fix linke to images 2017-05-10 02:06:09 +03:00
861e68ab3c Depend on a new PIO Core+ 2017-05-08 16:39:06 +03:00
4beecd62a8 Update PIO IDE main picture with Unified Debugger 2017-05-07 21:00:21 +03:00
1e2e409e8d Add info about PIO Unified Debugger 2017-05-07 20:48:38 +03:00
90cefe4809 Bump version to 3.4.0b2 2017-05-07 00:43:39 +03:00
866b3e915a Add link to PIO Unified Debugger to PIO Account page 2017-05-06 14:43:08 +03:00
2827e7dc3a Fixed issue when debugger fails with a space in path to a project // Resolve #954 2017-05-05 19:45:54 +03:00
a8da7dcfd3 Fix PyLint warning 2017-05-05 13:02:20 +03:00
70df106f57 Bump version to 3.4.0b1 2017-05-04 21:02:59 +03:00
d37c6fcdce Use root directory for PIO Home when path contains non-ascii characters // Resolve #951 Resolve #952 2017-05-04 21:02:32 +03:00
f3f8374253 A few updates for PIO Unified Debugger and PIO Account 2017-05-04 19:06:38 +03:00
a5973043b1 Allow to change account password with passed options 2017-05-04 12:31:03 +03:00
d3d87a0bfb Update history 2017-05-04 01:17:28 +03:00
c69269ea3d Offline mode for PIO Account Show command 2017-05-04 00:36:52 +03:00
30ff491a34 Remove extra delay before waiting for serial port 2017-05-03 20:33:37 +03:00
56d4d545c1 Don’t raise error when cache item has been deleted from another thread 2017-05-01 01:33:51 +03:00
884859324d User Guide (CLI) for PIO Unified Debugger 2017-04-30 01:52:06 +03:00
7d92bcdf58 Debugging tools/probes 2017-04-30 01:14:57 +03:00
ba545bfa29 Docs for “debug_tool” option 2017-04-29 02:16:11 +03:00
7c31a9c9b8 Some correction for debug options 2017-04-29 01:58:35 +03:00
13cd09d161 PIO Unified Debugger 2017-04-29 01:42:23 +03:00
d55f28e3d7 Bump version to 3.4.0a8 2017-04-28 19:00:12 +03:00
1e5df747cd Handle `env_default` in "platformio.ini" when re-initializing a project // Resolve #950 2017-04-28 18:10:37 +03:00
46e82e08ce Bump version to 3.4.0a7 2017-04-28 01:39:29 +03:00
9658bcdb73 The Unified Debugger 2017-04-28 01:38:25 +03:00
81c96808b6 Don’t override LED_BUILTIN with macro; sometime it is defined as static variable // Resolve #933 2017-04-27 20:53:54 +03:00
969e72c4a4 Fix issue when Library Dependency Finder (LDF) does not handle custom “src_dir” // Resolve #942 2017-04-27 20:01:17 +03:00
3d2df9f9a9 Fix linter error "unity.h does not exist" for Unit Testing // Resolve #947 2017-04-27 18:39:57 +03:00
384c3c45e4 Add “boards_dir” to known [platformio] option // Resolve #949 2017-04-27 18:30:40 +03:00
6b0467ead5 Use internal context to fetch IDE data 2017-04-27 18:28:50 +03:00
1344ab5bb6 Typo fix with account register command 2017-04-25 19:53:21 +03:00
ae3aeeca69 Update history 2017-04-24 16:25:01 +03:00
e976c617f7 Note about LDF and Dependency Finder Mode 2017-04-24 13:35:08 +03:00
a63592894c Bump 3.4.0a6 2017-04-15 21:28:23 +03:00
bd4636c98f Fix installing package from archive 2017-04-15 21:28:01 +03:00
dff3c7d093 Bump 3.4.0a5 2017-04-15 21:02:47 +03:00
d0f2aa38ca Fixed infinite dependency installing when repository consists of multiple libraries // Resolve #935 2017-04-15 20:32:11 +03:00
abb2fb7045 Add support for “.*cc” extension // Resolve #939 2017-04-15 16:51:15 +03:00
44be1dc1c7 Some fixes for new PyLint 2017-04-15 16:36:59 +03:00
64ed76762e Update Git-submodules for development platforms and libraries which were installed from repository 2017-04-15 16:19:41 +03:00
f194a1a572 Fix debug port auto-detecting 2017-04-15 12:55:34 +03:00
c7249aadf3 Generate “SRC_FILTER” on-the-fly for a custom library 2017-04-14 23:16:52 +03:00
d16fd73b05 Better detecting of mbed-enabled media disk 2017-04-14 18:05:15 +03:00
59b65ba668 Check mbed html page before uploading 2017-04-13 20:02:08 +03:00
ba17c57026 Update history 2017-04-12 20:25:43 +03:00
b5217682fd Fix multi line items for lib_deps // Resolve #931 2017-04-02 21:58:38 +03:00
a60792d20e Add temporary link to community forum for debugging discussion 2017-04-01 23:26:02 +03:00
f4c9d09020 Typo fix 2017-04-01 19:19:37 +03:00
97185fffb8 Bump 3.4.0a3 2017-04-01 15:40:52 +03:00
48ed0a508c Correct path in debug configuration 2017-04-01 14:51:57 +03:00
73f4bce99a Rename “debug_link” option to “debug_tool” 2017-04-01 14:35:55 +03:00
8055c84087 Add OpenOCD dev rules 2017-04-01 01:13:28 +03:00
7a8aff47e9 Be silent when upper level asks 2017-03-31 20:20:07 +03:00
62e755ce60 Quick fix when board doesn’t have debug configuration 2017-03-31 19:50:26 +03:00
75e1173f80 Initial support for debugging // Resolve #514 2017-03-31 18:55:19 +03:00
fe7c93d004 Multi-line support for the different options in “platformio.ini” // Resolve #889 2017-03-29 17:49:01 +03:00
d77dea5fe1 Describe how to remove registry records by Atom on Windows 2017-03-28 21:47:54 +03:00
dca2e10570 Merge branch 'release/v3.3.0' into develop 2017-03-27 14:39:43 +03:00
391 changed files with 40999 additions and 11414 deletions

View File

@ -1,21 +0,0 @@
build: off
environment:
matrix:
- TOXENV: "py27"
install:
- cmd: git submodule update --init --recursive
- cmd: SET PATH=%PATH%;C:\Python27\Scripts;C:\MinGW\bin
- cmd: pip install tox
test_script:
- cmd: tox
notifications:
- provider: Slack
incoming_webhook:
secure: E9H0SU0Ju7WLDvgxsV8cs3J62T3nTTX7QkEjsczN0Sto/c9hWkVfhc5gGWUkxhlD975cokHByKGJIdwYwCewqOI+7BrcT8U+nlga4Uau7J8=
on_build_success: false
on_build_failure: true
on_build_status_changed: true

1
.github/FUNDING.yml vendored Normal file
View File

@ -0,0 +1 @@
custom: https://platformio.org/donate

View File

@ -1,22 +1,27 @@
What kind of issue is this?
- [ ] Question. This issue tracker is not the place for questions. If you want to ask how to do
something, or to understand why something isn't working the way you expect it to, use
our Community Forums https://community.platformio.org
- [ ] **Question**.
This issue tracker is not the place for questions. If you want to ask how to do something,
or to understand why something isn't working the way you expect it to,
use [Community Forums](https://community.platformio.org) or [Premium Support](https://platformio.org/support)
- [ ] PlatformIO IDE. All issues related to PlatformIO IDE should be reported to appropriate repository
https://github.com/platformio/platformio-atom-ide/issues
- [ ] **PlatformIO IDE**.
All issues related to PlatformIO IDE should be reported to the
[PlatformIO IDE for VSCode](https://github.com/platformio/platformio-vscode-ide/issues) repository
- [ ] Development Platform or Board. All issues related to Development Platforms or Embedded Boards
should be reported to appropriate repository.
See full list with repositories and search for "platform-xxx" repository related to your hardware
https://github.com/platformio?query=platform-
- [ ] **Development Platform or Board**.
All issues (building, uploading, adding new boards, etc.) related to PlatformIO development platforms
should be reported to appropriate repository related to your hardware
https://github.com/topics/platformio-platform
- [ ] Feature Request. Start by telling us what problem youre trying to solve. Often a solution
- [ ] **Feature Request**.
Start by telling us what problem youre trying to solve. Often a solution
already exists! Dont send pull requests to implement new features without first getting our
support. Sometimes we leave features out on purpose to keep the project small.
- [ ] PlatformIO Core. If youve found a bug, please provide an information below.
- [ ] **PlatformIO Core**.
If youve found a bug, please provide an information below.
*You can erase any parts of this template not applicable to your Issue.*

53
.github/workflows/core.yml vendored Normal file
View File

@ -0,0 +1,53 @@
name: Core
on: [push, pull_request]
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.11", "3.12", "3.13"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Run "codespell" on Linux
if: startsWith(matrix.os, 'ubuntu')
run: |
python -m pip install codespell
make codespell
- name: Core System Info
run: |
tox -e py
- name: Integration Tests
if: ${{ matrix.python-version == '3.11' }}
run: |
tox -e testcore
- name: Slack Notification
uses: homoluctus/slatify@master
if: failure()
with:
type: ${{ job.status }}
job_name: '*Core*'
commit: true
url: ${{ secrets.SLACK_BUILD_WEBHOOK }}
token: ${{ secrets.SLACK_GITHUB_TOKEN }}

45
.github/workflows/deployment.yml vendored Normal file
View File

@ -0,0 +1,45 @@
name: Deployment
on:
push:
branches:
- "master"
- "release/**"
jobs:
deployment:
runs-on: ubuntu-latest
environment: production
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox build
- name: Deployment Tests
env:
TEST_EMAIL_LOGIN: ${{ secrets.TEST_EMAIL_LOGIN }}
TEST_EMAIL_PASSWORD: ${{ secrets.TEST_EMAIL_PASSWORD }}
TEST_EMAIL_IMAP_SERVER: ${{ secrets.TEST_EMAIL_IMAP_SERVER }}
run: |
tox -e testcore
- name: Build Python distributions
run: python -m build
- name: Publish package to PyPI
if: ${{ github.ref == 'refs/heads/master' }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

109
.github/workflows/docs.yml vendored Normal file
View File

@ -0,0 +1,109 @@
name: Docs
on: [push, pull_request]
jobs:
build:
name: Build Docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Build docs
run: |
tox -e docs
- name: Slack Notification
uses: homoluctus/slatify@master
if: failure()
with:
type: ${{ job.status }}
job_name: '*Docs*'
commit: true
url: ${{ secrets.SLACK_BUILD_WEBHOOK }}
token: ${{ secrets.SLACK_GITHUB_TOKEN }}
- name: Preserve Docs
if: ${{ github.event_name == 'push' }}
run: |
tar -czvf docs.tar.gz -C docs/_build html rtdpage
- name: Save artifact
if: ${{ github.event_name == 'push' }}
uses: actions/upload-artifact@v4
with:
name: docs
path: ./docs.tar.gz
deploy:
name: Deploy Docs
needs: build
runs-on: ubuntu-latest
env:
DOCS_REPO: platformio/platformio-docs
DOCS_DIR: platformio-docs
LATEST_DOCS_DIR: latest-docs
RELEASE_BUILD: ${{ startsWith(github.ref, 'refs/tags/v') }}
if: ${{ github.event_name == 'push' }}
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: docs
- name: Unpack artifact
run: |
mkdir ./${{ env.LATEST_DOCS_DIR }}
tar -xzf ./docs.tar.gz -C ./${{ env.LATEST_DOCS_DIR }}
- name: Delete Artifact
uses: geekyeggo/delete-artifact@v5
with:
name: docs
- name: Select Docs type
id: get-destination-dir
run: |
if [[ ${{ env.RELEASE_BUILD }} == true ]]; then
echo "::set-output name=dst_dir::stable"
else
echo "::set-output name=dst_dir::latest"
fi
- name: Checkout latest Docs
continue-on-error: true
uses: actions/checkout@v4
with:
repository: ${{ env.DOCS_REPO }}
path: ${{ env.DOCS_DIR }}
ref: gh-pages
- name: Synchronize Docs
run: |
rm -rf ${{ env.DOCS_DIR }}/.git
rm -rf ${{ env.DOCS_DIR }}/en/${{ steps.get-destination-dir.outputs.dst_dir }}
mkdir -p ${{ env.DOCS_DIR }}/en/${{ steps.get-destination-dir.outputs.dst_dir }}
cp -rf ${{ env.LATEST_DOCS_DIR }}/html/* ${{ env.DOCS_DIR }}/en/${{ steps.get-destination-dir.outputs.dst_dir }}
if [[ ${{ env.RELEASE_BUILD }} == false ]]; then
rm -rf ${{ env.DOCS_DIR }}/page
mkdir -p ${{ env.DOCS_DIR }}/page
cp -rf ${{ env.LATEST_DOCS_DIR }}/rtdpage/* ${{ env.DOCS_DIR }}/page
fi
- name: Validate Docs
run: |
if [ -z "$(ls -A ${{ env.DOCS_DIR }})" ]; then
echo "Docs folder is empty. Aborting!"
exit 1
fi
- name: Deploy to Github Pages
uses: peaceiris/actions-gh-pages@v4
with:
personal_token: ${{ secrets.DEPLOY_GH_DOCS_TOKEN }}
external_repository: ${{ env.DOCS_REPO }}
publish_dir: ./${{ env.DOCS_DIR }}
commit_message: Sync Docs

63
.github/workflows/examples.yml vendored Normal file
View File

@ -0,0 +1,63 @@
name: Examples
on: [push, pull_request]
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
env:
PIO_INSTALL_DEVPLATFORM_OWNERNAMES: "platformio"
PIO_INSTALL_DEVPLATFORM_NAMES: "aceinna_imu,atmelavr,atmelmegaavr,atmelsam,espressif32,espressif8266,nordicnrf52,raspberrypi,ststm32,teensy"
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Run on Linux
if: startsWith(matrix.os, 'ubuntu')
run: |
# Free space
sudo apt clean
# docker rmi $(docker image ls -aq)
df -h
tox -e testexamples
- name: Run on macOS
if: startsWith(matrix.os, 'macos')
run: |
df -h
tox -e testexamples
- name: Run on Windows
if: startsWith(matrix.os, 'windows')
env:
PLATFORMIO_CORE_DIR: C:/pio
PLATFORMIO_WORKSPACE_DIR: C:/pio-workspace/$PROJECT_HASH
run: |
tox -e testexamples
- name: Slack Notification
uses: homoluctus/slatify@master
if: failure()
with:
type: ${{ job.status }}
job_name: '*Examples*'
commit: true
url: ${{ secrets.SLACK_BUILD_WEBHOOK }}
token: ${{ secrets.SLACK_GITHUB_TOKEN }}

56
.github/workflows/projects.yml vendored Normal file
View File

@ -0,0 +1,56 @@
name: Projects
on: [push, pull_request]
jobs:
build:
strategy:
fail-fast: false
matrix:
project:
- marlin:
repository: "MarlinFirmware/Marlin"
folder: "Marlin"
config_dir: "Marlin"
env_name: "mega2560"
- smartknob:
repository: "scottbez1/smartknob"
folder: "smartknob"
config_dir: "smartknob"
env_name: "view"
- espurna:
repository: "xoseperez/espurna"
folder: "espurna"
config_dir: "espurna/code"
env_name: "nodemcu-lolin"
- OpenMQTTGateway:
repository: "1technophile/OpenMQTTGateway"
folder: "OpenMQTTGateway"
config_dir: "OpenMQTTGateway"
env_name: "esp32-m5atom-lite"
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install PlatformIO
run: pip install -U .
- name: Check out ${{ matrix.project.repository }}
uses: actions/checkout@v4
with:
submodules: "recursive"
repository: ${{ matrix.project.repository }}
path: ${{ matrix.project.folder }}
- name: Compile ${{ matrix.project.repository }}
run: pio run -d ${{ matrix.project.config_dir }} -e ${{ matrix.project.env_name }}

3
.gitignore vendored
View File

@ -1,6 +1,6 @@
*.egg-info
*.pyc
.pioenvs
__pycache__
.tox
docs/_build
dist
@ -9,3 +9,4 @@ build
coverage.xml
.coverage
htmlcov
.pytest_cache

View File

@ -1,3 +0,0 @@
[settings]
line_length=79
known_third_party=arrow,bottle,click,lockfile,pytest,requests,SCons,semantic_version,serial

View File

@ -1,23 +1,12 @@
[REPORTS]
output-format=colorized
[MESSAGES CONTROL]
# Only show warnings with the listed confidence levels. Leave empty to show
# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED
confidence=
# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
# multiple time. See also the "--disable" option for examples.
#enable=
# Disable the message, report, category or checker with the given id(s). You
# can either give multiple identifiers separated by comma (,) or put this
# option multiple times (only on the command line, not in the configuration
# file where it should appear only once).You can also use "--disable=all" to
# disable everything first and then reenable specific checks. For example, if
# you want to run only the similarities checker, you can use "--disable=all
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use"--disable=all --enable=classes
# --disable=W"
# disable=import-star-module-level,old-octal-literal,oct-method,print-statement,unpacking-in-except,parameter-unpacking,backtick,old-raise-syntax,old-ne-operator,long-suffix,dict-view-method,dict-iter-method,metaclass-assignment,next-method-called,raising-string,indexing-exception,raw_input-builtin,long-builtin,file-builtin,execfile-builtin,coerce-builtin,cmp-builtin,buffer-builtin,basestring-builtin,apply-builtin,filter-builtin-not-iterating,using-cmp-argument,useless-suppression,range-builtin-not-iterating,suppressed-message,no-absolute-import,old-division,cmp-method,reload-builtin,zip-builtin-not-iterating,intern-builtin,unichr-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,input-builtin,round-builtin,hex-method,nonzero-method,map-builtin-not-iterating
disable=locally-disabled,missing-docstring,invalid-name,too-few-public-methods,redefined-variable-type,import-error,similarities,unsupported-membership-test,unsubscriptable-object,ungrouped-imports,cyclic-import
disable=
missing-docstring,
duplicate-code,
invalid-name,
too-few-public-methods,
consider-using-f-string,
cyclic-import,
use-dict-literal

View File

@ -1,3 +0,0 @@
[style]
blank_line_before_nested_class_or_def = true
allow_multiline_lambdas = true

View File

@ -1,42 +0,0 @@
language: python
matrix:
include:
- os: linux
sudo: false
python: 2.7
env: TOX_ENV=docs
- os: linux
sudo: false
python: 2.7
env: TOX_ENV=lint
- os: linux
sudo: required
python: 2.7
env: TOX_ENV=py27
- os: osx
language: generic
env: TOX_ENV=skipexamples
install:
- git submodule update --init --recursive
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then sudo pip install -U tox; else pip install -U tox; fi
# ChipKIT issue: install 32-bit support for GCC PIC32
- if [[ "$TOX_ENV" == "py27" ]] && [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install libc6-i386; fi
script:
- tox -e $TOX_ENV
after_success:
- if [[ "$TOX_ENV" == "py27" ]] && [[ "$TRAVIS_OS_NAME" == "linux" ]]; then tox -e coverage; fi
- if [[ "$TOX_ENV" == "py27" ]] && [[ "$TRAVIS_OS_NAME" == "linux" ]]; then bash <(curl -s https://codecov.io/bash); fi
notifications:
email: false
slack:
rooms:
secure: JD6VGfN4+SLU2CwDdiIOr1VgwD+zbYUCE/srwyGuHavnjIkPItkl6T6Bn8Y4VrU6ysbuKotfdV2TAJJ82ivFbY8BvZBc7FBcYp/AGQ4FaCCV5ySv8RDAcQgdE12oaGzMdODiLqsB85f65zOlAFa+htaXyEiRTcotn6Y2hupatrI=
on_failure: always
on_success: change

3
CODE_OF_CONDUCT.md Normal file
View File

@ -0,0 +1,3 @@
# Code of Conduct
See https://piolabs.com/legal/code-of-conduct.html

View File

@ -1,21 +1,22 @@
Contributing
------------
To get started, <a href="https://www.clahub.com/agreements/platformio/platformio-core">sign the Contributor License Agreement</a>.
To get started, <a href="https://cla-assistant.io/platformio/platformio-core">sign the Contributor License Agreement</a>.
1. Fork the repository on GitHub.
2. Make a branch off of ``develop``
3. Run ``pip install tox``
4. Go to the root of project where is located ``tox.ini`` and run ``tox -e develop``
1. Fork the repository on GitHub
2. Clone repository `git clone --recursive https://github.com/YourGithubUsername/platformio-core.git`
3. Run `pip install tox`
4. Go to the root of the PlatformIO Core project where `tox.ini` is located (``cd platformio-core``) and run `tox -e py39`.
You can replace `py39` with your own Python version. For example, `py311` means Python 3.11.
5. Activate current development environment:
* Windows: ``.tox\develop\Scripts\activate``
* Bash/ZSH: ``source .tox/develop/bin/activate``
* Fish: ``source .tox/bin/activate.fish``
* Windows: `.tox\py39\Scripts\activate`
* Bash/ZSH: `source .tox/py39/bin/activate`
* Fish: `source .tox/py39/bin/activate.fish`
6. Make changes to code, documentation, etc.
7. Lint source code ``tox -e lint``
8. Run the tests ``tox -e py27``
9. Build documentation ``tox -e docs`` (creates a directory _build under docs where you can find the html)
7. Lint source code `make before-commit`
8. Run the tests `make test`
9. Build documentation `tox -e docs` (creates a directory _build under docs where you can find the html)
10. Commit changes to your forked repository
11. Submit a Pull Request on GitHub.
11. Submit a Pull Request on GitHub

File diff suppressed because it is too large Load Diff

View File

@ -1,15 +1,22 @@
lint:
pylint --rcfile=./.pylintrc ./tests
pylint --rcfile=./.pylintrc ./platformio
isort:
isort -rc ./platformio
isort -rc ./tests
isort ./platformio
isort ./tests
yapf:
yapf --recursive --in-place platformio/
format:
black ./platformio
black ./tests
before-commit: isort yapf lint
codespell:
codespell --skip "./build,./docs/_build" -L "AtLeast,TRE,ans,dout,homestate,ser"
test:
pytest --verbose --exitfirst -n 6 --dist=loadscope tests --ignore tests/test_examples.py
before-commit: codespell isort format lint
clean-docs:
rm -rf docs/_build
@ -20,4 +27,15 @@ clean: clean-docs
rm -rf .cache
rm -rf build
rm -rf htmlcov
rm -f .coverage
rm -f .coverage
profile:
# Usage $ > make PIOARGS="boards" profile
python -m cProfile -o .tox/.tmp/cprofile.prof -m platformio ${PIOARGS}
snakeviz .tox/.tmp/cprofile.prof
pack:
python setup.py sdist
publish:
python setup.py sdist upload

View File

@ -1,201 +1,103 @@
PlatformIO
==========
PlatformIO Core
===============
.. image:: https://travis-ci.org/platformio/platformio-core.svg?branch=develop
:target: https://travis-ci.org/platformio/platformio-core
:alt: Travis.CI Build Status
.. image:: https://ci.appveyor.com/api/projects/status/unnpw0n3c5k14btn/branch/develop?svg=true
:target: https://ci.appveyor.com/project/ivankravets/platformio-core
:alt: AppVeyor.CI Build Status
.. image:: https://requires.io/github/platformio/platformio-core/requirements.svg?branch=develop
:target: https://requires.io/github/platformio/platformio-core/requirements/?branch=develop
:alt: Requirements Status
.. image:: https://github.com/platformio/platformio-core/workflows/Core/badge.svg
:target: https://docs.platformio.org/en/latest/core/index.html
:alt: CI Build for PlatformIO Core
.. image:: https://github.com/platformio/platformio-core/workflows/Docs/badge.svg
:target: https://docs.platformio.org?utm_source=github&utm_medium=core
:alt: CI Build for Docs
.. image:: https://github.com/platformio/platformio-core/workflows/Examples/badge.svg
:target: https://github.com/platformio/platformio-examples
:alt: CI Build for dev-platform examples
.. image:: https://github.com/platformio/platformio-core/workflows/Projects/badge.svg
:target: https://docs.platformio.org/en/latest/tutorials/index.html#projects
:alt: CI Build for the Community Projects
.. image:: https://img.shields.io/pypi/v/platformio.svg
:target: https://pypi.python.org/pypi/platformio/
:alt: Latest Version
.. image:: https://img.shields.io/pypi/l/platformio.svg
:target: https://pypi.python.org/pypi/platformio/
:alt: License
.. image:: https://img.shields.io/PlatformIO/Community.png
:alt: Community Forums
:target: https://community.platformio.org
.. image:: https://img.shields.io/PlatformIO/Plus.png?color=orange
:alt: PlatformIO Plus: Professional solutions for an awesome open source PlatformIO ecosystem
:target: https://pioplus.com
.. image:: https://img.shields.io/badge/PlatformIO-Labs-orange.svg
:alt: PlatformIO Labs
:target: https://piolabs.com/?utm_source=github&utm_medium=core
**Quick Links:** `Home Page <http://platformio.org>`_ |
`PlatformIO Plus <https://pioplus.com>`_ |
`PlatformIO IDE <http://platformio.org/platformio-ide>`_ |
`Project Examples <https://github.com/platformio/platformio-examples/>`_ |
`Docs <http://docs.platformio.org>`_ |
`Donate <http://platformio.org/donate>`_ |
`Contact Us <https://pioplus.com/contact.html>`_
**Quick Links:** `Homepage <https://platformio.org?utm_source=github&utm_medium=core>`_ |
`PlatformIO IDE <https://platformio.org/platformio-ide?utm_source=github&utm_medium=core>`_ |
`Registry <https://registry.platformio.org?utm_source=github&utm_medium=core>`_ |
`Project Examples <https://github.com/platformio/platformio-examples/>`__ |
`Docs <https://docs.platformio.org?utm_source=github&utm_medium=core>`_ |
`Donate <https://platformio.org/donate?utm_source=github&utm_medium=core>`_ |
`Contact Us <https://piolabs.com/?utm_source=github&utm_medium=core>`_
**Social:** `Twitter <https://twitter.com/PlatformIO_Org>`_ |
**Social:** `LinkedIn <https://www.linkedin.com/company/platformio/>`_ |
`Twitter <https://twitter.com/PlatformIO_Org>`_ |
`Facebook <https://www.facebook.com/platformio>`_ |
`Hackaday <https://hackaday.io/project/7980-platformio>`_ |
`Bintray <https://bintray.com/platformio>`_ |
`Community <https://community.platformio.org>`_
`Community Forums <https://community.platformio.org?utm_source=github&utm_medium=core>`_
.. image:: http://docs.platformio.org/en/stable/_static/platformio-logo.png
:target: http://platformio.org
.. image:: https://raw.githubusercontent.com/platformio/platformio-web/develop/app/images/platformio-ide-laptop.png
:target: https://platformio.org?utm_source=github&utm_medium=core
`PlatformIO <http://platformio.org>`_ is an open source ecosystem for IoT
development. Cross-platform build system and library manager. Continuous and
IDE integration. Arduino, ESP8266 and ARM mbed compatible
`PlatformIO <https://platformio.org>`_: Your Gateway to Embedded Software Development Excellence.
* **PlatformIO IDE** - The next-generation integrated development environment for IoT.
C/C++ Intelligent Code Completion and Smart Code Linter for the super-fast coding.
Multi-projects workflow with Multiple Panes. Themes Support with dark and light colors.
Built-in Terminal with PlatformIO Core tool and support for the powerful Serial Port Monitor.
All advanced instruments without leaving your favourite development environment.
* **Development Platforms** - Embedded and Desktop development platforms with
pre-built toolchains, debuggers, uploaders and frameworks which work under
popular host OS: Mac, Windows, Linux (+ARM)
* **Embedded Boards** - Rapid Embedded Programming, IDE and Continuous
Integration in a few steps with PlatformIO thanks to built-in project
generator for the most popular embedded boards and IDE
* **Library Manager** - Hundreds Popular Libraries are organized into single
Web 2.0 platform: list by categories, keywords, authors, compatible
platforms and frameworks; learn via examples; be up-to-date with the latest
version.
Unlock the true potential of embedded software development with
PlatformIO's collaborative ecosystem, embracing declarative principles,
test-driven methodologies, and modern toolchains for unrivaled success.
*Atmel AVR & SAM, Espressif, Freescale Kinetis, Intel ARC32, Lattice iCE40,
Microchip PIC32, Nordic nRF51, NXP LPC, Silicon Labs EFM32, ST STM32,
TI MSP430 & Tiva, Teensy, Arduino, mbed, libOpenCM3, etc.*
* Open source, maximum permissive Apache 2.0 license
* Cross-platform IDE and Unified Debugger
* Static Code Analyzer and Remote Unit Testing
* Multi-platform and Multi-architecture Build System
* Firmware File Explorer and Memory Inspection
.. image:: http://docs.platformio.org/en/stable/_static/platformio-demo-wiring.gif
:target: http://platformio.org
Get Started
-----------
* `PlatformIO Plus and professional solutions <https://pioplus.com>`_
* `PlatformIO IDE <http://platformio.org/platformio-ide>`_
* `Get Started <http://platformio.org/get-started>`_
* `Library Search and Registry <http://platformio.org/lib>`_
* `Development Platforms <http://platformio.org/platforms>`_
* `Frameworks <http://platformio.org/frameworks>`_
* `Embedded Boards Explorer <http://platformio.org/boards>`_
* `Library Manager <http://docs.platformio.org/en/stable/librarymanager/index.html>`_
* `User Guide <http://docs.platformio.org/en/stable/userguide/index.html>`_
* `Continuous Integration <http://docs.platformio.org/en/stable/ci/index.html>`_
* `IDE Integration <http://docs.platformio.org/en/stable/ide.html>`_
* `Articles about us <http://docs.platformio.org/en/stable/articles.html>`_
* `FAQ <http://docs.platformio.org/en/stable/faq.html>`_
* `Release Notes <http://docs.platformio.org/en/stable/history.html>`_
* `What is PlatformIO? <https://docs.platformio.org/en/latest/what-is-platformio.html?utm_source=github&utm_medium=core>`_
* `PlatformIO IDE <https://platformio.org/platformio-ide?utm_source=github&utm_medium=core>`_
* `PlatformIO Core (CLI) <https://docs.platformio.org/en/latest/core.html?utm_source=github&utm_medium=core>`_
* `Project Examples <https://github.com/platformio/platformio-examples?utm_source=github&utm_medium=core>`__
Use whenever. *Run everywhere.*
-------------------------------
*PlatformIO* is written in pure *Python* and **doesn't depend** on any
additional libraries/tools from an operating system. It allows you to use
*PlatformIO* beginning from *PC (Mac, Linux, Win)* and ending with credit-card
sized computers (`Raspberry Pi <http://www.raspberrypi.org>`_,
`BeagleBone <http://beagleboard.org>`_,
`CubieBoard <http://cubieboard.org>`_).
Solutions
---------
Embedded Development. *Easier Than Ever.*
-----------------------------------------
*PlatformIO* is well suited for embedded development and has pre-configured
settings for most popular `Embedded Boards <http://platformio.org/boards>`_.
* `Library Management <https://docs.platformio.org/en/latest/librarymanager/index.html?utm_source=github&utm_medium=core>`_
* `Desktop IDEs Integration <https://docs.platformio.org/en/latest/ide.html?utm_source=github&utm_medium=core>`_
* `Continuous Integration <https://docs.platformio.org/en/latest/ci/index.html?utm_source=github&utm_medium=core>`_
* Colourful `command-line output <https://raw.githubusercontent.com/platformio/platformio/develop/examples/platformio-examples.png>`_
* `IDE Integration <http://docs.platformio.org/en/stable/ide.html>`_ with
*Cloud9, Codeanywhere, Eclipse Che, Atom, CLion, CodeBlocks, Eclipse, Emacs, NetBeans, Qt Creator, Sublime Text, Vim, Visual Studio*
* Cloud compiling and `Continuous Integration <http://docs.platformio.org/en/stable/ci/index.html>`_
with *AppVeyor, Circle CI, Drone, Shippable, Travis CI*
* Built-in `Serial Port Monitor <http://docs.platformio.org/en/stable/userguide/cmd_serialports.html#platformio-serialports-monitor>`_ and configurable
`build -flags/-options <http://docs.platformio.org/en/stable/projectconf.html#build-flags>`_
* Automatic **firmware uploading**
* Pre-built tool chains, frameworks for the popular `development platforms <http://platformio.org/platforms>`_
**Advanced**
.. image:: https://raw.githubusercontent.com/platformio/platformio-web/develop/app/images/platformio-embedded-development.png
:target: http://platformio.org
:alt: PlatformIO Embedded Development Process
* `Debugging <https://docs.platformio.org/en/latest/plus/debugging.html?utm_source=github&utm_medium=core>`_
* `Unit Testing <https://docs.platformio.org/en/latest/advanced/unit-testing/index.html?utm_source=github&utm_medium=core>`_
* `Static Code Analysis <https://docs.platformio.org/en/latest/plus/pio-check.html?utm_source=github&utm_medium=core>`_
* `Remote Development <https://docs.platformio.org/en/latest/plus/pio-remote.html?utm_source=github&utm_medium=core>`_
The Missing Library Manager. *It's here!*
-----------------------------------------
*PlatformIO Library Manager* is the missing library manager for development
platforms which allows you to organize and have up-to-date external libraries.
Registry
--------
* Friendly `Command-Line Interface <http://docs.platformio.org/en/stable/librarymanager/index.html>`_
* Modern `Web 2.0 Library Portal <http://platformio.org/lib>`_
* Open Source `Library Registry API <https://github.com/platformio/platformio-api>`_
* Library Crawler based on `library.json <http://docs.platformio.org/en/stable/librarymanager/config.html>`_
specification
* Project Dependency Manager with `Semantic Versioning <http://docs.platformio.org/page/librarymanager/index.html>`_ requirements
.. image:: https://raw.githubusercontent.com/platformio/platformio-web/develop/app/images/platformio-library-manager.png
:target: http://platformio.org
:alt: PlatformIO Library Manager Architecture
Smart Build System. *Fast and Reliable.*
----------------------------------------
*PlatformIO Code Builder* is built-on a next-generation software construction
tool named `SCons <http://www.scons.org/>`_. Think of *SCons* as an improved,
cross-platform substitute for the classic *Make* utility.
* Reliable, automatic *dependency analysis*
* Reliable detection of *build changes*
* Improved support for *parallel builds*
* Ability to share *built files in a cache*
* Lookup for external libraries which are installed via `Library Manager <http://docs.platformio.org/en/stable/librarymanager/index.html>`_
.. image:: https://raw.githubusercontent.com/platformio/platformio-web/develop/app/images/platformio-scons-builder.png
:target: http://platformio.org
:alt: PlatformIO Build System Architecture
Single source code. *Multiple platforms.*
-----------------------------------------
*PlatformIO* allows the developer to compile the same code with different
development platforms using only *One Command*
`platformio run <http://docs.platformio.org/en/stable/userguide/cmd_run.html>`_.
This happens due to
`Project Configuration File (platformio.ini) <http://docs.platformio.org/en/stable/projectconf.html>`_
where you can setup different environments with specific options (platform
type, firmware uploading settings, pre-built framework, build flags and many
more).
It has support for the most popular embedded platforms:
* `Atmel AVR <http://platformio.org/platforms/atmelavr>`_
* `Atmel SAM <http://platformio.org/platforms/atmelsam>`_
* `Espressif 32 <http://platformio.org/platforms/espressif32>`_
* `Espressif 8266 <http://platformio.org/platforms/espressif8266>`_
* `Freescale Kinetis <http://platformio.org/platforms/freescalekinetis>`_
* `Intel ARC32 <http://platformio.org/platforms/intel_arc32>`_
* `Lattice iCE40 <http://platformio.org/platforms/lattice_ice40>`_
* `Microchip PIC32 <http://platformio.org/platforms/microchippic32>`_
* `Nordic nRF51 <http://platformio.org/platforms/nordicnrf51>`_
* `NXP LPC <http://platformio.org/platforms/nxplpc>`_
* `ST STM32 <http://platformio.org/platforms/ststm32>`_
* `Silicon Labs EFM32 <http://platformio.org/platforms/siliconlabsefm32>`_
* `Teensy <http://platformio.org/platforms/teensy>`_
* `TI MSP430 <http://platformio.org/platforms/timsp430>`_
* `TI TivaVA C <http://platformio.org/platforms/titiva>`_
Frameworks:
* `Arduino <http://platformio.org/frameworks/arduino>`_
* `ARTIK SDK <http://platformio.org/frameworks/artik-sdk>`_
* `CMSIS <http://platformio.org/frameworks/cmsis>`_
* `Energia <http://platformio.org/frameworks/energia>`_
* `ESP-IDF <http://platformio.org/frameworks/espidf>`_
* `libOpenCM3 <http://platformio.org/frameworks/libopencm3>`_
* `mbed <http://platformio.org/frameworks/mbed>`_
* `Pumbaa <http://platformio.org/frameworks/pumbaa>`_
* `Simba <http://platformio.org/frameworks/simba>`_
* `SPL <http://platformio.org/frameworks/spl>`_
* `WiringPi <http://platformio.org/frameworks/wiringpi>`_
For further details, please refer to `What is PlatformIO? <http://docs.platformio.org/en/stable/faq.html#what-is-platformio>`_
* `Libraries <https://registry.platformio.org/search?t=library&utm_source=github&utm_medium=core>`_
* `Development Platforms <https://registry.platformio.org/search?t=platform&utm_source=github&utm_medium=core>`_
* `Development Tools <https://registry.platformio.org/search?t=tool&utm_source=github&utm_medium=core>`_
Contributing
------------
See `contributing guidelines <https://github.com/platformio/platformio/blob/develop/CONTRIBUTING.md>`_.
Telemetry / Privacy Policy
--------------------------
Share minimal diagnostics and usage information to help us make PlatformIO better.
It is enabled by default. For more information see:
* `Telemetry Setting <https://docs.platformio.org/en/latest/userguide/cmd_settings.html?utm_source=github&utm_medium=core#enable-telemetry>`_
License
-------
Copyright 2014-present PlatformIO <contact@platformio.org>
Copyright (c) 2014-present PlatformIO <contact@platformio.org>
The PlatformIO is licensed under the permissive Apache 2.0 license,
so you can use it in both commercial and personal projects with confidence.
.. image:: https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner-direct.svg
:target: https://github.com/vshymanskyy/StandWithUkraine/blob/main/docs/README.md
:alt: SWUbanner

34
SECURITY.md Normal file
View File

@ -0,0 +1,34 @@
# Security Policy
## Supported Versions
We are committed to ensuring the security and protection of PlatformIO Core.
To this end, we support only the following versions:
| Version | Supported |
| ------- | ------------------ |
| 6.1.x | :white_check_mark: |
| < 6.1 | :x: |
Unsupported versions of the PlatformIO Core may have known vulnerabilities or security issues that could compromise the security of our organization's systems and data.
Therefore, it is important that all developers use only supported versions of the PlatformIO Core.
## Reporting a Vulnerability
We take the security of our systems and data very seriously. We encourage responsible disclosure of any vulnerabilities or security issues that you may find in our systems or applications. If you believe you have discovered a vulnerability, please report it to us immediately.
To report a vulnerability, please send an email to our security team at contact@piolabs.com. Please include as much information as possible, including:
- A description of the vulnerability and how it can be exploited
- Steps to reproduce the vulnerability
- Any additional information that can help us understand and reproduce the vulnerability
Once we receive your report, our security team will acknowledge receipt within 24 hours and will work to validate the reported vulnerability. We will provide periodic updates on the progress of the vulnerability assessment, and will notify you once a fix has been deployed.
If the vulnerability is accepted, we will work to remediate the issue as quickly as possible. We may also provide credit or recognition to the individual who reported the vulnerability, at our discretion.
If the vulnerability is declined, we will provide a justification for our decision and may offer guidance on how to improve the report or how to test the system more effectively.
Please note that we will not take any legal action against individuals who report vulnerabilities in good faith and in accordance with this policy.
Thank you for helping us keep our systems and data secure.

2
docs

Submodule docs updated: d20acf3631...70ab7ee27b

View File

@ -1,4 +1,4 @@
# Copyright 2014-present PlatformIO <contact@platformio.org>
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -12,28 +12,34 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import sys
VERSION = (3, 3, 1)
VERSION = (6, 1, "19a2")
__version__ = ".".join([str(s) for s in VERSION])
__title__ = "platformio"
__description__ = ("An open source ecosystem for IoT development. "
"Cross-platform build system and library manager. "
"Continuous and IDE integration. "
"Arduino, ESP8266 and ARM mbed compatible")
__url__ = "http://platformio.org"
__description__ = (
"Your Gateway to Embedded Software Development Excellence. "
"Unlock the true potential of embedded software development "
"with PlatformIO's collaborative ecosystem, embracing "
"declarative principles, test-driven methodologies, and "
"modern toolchains for unrivaled success."
)
__url__ = "https://platformio.org"
__author__ = "Ivan Kravets"
__email__ = "me@ikravets.com"
__author__ = "PlatformIO Labs"
__email__ = "contact@piolabs.com"
__license__ = "Apache Software License"
__copyright__ = "Copyright 2014-present PlatformIO"
__copyright__ = "Copyright 2014-present PlatformIO Labs"
__apiurl__ = "https://api.platformio.org"
__accounts_api__ = "https://api.accounts.platformio.org"
__registry_mirror_hosts__ = [
"registry.platformio.org",
"registry.nm1.platformio.org",
]
__pioremote_endpoint__ = "ssl:host=remote.platformio.org:port=4413"
if sys.version_info < (2, 7, 0) or sys.version_info >= (3, 0, 0):
msg = ("PlatformIO version %s does not run under Python version %s.\n"
"Python 3 is not yet supported.\n")
sys.stderr.write(msg % (__version__, sys.version.split()[0]))
sys.exit(1)
__check_internet_hosts__ = [
"185.199.110.153", # Github.com
"88.198.170.159", # platformio.org
"github.com",
] + __registry_mirror_hosts__

View File

@ -1,4 +1,4 @@
# Copyright 2014-present PlatformIO <contact@platformio.org>
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -12,115 +12,116 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from os import getenv, listdir
from os.path import join
from platform import system
from sys import exit as sys_exit
from traceback import format_exc
import os
import sys
import traceback
import click
import requests
from platformio import __version__, exception, maintenance
from platformio.util import get_source_dir
class PlatformioCLI(click.MultiCommand): # pylint: disable=R0904
def list_commands(self, ctx):
cmds = []
for filename in listdir(join(get_source_dir(), "commands")):
if filename.startswith("__init__"):
continue
if filename.endswith(".py"):
cmds.append(filename[:-3])
cmds.sort()
return cmds
def get_command(self, ctx, name):
mod = None
try:
mod = __import__("platformio.commands." + name, None, None,
["cli"])
except ImportError:
try:
return self._handle_obsolate_command(name)
except AttributeError:
raise click.UsageError('No such command "%s"' % name, ctx)
return mod.cli
@staticmethod
def _handle_obsolate_command(name):
if name == "platforms":
from platformio.commands import platform
return platform.cli
elif name == "serialports":
from platformio.commands import device
return device.cli
raise AttributeError()
from platformio.cli import PlatformioCLI
from platformio.compat import IS_CYGWIN, ensure_python3
@click.command(
cls=PlatformioCLI,
context_settings=dict(help_option_names=["-h", "--help"]))
@click.version_option(__version__, prog_name="PlatformIO")
@click.option(
"--force",
"-f",
is_flag=True,
help="Force to accept any confirmation prompts.")
@click.option("--caller", "-c", help="Caller ID (service).")
cls=PlatformioCLI, context_settings=dict(help_option_names=["-h", "--help"])
)
@click.version_option(__version__, prog_name="PlatformIO Core")
@click.option("--force", "-f", is_flag=True, help="DEPRECATED", hidden=True)
@click.option("--caller", "-c", help="Caller ID (service)")
@click.option("--no-ansi", is_flag=True, help="Do not print ANSI control characters")
@click.pass_context
def cli(ctx, force, caller):
maintenance.on_platformio_start(ctx, force, caller)
@cli.resultcallback()
@click.pass_context
def process_result(ctx, result, force, caller): # pylint: disable=W0613
maintenance.on_platformio_end(ctx, result)
def main():
def cli(ctx, force, caller, no_ansi): # pylint: disable=unused-argument
try:
if "cygwin" in system().lower():
raise exception.CygwinEnvDetected()
if (
no_ansi
or str(
os.getenv("PLATFORMIO_NO_ANSI", os.getenv("PLATFORMIO_DISABLE_COLOR"))
).lower()
== "true"
):
# pylint: disable=protected-access
click._compat.isatty = lambda stream: False
elif (
str(
os.getenv("PLATFORMIO_FORCE_ANSI", os.getenv("PLATFORMIO_FORCE_COLOR"))
).lower()
== "true"
):
# pylint: disable=protected-access
click._compat.isatty = lambda stream: True
except: # pylint: disable=bare-except
pass
# https://urllib3.readthedocs.org
# /en/latest/security.html#insecureplatformwarning
maintenance.on_cmd_start(ctx, caller)
@cli.result_callback()
@click.pass_context
def process_result(*_, **__):
maintenance.on_cmd_end()
def configure():
if IS_CYGWIN:
raise exception.CygwinEnvDetected()
# https://urllib3.readthedocs.org
# /en/latest/security.html#insecureplatformwarning
try:
import urllib3 # pylint: disable=import-outside-toplevel
urllib3.disable_warnings()
except (AttributeError, ImportError):
pass
# Handle IOError issue with VSCode's Terminal (Windows)
click_echo_origin = [click.echo, click.secho]
def _safe_echo(origin, *args, **kwargs):
try:
import urllib3
urllib3.disable_warnings()
except (AttributeError, ImportError):
pass
click_echo_origin[origin](*args, **kwargs)
except IOError:
(sys.stderr.write if kwargs.get("err") else sys.stdout.write)(
"%s\n" % (args[0] if args else "")
)
# handle PLATFORMIO_FORCE_COLOR
if str(getenv("PLATFORMIO_FORCE_COLOR", "")).lower() == "true":
try:
# pylint: disable=protected-access
click._compat.isatty = lambda stream: True
except: # pylint: disable=bare-except
pass
click.echo = lambda *args, **kwargs: _safe_echo(0, *args, **kwargs)
click.secho = lambda *args, **kwargs: _safe_echo(1, *args, **kwargs)
cli(None, None, None)
except Exception as e: # pylint: disable=W0703
if not isinstance(e, exception.ReturnErrorCode):
maintenance.on_platformio_exception(e)
error_str = "Error: "
if isinstance(e, exception.PlatformioException):
error_str += str(e)
def main(argv=None):
exit_code = 0
prev_sys_argv = sys.argv[:]
if argv:
assert isinstance(argv, list)
sys.argv = argv
try:
ensure_python3(raise_exception=True)
configure()
cli() # pylint: disable=no-value-for-parameter
except SystemExit as exc:
if exc.code and str(exc.code).isdigit():
exit_code = int(exc.code)
except Exception as exc: # pylint: disable=broad-except
if not isinstance(exc, exception.ReturnErrorCode):
maintenance.on_platformio_exception(exc)
error_str = f"{exc.__class__.__name__}: "
if isinstance(exc, exception.PlatformioException):
error_str += str(exc)
else:
error_str += format_exc()
error_str += traceback.format_exc()
error_str += """
============================================================
An unexpected error occurred. Further steps:
* Verify that you have the latest version of PlatformIO using
`pip install -U platformio` command
`python -m pip install -U platformio` command
* Try to find answer in FAQ Troubleshooting section
http://docs.platformio.org/page/faq.html
https://docs.platformio.org/page/faq/index.html
* Report this problem to the developers
https://github.com/platformio/platformio-core/issues
@ -128,9 +129,16 @@ An unexpected error occurred. Further steps:
============================================================
"""
click.secho(error_str, fg="red", err=True)
return int(str(e)) if str(e).isdigit() else 1
return 0
exit_code = int(str(exc)) if str(exc).isdigit() else 1
maintenance.on_platformio_exit()
sys.argv = prev_sys_argv
return exit_code
def debug_gdb_main():
return main([sys.argv[0], "debug", "--interface", "gdb"] + sys.argv[1:])
if __name__ == "__main__":
sys_exit(main())
sys.exit(main())

View File

@ -1,4 +1,4 @@
# Copyright 2014-present PlatformIO <contact@platformio.org>
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.

44
platformio/account/cli.py Normal file
View File

@ -0,0 +1,44 @@
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import click
from platformio.account.commands.destroy import account_destroy_cmd
from platformio.account.commands.forgot import account_forgot_cmd
from platformio.account.commands.login import account_login_cmd
from platformio.account.commands.logout import account_logout_cmd
from platformio.account.commands.password import account_password_cmd
from platformio.account.commands.register import account_register_cmd
from platformio.account.commands.show import account_show_cmd
from platformio.account.commands.token import account_token_cmd
from platformio.account.commands.update import account_update_cmd
@click.group(
"account",
commands=[
account_destroy_cmd,
account_forgot_cmd,
account_login_cmd,
account_logout_cmd,
account_password_cmd,
account_register_cmd,
account_show_cmd,
account_token_cmd,
account_update_cmd,
],
short_help="Manage PlatformIO account",
)
def cli():
pass

View File

@ -0,0 +1,352 @@
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import time
from platformio import __accounts_api__, app
from platformio.exception import PlatformioException, UserSideException
from platformio.http import HTTPClient, HTTPClientError
class AccountError(PlatformioException):
MESSAGE = "{0}"
class AccountNotAuthorized(AccountError, UserSideException):
MESSAGE = "You are not authorized! Please log in to PlatformIO Account."
class AccountAlreadyAuthorized(AccountError, UserSideException):
MESSAGE = "You are already authorized with {0} account."
class AccountClient(HTTPClient): # pylint:disable=too-many-public-methods
SUMMARY_CACHE_TTL = 60 * 60 * 24 * 7
def __init__(self):
super().__init__(__accounts_api__)
@staticmethod
def get_refresh_token():
try:
return app.get_state_item("account").get("auth").get("refresh_token")
except Exception as exc:
raise AccountNotAuthorized() from exc
@staticmethod
def delete_local_session():
app.delete_state_item("account")
@staticmethod
def delete_local_state(key):
account = app.get_state_item("account")
if not account or key not in account:
return
del account[key]
app.set_state_item("account", account)
def fetch_json_data(self, *args, **kwargs):
try:
return super().fetch_json_data(*args, **kwargs)
except HTTPClientError as exc:
raise AccountError(exc) from exc
def fetch_authentication_token(self):
if os.environ.get("PLATFORMIO_AUTH_TOKEN"):
return os.environ.get("PLATFORMIO_AUTH_TOKEN")
auth = app.get_state_item("account", {}).get("auth", {})
if auth.get("access_token") and auth.get("access_token_expire"):
if auth.get("access_token_expire") > time.time():
return auth.get("access_token")
if auth.get("refresh_token"):
try:
data = self.fetch_json_data(
"post",
"/v1/login",
headers={
"Authorization": "Bearer %s" % auth.get("refresh_token")
},
)
app.set_state_item("account", data)
return data.get("auth").get("access_token")
except AccountError:
self.delete_local_session()
raise AccountNotAuthorized()
def login(self, username, password):
try:
self.fetch_authentication_token()
except: # pylint:disable=bare-except
pass
else:
raise AccountAlreadyAuthorized(
app.get_state_item("account", {}).get("email", "")
)
data = self.fetch_json_data(
"post",
"/v1/login",
data={"username": username, "password": password},
)
app.set_state_item("account", data)
return data
def login_with_code(self, client_id, code, redirect_uri):
try:
self.fetch_authentication_token()
except: # pylint:disable=bare-except
pass
else:
raise AccountAlreadyAuthorized(
app.get_state_item("account", {}).get("email", "")
)
result = self.fetch_json_data(
"post",
"/v1/login/code",
data={"client_id": client_id, "code": code, "redirect_uri": redirect_uri},
)
app.set_state_item("account", result)
return result
def logout(self):
refresh_token = self.get_refresh_token()
self.delete_local_session()
try:
self.fetch_json_data(
"post",
"/v1/logout",
data={"refresh_token": refresh_token},
)
except AccountError:
pass
return True
def change_password(self, old_password, new_password):
return self.fetch_json_data(
"post",
"/v1/password",
data={"old_password": old_password, "new_password": new_password},
x_with_authorization=True,
)
def registration(
self, username, email, password, firstname, lastname
): # pylint: disable=too-many-arguments,too-many-positional-arguments
try:
self.fetch_authentication_token()
except: # pylint:disable=bare-except
pass
else:
raise AccountAlreadyAuthorized(
app.get_state_item("account", {}).get("email", "")
)
return self.fetch_json_data(
"post",
"/v1/registration",
data={
"username": username,
"email": email,
"password": password,
"firstname": firstname,
"lastname": lastname,
},
)
def auth_token(self, password, regenerate):
return self.fetch_json_data(
"post",
"/v1/token",
data={"password": password, "regenerate": 1 if regenerate else 0},
x_with_authorization=True,
).get("auth_token")
def forgot_password(self, username):
return self.fetch_json_data(
"post",
"/v1/forgot",
data={"username": username},
)
def get_profile(self):
return self.fetch_json_data(
"get",
"/v1/profile",
x_with_authorization=True,
)
def update_profile(self, profile, current_password):
profile["current_password"] = current_password
self.delete_local_state("summary")
response = self.fetch_json_data(
"put",
"/v1/profile",
data=profile,
x_with_authorization=True,
)
return response
def get_account_info(self, offline=False):
account = app.get_state_item("account") or {}
if (
account.get("summary")
and account["summary"].get("expire_at", 0) > time.time()
):
return account["summary"]
if offline and account.get("email"):
return {
"profile": {
"email": account.get("email"),
"username": account.get("username"),
}
}
result = self.fetch_json_data(
"get",
"/v1/summary",
x_with_authorization=True,
)
account["summary"] = dict(
profile=result.get("profile"),
packages=result.get("packages"),
subscriptions=result.get("subscriptions"),
user_id=result.get("user_id"),
expire_at=int(time.time()) + self.SUMMARY_CACHE_TTL,
)
app.set_state_item("account", account)
return result
def get_logged_username(self):
return self.get_account_info(offline=True).get("profile").get("username")
def destroy_account(self):
return self.fetch_json_data(
"delete",
"/v1/account",
x_with_authorization=True,
)
def create_org(self, orgname, email, displayname):
return self.fetch_json_data(
"post",
"/v1/orgs",
data={"orgname": orgname, "email": email, "displayname": displayname},
x_with_authorization=True,
)
def get_org(self, orgname):
return self.fetch_json_data(
"get",
"/v1/orgs/%s" % orgname,
x_with_authorization=True,
)
def list_orgs(self):
return self.fetch_json_data(
"get",
"/v1/orgs",
x_with_authorization=True,
)
def update_org(self, orgname, data):
return self.fetch_json_data(
"put",
"/v1/orgs/%s" % orgname,
data={k: v for k, v in data.items() if v},
x_with_authorization=True,
)
def destroy_org(self, orgname):
return self.fetch_json_data(
"delete",
"/v1/orgs/%s" % orgname,
x_with_authorization=True,
)
def add_org_owner(self, orgname, username):
return self.fetch_json_data(
"post",
"/v1/orgs/%s/owners" % orgname,
data={"username": username},
x_with_authorization=True,
)
def list_org_owners(self, orgname):
return self.fetch_json_data(
"get",
"/v1/orgs/%s/owners" % orgname,
x_with_authorization=True,
)
def remove_org_owner(self, orgname, username):
return self.fetch_json_data(
"delete",
"/v1/orgs/%s/owners" % orgname,
params={"username": username},
x_with_authorization=True,
)
def create_team(self, orgname, teamname, description):
return self.fetch_json_data(
"post",
"/v1/orgs/%s/teams" % orgname,
data={"name": teamname, "description": description},
x_with_authorization=True,
)
def destroy_team(self, orgname, teamname):
return self.fetch_json_data(
"delete",
"/v1/orgs/%s/teams/%s" % (orgname, teamname),
x_with_authorization=True,
)
def get_team(self, orgname, teamname):
return self.fetch_json_data(
"get",
"/v1/orgs/%s/teams/%s" % (orgname, teamname),
x_with_authorization=True,
)
def list_teams(self, orgname):
return self.fetch_json_data(
"get",
"/v1/orgs/%s/teams" % orgname,
x_with_authorization=True,
)
def update_team(self, orgname, teamname, data):
return self.fetch_json_data(
"put",
"/v1/orgs/%s/teams/%s" % (orgname, teamname),
data={k: v for k, v in data.items() if v},
x_with_authorization=True,
)
def add_team_member(self, orgname, teamname, username):
return self.fetch_json_data(
"post",
"/v1/orgs/%s/teams/%s/members" % (orgname, teamname),
data={"username": username},
x_with_authorization=True,
)
def remove_team_member(self, orgname, teamname, username):
return self.fetch_json_data(
"delete",
"/v1/orgs/%s/teams/%s/members" % (orgname, teamname),
params={"username": username},
x_with_authorization=True,
)

View File

@ -1,4 +1,4 @@
# Copyright 2014-present PlatformIO <contact@platformio.org>
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.

View File

@ -0,0 +1,37 @@
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import click
from platformio.account.client import AccountClient, AccountNotAuthorized
@click.command("destroy", short_help="Destroy account")
def account_destroy_cmd():
client = AccountClient()
click.confirm(
"Are you sure you want to delete the %s user account?\n"
"Warning! All linked data will be permanently removed and can not be restored."
% client.get_logged_username(),
abort=True,
)
client.destroy_account()
try:
client.logout()
except AccountNotAuthorized:
pass
click.secho(
"User account has been destroyed.",
fg="green",
)

View File

@ -1,4 +1,4 @@
# Copyright 2014-present PlatformIO <contact@platformio.org>
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -12,18 +12,18 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from platformio.commands.update import cli as cmd_update
import click
from platformio.account.client import AccountClient
def test_update(clirunner, validate_cliresult):
matches = (
"Platform Manager",
"Up-to-date",
"Library Manager"
@click.command("forgot", short_help="Forgot password")
@click.option("--username", prompt="Username or email")
def account_forgot_cmd(username):
client = AccountClient()
client.forgot_password(username)
click.secho(
"If this account is registered, we will send the "
"further instructions to your email.",
fg="green",
)
result = clirunner.invoke(cmd_update, ["--only-check"])
validate_cliresult(result)
assert all([m in result.output for m in matches])
result = clirunner.invoke(cmd_update)
validate_cliresult(result)
assert all([m in result.output for m in matches])

View File

@ -0,0 +1,26 @@
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import click
from platformio.account.client import AccountClient
@click.command("login", short_help="Log in to PlatformIO Account")
@click.option("-u", "--username", prompt="Username or email")
@click.option("-p", "--password", prompt=True, hide_input=True)
def account_login_cmd(username, password):
client = AccountClient()
client.login(username, password)
click.secho("Successfully logged in!", fg="green")

View File

@ -0,0 +1,24 @@
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import click
from platformio.account.client import AccountClient
@click.command("logout", short_help="Log out of PlatformIO Account")
def account_logout_cmd():
client = AccountClient()
client.logout()
click.secho("Successfully logged out!", fg="green")

View File

@ -0,0 +1,26 @@
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import click
from platformio.account.client import AccountClient
@click.command("password", short_help="Change password")
@click.option("--old-password", prompt=True, hide_input=True)
@click.option("--new-password", prompt=True, hide_input=True, confirmation_prompt=True)
def account_password_cmd(old_password, new_password):
client = AccountClient()
client.change_password(old_password, new_password)
click.secho("Password successfully changed!", fg="green")

View File

@ -0,0 +1,52 @@
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import click
from platformio.account.client import AccountClient
from platformio.account.validate import (
validate_email,
validate_password,
validate_username,
)
@click.command("register", short_help="Create new PlatformIO Account")
@click.option(
"-u",
"--username",
prompt=True,
callback=lambda _, __, value: validate_username(value),
)
@click.option(
"-e", "--email", prompt=True, callback=lambda _, __, value: validate_email(value)
)
@click.option(
"-p",
"--password",
prompt=True,
hide_input=True,
confirmation_prompt=True,
callback=lambda _, __, value: validate_password(value),
)
@click.option("--firstname", prompt=True)
@click.option("--lastname", prompt=True)
def account_register_cmd(username, email, password, firstname, lastname):
client = AccountClient()
client.registration(username, email, password, firstname, lastname)
click.secho(
"An account has been successfully created. "
"Please check your mail to activate your account and verify your email address.",
fg="green",
)

View File

@ -0,0 +1,116 @@
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import json
import click
from tabulate import tabulate
from platformio import util
from platformio.account.client import AccountClient
@click.command("show", short_help="PlatformIO Account information")
@click.option("--offline", is_flag=True)
@click.option("--json-output", is_flag=True)
def account_show_cmd(offline, json_output):
client = AccountClient()
info = client.get_account_info(offline)
if json_output:
click.echo(json.dumps(info))
return
click.echo()
if info.get("profile"):
print_profile(info["profile"])
if info.get("packages"):
print_packages(info["packages"])
if info.get("subscriptions"):
print_subscriptions(info["subscriptions"])
click.echo()
def print_profile(profile):
click.secho("Profile", fg="cyan", bold=True)
click.echo("=" * len("Profile"))
data = []
if profile.get("username"):
data.append(("Username:", profile["username"]))
if profile.get("email"):
data.append(("Email:", profile["email"]))
if profile.get("firstname"):
data.append(("First name:", profile["firstname"]))
if profile.get("lastname"):
data.append(("Last name:", profile["lastname"]))
click.echo(tabulate(data, tablefmt="plain"))
def print_packages(packages):
click.echo()
click.secho("Packages", fg="cyan")
click.echo("=" * len("Packages"))
for package in packages:
click.echo()
click.secho(package.get("name"), bold=True)
click.echo("-" * len(package.get("name")))
if package.get("description"):
click.echo(package.get("description"))
data = []
expire = "-"
if "subscription" in package:
expire = util.parse_datetime(
package["subscription"].get("end_at")
or package["subscription"].get("next_bill_at")
).strftime("%Y-%m-%d")
data.append(("Expire:", expire))
services = []
for key in package:
if not key.startswith("service."):
continue
if isinstance(package[key], dict):
services.append(package[key].get("title"))
else:
services.append(package[key])
if services:
data.append(("Services:", ", ".join(services)))
click.echo(tabulate(data, tablefmt="plain"))
def print_subscriptions(subscriptions):
click.echo()
click.secho("Subscriptions", fg="cyan")
click.echo("=" * len("Subscriptions"))
for subscription in subscriptions:
click.echo()
click.secho(subscription.get("product_name"), bold=True)
click.echo("-" * len(subscription.get("product_name")))
data = [("State:", subscription.get("status"))]
begin_at = util.parse_datetime(subscription.get("begin_at")).strftime("%c")
data.append(("Start date:", begin_at or "-"))
end_at = subscription.get("end_at")
if end_at:
end_at = util.parse_datetime(subscription.get("end_at")).strftime("%c")
data.append(("End date:", end_at or "-"))
next_bill_at = subscription.get("next_bill_at")
if next_bill_at:
next_bill_at = util.parse_datetime(
subscription.get("next_bill_at")
).strftime("%c")
data.append(("Next payment:", next_bill_at or "-"))
data.append(
("Edit:", click.style(subscription.get("update_url"), fg="blue") or "-")
)
data.append(
("Cancel:", click.style(subscription.get("cancel_url"), fg="blue") or "-")
)
click.echo(tabulate(data, tablefmt="plain"))

View File

@ -0,0 +1,32 @@
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import json
import click
from platformio.account.client import AccountClient
@click.command("token", short_help="Get or regenerate Authentication Token")
@click.option("-p", "--password", prompt=True, hide_input=True)
@click.option("--regenerate", is_flag=True)
@click.option("--json-output", is_flag=True)
def account_token_cmd(password, regenerate, json_output):
client = AccountClient()
auth_token = client.auth_token(password, regenerate)
if json_output:
click.echo(json.dumps({"status": "success", "result": auth_token}))
return
click.secho("Personal Authentication Token: %s" % auth_token, fg="green")

View File

@ -0,0 +1,59 @@
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import click
from platformio.account.client import AccountClient, AccountNotAuthorized
from platformio.account.validate import validate_email, validate_username
@click.command("update", short_help="Update profile information")
@click.option("--current-password", prompt=True, hide_input=True)
@click.option("--username")
@click.option("--email")
@click.option("--firstname")
@click.option("--lastname")
def account_update_cmd(current_password, **kwargs):
client = AccountClient()
profile = client.get_profile()
new_profile = profile.copy()
if not any(kwargs.values()):
for field in profile:
new_profile[field] = click.prompt(
field.replace("_", " ").capitalize(), default=profile[field]
)
if field == "email":
validate_email(new_profile[field])
if field == "username":
validate_username(new_profile[field])
else:
new_profile.update({key: value for key, value in kwargs.items() if value})
client.update_profile(new_profile, current_password)
click.secho("Profile successfully updated!", fg="green")
username_changed = new_profile["username"] != profile["username"]
email_changed = new_profile["email"] != profile["email"]
if not username_changed and not email_changed:
return None
try:
client.logout()
except AccountNotAuthorized:
pass
if email_changed:
click.secho(
"Please check your mail to verify your new email address and re-login. ",
fg="yellow",
)
return None
click.secho("Please re-login.", fg="yellow")
return None

View File

@ -1,4 +1,4 @@
# Copyright 2014-present PlatformIO <contact@platformio.org>
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -11,11 +11,3 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
[report]
# Regexes for lines to exclude from consideration
exclude_lines =
pragma: no cover
def __repr__
raise AssertionError
raise NotImplementedError

View File

@ -0,0 +1,38 @@
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import click
from platformio.account.org.commands.add import org_add_cmd
from platformio.account.org.commands.create import org_create_cmd
from platformio.account.org.commands.destroy import org_destroy_cmd
from platformio.account.org.commands.list import org_list_cmd
from platformio.account.org.commands.remove import org_remove_cmd
from platformio.account.org.commands.update import org_update_cmd
@click.group(
"account",
commands=[
org_add_cmd,
org_create_cmd,
org_destroy_cmd,
org_list_cmd,
org_remove_cmd,
org_update_cmd,
],
short_help="Manage organizations",
)
def cli():
pass

View File

@ -0,0 +1,13 @@
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

View File

@ -0,0 +1,34 @@
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import click
from platformio.account.client import AccountClient
@click.command("add", short_help="Add a new owner to organization")
@click.argument(
"orgname",
)
@click.argument(
"username",
)
def org_add_cmd(orgname, username):
client = AccountClient()
client.add_org_owner(orgname, username)
return click.secho(
"The new owner `%s` has been successfully added to the `%s` organization."
% (username, orgname),
fg="green",
)

View File

@ -0,0 +1,38 @@
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import click
from platformio.account.client import AccountClient
from platformio.account.validate import validate_email, validate_orgname
@click.command("create", short_help="Create a new organization")
@click.argument(
"orgname",
callback=lambda _, __, value: validate_orgname(value),
)
@click.option(
"--email", callback=lambda _, __, value: validate_email(value) if value else value
)
@click.option(
"--displayname",
)
def org_create_cmd(orgname, email, displayname):
client = AccountClient()
client.create_org(orgname, email, displayname)
return click.secho(
"The organization `%s` has been successfully created." % orgname,
fg="green",
)

View File

@ -0,0 +1,34 @@
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import click
from platformio.account.client import AccountClient
@click.command("destroy", short_help="Destroy organization")
@click.argument("orgname")
def org_destroy_cmd(orgname):
client = AccountClient()
click.confirm(
"Are you sure you want to delete the `%s` organization account?\n"
"Warning! All linked data will be permanently removed and can not be restored."
% orgname,
abort=True,
)
client.destroy_org(orgname)
return click.secho(
"Organization `%s` has been destroyed." % orgname,
fg="green",
)

View File

@ -0,0 +1,48 @@
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import json
import click
from tabulate import tabulate
from platformio.account.client import AccountClient
@click.command("list", short_help="List organizations and their members")
@click.option("--json-output", is_flag=True)
def org_list_cmd(json_output):
client = AccountClient()
orgs = client.list_orgs()
if json_output:
return click.echo(json.dumps(orgs))
if not orgs:
return click.echo("You do not have any organization")
for org in orgs:
click.echo()
click.secho(org.get("orgname"), fg="cyan")
click.echo("-" * len(org.get("orgname")))
data = []
if org.get("displayname"):
data.append(("Display Name:", org.get("displayname")))
if org.get("email"):
data.append(("Email:", org.get("email")))
data.append(
(
"Owners:",
", ".join((owner.get("username") for owner in org.get("owners"))),
)
)
click.echo(tabulate(data, tablefmt="plain"))
return click.echo()

View File

@ -0,0 +1,34 @@
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import click
from platformio.account.client import AccountClient
@click.command("remove", short_help="Remove an owner from organization")
@click.argument(
"orgname",
)
@click.argument(
"username",
)
def org_remove_cmd(orgname, username):
client = AccountClient()
client.remove_org_owner(orgname, username)
return click.secho(
"The `%s` owner has been successfully removed from the `%s` organization."
% (username, orgname),
fg="green",
)

View File

@ -0,0 +1,50 @@
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import click
from platformio.account.client import AccountClient
from platformio.account.validate import validate_email, validate_orgname
@click.command("update", short_help="Update organization")
@click.argument("cur_orgname")
@click.option(
"--orgname",
callback=lambda _, __, value: validate_orgname(value) if value else value,
help="A new orgname",
)
@click.option(
"--email",
callback=lambda _, __, value: validate_email(value) if value else value,
)
@click.option("--displayname")
def org_update_cmd(cur_orgname, **kwargs):
client = AccountClient()
org = client.get_org(cur_orgname)
new_org = {
key: value if value is not None else org[key] for key, value in kwargs.items()
}
if not any(kwargs.values()):
for key in kwargs:
new_org[key] = click.prompt(key.capitalize(), default=org[key])
if key == "email":
validate_email(new_org[key])
if key == "orgname":
validate_orgname(new_org[key])
client.update_org(cur_orgname, new_org)
return click.secho(
"The organization `%s` has been successfully updated." % cur_orgname,
fg="green",
)

View File

@ -0,0 +1,13 @@
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

View File

@ -0,0 +1,38 @@
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import click
from platformio.account.team.commands.add import team_add_cmd
from platformio.account.team.commands.create import team_create_cmd
from platformio.account.team.commands.destroy import team_destroy_cmd
from platformio.account.team.commands.list import team_list_cmd
from platformio.account.team.commands.remove import team_remove_cmd
from platformio.account.team.commands.update import team_update_cmd
@click.group(
"team",
commands=[
team_add_cmd,
team_create_cmd,
team_destroy_cmd,
team_list_cmd,
team_remove_cmd,
team_update_cmd,
],
short_help="Manage organization teams",
)
def cli():
pass

View File

@ -0,0 +1,13 @@
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

View File

@ -0,0 +1,38 @@
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import click
from platformio.account.client import AccountClient
from platformio.account.validate import validate_orgname_teamname
@click.command("add", short_help="Add a new member to team")
@click.argument(
"orgname_teamname",
metavar="ORGNAME:TEAMNAME",
callback=lambda _, __, value: validate_orgname_teamname(value),
)
@click.argument(
"username",
)
def team_add_cmd(orgname_teamname, username):
orgname, teamname = orgname_teamname.split(":", 1)
client = AccountClient()
client.add_team_member(orgname, teamname, username)
return click.secho(
"The new member %s has been successfully added to the %s team."
% (username, teamname),
fg="green",
)

View File

@ -0,0 +1,37 @@
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import click
from platformio.account.client import AccountClient
from platformio.account.validate import validate_orgname_teamname
@click.command("create", short_help="Create a new team")
@click.argument(
"orgname_teamname",
metavar="ORGNAME:TEAMNAME",
callback=lambda _, __, value: validate_orgname_teamname(value),
)
@click.option(
"--description",
)
def team_create_cmd(orgname_teamname, description):
orgname, teamname = orgname_teamname.split(":", 1)
client = AccountClient()
client.create_team(orgname, teamname, description)
return click.secho(
"The team %s has been successfully created." % teamname,
fg="green",
)

View File

@ -0,0 +1,40 @@
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import click
from platformio.account.client import AccountClient
from platformio.account.validate import validate_orgname_teamname
@click.command("destroy", short_help="Destroy a team")
@click.argument(
"orgname_teamname",
metavar="ORGNAME:TEAMNAME",
callback=lambda _, __, value: validate_orgname_teamname(value),
)
def team_destroy_cmd(orgname_teamname):
orgname, teamname = orgname_teamname.split(":", 1)
click.confirm(
click.style(
"Are you sure you want to destroy the %s team?" % teamname, fg="yellow"
),
abort=True,
)
client = AccountClient()
client.destroy_team(orgname, teamname)
return click.secho(
"The team %s has been successfully destroyed." % teamname,
fg="green",
)

View File

@ -0,0 +1,61 @@
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import json
import click
from tabulate import tabulate
from platformio.account.client import AccountClient
@click.command("list", short_help="List teams")
@click.argument("orgname", required=False)
@click.option("--json-output", is_flag=True)
def team_list_cmd(orgname, json_output):
client = AccountClient()
data = {}
if not orgname:
for item in client.list_orgs():
teams = client.list_teams(item.get("orgname"))
data[item.get("orgname")] = teams
else:
teams = client.list_teams(orgname)
data[orgname] = teams
if json_output:
return click.echo(json.dumps(data[orgname] if orgname else data))
if not any(data.values()):
return click.secho("You do not have any teams.", fg="yellow")
for org_name, teams in data.items():
for team in teams:
click.echo()
click.secho("%s:%s" % (org_name, team.get("name")), fg="cyan")
click.echo("-" * len("%s:%s" % (org_name, team.get("name"))))
table_data = []
if team.get("description"):
table_data.append(("Description:", team.get("description")))
table_data.append(
(
"Members:",
(
", ".join(
(member.get("username") for member in team.get("members"))
)
if team.get("members")
else "-"
),
)
)
click.echo(tabulate(table_data, tablefmt="plain"))
return click.echo()

View File

@ -0,0 +1,36 @@
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import click
from platformio.account.client import AccountClient
from platformio.account.validate import validate_orgname_teamname
@click.command("remove", short_help="Remove a member from team")
@click.argument(
"orgname_teamname",
metavar="ORGNAME:TEAMNAME",
callback=lambda _, __, value: validate_orgname_teamname(value),
)
@click.argument("username")
def team_remove_cmd(orgname_teamname, username):
orgname, teamname = orgname_teamname.split(":", 1)
client = AccountClient()
client.remove_team_member(orgname, teamname, username)
return click.secho(
"The %s member has been successfully removed from the %s team."
% (username, teamname),
fg="green",
)

View File

@ -0,0 +1,51 @@
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import click
from platformio.account.client import AccountClient
from platformio.account.validate import validate_orgname_teamname, validate_teamname
@click.command("update", short_help="Update team")
@click.argument(
"orgname_teamname",
metavar="ORGNAME:TEAMNAME",
callback=lambda _, __, value: validate_orgname_teamname(value),
)
@click.option(
"--name",
callback=lambda _, __, value: validate_teamname(value) if value else value,
help="A new team name",
)
@click.option(
"--description",
)
def team_update_cmd(orgname_teamname, **kwargs):
orgname, teamname = orgname_teamname.split(":", 1)
client = AccountClient()
team = client.get_team(orgname, teamname)
new_team = {
key: value if value is not None else team[key] for key, value in kwargs.items()
}
if not any(kwargs.values()):
for key in kwargs:
new_team[key] = click.prompt(key.capitalize(), default=team[key])
if key == "name":
validate_teamname(new_team[key])
client.update_team(orgname, teamname, new_team)
return click.secho(
"The team %s has been successfully updated." % teamname,
fg="green",
)

View File

@ -0,0 +1,84 @@
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import re
import click
def validate_username(value, field="username"):
value = str(value).strip() if value else None
if not value or not re.match(
r"^[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,37}$", value, flags=re.I
):
raise click.BadParameter(
"Invalid %s format. "
"%s must contain only alphanumeric characters "
"or single hyphens, cannot begin or end with a hyphen, "
"and must not be longer than 38 characters."
% (field.lower(), field.capitalize())
)
return value
def validate_orgname(value):
return validate_username(value, "Organization name")
def validate_email(value):
value = str(value).strip() if value else None
if not value or not re.match(
r"^[a-z\d_\.\+\-]+@[a-z\d\-]+\.[a-z\d\-\.]+$", value, flags=re.I
):
raise click.BadParameter("Invalid email address")
return value
def validate_password(value):
value = str(value).strip() if value else None
if not value or not re.match(r"^(?=.*[a-z])(?=.*\d).{8,}$", value):
raise click.BadParameter(
"Invalid password format. "
"Password must contain at least 8 characters"
" including a number and a lowercase letter"
)
return value
def validate_teamname(value):
value = str(value).strip() if value else None
if not value or not re.match(
r"^[a-z\d](?:[a-z\d]|[\-_ ](?=[a-z\d])){0,19}$", value, flags=re.I
):
raise click.BadParameter(
"Invalid team name format. "
"Team name must only contain alphanumeric characters, "
"single hyphens, underscores, spaces. It can not "
"begin or end with a hyphen or a underscore and must"
" not be longer than 20 characters."
)
return value
def validate_orgname_teamname(value):
value = str(value).strip() if value else None
if not value or ":" not in value:
raise click.BadParameter(
"Please specify organization and team name using the following"
" format - orgname:teamname. For example, mycompany:DreamTeam"
)
orgname, teamname = value.split(":", 1)
validate_orgname(orgname)
validate_teamname(teamname)
return value

View File

@ -1,4 +1,4 @@
# Copyright 2014-present PlatformIO <contact@platformio.org>
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -12,291 +12,218 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import getpass
import hashlib
import json
import os
import platform
import socket
import time
import uuid
from copy import deepcopy
from os import environ, getenv, listdir, remove
from os.path import dirname, getmtime, isdir, isfile, join
from time import time
import requests
from lockfile import LockFailed, LockFile
from platformio import __version__, exception, fs, proc
from platformio.compat import IS_WINDOWS, hashlib_encode_data
from platformio.package.lockfile import LockFile
from platformio.project.config import ProjectConfig
from platformio.project.helpers import get_default_projects_dir
def projects_dir_validate(projects_dir):
assert os.path.isdir(projects_dir)
return os.path.abspath(projects_dir)
from platformio import __version__, exception, util
from platformio.exception import InvalidSettingName, InvalidSettingValue
DEFAULT_SETTINGS = {
"check_platformio_interval": {
"description": "Check for the new PlatformIO interval (days)",
"value": 3
"description": "Check for the new PlatformIO Core interval (days)",
"value": 7,
},
"check_platforms_interval": {
"description": "Check for the platform updates interval (days)",
"value": 7
"check_prune_system_threshold": {
"description": "Check for pruning unnecessary data threshold (megabytes)",
"value": 1024,
},
"check_libraries_interval": {
"description": "Check for the library updates interval (days)",
"value": 7
"enable_cache": {
"description": "Enable caching for HTTP API requests",
"value": True,
},
"auto_update_platforms": {
"description": "Automatically update platforms (Yes/No)",
"value": False
},
"auto_update_libraries": {
"description": "Automatically update libraries (Yes/No)",
"value": False
"enable_telemetry": {
"description": ("Telemetry service <https://bit.ly/pio-telemetry> (Yes/No)"),
"value": True,
},
"force_verbose": {
"description": "Force verbose output when processing environments",
"value": False
"value": False,
},
"enable_ssl": {
"description": "Enable SSL for PlatformIO Services",
"value": False
"projects_dir": {
"description": "Default location for PlatformIO projects (PlatformIO Home)",
"value": get_default_projects_dir(),
"validator": projects_dir_validate,
},
"enable_cache": {
"description": "Enable caching for API requests and Library Manager",
"value": True
"enable_proxy_strict_ssl": {
"description": "Verify the proxy server certificate against the list of supplied CAs",
"value": True,
},
"enable_telemetry": {
"description":
("Telemetry service <http://docs.platformio.org/page/"
"userguide/cmd_settings.html?#enable-telemetry> (Yes/No)"),
"value": True
}
}
SESSION_VARS = {"command_ctx": None, "force_option": False, "caller_id": None}
SESSION_VARS = {
"command_ctx": None,
"caller_id": None,
"custom_project_conf": None,
"pause_telemetry": False,
}
class State(object):
def resolve_state_path(conf_option_dir, file_name, ensure_dir_exists=True):
state_dir = ProjectConfig.get_instance().get("platformio", conf_option_dir)
if ensure_dir_exists and not os.path.isdir(state_dir):
os.makedirs(state_dir)
return os.path.join(state_dir, file_name)
class State:
def __init__(self, path=None, lock=False):
self.path = path
self.lock = lock
if not self.path:
self.path = join(util.get_home_dir(), "appstate.json")
self._state = {}
self._prev_state = {}
self.path = resolve_state_path("core_dir", "appstate.json")
self._storage = {}
self._lockfile = None
self.modified = False
def __enter__(self):
try:
self._lock_state_file()
if isfile(self.path):
self._state = util.load_json(self.path)
except ValueError:
self._state = {}
self._prev_state = deepcopy(self._state)
return self._state
if os.path.isfile(self.path):
self._storage = fs.load_json(self.path)
assert isinstance(self._storage, dict)
except (
AssertionError,
ValueError,
UnicodeDecodeError,
exception.InvalidJSONFile,
):
self._storage = {}
return self
def __exit__(self, type_, value, traceback):
if self._prev_state != self._state:
with open(self.path, "w") as fp:
if "dev" in __version__:
json.dump(self._state, fp, indent=4)
else:
json.dump(self._state, fp)
if self.modified:
try:
with open(self.path, mode="w", encoding="utf8") as fp:
fp.write(json.dumps(self._storage))
except IOError as exc:
raise exception.HomeDirPermissionsError(
os.path.dirname(self.path)
) from exc
self._unlock_state_file()
def _lock_state_file(self):
if not self.lock:
return
self._lockfile = LockFile(self.path)
if self._lockfile.is_locked() and \
(time() - getmtime(self._lockfile.lock_file)) > 10:
self._lockfile.break_lock()
try:
self._lockfile.acquire()
except LockFailed:
raise exception.PlatformioException(
"The directory `{0}` or its parent directory is not owned by "
"the current user and PlatformIO can not store configuration "
"data. \nPlease check the permissions and owner of that "
"directory. Otherwise, please remove manually `{0}` "
"directory and PlatformIO will create new from the current "
"user.".format(dirname(self.path)))
except IOError as exc:
raise exception.HomeDirPermissionsError(os.path.dirname(self.path)) from exc
def _unlock_state_file(self):
if self._lockfile:
if hasattr(self, "_lockfile") and self._lockfile:
self._lockfile.release()
def __del__(self):
self._unlock_state_file()
class ContentCache(object):
# Dictionary Proxy
def __init__(self, cache_dir=None):
self.cache_dir = None
self._db_path = None
self._lockfile = None
def as_dict(self):
return self._storage
if not get_setting("enable_cache"):
return
def keys(self):
return self._storage.keys()
self.cache_dir = cache_dir or join(util.get_home_dir(), ".cache")
self._db_path = join(self.cache_dir, "db.data")
def get(self, key, default=True):
return self._storage.get(key, default)
def __enter__(self):
if not self._db_path or not isfile(self._db_path):
return self
found = False
newlines = []
with open(self._db_path) as fp:
for line in fp.readlines():
if "=" not in line:
continue
line = line.strip()
expire, path = line.split("=")
if time() < int(expire) and isfile(path):
newlines.append(line)
continue
found = True
if isfile(path):
remove(path)
if not len(listdir(dirname(path))):
util.rmtree_(dirname(path))
def update(self, *args, **kwargs):
self.modified = True
return self._storage.update(*args, **kwargs)
if found and self._lock_dbindex():
with open(self._db_path, "w") as fp:
fp.write("\n".join(newlines) + "\n")
self._unlock_dbindex()
def clear(self):
return self._storage.clear()
return self
def __getitem__(self, key):
return self._storage[key]
def __exit__(self, type_, value, traceback):
pass
def __setitem__(self, key, value):
self.modified = True
self._storage[key] = value
def _lock_dbindex(self):
if not self.cache_dir:
os.makedirs(self.cache_dir)
self._lockfile = LockFile(self.cache_dir)
if self._lockfile.is_locked() and \
(time() - getmtime(self._lockfile.lock_file)) > 10:
self._lockfile.break_lock()
def __delitem__(self, key):
self.modified = True
del self._storage[key]
try:
self._lockfile.acquire()
except LockFailed:
return False
return True
def _unlock_dbindex(self):
if self._lockfile:
self._lockfile.release()
def get_cache_path(self, key):
assert len(key) > 3
return join(self.cache_dir, key[-2:], key)
@staticmethod
def key_from_args(*args):
h = hashlib.md5()
for data in args:
h.update(str(data))
return h.hexdigest()
def get(self, key):
cache_path = self.get_cache_path(key)
if not isfile(cache_path):
return None
with open(cache_path, "rb") as fp:
data = fp.read()
if data and data[0] in ("{", "["):
return json.loads(data)
return data
def set(self, key, data, valid):
if not data:
return
if not isdir(self.cache_dir):
os.makedirs(self.cache_dir)
tdmap = {"s": 1, "m": 60, "h": 3600, "d": 86400}
assert valid.endswith(tuple(tdmap.keys()))
cache_path = self.get_cache_path(key)
expire_time = int(time() + tdmap[valid[-1]] * int(valid[:-1]))
if not self._lock_dbindex():
return False
with open(self._db_path, "a") as fp:
fp.write("%s=%s\n" % (str(expire_time), cache_path))
self._unlock_dbindex()
if not isdir(dirname(cache_path)):
os.makedirs(dirname(cache_path))
with open(cache_path, "wb") as fp:
if isinstance(data, dict) or isinstance(data, list):
json.dump(data, fp)
else:
fp.write(str(data))
return True
def clean(self):
if not self.cache_dir or not isdir(self.cache_dir):
return
util.rmtree_(self.cache_dir)
def clean_cache():
with ContentCache() as cc:
cc.clean()
def __contains__(self, item):
return item in self._storage
def sanitize_setting(name, value):
if name not in DEFAULT_SETTINGS:
raise InvalidSettingName(name)
raise exception.InvalidSettingName(name)
defdata = DEFAULT_SETTINGS[name]
try:
if "validator" in defdata:
value = defdata['validator']()
elif isinstance(defdata['value'], bool):
value = defdata["validator"](value)
elif isinstance(defdata["value"], bool):
if not isinstance(value, bool):
value = str(value).lower() in ("true", "yes", "y", "1")
elif isinstance(defdata['value'], int):
elif isinstance(defdata["value"], int):
value = int(value)
except Exception:
raise InvalidSettingValue(value, name)
except Exception as exc:
raise exception.InvalidSettingValue(value, name) from exc
return value
def get_state_item(name, default=None):
with State() as data:
return data.get(name, default)
with State() as state:
return state.get(name, default)
def set_state_item(name, value):
with State(lock=True) as data:
data[name] = value
with State(lock=True) as state:
state[name] = value
state.modified = True
def delete_state_item(name):
with State(lock=True) as state:
if name in state:
del state[name]
def get_setting(name):
_env_name = "PLATFORMIO_SETTING_%s" % name.upper()
if _env_name in environ:
return sanitize_setting(name, getenv(_env_name))
if _env_name in os.environ:
return sanitize_setting(name, os.getenv(_env_name))
with State() as data:
if "settings" in data and name in data['settings']:
return data['settings'][name]
with State() as state:
if "settings" in state and name in state["settings"]:
return state["settings"][name]
return DEFAULT_SETTINGS[name]['value']
return DEFAULT_SETTINGS[name]["value"]
def set_setting(name, value):
with State(lock=True) as data:
if "settings" not in data:
data['settings'] = {}
data['settings'][name] = sanitize_setting(name, value)
with State(lock=True) as state:
if "settings" not in state:
state["settings"] = {}
state["settings"][name] = sanitize_setting(name, value)
state.modified = True
def reset_settings():
with State(lock=True) as data:
if "settings" in data:
del data['settings']
with State(lock=True) as state:
if "settings" in state:
del state["settings"]
def get_session_var(name, default=None):
@ -309,27 +236,58 @@ def set_session_var(name, value):
def is_disabled_progressbar():
return any([
get_session_var("force_option"), util.is_ci(),
getenv("PLATFORMIO_DISABLE_PROGRESSBAR") == "true"
])
return os.getenv("PLATFORMIO_DISABLE_PROGRESSBAR") == "true"
def get_cid():
cid = get_state_item("cid")
if not cid:
_uid = None
if getenv("C9_UID"):
_uid = getenv("C9_UID")
elif getenv("CHE_API", getenv("CHE_API_ENDPOINT")):
try:
_uid = requests.get("{api}/user?token={token}".format(
api=getenv("CHE_API", getenv("CHE_API_ENDPOINT")),
token=getenv("USER_TOKEN"))).json().get("id")
except: # pylint: disable=bare-except
pass
cid = str(
uuid.UUID(bytes=hashlib.md5(str(_uid if _uid else uuid.getnode()))
.digest()))
if cid:
return cid
uid = None
if os.getenv("GITHUB_USER"):
uid = os.getenv("GITHUB_USER")
elif os.getenv("GITPOD_GIT_USER_NAME"):
uid = os.getenv("GITPOD_GIT_USER_NAME")
if not uid:
uid = uuid.getnode()
cid = uuid.UUID(bytes=hashlib.md5(hashlib_encode_data(uid)).digest())
cid = str(cid)
if IS_WINDOWS or os.getuid() > 0: # pylint: disable=no-member
set_state_item("cid", cid)
set_state_item("created_at", int(time.time()))
return cid
def get_project_id(project_dir):
return hashlib.sha1(hashlib_encode_data(project_dir)).hexdigest()
def get_user_agent():
data = [
"PlatformIO/%s" % __version__,
"CI/%d" % int(proc.is_ci()),
"Container/%d" % int(proc.is_container()),
]
if get_session_var("caller_id"):
data.append("Caller/%s" % get_session_var("caller_id"))
if os.getenv("PLATFORMIO_IDE"):
data.append("IDE/%s" % os.getenv("PLATFORMIO_IDE"))
data.append("Python/%s" % platform.python_version())
data.append("Platform/%s" % platform.platform())
if not get_setting("enable_telemetry"):
data.append("Telemetry/0")
return " ".join(data)
def get_host_id():
h = hashlib.sha1(hashlib_encode_data(get_cid()))
try:
username = getpass.getuser()
h.update(hashlib_encode_data(username))
except: # pylint: disable=bare-except
pass
return h.hexdigest()
def get_host_name():
return str(socket.gethostname())[:255]

View File

@ -0,0 +1,487 @@
{
"$id": "https://example.com/library.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "library.json schema",
"type": "object",
"properties": {
"name": {
"type": "string",
"maxLength": 50,
"description": "A name of a library.\nMust be unique in the PlatformIO Registry\nShould be slug style for simplicity, consistency, and compatibility. Example: HelloWorld\nCan contain a-z, digits, and dashes (but not start/end with them)\nConsecutive dashes and [:;/,@<>] chars are not allowed.",
"required": true
},
"version": {
"type": "string",
"maxLength": 20,
"description": "A version of a current library source code. Can contain a-z, digits, dots or dash and should be Semantic Versioning compatible.",
"required": true
},
"description": {
"type": "string",
"maxLength": 255,
"description": "The field helps users to identify and search for your library with a brief description. Describe the hardware devices (sensors, boards and etc.) which are suitable with it.",
"required": true
},
"keywords": {
"anyOf": [
{
"type": "string",
"maxLength": 255
},
{
"type": "array",
"items": {
"type": "string",
"maxLength": 255
}
}
],
"description": "Used for search by keyword. Helps to make your library easier to discover without people needing to know its name.\nThe keyword should be lowercased, can contain a-z, digits and dash (but not start/end with them). A list from the keywords can be specified with separator , or declared as Array.",
"required": true
},
"homepage": {
"type": "string",
"maxLength": 255,
"description": "Home page of a library (if is different from repository url).",
"required": false
},
"repository": {
"type": "object",
"properties": {
"type": {
"enum": [
"git",
"hg",
"svn"
],
"description": "only “git”, “hg” or “svn” are supported"
},
"url": {
"type": "string"
},
"branch": {
"type": "string",
"description": "if is not specified, default branch will be used. This field will be ignored if tag/release exists with the value of version."
}
},
"description": "The repository in which the source code can be found.",
"required": false
},
"authors": {
"anyOf": [
{
"type": "object",
"properties": {
"name": {
"type": "string",
"required": true,
"description": "Full name"
},
"email": {
"type": "string"
},
"url": {
"type": "string",
"description": "An authors contact page"
},
"maintainer": {
"type": "boolean",
"description": "Specify “maintainer” status"
}
}
},
{
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"required": true,
"description": "Full name"
},
"email": {
"type": "string"
},
"url": {
"type": "string",
"description": "An authors contact page"
},
"maintainer": {
"type": "boolean",
"description": "Specify “maintainer” status"
}
}
}
}
],
"description": "An author contact information\nIf authors field is not defined, PlatformIO will try to fetch data from VCS provider (Github, Gitlab, etc) if repository is declared.",
"required": false
},
"license": {
"type": "string",
"description": "A SPDX license ID or SPDX Expression. You can check the full list of SPDX license IDs (see “Identifier” column).",
"required": false
},
"frameworks": {
"anyOf": [
{
"type": "string",
"description": "espidf, freertos, *, etc'"
},
{
"type": "array",
"items": {
"type": "string",
"description": "espidf, freertos, *, etc'"
}
}
],
"description": "A list with compatible frameworks. The available framework names are defined in the Frameworks section.\nIf the library is compatible with the all frameworks, then do not declare this field or you use *",
"required": false
},
"platforms": {
"anyOf": [
{
"type": "string",
"description": "atmelavr, espressif8266, *, etc'"
},
{
"type": "array",
"items": {
"type": "string",
"description": "atmelavr, espressif8266, *, etc'"
}
}
],
"description": "A list with compatible development platforms. The available platform name are defined in Development Platforms section.\nIf the library is compatible with the all platforms, then do not declare this field or use *.\nPlatformIO does not check platforms for compatibility in default mode. See Compatibility Mode for details. If you need a strict checking for compatible platforms for a library, please set libCompatMode to strict.",
"required": false
},
"headers": {
"anyOf": [
{
"type": "string",
"description": "MyLibrary.h"
},
{
"type": "array",
"items": {
"type": "string",
"description": "FooCore.h, FooFeature.h"
}
}
],
"description": "A list of header files that can be included in a project source files using #include <...> directive.",
"required": false
},
"examples": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"base": {
"type": "string"
},
"files": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"description": "A list of example patterns.",
"required": "false"
},
"dependencies": {
"anyOf": [
{
"type": "object",
"properties": {
"owner": {
"type": "string",
"description": "an owner name (username) from the PlatformIO Registry"
},
"name": {
"type": "string",
"description": "library name"
},
"version": {
"type": "string",
"description": "Version Requirements or Package Specifications"
},
"frameworks": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
],
"description": "project compatible Frameworks"
},
"platforms": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
],
"description": " project compatible Development Platforms"
}
}
},
{
"type": "array",
"items": {
"type": "object",
"properties": {
"owner": {
"type": "string",
"description": "an owner name (username) from the PlatformIO Registry"
},
"name": {
"type": "string",
"description": "library name"
},
"version": {
"type": "string",
"description": "Version Requirements or Package Specifications"
},
"frameworks": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
],
"description": "project compatible Frameworks"
},
"platforms": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
],
"description": " project compatible Development Platforms"
}
}
}
}
],
"description": "A list of dependent libraries that will be automatically installed.",
"required": false
},
"export": {
"type": "object",
"properties": {
"include": {
"type": "array",
"items": {
"type": "string"
},
"description": "Export only files that matched declared patterns.\n* - matches everything\n? - matches any single character\n[seq] - matches any character in seq\n[!seq] - matches any character not in seq"
},
"exclude": {
"type": "array",
"items": {
"type": "string"
},
"description": "Exclude the directories and files which match with exclude patterns."
}
},
"description": "This option is useful if you need to exclude extra data (test code, docs, images, PDFs, etc). It allows one to reduce the size of the final archive.\nTo check which files will be included in the final packages, please use pio pkg pack command.",
"required": false
},
"scripts": {
"type": "object",
"properties": {
"postinstall": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
],
"description": "runs a script AFTER the package has been installed.\nRun a custom Python script located in the package “scripts” folder AFTER the package is installed. Please note that you dont need to specify a Python interpreter for Python scripts"
},
"preuninstall": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
],
"description": "runs a script BEFORE the package is removed.\nRun a custom Bash script BEFORE the package is uninstalled. The script is declared as a list of command arguments and is located at the root of a package"
}
},
"description": "Execute custom scripts during the special Package Management CLI life cycle events",
"required": false
},
"build": {
"type": "object",
"properties": {
"flags": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
],
"description": "Extra flags to control preprocessing, compilation, assembly, and linking processes. More details build_flags.\nKeep in mind when operating with the -I flag (directories to be searched for header files). The path should be relative to the root directory where the library.json manifest is located."
},
"unflags": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
],
"description": "Remove base/initial flags which were set by development platform. More details build_unflags."
},
"includeDir": {
"type": "string",
"description": "Custom directory to be searched for header files. A default value is include and means that folder is located at the root of a library.\nThe Library Dependency Finder (LDF) will pick a library automatically only when a project or other dependent libraries include any header file located in includeDir or srcDir.",
"required": false
},
"srcDir": {
"type": "string",
"description": "Custom location of library source code. A default value is src and means that folder is located in the root of a library.",
"required": "false"
},
"srcFilter": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
],
"description": "Specify which source files should be included/excluded from build process. The path in filter should be relative to the srcDir option of a library.\nSee syntax for build_src_filter.\nPlease note that you can generate source filter “on-the-fly” using extraScript",
"required": false
},
"extraScript": {
"type": "string",
"description": "Launch extra script before a build process.",
"required": "false"
},
"libArchive": {
"type": "boolean",
"description": "Create an archive (*.a, static library) from the object files and link it into a firmware (program). This is default behavior of PlatformIO Build System (\"libArchive\": true).\nSetting \"libArchive\": false will instruct PlatformIO Build System to link object files directly (in-line). This could be useful if you need to override weak symbols defined in framework or other libraries.\nYou can disable library archiving globally using lib_archive option in “platformio.ini” (Project Configuration File).",
"required": "false"
},
"libLDFMode": {
"anyOf": [
{
"enum": [
"off"
],
"description": "“Manual mode”, does not process source files of a project and dependencies. Builds only the libraries that are specified in manifests (library.json, module.json) or using lib_deps option."
},
{
"enum": [
"chain"
],
"description": "[DEFAULT] Parses ALL C/C++ source files of the project and follows only by nested includes (#include ..., chain...) from the libraries. It also parses C, CC, CPP files from libraries which have the same name as included header file. Does not evaluate C/C++ Preprocessor conditional syntax."
},
{
"enum": [
"deep"
],
"description": "Parses ALL C/C++ source files of the project and parses ALL C/C++ source files of the each found dependency (recursively). Does not evaluate C/C++ Preprocessor conditional syntax."
},
{
"enum": [
"chain+"
],
"description": "The same behavior as for the chain but evaluates C/C++ Preprocessor conditional syntax."
},
{
"enum": [
"deep+"
],
"description": "The same behavior as for the deep but evaluates C/C++ Preprocessor conditional syntax."
}
],
"description": "Specify Library Dependency Finder Mode. See Dependency Finder Mode for details.",
"required": false
},
"libCompatMode": {
"type": "string",
"description": "Specify Library Compatibility Mode. See Compatibility Mode for details.",
"required": false
},
"builder": {
"anyOf": [
{
"enum": [
"PlatformIOLibBuilder"
],
"description": "Default Builder"
},
{
"enum": [
"ArduinoLibBuilder"
]
},
{
"enum": [
"MbedLibBuilder"
]
}
],
"description": "Override default PlatformIOLibBuilder with another builder.",
"required": false
}
},
"required": false
}
}
}

View File

@ -0,0 +1,183 @@
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#####################################################################################
#
# INSTALLATION
#
# Please visit > https://docs.platformio.org/en/latest/core/installation/udev-rules.html
#
#####################################################################################
#
# Boards
#
# CP210X USB UART
ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea[67][013]", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="80a9", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# FT231XS USB UART
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6015", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# Prolific Technology, Inc. PL2303 Serial Port
ATTRS{idVendor}=="067b", ATTRS{idProduct}=="2303", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# QinHeng Electronics HL-340 USB-Serial adapter
ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="7523", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# QinHeng Electronics CH343 USB-Serial adapter
ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="55d3", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# QinHeng Electronics CH9102 USB-Serial adapter
ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="55d4", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# Arduino boards
ATTRS{idVendor}=="2341", ATTRS{idProduct}=="[08][023]*", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
ATTRS{idVendor}=="2a03", ATTRS{idProduct}=="[08][02]*", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# Arduino SAM-BA
ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="6124", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{MTP_NO_PROBE}="1"
# Digistump boards
ATTRS{idVendor}=="16d0", ATTRS{idProduct}=="0753", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# Maple with DFU
ATTRS{idVendor}=="1eaf", ATTRS{idProduct}=="000[34]", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# USBtiny
ATTRS{idProduct}=="0c9f", ATTRS{idVendor}=="1781", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# USBasp V2.0
ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="05dc", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# Teensy boards
ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789B]?", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789A]?", ENV{MTP_NO_PROBE}="1"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789ABCD]?", MODE:="0666"
KERNEL=="ttyACM*", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789B]?", MODE:="0666"
# TI Stellaris Launchpad
ATTRS{idVendor}=="1cbe", ATTRS{idProduct}=="00fd", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# TI MSP430 Launchpad
ATTRS{idVendor}=="0451", ATTRS{idProduct}=="f432", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# GD32V DFU Bootloader
ATTRS{idVendor}=="28e9", ATTRS{idProduct}=="0189", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# FireBeetle-ESP32
ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="7522", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# Wio Terminal
ATTRS{idVendor}=="2886", ATTRS{idProduct}=="[08]02d", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# Raspberry Pi Pico
ATTRS{idVendor}=="2e8a", ATTRS{idProduct}=="[01]*", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# AIR32F103
ATTRS{idVendor}=="0d28", ATTRS{idProduct}=="0204", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# STM32 virtual COM port
ATTRS{idVendor}=="0483", ATTRS{idProduct}=="5740", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
#
# Debuggers
#
# Black Magic Probe
SUBSYSTEM=="tty", ATTRS{interface}=="Black Magic GDB Server", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
SUBSYSTEM=="tty", ATTRS{interface}=="Black Magic UART Port", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# opendous and estick
ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="204f", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# Original FT232/FT245/FT2232/FT232H/FT4232
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="60[01][104]", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# DISTORTEC JTAG-lock-pick Tiny 2
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="8220", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# TUMPA, TUMPA Lite
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="8a9[89]", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# XDS100v2
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="a6d0", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# Xverve Signalyzer Tool (DT-USB-ST), Signalyzer LITE (DT-USB-SLITE)
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="bca[01]", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# TI/Luminary Stellaris Evaluation Board FTDI (several)
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="bcd[9a]", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# egnite Turtelizer 2
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="bdc8", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# Section5 ICEbear
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="c14[01]", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# Amontec JTAGkey and JTAGkey-tiny
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="cff8", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# TI ICDI
ATTRS{idVendor}=="0451", ATTRS{idProduct}=="c32a", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# STLink probes
ATTRS{idVendor}=="0483", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# Hilscher NXHX Boards
ATTRS{idVendor}=="0640", ATTRS{idProduct}=="0028", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# Hitex probes
ATTRS{idVendor}=="0640", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# Altera USB Blaster
ATTRS{idVendor}=="09fb", ATTRS{idProduct}=="6001", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# Amontec JTAGkey-HiSpeed
ATTRS{idVendor}=="0fbb", ATTRS{idProduct}=="1000", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# SEGGER J-Link
ATTRS{idVendor}=="1366", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# Raisonance RLink
ATTRS{idVendor}=="138e", ATTRS{idProduct}=="9000", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# Debug Board for Neo1973
ATTRS{idVendor}=="1457", ATTRS{idProduct}=="5118", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# Olimex probes
ATTRS{idVendor}=="15ba", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# USBprog with OpenOCD firmware
ATTRS{idVendor}=="1781", ATTRS{idProduct}=="0c63", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# TI/Luminary Stellaris In-Circuit Debug Interface (ICDI) Board
ATTRS{idVendor}=="1cbe", ATTRS{idProduct}=="00fd", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# Marvell Sheevaplug
ATTRS{idVendor}=="9e88", ATTRS{idProduct}=="9e8f", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# Keil Software, Inc. ULink
ATTRS{idVendor}=="c251", ATTRS{idProduct}=="2710", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# CMSIS-DAP compatible adapters
ATTRS{product}=="*CMSIS-DAP*", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# Atmel AVR Dragon
ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2107", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# Espressif USB JTAG/serial debug unit
ATTRS{idVendor}=="303a", ATTRS{idProduct}=="1001", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
# Zephyr framework USB CDC-ACM
ATTRS{idVendor}=="2fe3", ATTRS{idProduct}=="0100", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"

View File

@ -1,4 +1,4 @@
# Copyright 2014-present PlatformIO <contact@platformio.org>
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.

View File

@ -1,4 +1,4 @@
# Copyright 2014-present PlatformIO <contact@platformio.org>
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -12,152 +12,239 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import base64
import json
from os import environ
from os.path import join
import os
import sys
from time import time
from SCons.Script import (ARGUMENTS, COMMAND_LINE_TARGETS, DEFAULT_TARGETS,
AllowSubstExceptions, AlwaysBuild,
DefaultEnvironment, Variables)
import click
from SCons.Script import ARGUMENTS # pylint: disable=import-error
from SCons.Script import COMMAND_LINE_TARGETS # pylint: disable=import-error
from SCons.Script import DEFAULT_TARGETS # pylint: disable=import-error
from SCons.Script import AllowSubstExceptions # pylint: disable=import-error
from SCons.Script import AlwaysBuild # pylint: disable=import-error
from SCons.Script import Default # pylint: disable=import-error
from SCons.Script import DefaultEnvironment # pylint: disable=import-error
from SCons.Script import Import # pylint: disable=import-error
from SCons.Script import Variables # pylint: disable=import-error
from platformio import util
from platformio import app, fs
from platformio.platform.base import PlatformBase
from platformio.proc import get_pythonexe_path
from platformio.project.helpers import get_project_dir
AllowSubstExceptions(NameError)
# allow common variables from INI file
commonvars = Variables(None)
commonvars.AddVariables(
("PLATFORM_MANIFEST",),
# append CLI arguments to build environment
clivars = Variables(None)
clivars.AddVariables(
("BUILD_SCRIPT",),
("EXTRA_SCRIPT",),
("PROJECT_CONFIG",),
("PIOENV",),
("PIOTEST",),
("PIOPLATFORM",),
("PIOFRAMEWORK",),
# build options
("BUILD_FLAGS",),
("SRC_BUILD_FLAGS",),
("BUILD_UNFLAGS",),
("SRC_FILTER",),
# library options
("LIB_LDF_MODE",),
("LIB_COMPAT_MODE",),
("LIB_DEPS",),
("LIB_IGNORE",),
("LIB_EXTRA_DIRS",),
# board options
("BOARD",),
("BOARD_MCU",),
("BOARD_F_CPU",),
("BOARD_F_FLASH",),
("BOARD_FLASH_MODE",),
# upload options
("PIOTEST_RUNNING_NAME",),
("UPLOAD_PORT",),
("UPLOAD_PROTOCOL",),
("UPLOAD_SPEED",),
("UPLOAD_FLAGS",),
("UPLOAD_RESETMETHOD",)
) # yapf: disable
("PROGRAM_ARGS",),
)
DEFAULT_ENV_OPTIONS = dict(
tools=[
"ar", "as", "gcc", "g++", "gnulink", "platformio", "pioplatform",
"piowinhooks", "piolib", "piotest", "pioupload", "piomisc"
], # yapf: disable
toolpath=[join(util.get_source_dir(), "builder", "tools")],
variables=commonvars,
# Propagating External Environment
PIOVARIABLES=commonvars.keys(),
ENV=environ,
UNIX_TIME=int(time()),
PROGNAME="program",
PIOHOME_DIR=util.get_home_dir(),
PROJECT_DIR=util.get_project_dir(),
PROJECTSRC_DIR=util.get_projectsrc_dir(),
PROJECTTEST_DIR=util.get_projecttest_dir(),
PROJECTDATA_DIR=util.get_projectdata_dir(),
PROJECTPIOENVS_DIR=util.get_projectpioenvs_dir(),
BUILD_DIR=join("$PROJECTPIOENVS_DIR", "$PIOENV"),
BUILDSRC_DIR=join("$BUILD_DIR", "src"),
BUILDTEST_DIR=join("$BUILD_DIR", "test"),
LIBSOURCE_DIRS=[
util.get_projectlib_dir(), util.get_projectlibdeps_dir(),
join("$PIOHOME_DIR", "lib")
"ar",
"cc",
"c++",
"link",
"piohooks",
"pioasm",
"piobuild",
"pioproject",
"pioplatform",
"piotest",
"piotarget",
"piolib",
"pioupload",
"piosize",
"pioino",
"piomisc",
"piointegration",
"piomaxlen",
],
PYTHONEXE=util.get_pythonexe_path())
toolpath=[os.path.join(fs.get_source_dir(), "builder", "tools")],
variables=clivars,
# Propagating External Environment
ENV=os.environ,
UNIX_TIME=int(time()),
BUILD_DIR=os.path.join("$PROJECT_BUILD_DIR", "$PIOENV"),
BUILD_SRC_DIR=os.path.join("$BUILD_DIR", "src"),
BUILD_TEST_DIR=os.path.join("$BUILD_DIR", "test"),
COMPILATIONDB_PATH=os.path.join("$PROJECT_DIR", "compile_commands.json"),
LIBPATH=["$BUILD_DIR"],
PROGNAME="program",
PROGPATH=os.path.join("$BUILD_DIR", "$PROGNAME$PROGSUFFIX"),
PROG_PATH="$PROGPATH", # deprecated
PYTHONEXE=get_pythonexe_path(),
)
# Declare command verbose messages
command_strings = dict(
ARCOM="Archiving",
LINKCOM="Linking",
RANLIBCOM="Indexing",
ASCOM="Compiling",
ASPPCOM="Compiling",
CCCOM="Compiling",
CXXCOM="Compiling",
)
if not int(ARGUMENTS.get("PIOVERBOSE", 0)):
DEFAULT_ENV_OPTIONS['ARCOMSTR'] = "Archiving $TARGET"
DEFAULT_ENV_OPTIONS['LINKCOMSTR'] = "Linking $TARGET"
DEFAULT_ENV_OPTIONS['RANLIBCOMSTR'] = "Indexing $TARGET"
for k in ("ASCOMSTR", "ASPPCOMSTR", "CCCOMSTR", "CXXCOMSTR"):
DEFAULT_ENV_OPTIONS[k] = "Compiling $TARGET"
for name, value in command_strings.items():
DEFAULT_ENV_OPTIONS["%sSTR" % name] = "%s $TARGET" % (value)
env = DefaultEnvironment(**DEFAULT_ENV_OPTIONS)
env.SConscriptChdir(False)
# decode common variables
for k in commonvars.keys():
if k in env:
env[k] = base64.b64decode(env[k])
# Load variables from CLI
env.Replace(
**{
key: PlatformBase.decode_scons_arg(env[key])
for key in list(clivars.keys())
if key in env
}
)
if env.GetOption('clean'):
env.PioClean(env.subst("$BUILD_DIR"))
# Setup project optional directories
config = env.GetProjectConfig()
app.set_session_var("custom_project_conf", config.path)
env.Replace(
PROJECT_DIR=get_project_dir(),
PROJECT_CORE_DIR=config.get("platformio", "core_dir"),
PROJECT_PACKAGES_DIR=config.get("platformio", "packages_dir"),
PROJECT_WORKSPACE_DIR=config.get("platformio", "workspace_dir"),
PROJECT_LIBDEPS_DIR=config.get("platformio", "libdeps_dir"),
PROJECT_INCLUDE_DIR=config.get("platformio", "include_dir"),
PROJECT_SRC_DIR=config.get("platformio", "src_dir"),
PROJECTSRC_DIR="$PROJECT_SRC_DIR", # legacy for dev/platform
PROJECT_TEST_DIR=config.get("platformio", "test_dir"),
PROJECT_DATA_DIR=config.get("platformio", "data_dir"),
PROJECTDATA_DIR="$PROJECT_DATA_DIR", # legacy for dev/platform
PROJECT_BUILD_DIR=config.get("platformio", "build_dir"),
BUILD_TYPE=env.GetBuildType(),
BUILD_CACHE_DIR=config.get("platformio", "build_cache_dir"),
LIBSOURCE_DIRS=[
config.get("platformio", "lib_dir"),
os.path.join("$PROJECT_LIBDEPS_DIR", "$PIOENV"),
config.get("platformio", "globallib_dir"),
],
)
if int(ARGUMENTS.get("ISATTY", 0)):
# pylint: disable=protected-access
click._compat.isatty = lambda stream: True
if env.subst("$BUILD_CACHE_DIR"):
if not os.path.isdir(env.subst("$BUILD_CACHE_DIR")):
os.makedirs(env.subst("$BUILD_CACHE_DIR"))
env.CacheDir("$BUILD_CACHE_DIR")
if not int(ARGUMENTS.get("PIOVERBOSE", 0)):
click.echo("Verbose mode can be enabled via `-v, --verbose` option")
if not os.path.isdir(env.subst("$BUILD_DIR")):
os.makedirs(env.subst("$BUILD_DIR"))
# Dynamically load dependent tools
if "compiledb" in COMMAND_LINE_TARGETS:
env.Tool("compilation_db")
env.LoadProjectOptions()
env.LoadPioPlatform()
env.SConsignFile(
os.path.join(
"$BUILD_CACHE_DIR" if env.subst("$BUILD_CACHE_DIR") else "$BUILD_DIR",
".sconsign%d%d" % (sys.version_info[0], sys.version_info[1]),
)
)
env.SConscript(env.GetExtraScripts("pre"), exports="env")
if env.IsCleanTarget():
env.CleanProject(fullclean=int(ARGUMENTS.get("FULLCLEAN", 0)))
env.Exit(0)
elif not int(ARGUMENTS.get("PIOVERBOSE", 0)):
print "Verbose mode can be enabled via `-v, --verbose` option"
# Handle custom variables from system environment
for var in ("BUILD_FLAGS", "SRC_BUILD_FLAGS", "SRC_FILTER", "EXTRA_SCRIPT",
"UPLOAD_PORT", "UPLOAD_FLAGS", "LIB_EXTRA_DIRS"):
k = "PLATFORMIO_%s" % var
if k not in environ:
continue
if var in ("UPLOAD_PORT", "EXTRA_SCRIPT") or not env.get(var):
env[var] = environ.get(k)
else:
env[var] = "%s%s%s" % (environ.get(k), ", "
if var == "LIB_EXTRA_DIRS" else " ", env[var])
# Parse comma separated items
for opt in ("PIOFRAMEWORK", "LIB_DEPS", "LIB_IGNORE", "LIB_EXTRA_DIRS"):
if opt not in env:
continue
env[opt] = [l.strip() for l in env[opt].split(", ") if l.strip()]
# Configure extra library source directories for LDF
if util.get_project_optional_dir("lib_extra_dirs"):
env.Prepend(LIBSOURCE_DIRS=[
l.strip()
for l in util.get_project_optional_dir("lib_extra_dirs").split(", ")
if l.strip()
])
env.Prepend(LIBSOURCE_DIRS=env.get("LIB_EXTRA_DIRS", []))
env.LoadPioPlatform(commonvars)
env.SConscriptChdir(0)
env.SConsignFile(join("$PROJECTPIOENVS_DIR", ".sconsign.dblite"))
env.SConscript("$BUILD_SCRIPT")
AlwaysBuild(env.Alias("__test", DEFAULT_TARGETS + ["size"]))
if "UPLOAD_FLAGS" in env:
env.Append(UPLOADERFLAGS=["$UPLOAD_FLAGS"])
env.Prepend(UPLOADERFLAGS=["$UPLOAD_FLAGS"])
if env.GetProjectOption("upload_command"):
env.Replace(UPLOADCMD=env.GetProjectOption("upload_command"))
if env.get("EXTRA_SCRIPT"):
env.SConscript(env.get("EXTRA_SCRIPT"), exports="env")
env.SConscript(env.GetExtraScripts("post"), exports="env")
##############################################################################
# Checking program size
if env.get("SIZETOOL") and not (
set(["nobuild", "sizedata"]) & set(COMMAND_LINE_TARGETS)
):
env.Depends("upload", "checkprogsize")
# Replace platform's "size" target with our
_new_targets = [t for t in DEFAULT_TARGETS if str(t) != "size"]
Default(None)
Default(_new_targets)
Default("checkprogsize")
if "compiledb" in COMMAND_LINE_TARGETS:
env.Alias("compiledb", env.CompilationDatabase("$COMPILATIONDB_PATH"))
# Print configured protocols
env.AddPreAction(
"upload",
env.VerboseAction(
lambda source, target, env: env.PrintUploadInfo(),
"Configuring upload protocol...",
),
)
AlwaysBuild(env.Alias("__debug", DEFAULT_TARGETS))
AlwaysBuild(env.Alias("__test", DEFAULT_TARGETS))
env.ProcessDelayedActions()
##############################################################################
if "envdump" in COMMAND_LINE_TARGETS:
print env.Dump()
click.echo(env.Dump())
env.Exit(0)
if "idedata" in COMMAND_LINE_TARGETS:
print "\n%s\n" % json.dumps(env.DumpIDEData())
if env.IsIntegrationDump():
projenv = None
try:
Import("projenv")
except: # pylint: disable=bare-except
projenv = env
data = projenv.DumpIntegrationData(env)
# dump to file for the further reading by project.helpers.load_build_metadata
with open(
projenv.subst(os.path.join("$BUILD_DIR", "idedata.json")),
mode="w",
encoding="utf8",
) as fp:
json.dump(data, fp)
click.echo("\n%s\n" % json.dumps(data)) # pylint: disable=undefined-variable
env.Exit(0)
if "sizedata" in COMMAND_LINE_TARGETS:
AlwaysBuild(
env.Alias(
"sizedata",
DEFAULT_TARGETS,
env.VerboseAction(env.DumpSizeData, "Generating memory usage report..."),
)
)
Default("sizedata")
# issue #4604: process targets sequentially
for index, target in enumerate(
[t for t in COMMAND_LINE_TARGETS if not t.startswith("__")][1:]
):
env.Depends(target, COMMAND_LINE_TARGETS[index])

View File

@ -1,4 +1,4 @@
# Copyright 2014-present PlatformIO <contact@platformio.org>
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.

View File

@ -0,0 +1,29 @@
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import SCons.Tool.asm # pylint: disable=import-error
#
# Resolve https://github.com/platformio/platformio-core/issues/3917
# Avoid forcing .S to bare assembly on Windows OS
#
if ".S" in SCons.Tool.asm.ASSuffixes:
SCons.Tool.asm.ASSuffixes.remove(".S")
if ".S" not in SCons.Tool.asm.ASPPSuffixes:
SCons.Tool.asm.ASPPSuffixes.append(".S")
generate = SCons.Tool.asm.generate
exists = SCons.Tool.asm.exists

View File

@ -0,0 +1,402 @@
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import fnmatch
import os
import sys
from SCons import Builder, Util # pylint: disable=import-error
from SCons.Node import FS # pylint: disable=import-error
from SCons.Script import COMMAND_LINE_TARGETS # pylint: disable=import-error
from SCons.Script import AlwaysBuild # pylint: disable=import-error
from SCons.Script import DefaultEnvironment # pylint: disable=import-error
from SCons.Script import SConscript # pylint: disable=import-error
from platformio import __version__, fs
from platformio.compat import IS_MACOS, string_types
from platformio.package.version import pepver_to_semver
from platformio.proc import where_is_program
SRC_HEADER_EXT = ["h", "hpp"]
SRC_ASM_EXT = ["S", "spp", "SPP", "sx", "s", "asm", "ASM"]
SRC_C_EXT = ["c"]
SRC_CXX_EXT = ["cc", "cpp", "cxx", "c++"]
SRC_BUILD_EXT = SRC_C_EXT + SRC_CXX_EXT + SRC_ASM_EXT
SRC_FILTER_DEFAULT = ["+<*>", "-<.git%s>" % os.sep, "-<.svn%s>" % os.sep]
def scons_patched_match_splitext(path, suffixes=None):
"""Patch SCons Builder, append $OBJSUFFIX to the end of each target"""
tokens = Util.splitext(path)
if suffixes and tokens[1] and tokens[1] in suffixes:
return (path, tokens[1])
return tokens
def GetBuildType(env):
modes = []
if (
set(["__debug", "sizedata"]) # sizedata = for memory inspection
& set(COMMAND_LINE_TARGETS)
or env.GetProjectOption("build_type") == "debug"
):
modes.append("debug")
if "__test" in COMMAND_LINE_TARGETS or env.GetProjectOption("build_type") == "test":
modes.append("test")
return ", ".join(modes or ["release"])
def BuildProgram(env):
env.ProcessProgramDeps()
env.ProcessCompileDbToolchainOption()
env.ProcessProjectDeps()
# append into the beginning a main LD script
if env.get("LDSCRIPT_PATH") and not any("-Wl,-T" in f for f in env["LINKFLAGS"]):
env.Prepend(LINKFLAGS=["-T", env.subst("$LDSCRIPT_PATH")])
# enable "cyclic reference" for linker
if (
env.get("LIBS")
and env.GetCompilerType() == "gcc"
and (env.PioPlatform().is_embedded() or not IS_MACOS)
):
env.Prepend(_LIBFLAGS="-Wl,--start-group ")
env.Append(_LIBFLAGS=" -Wl,--end-group")
program = env.Program(env.subst("$PROGPATH"), env["PIOBUILDFILES"])
env.Replace(PIOMAINPROG=program)
AlwaysBuild(
env.Alias(
"checkprogsize",
program,
env.VerboseAction(env.CheckUploadSize, "Checking size $PIOMAINPROG"),
)
)
print("Building in %s mode" % env["BUILD_TYPE"])
return program
def ProcessProgramDeps(env):
def _append_pio_macros():
core_version = pepver_to_semver(__version__)
env.AppendUnique(
CPPDEFINES=[
(
"PLATFORMIO",
int(
"{0:02d}{1:02d}{2:02d}".format(
core_version.major, core_version.minor, core_version.patch
)
),
)
]
)
_append_pio_macros()
env.PrintConfiguration()
# process extra flags from board
if "BOARD" in env and "build.extra_flags" in env.BoardConfig():
env.ProcessFlags(env.BoardConfig().get("build.extra_flags"))
# apply user flags
env.ProcessFlags(env.get("BUILD_FLAGS"))
# process framework scripts
env.BuildFrameworks(env.get("PIOFRAMEWORK"))
if "debug" in env["BUILD_TYPE"]:
env.ConfigureDebugTarget()
# remove specified flags
env.ProcessUnFlags(env.get("BUILD_UNFLAGS"))
def ProcessCompileDbToolchainOption(env):
if "compiledb" not in COMMAND_LINE_TARGETS:
return
# Resolve absolute path of toolchain
for cmd in ("CC", "CXX", "AS"):
if cmd not in env:
continue
if os.path.isabs(env[cmd]) or '"' in env[cmd]:
continue
env[cmd] = where_is_program(env.subst("$%s" % cmd), env.subst("${ENV['PATH']}"))
if " " in env[cmd]: # issue #4998: Space in compilator path
env[cmd] = f'"{env[cmd]}"'
if env.get("COMPILATIONDB_INCLUDE_TOOLCHAIN"):
print("Warning! `COMPILATIONDB_INCLUDE_TOOLCHAIN` is scoping")
for scope, includes in env.DumpIntegrationIncludes().items():
if scope in ("toolchain",):
env.Append(CPPPATH=includes)
def ProcessProjectDeps(env):
plb = env.ConfigureProjectLibBuilder()
# prepend project libs to the beginning of list
env.Prepend(LIBS=plb.build())
# prepend extra linker related options from libs
env.PrependUnique(
**{
key: plb.env.get(key)
for key in ("LIBS", "LIBPATH", "LINKFLAGS")
if plb.env.get(key)
}
)
if "test" in env["BUILD_TYPE"]:
build_files_before_nums = len(env.get("PIOBUILDFILES", []))
plb.env.BuildSources(
"$BUILD_TEST_DIR", "$PROJECT_TEST_DIR", "$PIOTEST_SRC_FILTER"
)
if len(env.get("PIOBUILDFILES", [])) - build_files_before_nums < 1:
sys.stderr.write(
"Error: Nothing to build. Please put your test suites "
"to the '%s' folder\n" % env.subst("$PROJECT_TEST_DIR")
)
env.Exit(1)
if "test" not in env["BUILD_TYPE"] or env.GetProjectOption("test_build_src"):
plb.env.BuildSources(
"$BUILD_SRC_DIR", "$PROJECT_SRC_DIR", env.get("SRC_FILTER")
)
if not env.get("PIOBUILDFILES") and not COMMAND_LINE_TARGETS:
sys.stderr.write(
"Error: Nothing to build. Please put your source code files "
"to the '%s' folder\n" % env.subst("$PROJECT_SRC_DIR")
)
env.Exit(1)
def ParseFlagsExtended(env, flags): # pylint: disable=too-many-branches
if not isinstance(flags, list):
flags = [flags]
result = {}
for raw in flags:
for key, value in env.ParseFlags(str(raw)).items():
if key not in result:
result[key] = []
result[key].extend(value)
cppdefines = []
for item in result["CPPDEFINES"]:
if not Util.is_Sequence(item):
cppdefines.append(item)
continue
name, value = item[:2]
if '"' in value:
value = value.replace('"', '\\"')
elif value.isdigit():
value = int(value)
elif value.replace(".", "", 1).isdigit():
value = float(value)
cppdefines.append((name, value))
result["CPPDEFINES"] = cppdefines
# fix relative CPPPATH & LIBPATH
for k in ("CPPPATH", "LIBPATH"):
for i, p in enumerate(result.get(k, [])):
p = env.subst(p)
if os.path.isdir(p):
result[k][i] = os.path.abspath(p)
# fix relative LIBs
for i, l in enumerate(result.get("LIBS", [])):
if isinstance(l, FS.File):
result["LIBS"][i] = os.path.abspath(l.get_path())
# fix relative path for "-include"
for i, f in enumerate(result.get("CCFLAGS", [])):
if isinstance(f, tuple) and f[0] == "-include":
result["CCFLAGS"][i] = (f[0], env.subst(f[1].get_path()))
return result
def ProcessFlags(env, flags): # pylint: disable=too-many-branches
if not flags:
return
env.Append(**env.ParseFlagsExtended(flags))
# Cancel any previous definition of name, either built in or
# provided with a -U option // Issue #191
undefines = [
u
for u in env.get("CCFLAGS", [])
if isinstance(u, string_types) and u.startswith("-U")
]
if undefines:
for undef in undefines:
env["CCFLAGS"].remove(undef)
if undef[2:] in env["CPPDEFINES"]:
env["CPPDEFINES"].remove(undef[2:])
env.Append(_CPPDEFFLAGS=" %s" % " ".join(undefines))
def ProcessUnFlags(env, flags):
if not flags:
return
parsed = env.ParseFlagsExtended(flags)
unflag_scopes = tuple(set(["ASPPFLAGS"] + list(parsed.keys())))
for scope in unflag_scopes:
for unflags in parsed.values():
for unflag in unflags:
for current in list(env.get(scope, [])):
conditions = [
unflag == current,
not isinstance(unflag, (tuple, list))
and isinstance(current, (tuple, list))
and unflag == current[0],
]
if any(conditions):
env[scope].remove(current)
def StringifyMacro(env, value): # pylint: disable=unused-argument
return '\\"%s\\"' % value.replace('"', '\\\\\\"')
def MatchSourceFiles(env, src_dir, src_filter=None, src_exts=None):
src_filter = env.subst(src_filter) if src_filter else None
src_filter = src_filter or SRC_FILTER_DEFAULT
src_exts = src_exts or (SRC_BUILD_EXT + SRC_HEADER_EXT)
return fs.match_src_files(env.subst(src_dir), src_filter, src_exts)
def CollectBuildFiles(
env, variant_dir, src_dir, src_filter=None, duplicate=False
): # pylint: disable=too-many-locals
sources = []
variants = []
src_dir = env.subst(src_dir)
if src_dir.endswith(os.sep):
src_dir = src_dir[:-1]
for item in env.MatchSourceFiles(src_dir, src_filter, SRC_BUILD_EXT):
_reldir = os.path.dirname(item)
_src_dir = os.path.join(src_dir, _reldir) if _reldir else src_dir
_var_dir = os.path.join(variant_dir, _reldir) if _reldir else variant_dir
if _var_dir not in variants:
variants.append(_var_dir)
env.VariantDir(_var_dir, _src_dir, duplicate)
sources.append(env.File(os.path.join(_var_dir, os.path.basename(item))))
middlewares = env.get("__PIO_BUILD_MIDDLEWARES")
if not middlewares:
return sources
new_sources = []
for node in sources:
new_node = node
for callback, pattern in middlewares:
if pattern and not fnmatch.fnmatch(node.srcnode().get_path(), pattern):
continue
if callback.__code__.co_argcount == 2:
new_node = callback(env, new_node)
else:
new_node = callback(new_node)
if not new_node:
break
if new_node:
new_sources.append(new_node)
return new_sources
def AddBuildMiddleware(env, callback, pattern=None):
env.Append(__PIO_BUILD_MIDDLEWARES=[(callback, pattern)])
def BuildFrameworks(env, frameworks):
if not frameworks:
return
if "BOARD" not in env:
sys.stderr.write(
"Please specify `board` in `platformio.ini` to use "
"with '%s' framework\n" % ", ".join(frameworks)
)
env.Exit(1)
supported_frameworks = env.BoardConfig().get("frameworks", [])
for name in frameworks:
if name == "arduino":
# Arduino IDE appends .o to the end of filename
Builder.match_splitext = scons_patched_match_splitext
if "nobuild" not in COMMAND_LINE_TARGETS:
env.ConvertInoToCpp()
if name in supported_frameworks:
SConscript(env.GetFrameworkScript(name), exports="env")
else:
sys.stderr.write("Error: This board doesn't support %s framework!\n" % name)
env.Exit(1)
def BuildLibrary(env, variant_dir, src_dir, src_filter=None, nodes=None):
env.ProcessUnFlags(env.get("BUILD_UNFLAGS"))
nodes = nodes or env.CollectBuildFiles(variant_dir, src_dir, src_filter)
return env.StaticLibrary(env.subst(variant_dir), nodes)
def BuildSources(env, variant_dir, src_dir, src_filter=None):
if env.get("PIOMAINPROG"):
sys.stderr.write(
"Error: The main program is already constructed and the inline "
"source files are not allowed. Please use `env.BuildLibrary(...)` "
"or PRE-type script instead."
)
env.Exit(1)
nodes = env.CollectBuildFiles(variant_dir, src_dir, src_filter)
DefaultEnvironment().Append(
PIOBUILDFILES=[
env.Object(node) if isinstance(node, FS.File) else node for node in nodes
]
)
def exists(_):
return True
def generate(env):
env.AddMethod(GetBuildType)
env.AddMethod(BuildProgram)
env.AddMethod(ProcessProgramDeps)
env.AddMethod(ProcessCompileDbToolchainOption)
env.AddMethod(ProcessProjectDeps)
env.AddMethod(ParseFlagsExtended)
env.AddMethod(ProcessFlags)
env.AddMethod(ProcessUnFlags)
env.AddMethod(StringifyMacro)
env.AddMethod(MatchSourceFiles)
env.AddMethod(CollectBuildFiles)
env.AddMethod(AddBuildMiddleware)
env.AddMethod(BuildFrameworks)
env.AddMethod(BuildLibrary)
env.AddMethod(BuildSources)
return env

View File

@ -0,0 +1,50 @@
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
def AddActionWrapper(handler):
def wraps(env, files, action):
if not isinstance(files, (list, tuple, set)):
files = [files]
known_nodes = []
unknown_files = []
for item in files:
nodes = env.arg2nodes(item, env.fs.Entry)
if nodes and nodes[0].exists():
known_nodes.extend(nodes)
else:
unknown_files.append(item)
if unknown_files:
env.Append(**{"_PIO_DELAYED_ACTIONS": [(handler, unknown_files, action)]})
if known_nodes:
return handler(known_nodes, action)
return []
return wraps
def ProcessDelayedActions(env):
for func, nodes, action in env.get("_PIO_DELAYED_ACTIONS", []):
func(nodes, action)
def generate(env):
env.Replace(**{"_PIO_DELAYED_ACTIONS": []})
env.AddMethod(AddActionWrapper(env.AddPreAction), "AddPreAction")
env.AddMethod(AddActionWrapper(env.AddPostAction), "AddPostAction")
env.AddMethod(ProcessDelayedActions)
def exists(_):
return True

View File

@ -0,0 +1,256 @@
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import atexit
import glob
import io
import os
import re
import tempfile
import click
from platformio.compat import get_filesystem_encoding, get_locale_encoding
class InoToCPPConverter:
PROTOTYPE_RE = re.compile(
r"""^(
(?:template\<.*\>\s*)? # template
([a-z_\d\&]+\*?\s+){1,2} # return type
([a-z_\d]+\s*) # name of prototype
\([a-z_,\.\*\&\[\]\s\d]*\) # arguments
)\s*(\{|;) # must end with `{` or `;`
""",
re.X | re.M | re.I,
)
DETECTMAIN_RE = re.compile(r"void\s+(setup|loop)\s*\(", re.M | re.I)
PROTOPTRS_TPLRE = r"\([^&\(]*&(%s)[^\)]*\)"
def __init__(self, env):
self.env = env
self._main_ino = None
self._safe_encoding = None
def read_safe_contents(self, path):
error_reported = False
for encoding in (
"utf-8",
None,
get_filesystem_encoding(),
get_locale_encoding(),
"latin-1",
):
try:
with io.open(path, encoding=encoding) as fp:
contents = fp.read()
self._safe_encoding = encoding
return contents
except UnicodeDecodeError:
if not error_reported:
error_reported = True
click.secho(
"Unicode decode error has occurred, please remove invalid "
"(non-ASCII or non-UTF8) characters from %s file or convert it to UTF-8"
% path,
fg="yellow",
err=True,
)
return ""
def write_safe_contents(self, path, contents):
with io.open(
path, "w", encoding=self._safe_encoding, errors="backslashreplace"
) as fp:
return fp.write(contents)
def is_main_node(self, contents):
return self.DETECTMAIN_RE.search(contents)
def convert(self, nodes):
contents = self.merge(nodes)
if not contents:
return None
return self.process(contents)
def merge(self, nodes):
assert nodes
lines = []
for node in nodes:
contents = self.read_safe_contents(node.get_path())
_lines = ['# 1 "%s"' % node.get_path().replace("\\", "/"), contents]
if self.is_main_node(contents):
lines = _lines + lines
self._main_ino = node.get_path()
else:
lines.extend(_lines)
if not self._main_ino:
self._main_ino = nodes[0].get_path()
return "\n".join(["#include <Arduino.h>"] + lines) if lines else None
def process(self, contents):
out_file = re.sub(r"[\"\'\;]+", "", self._main_ino) + ".cpp"
assert self._gcc_preprocess(contents, out_file)
contents = self.read_safe_contents(out_file)
contents = self._join_multiline_strings(contents)
self.write_safe_contents(out_file, self.append_prototypes(contents))
return out_file
def _gcc_preprocess(self, contents, out_file):
tmp_path = tempfile.mkstemp()[1]
self.write_safe_contents(tmp_path, contents)
self.env.Execute(
self.env.VerboseAction(
'$CXX -o "{0}" -x c++ -fpreprocessed -dD -E "{1}"'.format(
out_file, tmp_path
),
"Converting " + os.path.basename(out_file[:-4]),
)
)
atexit.register(_delete_file, tmp_path)
return os.path.isfile(out_file)
def _join_multiline_strings(self, contents):
if "\\\n" not in contents:
return contents
newlines = []
linenum = 0
stropen = False
for line in contents.split("\n"):
_linenum = self._parse_preproc_line_num(line)
if _linenum is not None:
linenum = _linenum
else:
linenum += 1
if line.endswith("\\"):
if line.startswith('"'):
stropen = True
newlines.append(line[:-1])
continue
if stropen:
newlines[len(newlines) - 1] += line[:-1]
continue
elif stropen and line.endswith(('",', '";')):
newlines[len(newlines) - 1] += line
stropen = False
newlines.append(
'#line %d "%s"' % (linenum, self._main_ino.replace("\\", "/"))
)
continue
newlines.append(line)
return "\n".join(newlines)
@staticmethod
def _parse_preproc_line_num(line):
if not line.startswith("#"):
return None
tokens = line.split(" ", 3)
if len(tokens) > 2 and tokens[1].isdigit():
return int(tokens[1])
return None
def _parse_prototypes(self, contents):
prototypes = []
reserved_keywords = set(["if", "else", "while"])
for match in self.PROTOTYPE_RE.finditer(contents):
if (
set([match.group(2).strip(), match.group(3).strip()])
& reserved_keywords
):
continue
prototypes.append(match)
return prototypes
def _get_total_lines(self, contents):
total = 0
if contents.endswith("\n"):
contents = contents[:-1]
for line in contents.split("\n")[::-1]:
linenum = self._parse_preproc_line_num(line)
if linenum is not None:
return total + linenum
total += 1
return total
def append_prototypes(self, contents):
prototypes = self._parse_prototypes(contents) or []
# skip already declared prototypes
declared = set(m.group(1).strip() for m in prototypes if m.group(4) == ";")
prototypes = [m for m in prototypes if m.group(1).strip() not in declared]
if not prototypes:
return contents
prototype_names = set(m.group(3).strip() for m in prototypes)
split_pos = prototypes[0].start()
match_ptrs = re.search(
self.PROTOPTRS_TPLRE % ("|".join(prototype_names)),
contents[:split_pos],
re.M,
)
if match_ptrs:
split_pos = contents.rfind("\n", 0, match_ptrs.start()) + 1
result = []
result.append(contents[:split_pos].strip())
result.append("%s;" % ";\n".join([m.group(1) for m in prototypes]))
result.append(
'#line %d "%s"'
% (
self._get_total_lines(contents[:split_pos]),
self._main_ino.replace("\\", "/"),
)
)
result.append(contents[split_pos:].strip())
return "\n".join(result)
def FindInoNodes(env):
src_dir = glob.escape(env.subst("$PROJECT_SRC_DIR"))
return env.Glob(os.path.join(src_dir, "*.ino")) + env.Glob(
os.path.join(src_dir, "*.pde")
)
def ConvertInoToCpp(env):
ino_nodes = env.FindInoNodes()
if not ino_nodes:
return
c = InoToCPPConverter(env)
out_file = c.convert(ino_nodes)
atexit.register(_delete_file, out_file)
def _delete_file(path):
try:
if os.path.isfile(path):
os.remove(path)
except: # pylint: disable=bare-except
pass
def generate(env):
env.AddMethod(FindInoNodes)
env.AddMethod(ConvertInoToCpp)
def exists(_):
return True

View File

@ -0,0 +1,188 @@
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import glob
import os
import SCons.Defaults # pylint: disable=import-error
import SCons.Subst # pylint: disable=import-error
from SCons.Script import COMMAND_LINE_TARGETS # pylint: disable=import-error
from platformio.proc import exec_command, where_is_program
def IsIntegrationDump(_):
return set(["__idedata", "idedata"]) & set(COMMAND_LINE_TARGETS)
def DumpIntegrationIncludes(env):
result = dict(build=[], compatlib=[], toolchain=[])
# `env`(project) CPPPATH
result["build"].extend(
[os.path.abspath(env.subst(item)) for item in env.get("CPPPATH", [])]
)
# installed libs
for lb in env.GetLibBuilders():
result["compatlib"].extend(
[os.path.abspath(inc) for inc in lb.get_include_dirs()]
)
# includes from toolchains
p = env.PioPlatform()
for pkg in p.get_installed_packages(with_optional=False):
if p.get_package_type(pkg.metadata.name) != "toolchain":
continue
toolchain_dir = glob.escape(pkg.path)
toolchain_incglobs = [
os.path.join(toolchain_dir, "*", "include", "c++", "*"),
os.path.join(toolchain_dir, "*", "include", "c++", "*", "*-*-*"),
os.path.join(toolchain_dir, "lib", "gcc", "*", "*", "include*"),
os.path.join(toolchain_dir, "*", "include*"),
]
for g in toolchain_incglobs:
result["toolchain"].extend([os.path.abspath(inc) for inc in glob.glob(g)])
return result
def get_gcc_defines(env):
items = []
try:
sysenv = os.environ.copy()
sysenv["PATH"] = str(env["ENV"]["PATH"])
result = exec_command(
"echo | %s -dM -E -" % env.subst("$CC"), env=sysenv, shell=True
)
except OSError:
return items
if result["returncode"] != 0:
return items
for line in result["out"].split("\n"):
tokens = line.strip().split(" ", 2)
if not tokens or tokens[0] != "#define":
continue
if len(tokens) > 2:
items.append("%s=%s" % (tokens[1], tokens[2]))
else:
items.append(tokens[1])
return items
def dump_defines(env):
defines = []
# global symbols
for item in SCons.Defaults.processDefines(env.get("CPPDEFINES", [])):
item = item.strip()
if item:
defines.append(env.subst(item).replace('\\"', '"'))
# special symbol for Atmel AVR MCU
if env["PIOPLATFORM"] == "atmelavr":
board_mcu = env.get("BOARD_MCU")
if not board_mcu and "BOARD" in env:
board_mcu = env.BoardConfig().get("build.mcu")
if board_mcu:
defines.append(
str(
"__AVR_%s__"
% board_mcu.upper()
.replace("ATMEGA", "ATmega")
.replace("ATTINY", "ATtiny")
)
)
# built-in GCC marcos
# if env.GetCompilerType() == "gcc":
# defines.extend(get_gcc_defines(env))
return defines
def dump_svd_path(env):
svd_path = env.GetProjectOption("debug_svd_path")
if svd_path:
return os.path.abspath(svd_path)
if "BOARD" not in env:
return None
try:
svd_path = env.BoardConfig().get("debug.svd_path")
assert svd_path
except (AssertionError, KeyError):
return None
# custom path to SVD file
if os.path.isfile(svd_path):
return svd_path
# default file from ./platform/misc/svd folder
p = env.PioPlatform()
if os.path.isfile(os.path.join(p.get_dir(), "misc", "svd", svd_path)):
return os.path.abspath(os.path.join(p.get_dir(), "misc", "svd", svd_path))
return None
def _split_flags_string(env, s):
args = env.subst_list(s, SCons.Subst.SUBST_CMD)[0]
return [str(arg) for arg in args]
def DumpIntegrationData(*args):
projenv, globalenv = args[0:2] # pylint: disable=unbalanced-tuple-unpacking
data = {
"build_type": globalenv.GetBuildType(),
"env_name": globalenv["PIOENV"],
"libsource_dirs": [
globalenv.subst(item) for item in globalenv.GetLibSourceDirs()
],
"defines": dump_defines(projenv),
"includes": projenv.DumpIntegrationIncludes(),
"cc_flags": _split_flags_string(projenv, "$CFLAGS $CCFLAGS $CPPFLAGS"),
"cxx_flags": _split_flags_string(projenv, "$CXXFLAGS $CCFLAGS $CPPFLAGS"),
"cc_path": where_is_program(
globalenv.subst("$CC"), globalenv.subst("${ENV['PATH']}")
),
"cxx_path": where_is_program(
globalenv.subst("$CXX"), globalenv.subst("${ENV['PATH']}")
),
"gdb_path": where_is_program(
globalenv.subst("$GDB"), globalenv.subst("${ENV['PATH']}")
),
"prog_path": globalenv.subst("$PROGPATH"),
"svd_path": dump_svd_path(globalenv),
"compiler_type": globalenv.GetCompilerType(),
"targets": globalenv.DumpTargets(),
"extra": dict(
flash_images=[
{"offset": item[0], "path": globalenv.subst(item[1])}
for item in globalenv.get("FLASH_EXTRA_IMAGES", [])
]
),
}
for key in ("IDE_EXTRA_DATA", "INTEGRATION_EXTRA_DATA"):
data["extra"].update(globalenv.get(key, {}))
return data
def exists(_):
return True
def generate(env):
env["IDE_EXTRA_DATA"] = {} # legacy support
env["INTEGRATION_EXTRA_DATA"] = {}
env.AddMethod(IsIntegrationDump)
env.AddMethod(DumpIntegrationIncludes)
env.AddMethod(DumpIntegrationData)
return env

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,96 @@
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import hashlib
import os
import re
from SCons.Platform import TempFileMunge # pylint: disable=import-error
from SCons.Script import COMMAND_LINE_TARGETS # pylint: disable=import-error
from SCons.Subst import quote_spaces # pylint: disable=import-error
from platformio.compat import IS_WINDOWS, hashlib_encode_data
# There are the next limits depending on a platform:
# - Windows = 8191
# - Unix = 131072
# We need ~512 characters for compiler and temporary file paths
MAX_LINE_LENGTH = (8191 if IS_WINDOWS else 131072) - 512
WINPATHSEP_RE = re.compile(r"\\([^\"'\\]|$)")
def tempfile_arg_esc_func(arg):
arg = quote_spaces(arg)
if not IS_WINDOWS:
return arg
# GCC requires double Windows slashes, let's use UNIX separator
return WINPATHSEP_RE.sub(r"/\1", arg)
def long_sources_hook(env, sources):
_sources = str(sources).replace("\\", "/")
if len(str(_sources)) < MAX_LINE_LENGTH:
return sources
# fix space in paths
data = []
for line in _sources.split(".o "):
line = line.strip()
if not line.endswith(".o"):
line += ".o"
data.append('"%s"' % line)
return '@"%s"' % _file_long_data(env, " ".join(data))
def _file_long_data(env, data):
build_dir = env.subst("$BUILD_DIR")
if not os.path.isdir(build_dir):
os.makedirs(build_dir)
tmp_file = os.path.join(
build_dir, "longcmd-%s" % hashlib.md5(hashlib_encode_data(data)).hexdigest()
)
if os.path.isfile(tmp_file):
return tmp_file
with open(tmp_file, mode="w", encoding="utf8") as fp:
fp.write(data)
return tmp_file
def exists(env):
return "compiledb" not in COMMAND_LINE_TARGETS and not env.IsIntegrationDump()
def generate(env):
if not exists(env):
return env
kwargs = dict(
_long_sources_hook=long_sources_hook,
TEMPFILE=TempFileMunge,
MAXLINELENGTH=MAX_LINE_LENGTH,
TEMPFILEARGESCFUNC=tempfile_arg_esc_func,
TEMPFILESUFFIX=".tmp",
TEMPFILEDIR="$BUILD_DIR",
)
for name in ("LINKCOM", "ASCOM", "ASPPCOM", "CCCOM", "CXXCOM"):
kwargs[name] = "${TEMPFILE('%s','$%sSTR')}" % (env.get(name), name)
kwargs["ARCOM"] = env.get("ARCOM", "").replace(
"$SOURCES", "${_long_sources_hook(__env__, SOURCES)}"
)
env.Replace(**kwargs)
return env

View File

@ -1,4 +1,4 @@
# Copyright 2014-present PlatformIO <contact@platformio.org>
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -12,313 +12,75 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import absolute_import
import atexit
import re
import os
import sys
from glob import glob
from os import environ, remove, walk
from os.path import basename, isdir, isfile, join, relpath
from tempfile import mkstemp
from SCons.Action import Action
from SCons.Defaults import processDefines
from SCons.Script import ARGUMENTS
from platformio import util
from platformio import fs, util
from platformio.proc import exec_command
class InoToCPPConverter(object):
PROTOTYPE_RE = re.compile(r"""^(
(?:template\<.*\>\s*)? # template
([a-z_\d]+\*?\s+){1,2} # return type
([a-z_\d]+\s*) # name of prototype
\([a-z_,\.\*\&\[\]\s\d]*\) # arguments
)\s*\{ # must end with {
""", re.X | re.M | re.I)
DETECTMAIN_RE = re.compile(r"void\s+(setup|loop)\s*\(", re.M | re.I)
PROTOPTRS_TPLRE = r"\([^&\(]*&(%s)[^\)]*\)"
def __init__(self, env):
self.env = env
self._main_ino = None
def is_main_node(self, contents):
return self.DETECTMAIN_RE.search(contents)
def convert(self, nodes):
contents = self.merge(nodes)
if not contents:
return
return self.process(contents)
def merge(self, nodes):
assert nodes
lines = []
for node in nodes:
contents = node.get_text_contents()
_lines = [
'# 1 "%s"' % node.get_path().replace("\\", "/"), contents
]
if self.is_main_node(contents):
lines = _lines + lines
self._main_ino = node.get_path()
else:
lines.extend(_lines)
if not self._main_ino:
self._main_ino = nodes[0].get_path()
return "\n".join(["#include <Arduino.h>"] + lines) if lines else None
def process(self, contents):
out_file = self._main_ino + ".cpp"
assert self._gcc_preprocess(contents, out_file)
with open(out_file) as fp:
contents = fp.read()
contents = self._join_multiline_strings(contents)
with open(out_file, "w") as fp:
fp.write(self.append_prototypes(contents))
return out_file
def _gcc_preprocess(self, contents, out_file):
tmp_path = mkstemp()[1]
with open(tmp_path, "w") as fp:
fp.write(contents)
self.env.Execute(
self.env.VerboseAction(
'$CXX -o "{0}" -x c++ -fpreprocessed -dD -E "{1}"'.format(
out_file, tmp_path), "Converting " + basename(
out_file[:-4])))
atexit.register(_delete_file, tmp_path)
return isfile(out_file)
def _join_multiline_strings(self, contents):
if "\\\n" not in contents:
return contents
newlines = []
linenum = 0
stropen = False
for line in contents.split("\n"):
_linenum = self._parse_preproc_line_num(line)
if _linenum is not None:
linenum = _linenum
else:
linenum += 1
if line.endswith("\\"):
if line.startswith('"'):
stropen = True
newlines.append(line[:-1])
continue
elif stropen:
newlines[len(newlines) - 1] += line[:-1]
continue
elif stropen and line.endswith('";'):
newlines[len(newlines) - 1] += line
stropen = False
newlines.append('#line %d "%s"' %
(linenum, self._main_ino.replace("\\", "/")))
continue
newlines.append(line)
return "\n".join(newlines)
@staticmethod
def _parse_preproc_line_num(line):
if not line.startswith("#"):
return None
tokens = line.split(" ", 3)
if len(tokens) > 2 and tokens[1].isdigit():
return int(tokens[1])
return None
def _parse_prototypes(self, contents):
prototypes = []
reserved_keywords = set(["if", "else", "while"])
for match in self.PROTOTYPE_RE.finditer(contents):
if (set([match.group(2).strip(), match.group(3).strip()]) &
reserved_keywords):
continue
prototypes.append(match)
return prototypes
def _get_total_lines(self, contents):
total = 0
if contents.endswith("\n"):
contents = contents[:-1]
for line in contents.split("\n")[::-1]:
linenum = self._parse_preproc_line_num(line)
if linenum is not None:
return total + linenum
total += 1
return total
def append_prototypes(self, contents):
prototypes = self._parse_prototypes(contents)
if not prototypes:
return contents
prototype_names = set([m.group(3).strip() for m in prototypes])
split_pos = prototypes[0].start()
match_ptrs = re.search(self.PROTOPTRS_TPLRE %
("|".join(prototype_names)),
contents[:split_pos], re.M)
if match_ptrs:
split_pos = contents.rfind("\n", 0, match_ptrs.start()) + 1
result = []
result.append(contents[:split_pos].strip())
result.append("%s;" % ";\n".join([m.group(1) for m in prototypes]))
result.append('#line %d "%s"' %
(self._get_total_lines(contents[:split_pos]),
self._main_ino.replace("\\", "/")))
result.append(contents[split_pos:].strip())
return "\n".join(result)
def ConvertInoToCpp(env):
src_dir = util.glob_escape(env.subst("$PROJECTSRC_DIR"))
ino_nodes = (
env.Glob(join(src_dir, "*.ino")) + env.Glob(join(src_dir, "*.pde")))
if not ino_nodes:
return
c = InoToCPPConverter(env)
out_file = c.convert(ino_nodes)
atexit.register(_delete_file, out_file)
def _delete_file(path):
@util.memoized()
def GetCompilerType(env): # pylint: disable=too-many-return-statements
CC = env.subst("$CC")
if CC.endswith("-gcc"):
return "gcc"
if os.path.basename(CC) == "clang":
return "clang"
try:
if isfile(path):
remove(path)
except: # pylint: disable=bare-except
pass
def DumpIDEData(env):
def get_includes(env_):
includes = []
for item in env_.get("CPPPATH", []):
includes.append(env_.subst(item))
# installed libs
for lb in env.GetLibBuilders():
includes.extend(lb.get_inc_dirs())
# includes from toolchains
p = env.PioPlatform()
for name in p.get_installed_packages():
if p.get_package_type(name) != "toolchain":
continue
toolchain_dir = util.glob_escape(p.get_package_dir(name))
toolchain_incglobs = [
join(toolchain_dir, "*", "include*"),
join(toolchain_dir, "lib", "gcc", "*", "*", "include*")
]
for g in toolchain_incglobs:
includes.extend(glob(g))
return includes
def get_defines(env_):
defines = []
# global symbols
for item in processDefines(env_.get("CPPDEFINES", [])):
defines.append(env_.subst(item).replace('\\', ''))
# special symbol for Atmel AVR MCU
if env['PIOPLATFORM'] == "atmelavr":
defines.append(
"__AVR_%s__" % env.BoardConfig().get("build.mcu").upper()
.replace("ATMEGA", "ATmega").replace("ATTINY", "ATtiny"))
return defines
LINTCCOM = "$CFLAGS $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS"
LINTCXXCOM = "$CXXFLAGS $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS"
env_ = env.Clone()
data = {
"libsource_dirs":
[env_.subst(l) for l in env_.get("LIBSOURCE_DIRS", [])],
"defines": get_defines(env_),
"includes": get_includes(env_),
"cc_flags": env_.subst(LINTCCOM),
"cxx_flags": env_.subst(LINTCXXCOM),
"cc_path": util.where_is_program(
env_.subst("$CC"), env_.subst("${ENV['PATH']}")),
"cxx_path": util.where_is_program(
env_.subst("$CXX"), env_.subst("${ENV['PATH']}"))
}
# https://github.com/platformio/platformio-atom-ide/issues/34
_new_defines = []
for item in processDefines(env_.get("CPPDEFINES", [])):
item = item.replace('\\"', '"')
if " " in item:
_new_defines.append(item.replace(" ", "\\\\ "))
else:
_new_defines.append(item)
env_.Replace(CPPDEFINES=_new_defines)
data.update({
"cc_flags": env_.subst(LINTCCOM),
"cxx_flags": env_.subst(LINTCXXCOM)
})
return data
def GetCompilerType(env):
try:
sysenv = environ.copy()
sysenv['PATH'] = str(env['ENV']['PATH'])
result = util.exec_command([env.subst("$CC"), "-v"], env=sysenv)
sysenv = os.environ.copy()
sysenv["PATH"] = str(env["ENV"]["PATH"])
result = exec_command([CC, "-v"], env=sysenv)
except OSError:
return None
if result['returncode'] != 0:
if result["returncode"] != 0:
return None
output = "".join([result['out'], result['err']]).lower()
if "clang" in output and "LLVM" in output:
output = "".join([result["out"], result["err"]]).lower()
if "clang version" in output:
return "clang"
elif "gcc" in output:
if "gcc" in output:
return "gcc"
return None
def GetActualLDScript(env):
def _lookup_in_ldpath(script):
for d in env.get("LIBPATH", []):
path = join(env.subst(d), script)
if isfile(path):
path = os.path.join(env.subst(d), script)
if os.path.isfile(path):
return path
return None
script = None
script_in_next = False
for f in env.get("LINKFLAGS", []):
if f.startswith("-Wl,-T"):
script = env.subst(f[6:].replace('"', "").strip())
if isfile(script):
return script
path = _lookup_in_ldpath(script)
if path:
return path
raw_script = None
if f == "-T":
script_in_next = True
continue
if script_in_next:
script_in_next = False
raw_script = f
elif f.startswith("-Wl,-T"):
raw_script = f[6:]
else:
continue
script = env.subst(raw_script.replace('"', "").strip())
if os.path.isfile(script):
return script
path = _lookup_in_ldpath(script)
if path:
return path
if script:
sys.stderr.write(
"Error: Could not find '%s' LD script in LDPATH '%s'\n" %
(script, env.subst("$LIBPATH")))
"Error: Could not find '%s' LD script in LDPATH '%s'\n"
% (script, env.subst("$LIBPATH"))
)
env.Exit(1)
if not script and "LDSCRIPT_PATH" in env:
path = _lookup_in_ldpath(env['LDSCRIPT_PATH'])
path = _lookup_in_ldpath(env["LDSCRIPT_PATH"])
if path:
return path
@ -326,35 +88,66 @@ def GetActualLDScript(env):
env.Exit(1)
def VerboseAction(_, act, actstr):
if int(ARGUMENTS.get("PIOVERBOSE", 0)):
return act
else:
return Action(act, actstr)
def ConfigureDebugTarget(env):
def _cleanup_debug_flags(scope):
if scope not in env:
return
unflags = ["-Os", "-g"]
for level in [0, 1, 2, 3]:
for flag in ("O", "g", "ggdb"):
unflags.append("-%s%d" % (flag, level))
env[scope] = [f for f in env.get(scope, []) if f not in unflags]
env.Append(CPPDEFINES=["__PLATFORMIO_BUILD_DEBUG__"])
for scope in ("ASFLAGS", "CCFLAGS", "LINKFLAGS"):
_cleanup_debug_flags(scope)
debug_flags = env.ParseFlags(
env.get("PIODEBUGFLAGS")
if env.get("PIODEBUGFLAGS")
and not env.GetProjectOptions(as_dict=True).get("debug_build_flags")
else env.GetProjectOption("debug_build_flags")
)
env.MergeFlags(debug_flags)
optimization_flags = [
f for f in debug_flags.get("CCFLAGS", []) if f.startswith(("-O", "-g"))
]
if optimization_flags:
env.AppendUnique(
ASFLAGS=[
# skip -O flags for assembler
f
for f in optimization_flags
if f.startswith("-g")
],
LINKFLAGS=optimization_flags,
)
def PioClean(env, clean_dir):
if not isdir(clean_dir):
print "Build environment is clean"
env.Exit(0)
for root, _, files in walk(clean_dir):
for file_ in files:
remove(join(root, file_))
print "Removed %s" % relpath(join(root, file_))
print "Done cleaning"
util.rmtree_(clean_dir)
env.Exit(0)
def GetExtraScripts(env, scope):
items = []
for item in env.GetProjectOption("extra_scripts", []):
if scope == "post" and ":" not in item:
items.append(item)
elif item.startswith("%s:" % scope):
items.append(item[len(scope) + 1 :])
if not items:
return items
with fs.cd(env.subst("$PROJECT_DIR")):
return [os.path.abspath(env.subst(item)) for item in items]
def generate(env):
env.AddMethod(GetCompilerType)
env.AddMethod(GetActualLDScript)
env.AddMethod(ConfigureDebugTarget)
env.AddMethod(GetExtraScripts)
# bakward-compatibility with Zephyr build script
env.AddMethod(ConfigureDebugTarget, "ConfigureDebugFlags")
def exists(_):
return True
def generate(env):
env.AddMethod(ConvertInoToCpp)
env.AddMethod(DumpIDEData)
env.AddMethod(GetCompilerType)
env.AddMethod(GetActualLDScript)
env.AddMethod(VerboseAction)
env.AddMethod(PioClean)
return env

View File

@ -1,4 +1,4 @@
# Copyright 2014-present PlatformIO <contact@platformio.org>
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -12,87 +12,231 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import absolute_import
import os
import sys
from os.path import isdir, isfile, join
from SCons.Script import COMMAND_LINE_TARGETS
from SCons.Script import ARGUMENTS # pylint: disable=import-error
from SCons.Script import COMMAND_LINE_TARGETS # pylint: disable=import-error
from SCons.Script import DefaultEnvironment # pylint: disable=import-error
from platformio import exception, util
from platformio.managers.platform import PlatformFactory
from platformio import fs, util
from platformio.compat import IS_MACOS, IS_WINDOWS
from platformio.package.meta import PackageItem
from platformio.package.version import get_original_version
from platformio.platform.exception import UnknownBoard
from platformio.platform.factory import PlatformFactory
from platformio.project.config import ProjectOptions
# pylint: disable=too-many-branches, too-many-locals
@util.memoized
def initPioPlatform(name):
return PlatformFactory.newPlatform(name)
@util.memoized()
def _PioPlatform():
env = DefaultEnvironment()
return PlatformFactory.from_env(env["PIOENV"], targets=COMMAND_LINE_TARGETS)
def PioPlatform(env):
variables = {}
for name in env['PIOVARIABLES']:
if name in env:
variables[name.lower()] = env[name]
p = initPioPlatform(env['PLATFORM_MANIFEST'])
p.configure_default_packages(variables, COMMAND_LINE_TARGETS)
return p
def PioPlatform(_):
return _PioPlatform()
def BoardConfig(env, board=None):
p = initPioPlatform(env['PLATFORM_MANIFEST'])
try:
config = p.board_config(board if board else env['BOARD'])
except exception.UnknownBoard as e:
sys.stderr.write("Error: %s\n" % str(e))
env.Exit(1)
return config
with fs.cd(env.subst("$PROJECT_DIR")):
try:
p = env.PioPlatform()
board = board or env.get("BOARD")
assert board, "BoardConfig: Board is not defined"
return p.board_config(board)
except (AssertionError, UnknownBoard) as exc:
sys.stderr.write("Error: %s\n" % str(exc))
env.Exit(1)
return None
def GetFrameworkScript(env, framework):
p = env.PioPlatform()
assert p.frameworks and framework in p.frameworks
script_path = env.subst(p.frameworks[framework]['script'])
if not isfile(script_path):
script_path = join(p.get_dir(), script_path)
script_path = env.subst(p.frameworks[framework]["script"])
if not os.path.isfile(script_path):
script_path = os.path.join(p.get_dir(), script_path)
return script_path
def LoadPioPlatform(env, variables):
def LoadPioPlatform(env):
p = env.PioPlatform()
installed_packages = p.get_installed_packages()
# Add toolchains and uploaders to $PATH
for name in installed_packages:
type_ = p.get_package_type(name)
if type_ not in ("toolchain", "uploader"):
# Ensure real platform name
env["PIOPLATFORM"] = p.name
# Add toolchains and uploaders to $PATH and $*_LIBRARY_PATH
for pkg in p.get_installed_packages():
type_ = p.get_package_type(pkg.metadata.name)
if type_ not in ("toolchain", "uploader", "debugger"):
continue
path = p.get_package_dir(name)
if isdir(join(path, "bin")):
path = join(path, "bin")
env.PrependENVPath("PATH", path)
env.PrependENVPath(
"PATH",
(
os.path.join(pkg.path, "bin")
if os.path.isdir(os.path.join(pkg.path, "bin"))
else pkg.path
),
)
if (
not IS_WINDOWS
and os.path.isdir(os.path.join(pkg.path, "lib"))
and type_ != "toolchain"
):
env.PrependENVPath(
"DYLD_LIBRARY_PATH" if IS_MACOS else "LD_LIBRARY_PATH",
os.path.join(pkg.path, "lib"),
)
# Platform specific LD Scripts
if isdir(join(p.get_dir(), "ldscripts")):
env.Prepend(LIBPATH=[join(p.get_dir(), "ldscripts")])
if os.path.isdir(os.path.join(p.get_dir(), "ldscripts")):
env.Prepend(LIBPATH=[os.path.join(p.get_dir(), "ldscripts")])
if "BOARD" not in env:
return
# update board manifest with overridden data from INI config
board_config = env.BoardConfig()
for k in variables.keys():
if (k in env or
not any([k.startswith("BOARD_"), k.startswith("UPLOAD_")])):
for option, value in env.GetProjectOptions():
if not option.startswith("board_"):
continue
_opt, _val = k.lower().split("_", 1)
if _opt == "board":
_opt = "build"
if _val in board_config.get(_opt):
env.Replace(**{k: board_config.get("%s.%s" % (_opt, _val))})
option = option.lower()[6:]
try:
if isinstance(board_config.get(option), bool):
value = str(value).lower() in ("1", "yes", "true")
elif isinstance(board_config.get(option), int):
value = int(value)
except KeyError:
pass
board_config.update(option, value)
# load default variables from board config
for option_meta in ProjectOptions.values():
if not option_meta.buildenvvar or option_meta.buildenvvar in env:
continue
data_path = (
option_meta.name[6:]
if option_meta.name.startswith("board_")
else option_meta.name.replace("_", ".")
)
try:
env[option_meta.buildenvvar] = board_config.get(data_path)
except KeyError:
pass
if "build.ldscript" in board_config:
env.Replace(LDSCRIPT_PATH=board_config.get("build.ldscript"))
def PrintConfiguration(env): # pylint: disable=too-many-statements
platform = env.PioPlatform()
pkg_metadata = PackageItem(platform.get_dir()).metadata
board_config = env.BoardConfig() if "BOARD" in env else None
def _get_configuration_data():
return (
None
if not board_config
else [
"CONFIGURATION:",
"https://docs.platformio.org/page/boards/%s/%s.html"
% (platform.name, board_config.id),
]
)
def _get_plaform_data():
data = [
"PLATFORM: %s (%s)"
% (
platform.title,
pkg_metadata.version if pkg_metadata else platform.version,
)
]
if (
int(ARGUMENTS.get("PIOVERBOSE", 0))
and pkg_metadata
and pkg_metadata.spec.external
):
data.append("(%s)" % pkg_metadata.spec.uri)
if board_config:
data.extend([">", board_config.get("name")])
return data
def _get_hardware_data():
data = ["HARDWARE:"]
mcu = env.subst("$BOARD_MCU")
f_cpu = env.subst("$BOARD_F_CPU")
if mcu:
data.append(mcu.upper())
if f_cpu:
f_cpu = int("".join([c for c in str(f_cpu) if c.isdigit()]))
data.append("%dMHz," % (f_cpu / 1000000))
if not board_config:
return data
ram = board_config.get("upload", {}).get("maximum_ram_size")
flash = board_config.get("upload", {}).get("maximum_size")
data.append(
"%s RAM, %s Flash"
% (fs.humanize_file_size(ram), fs.humanize_file_size(flash))
)
return data
def _get_debug_data():
debug_tools = (
board_config.get("debug", {}).get("tools") if board_config else None
)
if not debug_tools:
return None
data = [
"DEBUG:",
"Current",
"(%s)"
% board_config.get_debug_tool_name(env.GetProjectOption("debug_tool")),
]
onboard = []
external = []
for key, value in debug_tools.items():
if value.get("onboard"):
onboard.append(key)
else:
external.append(key)
if onboard:
data.extend(["On-board", "(%s)" % ", ".join(sorted(onboard))])
if external:
data.extend(["External", "(%s)" % ", ".join(sorted(external))])
return data
def _get_packages_data():
data = []
for item in platform.dump_used_packages():
original_version = get_original_version(item["version"])
info = "%s @ %s" % (item["name"], item["version"])
extra = []
if original_version:
extra.append(original_version)
if "src_url" in item and int(ARGUMENTS.get("PIOVERBOSE", 0)):
extra.append(item["src_url"])
if extra:
info += " (%s)" % ", ".join(extra)
data.append(info)
if not data:
return None
return ["PACKAGES:"] + ["\n - %s" % d for d in sorted(data)]
for data in (
_get_configuration_data(),
_get_plaform_data(),
_get_hardware_data(),
_get_debug_data(),
_get_packages_data(),
):
if data and len(data) > 1:
print(" ".join(data))
def exists(_):
return True
@ -102,4 +246,5 @@ def generate(env):
env.AddMethod(BoardConfig)
env.AddMethod(GetFrameworkScript)
env.AddMethod(LoadPioPlatform)
env.AddMethod(PrintConfiguration)
return env

View File

@ -0,0 +1,54 @@
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from platformio.compat import MISSING
from platformio.project.config import ProjectConfig
def GetProjectConfig(env):
return ProjectConfig.get_instance(env["PROJECT_CONFIG"])
def GetProjectOptions(env, as_dict=False):
return env.GetProjectConfig().items(env=env["PIOENV"], as_dict=as_dict)
def GetProjectOption(env, option, default=MISSING):
return env.GetProjectConfig().get("env:" + env["PIOENV"], option, default)
def LoadProjectOptions(env):
config = env.GetProjectConfig()
section = "env:" + env["PIOENV"]
for option in config.options(section):
option_meta = config.find_option_meta(section, option)
if (
not option_meta
or not option_meta.buildenvvar
or option_meta.buildenvvar in env
):
continue
env[option_meta.buildenvvar] = config.get(section, option)
def exists(_):
return True
def generate(env):
env.AddMethod(GetProjectConfig)
env.AddMethod(GetProjectOptions)
env.AddMethod(GetProjectOption)
env.AddMethod(LoadProjectOptions)
return env

View File

@ -0,0 +1,266 @@
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# pylint: disable=too-many-locals
import json
import sys
from os import environ, makedirs, remove
from os.path import isdir, join, splitdrive
from elftools.elf.descriptions import describe_sh_flags
from elftools.elf.elffile import ELFFile
from platformio.compat import IS_WINDOWS
from platformio.proc import exec_command
def _run_tool(cmd, env, tool_args):
sysenv = environ.copy()
sysenv["PATH"] = str(env["ENV"]["PATH"])
build_dir = env.subst("$BUILD_DIR")
if not isdir(build_dir):
makedirs(build_dir)
tmp_file = join(build_dir, "size-data-longcmd.txt")
with open(tmp_file, mode="w", encoding="utf8") as fp:
fp.write("\n".join(tool_args))
cmd.append("@" + tmp_file)
result = exec_command(cmd, env=sysenv)
remove(tmp_file)
return result
def _get_symbol_locations(env, elf_path, addrs):
if not addrs:
return {}
cmd = [env.subst("$CC").replace("-gcc", "-addr2line"), "-e", elf_path]
result = _run_tool(cmd, env, addrs)
locations = [line for line in result["out"].split("\n") if line]
assert len(addrs) == len(locations)
return dict(zip(addrs, [loc.strip() for loc in locations]))
def _get_demangled_names(env, mangled_names):
if not mangled_names:
return {}
result = _run_tool(
[env.subst("$CC").replace("-gcc", "-c++filt")], env, mangled_names
)
demangled_names = [line for line in result["out"].split("\n") if line]
assert len(mangled_names) == len(demangled_names)
return dict(
zip(
mangled_names,
[dn.strip().replace("::__FUNCTION__", "") for dn in demangled_names],
)
)
def _collect_sections_info(env, elffile):
sections = {}
for section in elffile.iter_sections():
if section.is_null() or section.name.startswith(".debug"):
continue
section_type = section["sh_type"]
section_flags = describe_sh_flags(section["sh_flags"])
section_size = section.data_size
section_data = {
"name": section.name,
"size": section_size,
"start_addr": section["sh_addr"],
"type": section_type,
"flags": section_flags,
}
sections[section.name] = section_data
sections[section.name]["in_flash"] = env.pioSizeIsFlashSection(section_data)
sections[section.name]["in_ram"] = env.pioSizeIsRamSection(section_data)
return sections
def _collect_symbols_info(env, elffile, elf_path, sections):
symbols = []
symbol_section = elffile.get_section_by_name(".symtab")
if symbol_section.is_null():
sys.stderr.write("Couldn't find symbol table. Is ELF file stripped?")
env.Exit(1)
sysenv = environ.copy()
sysenv["PATH"] = str(env["ENV"]["PATH"])
symbol_addrs = []
mangled_names = []
for s in symbol_section.iter_symbols():
symbol_info = s.entry["st_info"]
symbol_addr = s["st_value"]
symbol_size = s["st_size"]
symbol_type = symbol_info["type"]
if not env.pioSizeIsValidSymbol(s.name, symbol_type, symbol_addr):
continue
symbol = {
"addr": symbol_addr,
"bind": symbol_info["bind"],
"name": s.name,
"type": symbol_type,
"size": symbol_size,
"section": env.pioSizeDetermineSection(sections, symbol_addr),
}
if s.name.startswith("_Z"):
mangled_names.append(s.name)
symbol_addrs.append(hex(symbol_addr))
symbols.append(symbol)
symbol_locations = _get_symbol_locations(env, elf_path, symbol_addrs)
demangled_names = _get_demangled_names(env, mangled_names)
for symbol in symbols:
if symbol["name"].startswith("_Z"):
symbol["demangled_name"] = demangled_names.get(symbol["name"])
location = symbol_locations.get(hex(symbol["addr"]))
if not location or "?" in location:
continue
if IS_WINDOWS:
drive, tail = splitdrive(location)
location = join(drive.upper(), tail)
symbol["file"] = location
symbol["line"] = 0
if ":" in location:
file_, line = location.rsplit(":", 1)
if line.isdigit():
symbol["file"] = file_
symbol["line"] = int(line)
return symbols
def pioSizeDetermineSection(_, sections, symbol_addr):
for section, info in sections.items():
if not info.get("in_flash", False) and not info.get("in_ram", False):
continue
if symbol_addr in range(info["start_addr"], info["start_addr"] + info["size"]):
return section
return "unknown"
def pioSizeIsValidSymbol(_, symbol_name, symbol_type, symbol_address):
return symbol_name and symbol_address != 0 and symbol_type != "STT_NOTYPE"
def pioSizeIsRamSection(_, section):
return (
section.get("type", "") in ("SHT_NOBITS", "SHT_PROGBITS")
and section.get("flags", "") == "WA"
)
def pioSizeIsFlashSection(_, section):
return section.get("type", "") == "SHT_PROGBITS" and "A" in section.get("flags", "")
def pioSizeCalculateFirmwareSize(_, sections):
flash_size = ram_size = 0
for section_info in sections.values():
if section_info.get("in_flash", False):
flash_size += section_info.get("size", 0)
if section_info.get("in_ram", False):
ram_size += section_info.get("size", 0)
return ram_size, flash_size
def DumpSizeData(_, target, source, env): # pylint: disable=unused-argument
data = {"device": {}, "memory": {}, "version": 1}
board = env.BoardConfig()
if board:
data["device"] = {
"mcu": board.get("build.mcu", ""),
"cpu": board.get("build.cpu", ""),
"frequency": board.get("build.f_cpu"),
"flash": int(board.get("upload.maximum_size", 0)),
"ram": int(board.get("upload.maximum_ram_size", 0)),
}
if data["device"]["frequency"] and data["device"]["frequency"].endswith("L"):
data["device"]["frequency"] = int(data["device"]["frequency"][0:-1])
elf_path = env.subst("$PIOMAINPROG")
with open(elf_path, "rb") as fp:
elffile = ELFFile(fp)
if not elffile.has_dwarf_info():
sys.stderr.write("Elf file doesn't contain DWARF information")
env.Exit(1)
sections = _collect_sections_info(env, elffile)
firmware_ram, firmware_flash = env.pioSizeCalculateFirmwareSize(sections)
data["memory"]["total"] = {
"ram_size": firmware_ram,
"flash_size": firmware_flash,
"sections": sections,
}
files = {}
for symbol in _collect_symbols_info(env, elffile, elf_path, sections):
file_path = symbol.get("file") or "unknown"
if not files.get(file_path, {}):
files[file_path] = {"symbols": [], "ram_size": 0, "flash_size": 0}
symbol_size = symbol.get("size", 0)
section = sections.get(symbol.get("section", ""), {})
if not section:
continue
if section.get("in_ram", False):
files[file_path]["ram_size"] += symbol_size
if section.get("in_flash", False):
files[file_path]["flash_size"] += symbol_size
files[file_path]["symbols"].append(symbol)
data["memory"]["files"] = []
for k, v in files.items():
file_data = {"path": k}
file_data.update(v)
data["memory"]["files"].append(file_data)
with open(
join(env.subst("$BUILD_DIR"), "sizedata.json"), mode="w", encoding="utf8"
) as fp:
fp.write(json.dumps(data))
def exists(_):
return True
def generate(env):
env.AddMethod(pioSizeIsRamSection)
env.AddMethod(pioSizeIsFlashSection)
env.AddMethod(pioSizeCalculateFirmwareSize)
env.AddMethod(pioSizeDetermineSection)
env.AddMethod(pioSizeIsValidSymbol)
env.AddMethod(DumpSizeData)
return env

View File

@ -0,0 +1,116 @@
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os
from SCons.Action import Action # pylint: disable=import-error
from SCons.Script import ARGUMENTS # pylint: disable=import-error
from SCons.Script import AlwaysBuild # pylint: disable=import-error
from platformio import compat, fs
def VerboseAction(_, act, actstr):
if int(ARGUMENTS.get("PIOVERBOSE", 0)):
return act
return Action(act, actstr)
def IsCleanTarget(env):
return env.GetOption("clean")
def CleanProject(env, fullclean=False):
def _relpath(path):
if compat.IS_WINDOWS:
prefix = os.getcwd()[:2].lower()
if (
":" not in prefix
or not path.lower().startswith(prefix)
or os.path.relpath(path).startswith("..")
):
return path
return os.path.relpath(path)
def _clean_dir(path):
clean_rel_path = _relpath(path)
print(f"Removing {clean_rel_path}")
fs.rmtree(path)
build_dir = env.subst("$BUILD_DIR")
libdeps_dir = env.subst(os.path.join("$PROJECT_LIBDEPS_DIR", "$PIOENV"))
if os.path.isdir(build_dir):
_clean_dir(build_dir)
else:
print("Build environment is clean")
if fullclean and os.path.isdir(libdeps_dir):
_clean_dir(libdeps_dir)
print("Done cleaning")
def AddTarget( # pylint: disable=too-many-arguments,too-many-positional-arguments
env,
name,
dependencies,
actions,
title=None,
description=None,
group="General",
always_build=True,
):
if "__PIO_TARGETS" not in env:
env["__PIO_TARGETS"] = {}
assert name not in env["__PIO_TARGETS"]
env["__PIO_TARGETS"][name] = dict(
name=name, title=title, description=description, group=group
)
target = env.Alias(name, dependencies, actions)
if always_build:
AlwaysBuild(target)
return target
def AddPlatformTarget(env, *args, **kwargs):
return env.AddTarget(group="Platform", *args, **kwargs)
def AddCustomTarget(env, *args, **kwargs):
return env.AddTarget(group="Custom", *args, **kwargs)
def DumpTargets(env):
targets = env.get("__PIO_TARGETS") or {}
# pre-fill default targets if embedded dev-platform
if env.PioPlatform().is_embedded() and not any(
t["group"] == "Platform" for t in targets.values()
):
targets["upload"] = dict(name="upload", group="Platform", title="Upload")
return list(targets.values())
def exists(_):
return True
def generate(env):
env.AddMethod(VerboseAction)
env.AddMethod(IsCleanTarget)
env.AddMethod(CleanProject)
env.AddMethod(AddTarget)
env.AddMethod(AddPlatformTarget)
env.AddMethod(AddCustomTarget)
env.AddMethod(DumpTargets)
return env

View File

@ -1,4 +1,4 @@
# Copyright 2014-present PlatformIO <contact@platformio.org>
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -12,37 +12,50 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import absolute_import
import os
from os.path import join, sep
from platformio.managers.core import get_core_package_dir
from platformio.builder.tools import piobuild
from platformio.test.result import TestSuite
from platformio.test.runners.factory import TestRunnerFactory
def ProcessTest(env):
def ConfigureTestTarget(env):
env.Append(
CPPDEFINES=["UNIT_TEST", "UNITY_INCLUDE_CONFIG_H"],
CPPPATH=[join("$BUILD_DIR", "UnityTestLib")])
unitylib = env.BuildLibrary(
join("$BUILD_DIR", "UnityTestLib"), get_core_package_dir("tool-unity"))
env.Prepend(LIBS=[unitylib])
CPPDEFINES=["UNIT_TEST"], # deprecated, use PIO_UNIT_TESTING
PIOTEST_SRC_FILTER=[f"+<*.{ext}>" for ext in piobuild.SRC_BUILD_EXT],
)
env.Prepend(CPPPATH=["$PROJECT_TEST_DIR"])
src_filter = None
if "PIOTEST" in env:
src_filter = "+<output_export.cpp>"
src_filter += " +<%s%s>" % (env['PIOTEST'], sep)
if "PIOTEST_RUNNING_NAME" in env:
test_name = env["PIOTEST_RUNNING_NAME"]
while True:
test_name = os.path.dirname(test_name) # parent dir
# skip nested tests (user's side issue?)
if not test_name or os.path.basename(test_name).startswith("test_"):
break
env.Prepend(
PIOTEST_SRC_FILTER=[
f"+<{test_name}{os.path.sep}*.{ext}>"
for ext in piobuild.SRC_BUILD_EXT
],
CPPPATH=[os.path.join("$PROJECT_TEST_DIR", test_name)],
)
return env.CollectBuildFiles(
"$BUILDTEST_DIR",
"$PROJECTTEST_DIR",
src_filter=src_filter,
duplicate=False)
env.Prepend(
PIOTEST_SRC_FILTER=[f"+<$PIOTEST_RUNNING_NAME{os.path.sep}>"],
CPPPATH=[os.path.join("$PROJECT_TEST_DIR", "$PIOTEST_RUNNING_NAME")],
)
test_runner = TestRunnerFactory.new(
TestSuite(env["PIOENV"], env.get("PIOTEST_RUNNING_NAME", "*")),
env.GetProjectConfig(),
)
test_runner.configure_build_env(env)
def generate(env):
env.AddMethod(ConfigureTestTarget)
def exists(_):
return True
def generate(env):
env.AddMethod(ProcessTest)
return env

View File

@ -1,4 +1,4 @@
# Copyright 2014-present PlatformIO <contact@platformio.org>
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -12,20 +12,21 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import absolute_import
# pylint: disable=unused-argument
import os
import re
import sys
from fnmatch import fnmatch
from os import environ
from os.path import isfile, join
from platform import system
from shutil import copyfile
from time import sleep
from SCons.Node.Alias import Alias
from serial import Serial
from SCons.Script import ARGUMENTS # pylint: disable=import-error
from serial import Serial, SerialException
from platformio import util
from platformio import exception, fs
from platformio.device.finder import SerialPortFinder, find_mbed_disk, is_pattern_port
from platformio.device.list.util import list_serial_ports
from platformio.proc import exec_command
def FlushSerialBuffer(env, port):
@ -41,27 +42,27 @@ def FlushSerialBuffer(env, port):
def TouchSerialPort(env, port, baudrate):
port = env.subst(port)
print "Forcing reset using %dbps open/close on port %s" % (baudrate, port)
print("Forcing reset using %dbps open/close on port %s" % (baudrate, port))
try:
s = Serial(port=port, baudrate=baudrate)
s.setDTR(False)
s.close()
except: # pylint: disable=W0702
except: # pylint: disable=bare-except
pass
sleep(0.4)
sleep(0.4) # DO NOT REMOVE THAT (required by SAM-BA based boards)
def WaitForNewSerialPort(env, before):
print "Waiting for the new upload port..."
print("Waiting for the new upload port...")
prev_port = env.subst("$UPLOAD_PORT")
new_port = None
elapsed = 0
sleep(1)
before = [p["port"] for p in before]
while elapsed < 5 and new_port is None:
now = util.get_serialports()
now = [p["port"] for p in list_serial_ports()]
for p in now:
if p not in before:
new_port = p['port']
new_port = p
break
before = now
sleep(0.25)
@ -69,134 +70,178 @@ def WaitForNewSerialPort(env, before):
if not new_port:
for p in now:
if prev_port == p['port']:
new_port = p['port']
if prev_port == p:
new_port = p
break
try:
s = Serial(new_port)
s.close()
except SerialException:
sleep(1)
if not new_port:
sys.stderr.write("Error: Couldn't find a board on the selected port. "
"Check that you have the correct port selected. "
"If it is correct, try pressing the board's reset "
"button after initiating the upload.\n")
sys.stderr.write(
"Error: Couldn't find a board on the selected port. "
"Check that you have the correct port selected. "
"If it is correct, try pressing the board's reset "
"button after initiating the upload.\n"
)
env.Exit(1)
return new_port
def AutodetectUploadPort(*args, **kwargs): # pylint: disable=unused-argument
def AutodetectUploadPort(*args, **kwargs):
env = args[0]
def _get_pattern():
if "UPLOAD_PORT" not in env:
return None
if set(["*", "?", "[", "]"]) & set(env['UPLOAD_PORT']):
return env['UPLOAD_PORT']
return None
def _is_match_pattern(port):
pattern = _get_pattern()
if not pattern:
return True
return fnmatch(port, pattern)
def _look_for_mbed_disk():
msdlabels = ("mbed", "nucleo", "frdm", "microbit")
for item in util.get_logicaldisks():
if not _is_match_pattern(item['disk']):
continue
if (item['name'] and
any([l in item['name'].lower() for l in msdlabels])):
return item['disk']
if isfile(join(item['disk'], "mbed.html")):
return item['disk']
return None
def _look_for_serial_port():
port = None
board_hwids = []
if "BOARD" in env and "build.hwids" in env.BoardConfig():
board_hwids = env.BoardConfig().get("build.hwids")
for item in util.get_serialports(filter_hwid=True):
if not _is_match_pattern(item['port']):
continue
port = item['port']
for hwid in board_hwids:
hwid_str = ("%s:%s" % (hwid[0], hwid[1])).replace("0x", "")
if hwid_str in item['hwid']:
return port
return port
if "UPLOAD_PORT" in env and not _get_pattern():
print env.subst("Use manually specified: $UPLOAD_PORT")
initial_port = env.subst("$UPLOAD_PORT")
upload_protocol = env.subst("$UPLOAD_PROTOCOL")
if initial_port and not is_pattern_port(initial_port):
print(env.subst("Using manually specified: $UPLOAD_PORT"))
return
if "mbed" in env.subst("$PIOFRAMEWORK"):
env.Replace(UPLOAD_PORT=_look_for_mbed_disk())
if upload_protocol == "mbed" or (
"mbed" in env.subst("$PIOFRAMEWORK") and not upload_protocol
):
env.Replace(UPLOAD_PORT=find_mbed_disk(initial_port))
else:
if (system() == "Linux" and not any([
isfile("/etc/udev/rules.d/99-platformio-udev.rules"),
isfile("/lib/udev/rules.d/99-platformio-udev.rules")
])):
sys.stderr.write(
"\nWarning! Please install `99-platformio-udev.rules` and "
"check that your board's PID and VID are listed in the rules."
"\n https://raw.githubusercontent.com/platformio/platformio"
"/develop/scripts/99-platformio-udev.rules\n")
env.Replace(UPLOAD_PORT=_look_for_serial_port())
try:
fs.ensure_udev_rules()
except exception.InvalidUdevRules as exc:
sys.stderr.write("\n%s\n\n" % exc)
env.Replace(
UPLOAD_PORT=SerialPortFinder(
board_config=env.BoardConfig() if "BOARD" in env else None,
upload_protocol=upload_protocol,
prefer_gdb_port="blackmagic" in upload_protocol,
verbose=int(ARGUMENTS.get("PIOVERBOSE", 0)),
).find(initial_port)
)
if env.subst("$UPLOAD_PORT"):
print env.subst("Auto-detected: $UPLOAD_PORT")
print(env.subst("Auto-detected: $UPLOAD_PORT"))
else:
sys.stderr.write(
"Error: Please specify `upload_port` for environment or use "
"global `--upload-port` option.\n"
"For some development platforms it can be a USB flash "
"drive (i.e. /media/<user>/<device name>)\n")
"drive (i.e. /media/<user>/<device name>)\n"
)
env.Exit(1)
def UploadToDisk(_, target, source, env): # pylint: disable=W0613,W0621
def UploadToDisk(_, target, source, env):
assert "UPLOAD_PORT" in env
progname = env.subst("$PROGNAME")
for ext in ("bin", "hex"):
fpath = join(env.subst("$BUILD_DIR"), "%s.%s" % (progname, ext))
if not isfile(fpath):
fpath = os.path.join(env.subst("$BUILD_DIR"), "%s.%s" % (progname, ext))
if not os.path.isfile(fpath):
continue
copyfile(fpath,
join(env.subst("$UPLOAD_PORT"), "%s.%s" % (progname, ext)))
print "Firmware has been successfully uploaded.\n"\
"(Some boards may require manual hard reset)"
copyfile(
fpath, os.path.join(env.subst("$UPLOAD_PORT"), "%s.%s" % (progname, ext))
)
print(
"Firmware has been successfully uploaded.\n"
"(Some boards may require manual hard reset)"
)
def CheckUploadSize(_, target, source, env): # pylint: disable=W0613,W0621
if "BOARD" not in env:
return
max_size = int(env.BoardConfig().get("upload.maximum_size", 0))
if max_size == 0 or "SIZETOOL" not in env:
return
sysenv = environ.copy()
sysenv['PATH'] = str(env['ENV']['PATH'])
cmd = [
env.subst("$SIZETOOL"), "-B",
str(source[0] if isinstance(target[0], Alias) else target[0])
def CheckUploadSize(_, target, source, env):
check_conditions = [
env.get("BOARD"),
env.get("SIZETOOL") or env.get("SIZECHECKCMD"),
]
result = util.exec_command(cmd, env=sysenv)
if result['returncode'] != 0:
if not all(check_conditions):
return
program_max_size = int(env.BoardConfig().get("upload.maximum_size", 0))
data_max_size = int(env.BoardConfig().get("upload.maximum_ram_size", 0))
if program_max_size == 0:
return
print result['out'].strip()
line = result['out'].strip().splitlines()[1]
values = [v.strip() for v in line.split("\t")]
used_size = int(values[0]) + int(values[1])
def _configure_defaults():
env.Replace(
SIZECHECKCMD="$SIZETOOL -B -d $SOURCES",
SIZEPROGREGEXP=r"^(\d+)\s+(\d+)\s+\d+\s",
SIZEDATAREGEXP=r"^\d+\s+(\d+)\s+(\d+)\s+\d+",
)
if used_size > max_size:
sys.stderr.write("Error: The program size (%d bytes) is greater "
"than maximum allowed (%s bytes)\n" %
(used_size, max_size))
def _get_size_output():
cmd = env.get("SIZECHECKCMD")
if not cmd:
return None
if not isinstance(cmd, list):
cmd = cmd.split()
cmd = [arg.replace("$SOURCES", str(source[0])) for arg in cmd if arg]
sysenv = os.environ.copy()
sysenv["PATH"] = str(env["ENV"]["PATH"])
result = exec_command(env.subst(cmd), env=sysenv)
if result["returncode"] != 0:
return None
return result["out"].strip()
def _calculate_size(output, pattern):
if not output or not pattern:
return -1
size = 0
regexp = re.compile(pattern)
for line in output.split("\n"):
line = line.strip()
if not line:
continue
match = regexp.search(line)
if not match:
continue
size += sum(int(value) for value in match.groups())
return size
def _format_availale_bytes(value, total):
percent_raw = float(value) / float(total)
blocks_per_progress = 10
used_blocks = min(
int(round(blocks_per_progress * percent_raw)), blocks_per_progress
)
return "[{:{}}] {: 6.1%} (used {:d} bytes from {:d} bytes)".format(
"=" * used_blocks, blocks_per_progress, percent_raw, value, total
)
if not env.get("SIZECHECKCMD") and not env.get("SIZEPROGREGEXP"):
_configure_defaults()
output = _get_size_output()
program_size = _calculate_size(output, env.get("SIZEPROGREGEXP"))
data_size = _calculate_size(output, env.get("SIZEDATAREGEXP"))
print('Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"')
if data_max_size and data_size > -1:
print("RAM: %s" % _format_availale_bytes(data_size, data_max_size))
if program_size > -1:
print("Flash: %s" % _format_availale_bytes(program_size, program_max_size))
if int(ARGUMENTS.get("PIOVERBOSE", 0)):
print(output)
if data_max_size and data_size > data_max_size:
sys.stderr.write(
"Warning! The data size (%d bytes) is greater "
"than maximum allowed (%s bytes)\n" % (data_size, data_max_size)
)
if program_size > program_max_size:
sys.stderr.write(
"Error: The program size (%d bytes) is greater "
"than maximum allowed (%s bytes)\n" % (program_size, program_max_size)
)
env.Exit(1)
def PrintUploadInfo(env):
configured = env.subst("$UPLOAD_PROTOCOL")
available = [configured] if configured else []
if "BOARD" in env:
available.extend(env.BoardConfig().get("upload", {}).get("protocols", []))
if available:
print("AVAILABLE: %s" % ", ".join(sorted(set(available))))
if configured:
print("CURRENT: upload_protocol = %s" % configured)
def exists(_):
return True
@ -208,4 +253,5 @@ def generate(env):
env.AddMethod(AutodetectUploadPort)
env.AddMethod(UploadToDisk)
env.AddMethod(CheckUploadSize)
env.AddMethod(PrintUploadInfo)
return env

View File

@ -1,88 +0,0 @@
# Copyright 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from hashlib import md5
from os import makedirs
from os.path import isdir, isfile, join
from platform import system
# Windows CLI has limit with command length to 8192
# Leave 2000 chars for flags and other options
MAX_SOURCES_LENGTH = 6000
def long_sources_hook(env, sources):
_sources = str(sources).replace("\\", "/")
if len(str(_sources)) < MAX_SOURCES_LENGTH:
return sources
# fix space in paths
data = []
for line in _sources.split(".o "):
line = line.strip()
if not line.endswith(".o"):
line += ".o"
data.append('"%s"' % line)
return '@"%s"' % _file_long_data(env, " ".join(data))
def long_incflags_hook(env, incflags):
_incflags = env.subst(incflags).replace("\\", "/")
if len(_incflags) < MAX_SOURCES_LENGTH:
return incflags
# fix space in paths
data = []
for line in _incflags.split(" -I"):
line = line.strip()
if not line.startswith("-I"):
line = "-I" + line
data.append('-I"%s"' % line[2:])
return '@"%s"' % _file_long_data(env, " ".join(data))
def _file_long_data(env, data):
build_dir = env.subst("$BUILD_DIR")
if not isdir(build_dir):
makedirs(build_dir)
tmp_file = join(build_dir, "longcmd-%s" % md5(data).hexdigest())
if isfile(tmp_file):
return tmp_file
with open(tmp_file, "w") as fp:
fp.write(data)
return tmp_file
def exists(_):
return True
def generate(env):
if system() != "Windows":
return
env.Replace(_long_sources_hook=long_sources_hook)
env.Replace(_long_incflags_hook=long_incflags_hook)
coms = {}
for key in ("ARCOM", "LINKCOM"):
coms[key] = env.get(key, "").replace(
"$SOURCES", "${_long_sources_hook(__env__, SOURCES)}")
for key in ("_CCCOMCOM", "ASPPCOM"):
coms[key] = env.get(key, "").replace(
"$_CPPINCFLAGS", "${_long_incflags_hook(__env__, _CPPINCFLAGS)}")
env.Replace(**coms)
return env

View File

@ -1,291 +0,0 @@
# Copyright 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import absolute_import
import re
import sys
from glob import glob
from os import sep, walk
from os.path import basename, dirname, isdir, join, realpath
from SCons.Action import Action
from SCons.Script import (COMMAND_LINE_TARGETS, AlwaysBuild,
DefaultEnvironment, SConscript)
from SCons.Util import case_sensitive_suffixes, is_Sequence
from platformio.util import glob_escape, pioversion_to_intstr
SRC_BUILD_EXT = ["c", "cpp", "S", "spp", "SPP", "sx", "s", "asm", "ASM"]
SRC_HEADER_EXT = ["h", "hpp"]
SRC_FILTER_DEFAULT = ["+<*>", "-<.git%s>" % sep, "-<svn%s>" % sep]
def BuildProgram(env):
def _append_pio_macros():
env.AppendUnique(CPPDEFINES=[(
"PLATFORMIO",
int("{0:02d}{1:02d}{2:02d}".format(*pioversion_to_intstr())))])
_append_pio_macros()
# fix ASM handling under non-casitive OS
if not case_sensitive_suffixes(".s", ".S"):
env.Replace(AS="$CC", ASCOM="$ASPPCOM")
# process extra flags from board
if "BOARD" in env and "build.extra_flags" in env.BoardConfig():
env.ProcessFlags(env.BoardConfig().get("build.extra_flags"))
# remove base flags
env.ProcessUnFlags(env.get("BUILD_UNFLAGS"))
# apply user flags
env.ProcessFlags(env.get("BUILD_FLAGS"))
env.BuildFrameworks(env.get("PIOFRAMEWORK"))
# restore PIO macros if it was deleted by framework
_append_pio_macros()
# build dependent libs
deplibs = env.BuildDependentLibraries("$PROJECTSRC_DIR")
# append specified LD_SCRIPT
if ("LDSCRIPT_PATH" in env and
not any(["-Wl,-T" in f for f in env['LINKFLAGS']])):
env.Append(LINKFLAGS=['-Wl,-T"$LDSCRIPT_PATH"'])
# enable "cyclic reference" for linker
if env.get("LIBS", deplibs) and env.GetCompilerType() == "gcc":
env.Prepend(_LIBFLAGS="-Wl,--start-group ")
env.Append(_LIBFLAGS=" -Wl,--end-group")
# Handle SRC_BUILD_FLAGS
env.ProcessFlags(env.get("SRC_BUILD_FLAGS"))
env.Append(
CPPPATH=["$PROJECTSRC_DIR"],
LIBS=deplibs,
LIBPATH=["$BUILD_DIR"],
PIOBUILDFILES=env.CollectBuildFiles(
"$BUILDSRC_DIR",
"$PROJECTSRC_DIR",
src_filter=env.get("SRC_FILTER"),
duplicate=False))
if "__test" in COMMAND_LINE_TARGETS:
env.Append(PIOBUILDFILES=env.ProcessTest())
if not env['PIOBUILDFILES'] and not COMMAND_LINE_TARGETS:
sys.stderr.write(
"Error: Nothing to build. Please put your source code files "
"to '%s' folder\n" % env.subst("$PROJECTSRC_DIR"))
env.Exit(1)
program = env.Program(
join("$BUILD_DIR", env.subst("$PROGNAME")), env['PIOBUILDFILES'])
checksize_action = Action(env.CheckUploadSize, "Checking program size")
AlwaysBuild(env.Alias("checkprogsize", program, checksize_action))
if set(["upload", "program"]) & set(COMMAND_LINE_TARGETS):
env.AddPostAction(program, checksize_action)
return program
def ProcessFlags(env, flags): # pylint: disable=too-many-branches
if not flags:
return
if isinstance(flags, list):
flags = " ".join(flags)
parsed_flags = env.ParseFlags(str(flags))
for flag in parsed_flags.pop("CPPDEFINES"):
if not is_Sequence(flag):
env.Append(CPPDEFINES=flag)
continue
_key, _value = flag[:2]
if '\"' in _value:
_value = _value.replace('\"', '\\\"')
elif _value.isdigit():
_value = int(_value)
elif _value.replace(".", "", 1).isdigit():
_value = float(_value)
env.Append(CPPDEFINES=(_key, _value))
env.Append(**parsed_flags)
# fix relative CPPPATH & LIBPATH
for k in ("CPPPATH", "LIBPATH"):
for i, p in enumerate(env.get(k, [])):
if isdir(p):
env[k][i] = realpath(p)
# fix relative path for "-include"
for i, f in enumerate(env.get("CCFLAGS", [])):
if isinstance(f, tuple) and f[0] == "-include":
env['CCFLAGS'][i] = (f[0], env.File(realpath(f[1].get_path())))
# Cancel any previous definition of name, either built in or
# provided with a -D option // Issue #191
undefines = [
u for u in env.get("CCFLAGS", [])
if isinstance(u, basestring) and u.startswith("-U")
]
if undefines:
for undef in undefines:
env['CCFLAGS'].remove(undef)
env.Append(_CPPDEFFLAGS=" %s" % " ".join(undefines))
def ProcessUnFlags(env, flags):
if not flags:
return
if isinstance(flags, list):
flags = " ".join(flags)
parsed_flags = env.ParseFlags(str(flags))
all_flags = []
for items in parsed_flags.values():
all_flags.extend(items)
all_flags = set(all_flags)
for key in parsed_flags:
cur_flags = set(env.Flatten(env.get(key, [])))
for item in cur_flags & all_flags:
while item in env[key]:
env[key].remove(item)
def IsFileWithExt(env, file_, ext): # pylint: disable=W0613
if basename(file_).startswith("."):
return False
for e in ext:
if file_.endswith(".%s" % e):
return True
return False
def MatchSourceFiles(env, src_dir, src_filter=None):
SRC_FILTER_PATTERNS_RE = re.compile(r"(\+|\-)<([^>]+)>")
def _append_build_item(items, item, src_dir):
if env.IsFileWithExt(item, SRC_BUILD_EXT + SRC_HEADER_EXT):
items.add(item.replace(src_dir + sep, ""))
src_dir = env.subst(src_dir)
src_filter = src_filter or SRC_FILTER_DEFAULT
if isinstance(src_filter, list) or isinstance(src_filter, tuple):
src_filter = " ".join(src_filter)
matches = set()
# correct fs directory separator
src_filter = src_filter.replace("/", sep).replace("\\", sep)
for (action, pattern) in SRC_FILTER_PATTERNS_RE.findall(src_filter):
items = set()
for item in glob(join(glob_escape(src_dir), pattern)):
if isdir(item):
for root, _, files in walk(item, followlinks=True):
for f in files:
_append_build_item(items, join(root, f), src_dir)
else:
_append_build_item(items, item, src_dir)
if action == "+":
matches |= items
else:
matches -= items
return sorted(list(matches))
def CollectBuildFiles(env,
variant_dir,
src_dir,
src_filter=None,
duplicate=False):
sources = []
variants = []
src_dir = env.subst(src_dir)
if src_dir.endswith(sep):
src_dir = src_dir[:-1]
for item in env.MatchSourceFiles(src_dir, src_filter):
_reldir = dirname(item)
_src_dir = join(src_dir, _reldir) if _reldir else src_dir
_var_dir = join(variant_dir, _reldir) if _reldir else variant_dir
if _var_dir not in variants:
variants.append(_var_dir)
env.VariantDir(_var_dir, _src_dir, duplicate)
if env.IsFileWithExt(item, SRC_BUILD_EXT):
sources.append(env.File(join(_var_dir, basename(item))))
return sources
def BuildFrameworks(env, frameworks):
if not frameworks:
return
if "BOARD" not in env:
sys.stderr.write("Please specify `board` in `platformio.ini` to use "
"with '%s' framework\n" % ", ".join(frameworks))
env.Exit(1)
board_frameworks = env.BoardConfig().get("frameworks", [])
if frameworks == ["platformio"]:
if board_frameworks:
frameworks.insert(0, board_frameworks[0])
else:
sys.stderr.write(
"Error: Please specify `board` in `platformio.ini`\n")
env.Exit(1)
for f in frameworks:
if f in ("arduino", "energia"):
env.ConvertInoToCpp()
if f in board_frameworks:
SConscript(env.GetFrameworkScript(f))
else:
sys.stderr.write(
"Error: This board doesn't support %s framework!\n" % f)
env.Exit(1)
def BuildLibrary(env, variant_dir, src_dir, src_filter=None):
lib = env.Clone()
return lib.StaticLibrary(
lib.subst(variant_dir),
lib.CollectBuildFiles(variant_dir, src_dir, src_filter=src_filter))
def BuildSources(env, variant_dir, src_dir, src_filter=None):
DefaultEnvironment().Append(PIOBUILDFILES=env.Clone().CollectBuildFiles(
variant_dir, src_dir, src_filter=src_filter))
def exists(_):
return True
def generate(env):
env.AddMethod(BuildProgram)
env.AddMethod(ProcessFlags)
env.AddMethod(ProcessUnFlags)
env.AddMethod(IsFileWithExt)
env.AddMethod(MatchSourceFiles)
env.AddMethod(CollectBuildFiles)
env.AddMethod(BuildFrameworks)
env.AddMethod(BuildLibrary)
env.AddMethod(BuildSources)
return env

165
platformio/cache.py Normal file
View File

@ -0,0 +1,165 @@
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import codecs
import hashlib
import os
from time import time
from platformio import app, fs
from platformio.compat import hashlib_encode_data
from platformio.package.lockfile import LockFile
from platformio.project.helpers import get_project_cache_dir
class ContentCache:
def __init__(self, namespace=None):
self.cache_dir = os.path.join(get_project_cache_dir(), namespace or "content")
self._db_path = os.path.join(self.cache_dir, "db.data")
self._lockfile = None
if not os.path.isdir(self.cache_dir):
os.makedirs(self.cache_dir)
def __enter__(self):
# cleanup obsolete items
self.delete()
return self
def __exit__(self, type_, value, traceback):
pass
@staticmethod
def key_from_args(*args):
h = hashlib.sha1()
for arg in args:
if arg:
h.update(hashlib_encode_data(arg))
return h.hexdigest()
def get_cache_path(self, key):
assert "/" not in key and "\\" not in key
key = str(key)
assert len(key) > 3
return os.path.join(self.cache_dir, key)
def get(self, key):
cache_path = self.get_cache_path(key)
if not os.path.isfile(cache_path):
return None
with codecs.open(cache_path, "rb", encoding="utf8") as fp:
return fp.read()
def set(self, key, data, valid):
if not app.get_setting("enable_cache"):
return False
cache_path = self.get_cache_path(key)
if os.path.isfile(cache_path):
self.delete(key)
if not data:
return False
tdmap = {"s": 1, "m": 60, "h": 3600, "d": 86400}
assert valid.endswith(tuple(tdmap))
expire_time = int(time() + tdmap[valid[-1]] * int(valid[:-1]))
if not self._lock_dbindex():
return False
if not os.path.isdir(os.path.dirname(cache_path)):
os.makedirs(os.path.dirname(cache_path))
try:
with codecs.open(cache_path, mode="wb", encoding="utf8") as fp:
fp.write(data)
with open(self._db_path, mode="a", encoding="utf8") as fp:
fp.write("%s=%s\n" % (str(expire_time), os.path.basename(cache_path)))
except UnicodeError:
if os.path.isfile(cache_path):
try:
os.remove(cache_path)
except OSError:
pass
return self._unlock_dbindex()
def delete(self, keys=None):
"""Keys=None, delete expired items"""
if not os.path.isfile(self._db_path):
return None
if not keys:
keys = []
if not isinstance(keys, list):
keys = [keys]
paths_for_delete = [self.get_cache_path(k) for k in keys]
found = False
newlines = []
with open(self._db_path, encoding="utf8") as fp:
for line in fp.readlines():
line = line.strip()
if "=" not in line:
continue
expire, fname = line.split("=")
path = os.path.join(self.cache_dir, fname)
try:
if (
time() < int(expire)
and os.path.isfile(path)
and path not in paths_for_delete
):
newlines.append(line)
continue
except ValueError:
pass
found = True
if os.path.isfile(path):
try:
os.remove(path)
if not os.listdir(os.path.dirname(path)):
fs.rmtree(os.path.dirname(path))
except OSError:
pass
if found and self._lock_dbindex():
with open(self._db_path, mode="w", encoding="utf8") as fp:
fp.write("\n".join(newlines) + "\n")
self._unlock_dbindex()
return True
def clean(self):
if not os.path.isdir(self.cache_dir):
return
fs.rmtree(self.cache_dir)
def _lock_dbindex(self):
self._lockfile = LockFile(self.cache_dir)
try:
self._lockfile.acquire()
except: # pylint: disable=bare-except
return False
return True
def _unlock_dbindex(self):
if self._lockfile:
self._lockfile.release()
return True
#
# Helpers
#
def cleanup_content_cache(namespace=None):
with ContentCache(namespace) as cc:
cc.clean()

View File

@ -0,0 +1,13 @@
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

348
platformio/check/cli.py Normal file
View File

@ -0,0 +1,348 @@
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# pylint: disable=too-many-arguments,too-many-locals,too-many-branches
# pylint: disable=redefined-builtin,too-many-statements
import json
import os
import shutil
from collections import Counter
from time import time
import click
from tabulate import tabulate
from platformio import app, exception, fs, util
from platformio.check.defect import DefectItem
from platformio.check.tools import CheckToolFactory
from platformio.project.config import ProjectConfig
from platformio.project.helpers import find_project_dir_above, get_project_dir
@click.command("check", short_help="Static Code Analysis")
@click.option("-e", "--environment", multiple=True)
@click.option(
"-d",
"--project-dir",
default=os.getcwd,
type=click.Path(exists=True, file_okay=True, dir_okay=True, writable=True),
)
@click.option(
"-c",
"--project-conf",
type=click.Path(exists=True, file_okay=True, dir_okay=False, readable=True),
)
@click.option("--pattern", multiple=True, hidden=True)
@click.option("-f", "--src-filters", multiple=True)
@click.option("--flags", multiple=True)
@click.option(
"--severity", multiple=True, type=click.Choice(DefectItem.SEVERITY_LABELS.values())
)
@click.option("-s", "--silent", is_flag=True)
@click.option("-v", "--verbose", is_flag=True)
@click.option("--json-output", is_flag=True)
@click.option(
"--fail-on-defect",
multiple=True,
type=click.Choice(DefectItem.SEVERITY_LABELS.values()),
)
@click.option("--skip-packages", is_flag=True)
def cli( # pylint: disable=too-many-positional-arguments
environment,
project_dir,
project_conf,
src_filters,
pattern,
flags,
severity,
silent,
verbose,
json_output,
fail_on_defect,
skip_packages,
):
app.set_session_var("custom_project_conf", project_conf)
# find project directory on upper level
if os.path.isfile(project_dir):
project_dir = find_project_dir_above(project_dir)
results = []
with fs.cd(project_dir):
config = ProjectConfig.get_instance(project_conf)
config.validate(environment)
default_envs = config.default_envs()
for envname in config.envs():
skipenv = any(
[
environment and envname not in environment,
not environment and default_envs and envname not in default_envs,
]
)
env_options = config.items(env=envname, as_dict=True)
env_dump = []
for k, v in env_options.items():
if k not in ("platform", "framework", "board"):
continue
env_dump.append(
"%s: %s" % (k, ", ".join(v) if isinstance(v, list) else v)
)
default_src_filters = []
for d in (
config.get("platformio", "src_dir"),
config.get("platformio", "include_dir"),
):
try:
default_src_filters.append("+<%s>" % os.path.relpath(d))
except ValueError as exc:
# On Windows if sources are located on a different logical drive
if not json_output and not silent:
click.echo(
"Error: Project cannot be analyzed! The project folder `%s`"
" is located on a different logical drive\n" % d
)
raise exception.ReturnErrorCode(1) from exc
env_src_filters = (
src_filters
or pattern
or env_options.get(
"check_src_filters",
env_options.get("check_patterns", default_src_filters),
)
)
tool_options = dict(
verbose=verbose,
silent=silent,
src_filters=env_src_filters,
flags=flags or env_options.get("check_flags"),
severity=(
[DefectItem.SEVERITY_LABELS[DefectItem.SEVERITY_HIGH]]
if silent
else severity or config.get("env:" + envname, "check_severity")
),
skip_packages=skip_packages or env_options.get("check_skip_packages"),
platform_packages=env_options.get("platform_packages"),
)
for tool in config.get("env:" + envname, "check_tool"):
if skipenv:
results.append({"env": envname, "tool": tool})
continue
if not silent and not json_output:
print_processing_header(tool, envname, env_dump)
ct = CheckToolFactory.new(
tool, os.getcwd(), config, envname, tool_options
)
result = {"env": envname, "tool": tool, "duration": time()}
rc = ct.check(
on_defect_callback=(
None
if (json_output or verbose)
else lambda defect: click.echo(repr(defect))
)
)
result["defects"] = ct.get_defects()
result["duration"] = time() - result["duration"]
result["succeeded"] = rc == 0
if fail_on_defect:
result["succeeded"] = rc == 0 and not any(
DefectItem.SEVERITY_LABELS[d.severity] in fail_on_defect
for d in result["defects"]
)
result["stats"] = collect_component_stats(result)
results.append(result)
if verbose:
click.echo("\n".join(repr(d) for d in result["defects"]))
if not json_output and not silent:
if rc != 0:
click.echo(
"Error: %s failed to perform check! Please "
"examine tool output in verbose mode." % tool
)
elif not result["defects"]:
click.echo("No defects found")
print_processing_footer(result)
if json_output:
click.echo(json.dumps(results_to_json(results)))
elif not silent:
print_check_summary(results, verbose=verbose)
# Reset custom project config
app.set_session_var("custom_project_conf", None)
command_failed = any(r.get("succeeded") is False for r in results)
if command_failed:
raise exception.ReturnErrorCode(1)
def results_to_json(raw):
results = []
for item in raw:
if item.get("succeeded") is None:
continue
item.update(
{
"succeeded": bool(item.get("succeeded")),
"defects": [d.as_dict() for d in item.get("defects", [])],
}
)
results.append(item)
return results
def print_processing_header(tool, envname, envdump):
click.echo(
"Checking %s > %s (%s)"
% (click.style(envname, fg="cyan", bold=True), tool, "; ".join(envdump))
)
terminal_width = shutil.get_terminal_size().columns
click.secho("-" * terminal_width, bold=True)
def print_processing_footer(result):
is_failed = not result.get("succeeded")
util.print_labeled_bar(
"[%s] Took %.2f seconds"
% (
(
click.style("FAILED", fg="red", bold=True)
if is_failed
else click.style("PASSED", fg="green", bold=True)
),
result["duration"],
),
is_error=is_failed,
)
def collect_component_stats(result):
components = {}
def _append_defect(component, defect):
if not components.get(component):
components[component] = Counter()
components[component].update({DefectItem.SEVERITY_LABELS[defect.severity]: 1})
for defect in result.get("defects", []):
component = os.path.dirname(defect.file) or defect.file
_append_defect(component, defect)
if component.lower().startswith(get_project_dir().lower()):
while os.sep in component:
component = os.path.dirname(component)
_append_defect(component, defect)
return components
def print_defects_stats(results):
if not results:
return
component_stats = {}
for r in results:
for k, v in r.get("stats", {}).items():
if not component_stats.get(k):
component_stats[k] = Counter()
component_stats[k].update(r["stats"][k])
if not component_stats:
return
severity_labels = list(DefectItem.SEVERITY_LABELS.values())
severity_labels.reverse()
tabular_data = []
for k, v in component_stats.items():
tool_defect = [v.get(s, 0) for s in severity_labels]
tabular_data.append([k] + tool_defect)
total = ["Total"] + [sum(d) for d in list(zip(*tabular_data))[1:]]
tabular_data.sort()
tabular_data.append([]) # Empty line as delimiter
tabular_data.append(total)
headers = ["Component"]
headers.extend([label.upper() for label in severity_labels])
headers = [click.style(h, bold=True) for h in headers]
click.echo(tabulate(tabular_data, headers=headers, numalign="center"))
click.echo()
def print_check_summary(results, verbose=False):
click.echo()
tabular_data = []
succeeded_nums = 0
failed_nums = 0
duration = 0
print_defects_stats(results)
for result in results:
duration += result.get("duration", 0)
if result.get("succeeded") is False:
failed_nums += 1
status_str = click.style("FAILED", fg="red")
elif result.get("succeeded") is None:
status_str = "IGNORED"
if not verbose:
continue
else:
succeeded_nums += 1
status_str = click.style("PASSED", fg="green")
tabular_data.append(
(
click.style(result["env"], fg="cyan"),
result["tool"],
status_str,
util.humanize_duration_time(result.get("duration")),
)
)
click.echo(
tabulate(
tabular_data,
headers=[
click.style(s, bold=True)
for s in ("Environment", "Tool", "Status", "Duration")
],
),
err=failed_nums,
)
util.print_labeled_bar(
"%s%d succeeded in %s"
% (
"%d failed, " % failed_nums if failed_nums else "",
succeeded_nums,
util.humanize_duration_time(duration),
),
is_error=failed_nums,
fg="red" if failed_nums else "green",
)

View File

@ -0,0 +1,95 @@
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import click
from platformio.exception import PlatformioException
from platformio.project.helpers import get_project_dir
# pylint: disable=too-many-instance-attributes, redefined-builtin
# pylint: disable=too-many-arguments
class DefectItem:
SEVERITY_HIGH = 1
SEVERITY_MEDIUM = 2
SEVERITY_LOW = 4
SEVERITY_LABELS = {4: "low", 2: "medium", 1: "high"}
def __init__( # pylint: disable=too-many-positional-arguments
self,
severity,
category,
message,
file=None,
line=0,
column=0,
id=None,
callstack=None,
cwe=None,
):
assert severity in (self.SEVERITY_HIGH, self.SEVERITY_MEDIUM, self.SEVERITY_LOW)
self.severity = severity
self.category = category
self.message = message
self.line = int(line)
self.column = int(column)
self.callstack = callstack
self.cwe = cwe
self.id = id
self.file = file or "unknown"
if file.lower().startswith(get_project_dir().lower()):
self.file = os.path.relpath(file, get_project_dir())
def __repr__(self):
defect_color = None
if self.severity == self.SEVERITY_HIGH:
defect_color = "red"
elif self.severity == self.SEVERITY_MEDIUM:
defect_color = "yellow"
format_str = "{file}:{line}: [{severity}:{category}] {message} {id}"
return format_str.format(
severity=click.style(self.SEVERITY_LABELS[self.severity], fg=defect_color),
category=click.style(self.category.lower(), fg=defect_color),
file=click.style(self.file, bold=True),
message=self.message,
line=self.line,
id="%s" % "[%s]" % self.id if self.id else "",
)
def __or__(self, defect):
return self.severity | defect.severity
@staticmethod
def severity_to_int(label):
for key, value in DefectItem.SEVERITY_LABELS.items():
if label == value:
return key
raise PlatformioException("Unknown severity label -> %s" % label)
def as_dict(self):
return {
"severity": self.SEVERITY_LABELS[self.severity],
"category": self.category,
"message": self.message,
"file": os.path.abspath(self.file),
"line": self.line,
"column": self.column,
"callstack": self.callstack,
"id": self.id,
"cwe": self.cwe,
}

View File

@ -0,0 +1,33 @@
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from platformio import exception
from platformio.check.tools.clangtidy import ClangtidyCheckTool
from platformio.check.tools.cppcheck import CppcheckCheckTool
from platformio.check.tools.pvsstudio import PvsStudioCheckTool
class CheckToolFactory:
@staticmethod
def new(tool, project_dir, config, envname, options):
cls = None
if tool == "cppcheck":
cls = CppcheckCheckTool
elif tool == "clangtidy":
cls = ClangtidyCheckTool
elif tool == "pvs-studio":
cls = PvsStudioCheckTool
else:
raise exception.PlatformioException("Unknown check tool `%s`" % tool)
return cls(project_dir, config, envname, options)

View File

@ -0,0 +1,267 @@
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import tempfile
import click
from platformio import fs, proc
from platformio.check.defect import DefectItem
from platformio.package.manager.core import get_core_package_dir
from platformio.package.meta import PackageSpec
from platformio.project.helpers import load_build_metadata
class CheckToolBase: # pylint: disable=too-many-instance-attributes
def __init__(self, project_dir, config, envname, options):
self.config = config
self.envname = envname
self.options = options
self.project_dir = project_dir
self.cc_flags = []
self.cxx_flags = []
self.cpp_includes = []
self.cpp_defines = []
self.toolchain_defines = []
self._tmp_files = []
self.cc_path = None
self.cxx_path = None
self._defects = []
self._on_defect_callback = None
self._bad_input = False
self._load_cpp_data()
# detect all defects by default
if not self.options.get("severity"):
self.options["severity"] = [
DefectItem.SEVERITY_LOW,
DefectItem.SEVERITY_MEDIUM,
DefectItem.SEVERITY_HIGH,
]
# cast to severity by ids
self.options["severity"] = [
s if isinstance(s, int) else DefectItem.severity_to_int(s)
for s in self.options["severity"]
]
def _load_cpp_data(self):
data = load_build_metadata(self.project_dir, self.envname)
if not data:
return
self.cc_flags = data.get("cc_flags", [])
self.cxx_flags = data.get("cxx_flags", [])
self.cpp_includes = self._dump_includes(data.get("includes", {}))
self.cpp_defines = data.get("defines", [])
self.cc_path = data.get("cc_path")
self.cxx_path = data.get("cxx_path")
self.toolchain_defines = self._get_toolchain_defines()
def get_tool_dir(self, pkg_name):
for spec in self.options["platform_packages"] or []:
spec = PackageSpec(spec)
if spec.name == pkg_name:
return get_core_package_dir(pkg_name, spec=spec)
return get_core_package_dir(pkg_name)
def get_flags(self, tool):
result = []
flags = self.options.get("flags") or []
for flag in flags:
if ":" not in flag or flag.startswith("-"):
result.extend([f for f in flag.split(" ") if f])
elif flag.startswith("%s:" % tool):
result.extend([f for f in flag.split(":", 1)[1].split(" ") if f])
return result
def _get_toolchain_defines(self):
def _extract_defines(language, includes_file):
build_flags = self.cxx_flags if language == "c++" else self.cc_flags
defines = []
cmd = "echo | %s -x %s %s %s -dM -E -" % (
self.cc_path,
language,
" ".join(
[f for f in build_flags if f.startswith(("-m", "-f", "-std"))]
),
includes_file,
)
result = proc.exec_command(cmd, shell=True)
if result["returncode"] != 0:
click.echo("Warning: Failed to extract toolchain defines!")
if self.options.get("verbose"):
click.echo(result["out"])
click.echo(result["err"])
for line in result["out"].split("\n"):
tokens = line.strip().split(" ", 2)
if not tokens or tokens[0] != "#define":
continue
if len(tokens) > 2:
defines.append("%s=%s" % (tokens[1], tokens[2]))
else:
defines.append(tokens[1])
return defines
incflags_file = self._long_includes_hook(self.cpp_includes)
return {lang: _extract_defines(lang, incflags_file) for lang in ("c", "c++")}
def _create_tmp_file(self, data):
with tempfile.NamedTemporaryFile("w", delete=False) as fp:
fp.write(data)
self._tmp_files.append(fp.name)
return fp.name
def _long_includes_hook(self, includes):
data = []
for inc in includes:
data.append('-I"%s"' % fs.to_unix_path(inc))
return '@"%s"' % self._create_tmp_file(" ".join(data))
@staticmethod
def _dump_includes(includes_map):
result = []
for includes in includes_map.values():
for include in includes:
if include not in result:
result.append(include)
return result
@staticmethod
def is_flag_set(flag, flags):
return any(flag in f for f in flags)
def get_defects(self):
return self._defects
def configure_command(self):
raise NotImplementedError
def on_tool_output(self, line):
line = self.tool_output_filter(line)
if not line:
return
defect = self.parse_defect(line)
if not isinstance(defect, DefectItem):
if self.options.get("verbose"):
click.echo(line)
return
if defect.severity not in self.options["severity"]:
return
self._defects.append(defect)
if self._on_defect_callback:
self._on_defect_callback(defect)
@staticmethod
def tool_output_filter(line):
return line
@staticmethod
def parse_defect(raw_line):
return raw_line
def clean_up(self):
for f in self._tmp_files:
if os.path.isfile(f):
os.remove(f)
@staticmethod
def is_check_successful(cmd_result):
return cmd_result["returncode"] == 0
def execute_check_cmd(self, cmd):
result = proc.exec_command(
cmd,
stdout=proc.LineBufferedAsyncPipe(self.on_tool_output),
stderr=proc.LineBufferedAsyncPipe(self.on_tool_output),
)
if not self.is_check_successful(result):
click.echo(
"\nError: Failed to execute check command! Exited with code %d."
% result["returncode"]
)
if self.options.get("verbose"):
click.echo(result["out"])
click.echo(result["err"])
self._bad_input = True
return result
@staticmethod
def get_project_target_files(project_dir, src_filters):
c_extension = (".c",)
cpp_extensions = (".cc", ".cpp", ".cxx", ".ino")
header_extensions = (".h", ".hh", ".hpp", ".hxx")
result = {"c": [], "c++": [], "headers": []}
def _add_file(path):
if path.endswith(header_extensions):
result["headers"].append(os.path.abspath(path))
elif path.endswith(c_extension):
result["c"].append(os.path.abspath(path))
elif path.endswith(cpp_extensions):
result["c++"].append(os.path.abspath(path))
src_filters = normalize_src_filters(src_filters)
for f in fs.match_src_files(project_dir, src_filters):
_add_file(f)
return result
def check(self, on_defect_callback=None):
self._on_defect_callback = on_defect_callback
cmd = self.configure_command()
if cmd:
if self.options.get("verbose"):
click.echo(" ".join(cmd))
self.execute_check_cmd(cmd)
else:
if self.options.get("verbose"):
click.echo("Error: Couldn't configure command")
self._bad_input = True
self.clean_up()
return self._bad_input
#
# Helpers
#
def normalize_src_filters(src_filters):
def _normalize(src_filters):
return (
src_filters
if src_filters.startswith(("+<", "-<"))
else "+<%s>" % src_filters
)
if isinstance(src_filters, (list, tuple)):
return " ".join([_normalize(f) for f in src_filters])
return _normalize(src_filters)

View File

@ -0,0 +1,90 @@
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import re
from os.path import join
from platformio.check.defect import DefectItem
from platformio.check.tools.base import CheckToolBase
class ClangtidyCheckTool(CheckToolBase):
def tool_output_filter(self, line): # pylint: disable=arguments-differ
if not self.options.get("verbose") and "[clang-diagnostic-error]" in line:
return ""
if "[CommonOptionsParser]" in line:
self._bad_input = True
return line
if any(d in line for d in ("note: ", "error: ", "warning: ")):
return line
return ""
def parse_defect(self, raw_line): # pylint: disable=arguments-differ
match = re.match(r"^(.*):(\d+):(\d+):\s+([^:]+):\s(.+)\[([^]]+)\]$", raw_line)
if not match:
return raw_line
file_, line, column, category, message, defect_id = match.groups()
severity = DefectItem.SEVERITY_LOW
if category == "error":
severity = DefectItem.SEVERITY_HIGH
elif category == "warning":
severity = DefectItem.SEVERITY_MEDIUM
return DefectItem(severity, category, message, file_, line, column, defect_id)
@staticmethod
def is_check_successful(cmd_result):
# Note: Clang-Tidy returns 1 for not critical compilation errors,
# so 0 and 1 are only acceptable values
return cmd_result["returncode"] < 2
def configure_command(self):
tool_path = join(self.get_tool_dir("tool-clangtidy"), "clang-tidy")
cmd = [tool_path, "--quiet"]
flags = self.get_flags("clangtidy")
if not (
self.is_flag_set("--checks", flags) or self.is_flag_set("--config", flags)
):
cmd.append("--checks=*")
project_files = self.get_project_target_files(
self.project_dir, self.options["src_filters"]
)
src_files = []
for items in project_files.values():
src_files.extend(items)
cmd.extend(flags + src_files + ["--"])
cmd.extend(
["-D%s" % d for d in self.cpp_defines + self.toolchain_defines["c++"]]
)
includes = []
for inc in self.cpp_includes:
if self.options.get("skip_packages") and inc.lower().startswith(
self.config.get("platformio", "packages_dir").lower()
):
continue
includes.append(inc)
cmd.extend(["-I%s" % inc for inc in includes])
return cmd

View File

@ -0,0 +1,271 @@
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import click
from platformio import proc
from platformio.check.defect import DefectItem
from platformio.check.tools.base import CheckToolBase
class CppcheckCheckTool(CheckToolBase):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self._field_delimiter = "<&PIO&>"
self._buffer = ""
self.defect_fields = [
"severity",
"message",
"file",
"line",
"column",
"callstack",
"cwe",
"id",
]
def tool_output_filter(self, line): # pylint: disable=arguments-differ
if (
not self.options.get("verbose")
and "--suppress=unmatchedSuppression:" in line
):
return ""
if any(
msg in line
for msg in (
"No C or C++ source files found",
"unrecognized command line option",
"there was an internal error",
)
):
self._bad_input = True
return line
def parse_defect(self, raw_line): # pylint: disable=arguments-differ
if self._field_delimiter not in raw_line:
return None
self._buffer += raw_line
if any(f not in self._buffer for f in self.defect_fields):
return None
args = {}
for field in self._buffer.split(self._field_delimiter):
field = field.strip().replace('"', "")
name, value = field.split("=", 1)
args[name] = value
args["category"] = args["severity"]
if args["severity"] == "error":
args["severity"] = DefectItem.SEVERITY_HIGH
elif args["severity"] == "warning":
args["severity"] = DefectItem.SEVERITY_MEDIUM
else:
args["severity"] = DefectItem.SEVERITY_LOW
# Skip defects found in third-party software, but keep in mind that such defects
# might break checking process so defects from project files are not reported
breaking_defect_ids = ("preprocessorErrorDirective", "syntaxError")
if (
args.get("file", "")
.lower()
.startswith(self.config.get("platformio", "packages_dir").lower())
):
if args["id"] in breaking_defect_ids:
if self.options.get("verbose"):
click.echo(
"Error: Found a breaking defect '%s' in %s:%s\n"
"Please note: check results might not be valid!\n"
"Try adding --skip-packages"
% (args.get("message"), args.get("file"), args.get("line"))
)
click.echo()
self._bad_input = True
self._buffer = ""
return None
self._buffer = ""
return DefectItem(**args)
def configure_command(self, language, src_file): # pylint: disable=arguments-differ
tool_path = os.path.join(self.get_tool_dir("tool-cppcheck"), "cppcheck")
cmd = [
tool_path,
"--addon-python=%s" % proc.get_pythonexe_path(),
"--error-exitcode=3",
"--verbose" if self.options.get("verbose") else "--quiet",
]
cmd.append(
'--template="%s"'
% self._field_delimiter.join(
["{0}={{{0}}}".format(f) for f in self.defect_fields]
)
)
flags = self.get_flags("cppcheck")
if not flags:
# by default user can suppress reporting individual defects
# directly in code // cppcheck-suppress warningID
cmd.append("--inline-suppr")
if not self.is_flag_set("--platform", flags):
cmd.append("--platform=unspecified")
if not self.is_flag_set("--enable", flags):
enabled_checks = [
"warning",
"style",
"performance",
"portability",
"unusedFunction",
]
cmd.append("--enable=%s" % ",".join(enabled_checks))
if not self.is_flag_set("--language", flags):
cmd.append("--language=" + language)
build_flags = self.cxx_flags if language == "c++" else self.cc_flags
if not self.is_flag_set("--std", flags):
# Try to guess the standard version from the build flags
for flag in build_flags:
if "-std" in flag:
cmd.append("-" + self.convert_language_standard(flag))
cmd.extend(
["-D%s" % d for d in self.cpp_defines + self.toolchain_defines[language]]
)
cmd.extend(flags)
cmd.extend(
"--include=" + inc
for inc in self.get_forced_includes(build_flags, self.cpp_includes)
)
cmd.append("--includes-file=%s" % self._generate_inc_file())
cmd.append('"%s"' % src_file)
return cmd
@staticmethod
def get_forced_includes(build_flags, includes):
def _extract_filepath(flag, include_options, build_flags):
path = ""
for option in include_options:
if not flag.startswith(option):
continue
if flag.split(option)[1].strip():
path = flag.split(option)[1].strip()
elif build_flags.index(flag) + 1 < len(build_flags):
path = build_flags[build_flags.index(flag) + 1]
return path
def _search_include_dir(filepath, include_paths):
for inc_path in include_paths:
path = os.path.join(inc_path, filepath)
if os.path.isfile(path):
return path
return ""
result = []
include_options = ("-include", "-imacros")
for f in build_flags:
if f.startswith(include_options):
filepath = _extract_filepath(f, include_options, build_flags)
if not os.path.isabs(filepath):
filepath = _search_include_dir(filepath, includes)
if os.path.isfile(filepath):
result.append(filepath)
return result
def _generate_src_file(self, src_files):
return self._create_tmp_file("\n".join(src_files))
def _generate_inc_file(self):
result = []
for inc in self.cpp_includes:
if self.options.get("skip_packages") and inc.lower().startswith(
self.config.get("platformio", "packages_dir").lower()
):
continue
result.append(inc)
return self._create_tmp_file("\n".join(result))
def clean_up(self):
super().clean_up()
# delete temporary dump files generated by addons
if not self.is_flag_set("--addon", self.get_flags("cppcheck")):
return
for files in self.get_project_target_files(
self.project_dir, self.options["src_filters"]
).values():
for f in files:
dump_file = f + ".dump"
if os.path.isfile(dump_file):
os.remove(dump_file)
@staticmethod
def is_check_successful(cmd_result):
# Cppcheck is configured to return '3' if a defect is found
return cmd_result["returncode"] in (0, 3)
@staticmethod
def convert_language_standard(flag):
cpp_standards_map = {
"0x": "11",
"1y": "14",
"1z": "17",
"2a": "20",
}
standard = flag[-2:]
# Note: GNU extensions are not supported and converted to regular standards
return flag.replace("gnu", "c").replace(
standard, cpp_standards_map.get(standard, standard)
)
def check(self, on_defect_callback=None):
self._on_defect_callback = on_defect_callback
project_files = self.get_project_target_files(
self.project_dir, self.options["src_filters"]
)
src_files_scope = ("c", "c++")
if not any(project_files[t] for t in src_files_scope):
click.echo("Error: Nothing to check.")
return True
for scope, files in project_files.items():
if scope not in src_files_scope:
continue
for src_file in files:
cmd = self.configure_command(scope, src_file)
if not cmd:
self._bad_input = True
continue
if self.options.get("verbose"):
click.echo(" ".join(cmd))
self.execute_check_cmd(cmd)
self.clean_up()
return self._bad_input

View File

@ -0,0 +1,251 @@
# Copyright (c) 2020-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import shutil
import tempfile
from xml.etree.ElementTree import fromstring
import click
from platformio import proc
from platformio.check.defect import DefectItem
from platformio.check.tools.base import CheckToolBase
from platformio.compat import IS_WINDOWS
class PvsStudioCheckTool(CheckToolBase): # pylint: disable=too-many-instance-attributes
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self._tmp_dir = tempfile.mkdtemp(prefix="piocheck")
self._tmp_preprocessed_file = self._generate_tmp_file_path() + ".i"
self._tmp_output_file = self._generate_tmp_file_path() + ".pvs"
self._tmp_cfg_file = self._generate_tmp_file_path() + ".cfg"
self._tmp_cmd_file = self._generate_tmp_file_path() + ".cmd"
self.tool_path = os.path.join(
self.get_tool_dir("tool-pvs-studio"),
"x64" if IS_WINDOWS else "bin",
"pvs-studio",
)
with open(self._tmp_cfg_file, mode="w", encoding="utf8") as fp:
fp.write(
"exclude-path = "
+ self.config.get("platformio", "packages_dir").replace("\\", "/")
)
with open(self._tmp_cmd_file, mode="w", encoding="utf8") as fp:
fp.write(
" ".join(
['-I"%s"' % inc.replace("\\", "/") for inc in self.cpp_includes]
)
)
def tool_output_filter(self, line): # pylint: disable=arguments-differ
if any(
err_msg in line.lower()
for err_msg in (
"license was not entered",
"license information is incorrect",
)
):
self._bad_input = True
return line
def _process_defects(self, defects):
for defect in defects:
if not isinstance(defect, DefectItem):
return
if defect.severity not in self.options["severity"]:
return
self._defects.append(defect)
if self._on_defect_callback:
self._on_defect_callback(defect)
def _demangle_report(self, output_file):
converter_tool = os.path.join(
self.get_tool_dir("tool-pvs-studio"),
"HtmlGenerator" if IS_WINDOWS else os.path.join("bin", "plog-converter"),
)
cmd = (
converter_tool,
"-t",
"xml",
output_file,
"-m",
"cwe",
"-m",
"misra",
"-a",
# Enable all possible analyzers and defect levels
"GA:1,2,3;64:1,2,3;OP:1,2,3;CS:1,2,3;MISRA:1,2,3",
"--cerr",
)
result = proc.exec_command(cmd)
if result["returncode"] != 0:
click.echo(result["err"])
self._bad_input = True
return result["err"]
def parse_defects(self, output_file):
defects = []
report = self._demangle_report(output_file)
if not report:
self._bad_input = True
return []
try:
defects_data = fromstring(report)
except: # pylint: disable=bare-except
click.echo("Error: Couldn't decode generated report!")
self._bad_input = True
return []
for table in defects_data.iter("PVS-Studio_Analysis_Log"):
message = table.find("Message").text
category = table.find("ErrorType").text
line = table.find("Line").text
file_ = table.find("File").text
defect_id = table.find("ErrorCode").text
cwe = table.find("CWECode")
cwe_id = None
if cwe is not None:
cwe_id = cwe.text.lower().replace("cwe-", "")
misra = table.find("MISRA")
if misra is not None:
message += " [%s]" % misra.text
severity = DefectItem.SEVERITY_LOW
if category == "error":
severity = DefectItem.SEVERITY_HIGH
elif category == "warning":
severity = DefectItem.SEVERITY_MEDIUM
defects.append(
DefectItem(
severity, category, message, file_, line, id=defect_id, cwe=cwe_id
)
)
return defects
def configure_command(self, src_file): # pylint: disable=arguments-differ
if os.path.isfile(self._tmp_output_file):
os.remove(self._tmp_output_file)
if not os.path.isfile(self._tmp_preprocessed_file):
click.echo("Error: Missing preprocessed file for '%s'" % src_file)
return ""
cmd = [
self.tool_path,
"--skip-cl-exe",
"yes",
"--language",
"C" if src_file.endswith(".c") else "C++",
"--preprocessor",
"gcc",
"--cfg",
self._tmp_cfg_file,
"--source-file",
src_file,
"--i-file",
self._tmp_preprocessed_file,
"--output-file",
self._tmp_output_file,
]
flags = self.get_flags("pvs-studio")
if not self.is_flag_set("--platform", flags):
cmd.append("--platform=arm")
cmd.extend(flags)
return cmd
def _generate_tmp_file_path(self):
# pylint: disable=protected-access
return os.path.join(self._tmp_dir, next(tempfile._get_candidate_names()))
def _prepare_preprocessed_file(self, src_file):
if os.path.isfile(self._tmp_preprocessed_file):
os.remove(self._tmp_preprocessed_file)
flags = self.cxx_flags
compiler = self.cxx_path
if src_file.endswith(".c"):
flags = self.cc_flags
compiler = self.cc_path
cmd = [
compiler,
'"%s"' % src_file,
"-E",
"-o",
'"%s"' % self._tmp_preprocessed_file,
]
cmd.extend([f for f in flags if f])
cmd.extend(['"-D%s"' % d.replace('"', '\\"') for d in self.cpp_defines])
cmd.append('@"%s"' % self._tmp_cmd_file)
# Explicitly specify C++ as the language used in .ino files
if src_file.endswith(".ino"):
cmd.insert(1, "-xc++")
result = proc.exec_command(" ".join(cmd), shell=True)
if result["returncode"] != 0 or result["err"]:
if self.options.get("verbose"):
click.echo(" ".join(cmd))
click.echo(result["err"])
self._bad_input = True
def clean_up(self):
super().clean_up()
if os.path.isdir(self._tmp_dir):
shutil.rmtree(self._tmp_dir)
@staticmethod
def is_check_successful(cmd_result):
return (
"license" not in cmd_result["err"].lower() and cmd_result["returncode"] == 0
)
def check(self, on_defect_callback=None):
self._on_defect_callback = on_defect_callback
for scope, files in self.get_project_target_files(
self.project_dir, self.options["src_filters"]
).items():
if scope not in ("c", "c++"):
continue
for src_file in files:
self._prepare_preprocessed_file(src_file)
cmd = self.configure_command(src_file)
if self.options.get("verbose"):
click.echo(" ".join(cmd))
if not cmd:
self._bad_input = True
continue
result = self.execute_check_cmd(cmd)
if result["returncode"] != 0:
continue
self._process_defects(self.parse_defects(self._tmp_output_file))
self.clean_up()
return self._bad_input

110
platformio/cli.py Normal file
View File

@ -0,0 +1,110 @@
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import importlib
from pathlib import Path
import click
class PlatformioCLI(click.MultiCommand):
leftover_args = []
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self._pio_root_path = Path(__file__).parent
self._pio_cmd_aliases = dict(package="pkg")
def _find_pio_commands(self):
def _to_module_path(p):
return (
"platformio." + ".".join(p.relative_to(self._pio_root_path).parts)[:-3]
)
result = {}
for p in self._pio_root_path.rglob("cli.py"):
# skip this module
if p.parent == self._pio_root_path:
continue
cmd_name = p.parent.name
result[self._pio_cmd_aliases.get(cmd_name, cmd_name)] = _to_module_path(p)
# find legacy commands
for p in (self._pio_root_path / "commands").iterdir():
if p.name.startswith("_"):
continue
if (p / "command.py").is_file():
result[p.name] = _to_module_path(p / "command.py")
elif p.name.endswith(".py"):
result[p.name[:-3]] = _to_module_path(p)
return result
@staticmethod
def in_silence():
args = PlatformioCLI.leftover_args
return args and any(
[
args[0] == "debug" and "--interpreter" in " ".join(args),
args[0] == "upgrade",
"--json-output" in args,
"--version" in args,
]
)
@classmethod
def reveal_cmd_path_args(cls, ctx):
result = []
group = ctx.command
args = cls.leftover_args[::]
while args:
cmd_name = args.pop(0)
next_group = group.get_command(ctx, cmd_name)
if next_group:
group = next_group
result.append(cmd_name)
if not hasattr(group, "get_command"):
break
return result
def invoke(self, ctx):
PlatformioCLI.leftover_args = ctx.args
if hasattr(ctx, "protected_args"):
PlatformioCLI.leftover_args = ctx.protected_args + ctx.args
return super().invoke(ctx)
def list_commands(self, ctx):
return sorted(list(self._find_pio_commands()))
def get_command(self, ctx, cmd_name):
commands = self._find_pio_commands()
if cmd_name not in commands:
return self._handle_obsolate_command(ctx, cmd_name)
module = importlib.import_module(commands[cmd_name])
return getattr(module, "cli")
@staticmethod
def _handle_obsolate_command(ctx, cmd_name):
# pylint: disable=import-outside-toplevel
if cmd_name == "init":
from platformio.project.commands.init import project_init_cmd
return project_init_cmd
if cmd_name == "package":
from platformio.package.cli import cli
return cli
raise click.UsageError('No such command "%s"' % cmd_name, ctx)

View File

@ -1,4 +1,4 @@
# Copyright 2014-present PlatformIO <contact@platformio.org>
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.

View File

@ -1,67 +0,0 @@
# Copyright 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# pylint: disable=unused-argument
import sys
import click
from platformio.managers.core import pioplus_call
@click.group("account", short_help="Manage PIO Account")
def cli():
pass
@cli.command("register", short_help="Create new PIO Account")
@click.option("-u", "--username")
def account_register(**kwargs):
pioplus_call(sys.argv[1:])
@cli.command("login", short_help="Log in to PIO Account")
@click.option("-u", "--username")
@click.option("-p", "--password")
def account_login(**kwargs):
pioplus_call(sys.argv[1:])
@cli.command("logout", short_help="Log out of PIO Account")
def account_logout():
pioplus_call(sys.argv[1:])
@cli.command("password", short_help="Change password")
def account_password():
pioplus_call(sys.argv[1:])
@cli.command("token", short_help="Get or regenerate Authentication Token")
@click.option("--regenerate", is_flag=True)
def account_token(**kwargs):
pioplus_call(sys.argv[1:])
@cli.command("forgot", short_help="Forgot password")
@click.option("-u", "--username")
def account_forgot(**kwargs):
pioplus_call(sys.argv[1:])
@cli.command("show", short_help="PIO Account information: groups, permissions")
@click.option("--json-output", is_flag=True)
def account_show(**kwargs):
pioplus_call(sys.argv[1:])

View File

@ -1,4 +1,4 @@
# Copyright 2014-present PlatformIO <contact@platformio.org>
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -13,14 +13,16 @@
# limitations under the License.
import json
import shutil
import click
from tabulate import tabulate
from platformio.exception import APIRequestError, InternetIsOffline
from platformio.managers.platform import PlatformManager
from platformio import fs
from platformio.package.manager.platform import PlatformPackageManager
@click.command("boards", short_help="Embedded Board Explorer")
@click.command("boards", short_help="Board Explorer")
@click.argument("query", required=False)
@click.option("--installed", is_flag=True)
@click.option("--json-output", is_flag=True)
@ -30,79 +32,54 @@ def cli(query, installed, json_output): # pylint: disable=R0912
grpboards = {}
for board in _get_boards(installed):
if query and query.lower() not in json.dumps(board).lower():
if query and not any(
query.lower() in str(board.get(k, "")).lower()
for k in ("id", "name", "mcu", "vendor", "platform", "frameworks")
):
continue
if board['platform'] not in grpboards:
grpboards[board['platform']] = []
grpboards[board['platform']].append(board)
if board["platform"] not in grpboards:
grpboards[board["platform"]] = []
grpboards[board["platform"]].append(board)
terminal_width, _ = click.get_terminal_size()
for (platform, boards) in sorted(grpboards.items()):
terminal_width = shutil.get_terminal_size().columns
for platform, boards in sorted(grpboards.items()):
click.echo("")
click.echo("Platform: ", nl=False)
click.secho(platform, bold=True)
click.echo("-" * terminal_width)
click.echo("=" * terminal_width)
print_boards(boards)
return True
def print_boards(boards):
terminal_width, _ = click.get_terminal_size()
BOARDLIST_TPL = ("{type:<30} {mcu:<14} {frequency:<8} "
" {flash:<7} {ram:<6} {name}")
click.echo(
BOARDLIST_TPL.format(
type=click.style("ID", fg="cyan"),
mcu="MCU",
frequency="Frequency",
flash="Flash",
ram="RAM",
name="Name"))
click.echo("-" * terminal_width)
for board in boards:
ram_size = board['ram']
if ram_size >= 1024:
if ram_size % 1024:
ram_size = "%.1fkB" % (ram_size / 1024.0)
else:
ram_size = "%dkB" % (ram_size / 1024)
else:
ram_size = "%dB" % ram_size
click.echo(
BOARDLIST_TPL.format(
type=click.style(board['id'], fg="cyan"),
mcu=board['mcu'],
frequency="%dMhz" % (board['fcpu'] / 1000000),
flash="%dkB" % (board['rom'] / 1024),
ram=ram_size,
name=board['name']))
tabulate(
[
(
click.style(b["id"], fg="cyan"),
b["mcu"],
"%dMHz" % (b["fcpu"] / 1000000),
fs.humanize_file_size(b["rom"]),
fs.humanize_file_size(b["ram"]),
b["name"],
)
for b in boards
],
headers=["ID", "MCU", "Frequency", "Flash", "RAM", "Name"],
)
)
def _get_boards(installed=False):
boards = PlatformManager().get_installed_boards()
if not installed:
know_boards = ["%s:%s" % (b['platform'], b['id']) for b in boards]
try:
for board in PlatformManager().get_registered_boards():
key = "%s:%s" % (board['platform'], board['id'])
if key not in know_boards:
boards.append(board)
except InternetIsOffline:
pass
return sorted(boards, key=lambda b: b['name'])
pm = PlatformPackageManager()
return pm.get_installed_boards() if installed else pm.get_all_boards()
def _print_boards_json(query, installed=False):
result = []
try:
boards = _get_boards(installed)
except APIRequestError:
if not installed:
boards = _get_boards(True)
for board in boards:
for board in _get_boards(installed):
if query:
search_data = "%s %s" % (board['id'], json.dumps(board).lower())
search_data = "%s %s" % (board["id"], json.dumps(board).lower())
if query.lower() not in search_data.lower():
continue
result.append(board)

View File

@ -1,4 +1,4 @@
# Copyright 2014-present PlatformIO <contact@platformio.org>
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -12,19 +12,18 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from glob import glob
from os import getenv, makedirs, remove
from os.path import abspath, basename, expanduser, isdir, isfile, join
from shutil import copyfile, copytree
from tempfile import mkdtemp
import glob
import os
import shutil
import tempfile
import click
from platformio import app, util
from platformio.commands.init import cli as cmd_init
from platformio.commands.init import validate_boards
from platformio.commands.run import cli as cmd_run
from platformio import fs
from platformio.exception import CIBuildEnvsEmpty
from platformio.project.commands.init import project_init_cmd, validate_boards
from platformio.project.config import ProjectConfig
from platformio.run.cli import cli as cmd_run
def validate_path(ctx, param, value): # pylint: disable=unused-argument
@ -32,69 +31,71 @@ def validate_path(ctx, param, value): # pylint: disable=unused-argument
value = list(value)
for i, p in enumerate(value):
if p.startswith("~"):
value[i] = expanduser(p)
value[i] = abspath(value[i])
if not glob(value[i]):
value[i] = fs.expanduser(p)
value[i] = os.path.abspath(value[i])
if not glob.glob(value[i], recursive=True):
invalid_path = p
break
try:
assert invalid_path is None
return value
except AssertionError:
raise click.BadParameter("Found invalid path: %s" % invalid_path)
except AssertionError as exc:
raise click.BadParameter("Found invalid path: %s" % invalid_path) from exc
@click.command("ci", short_help="Continuous Integration")
@click.argument("src", nargs=-1, callback=validate_path)
@click.option(
"-l", "--lib", multiple=True, callback=validate_path, metavar="DIRECTORY")
@click.option("-l", "--lib", multiple=True, callback=validate_path, metavar="DIRECTORY")
@click.option("--exclude", multiple=True)
@click.option(
"-b", "--board", multiple=True, metavar="ID", callback=validate_boards)
@click.option("-b", "--board", multiple=True, metavar="ID", callback=validate_boards)
@click.option(
"--build-dir",
default=mkdtemp,
type=click.Path(
exists=True,
file_okay=False,
dir_okay=True,
writable=True,
resolve_path=True))
default=tempfile.mkdtemp,
type=click.Path(file_okay=False, dir_okay=True, writable=True),
)
@click.option("--keep-build-dir", is_flag=True)
@click.option(
"-C",
"-c",
"--project-conf",
type=click.Path(
exists=True,
file_okay=True,
dir_okay=False,
readable=True,
resolve_path=True))
type=click.Path(exists=True, file_okay=True, dir_okay=False, readable=True),
)
@click.option("-O", "--project-option", multiple=True)
@click.option("-e", "--environment", "environments", multiple=True)
@click.option("-v", "--verbose", is_flag=True)
@click.pass_context
def cli( # pylint: disable=too-many-arguments
ctx, src, lib, exclude, board, build_dir, keep_build_dir, project_conf,
project_option, verbose):
if not src and getenv("PLATFORMIO_CI_SRC"):
src = validate_path(ctx, None, getenv("PLATFORMIO_CI_SRC").split(":"))
def cli( # pylint: disable=too-many-arguments,too-many-positional-arguments, too-many-branches
ctx,
src,
lib,
exclude,
board,
build_dir,
keep_build_dir,
project_conf,
project_option,
environments,
verbose,
):
if not src and os.getenv("PLATFORMIO_CI_SRC"):
src = validate_path(ctx, None, os.getenv("PLATFORMIO_CI_SRC").split(":"))
if not src:
raise click.BadParameter("Missing argument 'src'")
try:
app.set_session_var("force_option", True)
_clean_dir(build_dir)
if not keep_build_dir and os.path.isdir(build_dir):
fs.rmtree(build_dir)
if not os.path.isdir(build_dir):
os.makedirs(build_dir)
for dir_name, patterns in dict(lib=lib, src=src).iteritems():
for dir_name, patterns in dict(lib=lib, src=src).items():
if not patterns:
continue
contents = []
for p in patterns:
contents += glob(p)
_copy_contents(join(build_dir, dir_name), contents)
contents += glob.glob(p, recursive=True)
_copy_contents(os.path.join(build_dir, dir_name), contents)
if project_conf and isfile(project_conf):
if project_conf and os.path.isfile(project_conf):
_copy_project_conf(build_dir, project_conf)
elif not board:
raise CIBuildEnvsEmpty()
@ -104,66 +105,70 @@ def cli( # pylint: disable=too-many-arguments
# initialise project
ctx.invoke(
cmd_init,
project_init_cmd,
project_dir=build_dir,
board=board,
project_option=project_option)
boards=board,
project_options=project_option,
)
# process project
ctx.invoke(cmd_run, project_dir=build_dir, verbose=verbose)
ctx.invoke(
cmd_run, project_dir=build_dir, environment=environments, verbose=verbose
)
finally:
if not keep_build_dir:
util.rmtree_(build_dir)
fs.rmtree(build_dir)
def _clean_dir(dirpath):
util.rmtree_(dirpath)
makedirs(dirpath)
def _copy_contents(dst_dir, contents):
def _copy_contents(dst_dir, contents): # pylint: disable=too-many-branches
items = {"dirs": set(), "files": set()}
for path in contents:
if isdir(path):
items['dirs'].add(path)
elif isfile(path):
items['files'].add(path)
if os.path.isdir(path):
items["dirs"].add(path)
elif os.path.isfile(path):
items["files"].add(path)
dst_dir_name = basename(dst_dir)
dst_dir_name = os.path.basename(dst_dir)
if dst_dir_name == "src" and len(items['dirs']) == 1:
copytree(list(items['dirs']).pop(), dst_dir, symlinks=True)
if dst_dir_name == "src" and len(items["dirs"]) == 1:
if not os.path.isdir(dst_dir):
shutil.copytree(list(items["dirs"]).pop(), dst_dir, symlinks=True)
else:
makedirs(dst_dir)
for d in items['dirs']:
copytree(d, join(dst_dir, basename(d)), symlinks=True)
if not os.path.isdir(dst_dir):
os.makedirs(dst_dir)
for d in items["dirs"]:
src_dst_dir = os.path.join(dst_dir, os.path.basename(d))
if not os.path.isdir(src_dst_dir):
shutil.copytree(d, src_dst_dir, symlinks=True)
if not items['files']:
if not items["files"]:
return
if dst_dir_name == "lib":
dst_dir = join(dst_dir, mkdtemp(dir=dst_dir))
dst_dir = os.path.join(dst_dir, tempfile.mkdtemp(dir=dst_dir))
for f in items['files']:
copyfile(f, join(dst_dir, basename(f)))
for f in items["files"]:
dst_file = os.path.join(dst_dir, os.path.basename(f))
if f == dst_file:
continue
shutil.copyfile(f, dst_file)
def _exclude_contents(dst_dir, patterns):
contents = []
for p in patterns:
contents += glob(join(util.glob_escape(dst_dir), p))
contents += glob.glob(os.path.join(glob.escape(dst_dir), p), recursive=True)
for path in contents:
path = abspath(path)
if isdir(path):
util.rmtree_(path)
elif isfile(path):
remove(path)
path = os.path.abspath(path)
if os.path.isdir(path):
fs.rmtree(path)
elif os.path.isfile(path):
os.remove(path)
def _copy_project_conf(build_dir, project_conf):
config = util.load_project_config(project_conf)
config = ProjectConfig(project_conf, parse_extra=False)
if config.has_section("platformio"):
config.remove_section("platformio")
with open(join(build_dir, "platformio.ini"), "w") as fp:
config.write(fp)
config.save(os.path.join(build_dir, "platformio.ini"))

View File

@ -1,128 +0,0 @@
# Copyright 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import json
import sys
import click
from serial.tools import miniterm
from platformio.exception import MinitermException
from platformio.util import get_serialports
@click.group(short_help="Monitor device or list existing")
def cli():
pass
@cli.command("list", short_help="List devices")
@click.option("--json-output", is_flag=True)
def device_list(json_output):
if json_output:
click.echo(json.dumps(get_serialports()))
return
for item in get_serialports():
click.secho(item['port'], fg="cyan")
click.echo("-" * len(item['port']))
click.echo("Hardware ID: %s" % item['hwid'])
click.echo("Description: %s" % item['description'])
click.echo("")
@cli.command("monitor", short_help="Monitor device (Serial)")
@click.option("--port", "-p", help="Port, a number or a device name")
@click.option(
"--baud", "-b", type=int, default=9600, help="Set baud rate, default=9600")
@click.option(
"--parity",
default="N",
type=click.Choice(["N", "E", "O", "S", "M"]),
help="Set parity, default=N")
@click.option(
"--rtscts", is_flag=True, help="Enable RTS/CTS flow control, default=Off")
@click.option(
"--xonxoff",
is_flag=True,
help="Enable software flow control, default=Off")
@click.option(
"--rts",
default=None,
type=click.IntRange(0, 1),
help="Set initial RTS line state")
@click.option(
"--dtr",
default=None,
type=click.IntRange(0, 1),
help="Set initial DTR line state")
@click.option("--echo", is_flag=True, help="Enable local echo, default=Off")
@click.option(
"--encoding",
default="UTF-8",
help="Set the encoding for the serial port (e.g. hexlify, "
"Latin1, UTF-8), default: UTF-8")
@click.option("--filter", "-f", multiple=True, help="Add text transformation")
@click.option(
"--eol",
default="CRLF",
type=click.Choice(["CR", "LF", "CRLF"]),
help="End of line mode, default=CRLF")
@click.option(
"--raw", is_flag=True, help="Do not apply any encodings/transformations")
@click.option(
"--exit-char",
type=int,
default=3,
help="ASCII code of special character that is used to exit "
"the application, default=3 (Ctrl+C)")
@click.option(
"--menu-char",
type=int,
default=20,
help="ASCII code of special character that is used to "
"control miniterm (menu), default=20 (DEC)")
@click.option(
"--quiet",
is_flag=True,
help="Diagnostics: suppress non-error messages, default=Off")
def device_monitor(**kwargs):
if not kwargs['port']:
ports = get_serialports(filter_hwid=True)
if len(ports) == 1:
kwargs['port'] = ports[0]['port']
sys.argv = ["monitor"]
for k, v in kwargs.iteritems():
if k in ("port", "baud", "rts", "dtr"):
continue
k = "--" + k.replace("_", "-")
if isinstance(v, bool):
if v:
sys.argv.append(k)
elif isinstance(v, tuple):
for i in v:
sys.argv.extend([k, i])
else:
sys.argv.extend([k, str(v)])
try:
miniterm.main(
default_port=kwargs['port'],
default_baudrate=kwargs['baud'],
default_rts=kwargs['rts'],
default_dtr=kwargs['dtr'])
except Exception as e:
raise MinitermException(e)

View File

@ -0,0 +1,18 @@
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# pylint: disable=unused-import
from platformio.device.monitor.filters.base import (
DeviceMonitorFilterBase as DeviceMonitorFilter,
)

View File

@ -1,353 +0,0 @@
# Copyright 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# pylint: disable=too-many-arguments,too-many-locals, too-many-branches
from os import getcwd, makedirs
from os.path import isdir, isfile, join
from shutil import copyfile
import click
from platformio import exception, util
from platformio.commands.platform import \
platform_install as cli_platform_install
from platformio.ide.projectgenerator import ProjectGenerator
from platformio.managers.platform import PlatformManager
def validate_boards(ctx, param, value): # pylint: disable=W0613
pm = PlatformManager()
for id_ in value:
try:
pm.board_config(id_)
except exception.UnknownBoard:
raise click.BadParameter(
"`%s`. Please search for board ID using `platformio boards` "
"command" % id_)
return value
@click.command(
"init", short_help="Initialize PlatformIO project or update existing")
@click.option(
"--project-dir",
"-d",
default=getcwd,
type=click.Path(
exists=True,
file_okay=False,
dir_okay=True,
writable=True,
resolve_path=True))
@click.option(
"-b", "--board", multiple=True, metavar="ID", callback=validate_boards)
@click.option(
"--ide", type=click.Choice(ProjectGenerator.get_supported_ides()))
@click.option("-O", "--project-option", multiple=True)
@click.option("--env-prefix", default="")
@click.option("-s", "--silent", is_flag=True)
@click.pass_context
def cli(
ctx, # pylint: disable=R0913
project_dir,
board,
ide,
project_option,
env_prefix,
silent):
if not silent:
if project_dir == getcwd():
click.secho(
"\nThe current working directory", fg="yellow", nl=False)
click.secho(" %s " % project_dir, fg="cyan", nl=False)
click.secho(
"will be used for project.\n"
"You can specify another project directory via\n"
"`platformio init -d %PATH_TO_THE_PROJECT_DIR%` command.",
fg="yellow")
click.echo("")
click.echo("The next files/directories have been created in %s" %
click.style(project_dir, fg="cyan"))
click.echo("%s - Project Configuration File" % click.style(
"platformio.ini", fg="cyan"))
click.echo("%s - Put your source files here" % click.style(
"src", fg="cyan"))
click.echo("%s - Put here project specific (private) libraries" %
click.style("lib", fg="cyan"))
init_base_project(project_dir)
if board:
fill_project_envs(ctx, project_dir, board, project_option, env_prefix,
ide is not None)
if ide:
if not board:
board = get_first_board(project_dir)
if board:
board = [board]
if not board:
raise exception.BoardNotDefined()
if len(board) > 1:
click.secho(
"Warning! You have initialised project with more than 1 board"
" for the specified IDE.\n"
"However, the IDE features (code autocompletion, syntax "
"linter) have been configured for the first board '%s' from "
"your list '%s'." % (board[0], ", ".join(board)),
fg="yellow")
pg = ProjectGenerator(project_dir, ide, board[0])
pg.generate()
if not silent:
click.secho(
"\nProject has been successfully initialized!\nUseful commands:\n"
"`platformio run` - process/build project from the current "
"directory\n"
"`platformio run --target upload` or `platformio run -t upload` "
"- upload firmware to embedded board\n"
"`platformio run --target clean` - clean project (remove compiled "
"files)\n"
"`platformio run --help` - additional information",
fg="green")
def get_first_board(project_dir):
config = util.load_project_config(project_dir)
for section in config.sections():
if not section.startswith("env:"):
continue
elif config.has_option(section, "board"):
return config.get(section, "board")
return None
def init_base_project(project_dir):
if not util.is_platformio_project(project_dir):
copyfile(
join(util.get_source_dir(), "projectconftpl.ini"),
join(project_dir, "platformio.ini"))
lib_dir = join(project_dir, "lib")
src_dir = join(project_dir, "src")
config = util.load_project_config(project_dir)
if config.has_option("platformio", "src_dir"):
src_dir = join(project_dir, config.get("platformio", "src_dir"))
for d in (src_dir, lib_dir):
if not isdir(d):
makedirs(d)
init_lib_readme(lib_dir)
init_ci_conf(project_dir)
init_cvs_ignore(project_dir)
def init_lib_readme(lib_dir):
if isfile(join(lib_dir, "readme.txt")):
return
with open(join(lib_dir, "readme.txt"), "w") as f:
f.write("""
This directory is intended for the project specific (private) libraries.
PlatformIO will compile them to static libraries and link to executable file.
The source code of each library should be placed in separate directory, like
"lib/private_lib/[here are source files]".
For example, see how can be organized `Foo` and `Bar` libraries:
|--lib
| |--Bar
| | |--docs
| | |--examples
| | |--src
| | |- Bar.c
| | |- Bar.h
| |--Foo
| | |- Foo.c
| | |- Foo.h
| |- readme.txt --> THIS FILE
|- platformio.ini
|--src
|- main.c
Then in `src/main.c` you should use:
#include <Foo.h>
#include <Bar.h>
// rest H/C/CPP code
PlatformIO will find your libraries automatically, configure preprocessor's
include paths and build them.
More information about PlatformIO Library Dependency Finder
- http://docs.platformio.org/page/librarymanager/ldf.html
""")
def init_ci_conf(project_dir):
if isfile(join(project_dir, ".travis.yml")):
return
with open(join(project_dir, ".travis.yml"), "w") as f:
f.write("""# Continuous Integration (CI) is the practice, in software
# engineering, of merging all developer working copies with a shared mainline
# several times a day < http://docs.platformio.org/page/ci/index.html >
#
# Documentation:
#
# * Travis CI Embedded Builds with PlatformIO
# < https://docs.travis-ci.com/user/integration/platformio/ >
#
# * PlatformIO integration with Travis CI
# < http://docs.platformio.org/page/ci/travis.html >
#
# * User Guide for `platformio ci` command
# < http://docs.platformio.org/page/userguide/cmd_ci.html >
#
#
# Please choice one of the following templates (proposed below) and uncomment
# it (remove "# " before each line) or use own configuration according to the
# Travis CI documentation (see above).
#
#
# Template #1: General project. Test it using existing `platformio.ini`.
#
# language: python
# python:
# - "2.7"
#
# sudo: false
# cache:
# directories:
# - "~/.platformio"
#
# install:
# - pip install -U platformio
#
# script:
# - platformio run
#
# Template #2: The project is intended to by used as a library with examples
#
# language: python
# python:
# - "2.7"
#
# sudo: false
# cache:
# directories:
# - "~/.platformio"
#
# env:
# - PLATFORMIO_CI_SRC=path/to/test/file.c
# - PLATFORMIO_CI_SRC=examples/file.ino
# - PLATFORMIO_CI_SRC=path/to/test/directory
#
# install:
# - pip install -U platformio
#
# script:
# - platformio ci --lib="." --board=ID_1 --board=ID_2 --board=ID_N
""")
def init_cvs_ignore(project_dir):
ignore_path = join(project_dir, ".gitignore")
default = [".pioenvs\n", ".piolibdeps\n"]
current = []
modified = False
if isfile(ignore_path):
with open(ignore_path) as fp:
current = fp.readlines()
if current and not current[-1].endswith("\n"):
current[-1] += "\n"
for d in default:
if d not in current:
modified = True
current.append(d)
if not modified:
return
with open(ignore_path, "w") as fp:
fp.writelines(current)
def fill_project_envs(ctx, project_dir, board_ids, project_option, env_prefix,
force_download):
content = []
used_boards = []
used_platforms = []
config = util.load_project_config(project_dir)
for section in config.sections():
cond = [
section.startswith("env:"), config.has_option(section, "board")
]
if all(cond):
used_boards.append(config.get(section, "board"))
pm = PlatformManager()
for id_ in board_ids:
board_config = pm.board_config(id_)
used_platforms.append(board_config['platform'])
if id_ in used_boards:
continue
used_boards.append(id_)
envopts = {"platform": board_config['platform'], "board": id_}
# find default framework for board
frameworks = board_config.get("frameworks")
if frameworks:
envopts['framework'] = frameworks[0]
for item in project_option:
if "=" not in item:
continue
_name, _value = item.split("=", 1)
envopts[_name.strip()] = _value.strip()
content.append("")
content.append("[env:%s%s]" % (env_prefix, id_))
for name, value in envopts.items():
content.append("%s = %s" % (name, value))
if force_download and used_platforms:
_install_dependent_platforms(ctx, used_platforms)
if not content:
return
with open(join(project_dir, "platformio.ini"), "a") as f:
content.append("")
f.write("\n".join(content))
def _install_dependent_platforms(ctx, platforms):
installed_platforms = [
p['name'] for p in PlatformManager().get_installed()
]
if set(platforms) <= set(installed_platforms):
return
ctx.invoke(
cli_platform_install,
platforms=list(set(platforms) - set(installed_platforms)))

View File

@ -1,4 +1,4 @@
# Copyright 2014-present PlatformIO <contact@platformio.org>
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -15,94 +15,185 @@
# pylint: disable=too-many-branches, too-many-locals
import json
from os.path import isdir, join
from time import sleep
from urllib import quote
import logging
import os
import arrow
import click
from platformio import exception, util
from platformio.managers.lib import LibraryManager
from platformio.managers.platform import PlatformFactory, PlatformManager
from platformio.util import get_api_result
from platformio import exception, fs
from platformio.cli import PlatformioCLI
from platformio.package.commands.install import package_install_cmd
from platformio.package.commands.list import package_list_cmd
from platformio.package.commands.search import package_search_cmd
from platformio.package.commands.show import package_show_cmd
from platformio.package.commands.uninstall import package_uninstall_cmd
from platformio.package.commands.update import package_update_cmd
from platformio.package.exception import NotGlobalLibDir
from platformio.package.manager.library import LibraryPackageManager
from platformio.package.meta import PackageItem, PackageSpec
from platformio.proc import is_ci
from platformio.project.config import ProjectConfig
from platformio.project.helpers import get_project_dir, is_platformio_project
CTX_META_INPUT_DIRS_KEY = __name__ + ".input_dirs"
CTX_META_PROJECT_ENVIRONMENTS_KEY = __name__ + ".project_environments"
CTX_META_STORAGE_DIRS_KEY = __name__ + ".storage_dirs"
CTX_META_STORAGE_LIBDEPS_KEY = __name__ + ".storage_lib_deps"
@click.group(short_help="Library Manager")
@click.option(
"-g",
"--global",
is_flag=True,
help="Manage global PlatformIO"
" library storage `%s`" % join(util.get_home_dir(), "lib"))
def get_project_global_lib_dir():
return ProjectConfig.get_instance().get("platformio", "globallib_dir")
def invoke_command(ctx, cmd, **kwargs):
input_dirs = ctx.meta.get(CTX_META_INPUT_DIRS_KEY, [])
project_environments = ctx.meta[CTX_META_PROJECT_ENVIRONMENTS_KEY]
for input_dir in input_dirs:
cmd_kwargs = kwargs.copy()
if is_platformio_project(input_dir):
cmd_kwargs["project_dir"] = input_dir
cmd_kwargs["environments"] = project_environments
else:
cmd_kwargs["global"] = True
cmd_kwargs["storage_dir"] = input_dir
ctx.invoke(cmd, **cmd_kwargs)
@click.group(short_help="Library manager", hidden=True)
@click.option(
"-d",
"--storage-dir",
multiple=True,
default=None,
type=click.Path(
exists=True,
file_okay=False,
dir_okay=True,
writable=True,
resolve_path=True),
help="Manage custom library storage")
type=click.Path(exists=True, file_okay=False, dir_okay=True, writable=True),
help="Manage custom library storage",
)
@click.option(
"-g", "--global", is_flag=True, help="Manage global PlatformIO library storage"
)
@click.option(
"-e",
"--environment",
multiple=True,
help=(
"Manage libraries for the specific project build environments "
"declared in `platformio.ini`"
),
)
@click.pass_context
def cli(ctx, **options):
non_storage_cmds = ("search", "show", "register", "stats", "builtin")
in_silence = PlatformioCLI.in_silence()
storage_cmds = ("install", "uninstall", "update", "list")
# skip commands that don't need storage folder
if ctx.invoked_subcommand in non_storage_cmds or \
(len(ctx.args) == 2 and ctx.args[1] in ("-h", "--help")):
if ctx.invoked_subcommand not in storage_cmds or (
len(ctx.args) == 2 and ctx.args[1] in ("-h", "--help")
):
return
storage_dir = options['storage_dir']
if not storage_dir:
if options['global']:
storage_dir = join(util.get_home_dir(), "lib")
elif util.is_platformio_project():
storage_dir = util.get_projectlibdeps_dir()
elif util.is_ci():
storage_dir = join(util.get_home_dir(), "lib")
storage_dirs = list(options["storage_dir"])
if options["global"]:
storage_dirs.append(get_project_global_lib_dir())
if not storage_dirs:
if is_platformio_project():
storage_dirs = [get_project_dir()]
elif is_ci():
storage_dirs = [get_project_global_lib_dir()]
click.secho(
"Warning! Global library storage is used automatically. "
"Please use `platformio lib --global %s` command to remove "
"this warning." % ctx.invoked_subcommand,
fg="yellow")
fg="yellow",
)
if not storage_dir and not util.is_platformio_project():
raise exception.NotGlobalLibDir(util.get_project_dir(),
join(util.get_home_dir(), "lib"),
ctx.invoked_subcommand)
if not storage_dirs:
raise NotGlobalLibDir(
get_project_dir(), get_project_global_lib_dir(), ctx.invoked_subcommand
)
ctx.obj = LibraryManager(storage_dir)
if "--json-output" not in ctx.args:
click.echo("Library Storage: " + storage_dir)
ctx.meta[CTX_META_PROJECT_ENVIRONMENTS_KEY] = options["environment"]
ctx.meta[CTX_META_INPUT_DIRS_KEY] = storage_dirs
ctx.meta[CTX_META_STORAGE_DIRS_KEY] = []
ctx.meta[CTX_META_STORAGE_LIBDEPS_KEY] = {}
for storage_dir in storage_dirs:
if not is_platformio_project(storage_dir):
ctx.meta[CTX_META_STORAGE_DIRS_KEY].append(storage_dir)
continue
with fs.cd(storage_dir):
config = ProjectConfig.get_instance(
os.path.join(storage_dir, "platformio.ini")
)
config.validate(options["environment"], silent=in_silence)
libdeps_dir = config.get("platformio", "libdeps_dir")
for env in config.envs():
if options["environment"] and env not in options["environment"]:
continue
storage_dir = os.path.join(libdeps_dir, env)
ctx.meta[CTX_META_STORAGE_DIRS_KEY].append(storage_dir)
ctx.meta[CTX_META_STORAGE_LIBDEPS_KEY][storage_dir] = config.get(
"env:" + env, "lib_deps", []
)
@cli.command("install", short_help="Install library")
@click.argument("libraries", required=False, nargs=-1, metavar="[LIBRARY...]")
# @click.option(
# "--save",
# is_flag=True,
# help="Save installed libraries into the project's platformio.ini "
# "library dependencies")
@click.option(
"-s", "--silent", is_flag=True, help="Suppress progress reporting")
"--save/--no-save",
is_flag=True,
default=True,
help="Save installed libraries into the `platformio.ini` dependency list"
" (enabled by default)",
)
@click.option("-s", "--silent", is_flag=True, help="Suppress progress reporting")
@click.option(
"--interactive",
is_flag=True,
help="Allow to make a choice for all prompts")
@click.pass_obj
def lib_install(lm, libraries, silent, interactive):
# @TODO "save" option
for library in libraries:
lm.install(library, silent=silent, interactive=interactive)
help="Deprecated! Please use a strict dependency specification (owner/libname)",
)
@click.option(
"-f", "--force", is_flag=True, help="Reinstall/redownload library if exists"
)
@click.pass_context
def lib_install( # pylint: disable=too-many-arguments,too-many-positional-arguments,unused-argument
ctx, libraries, save, silent, interactive, force
):
click.secho(
"\nWARNING: This command is deprecated and will be removed in "
"the next releases. \nPlease use `pio pkg install` instead.\n",
fg="yellow",
)
return invoke_command(
ctx,
package_install_cmd,
libraries=libraries,
no_save=not save,
force=force,
silent=silent,
)
@cli.command("uninstall", short_help="Uninstall libraries")
@cli.command("uninstall", short_help="Remove libraries")
@click.argument("libraries", nargs=-1, metavar="[LIBRARY...]")
@click.pass_obj
def lib_uninstall(lm, libraries):
for library in libraries:
lm.uninstall(library)
@click.option(
"--save/--no-save",
is_flag=True,
default=True,
help="Remove libraries from the `platformio.ini` dependency list and save changes"
" (enabled by default)",
)
@click.option("-s", "--silent", is_flag=True, help="Suppress progress reporting")
@click.pass_context
def lib_uninstall(ctx, libraries, save, silent):
click.secho(
"\nWARNING: This command is deprecated and will be removed in "
"the next releases. \nPlease use `pio pkg uninstall` instead.\n",
fg="yellow",
)
invoke_command(
ctx,
package_uninstall_cmd,
libraries=libraries,
no_save=not save,
silent=silent,
)
@cli.command("update", short_help="Update installed libraries")
@ -111,73 +202,106 @@ def lib_uninstall(lm, libraries):
"-c",
"--only-check",
is_flag=True,
help="Do not update, only check for new version")
help="DEPRECATED. Please use `--dry-run` instead",
)
@click.option(
"--dry-run", is_flag=True, help="Do not update, only check for the new versions"
)
@click.option("-s", "--silent", is_flag=True, help="Suppress progress reporting")
@click.option("--json-output", is_flag=True)
@click.pass_obj
def lib_update(lm, libraries, only_check, json_output):
if not libraries:
libraries = [manifest['__pkg_dir'] for manifest in lm.get_installed()]
@click.pass_context
def lib_update( # pylint: disable=too-many-arguments,too-many-positional-arguments
ctx, libraries, only_check, dry_run, silent, json_output
):
only_check = dry_run or only_check
if only_check and not json_output:
raise exception.UserSideException(
"This command is deprecated, please use `pio pkg outdated` instead"
)
if not json_output:
click.secho(
"\nWARNING: This command is deprecated and will be removed in "
"the next releases. \nPlease use `pio pkg update` instead.\n",
fg="yellow",
)
return invoke_command(
ctx,
package_update_cmd,
libraries=libraries,
silent=silent,
)
storage_dirs = ctx.meta[CTX_META_STORAGE_DIRS_KEY]
json_result = {}
for storage_dir in storage_dirs:
lib_deps = ctx.meta.get(CTX_META_STORAGE_LIBDEPS_KEY, {}).get(storage_dir, [])
lm = LibraryPackageManager(storage_dir)
lm.set_log_level(logging.WARN if silent else logging.DEBUG)
_libraries = libraries or lib_deps or lm.get_installed()
if only_check and json_output:
result = []
for library in libraries:
pkg_dir = library if isdir(library) else None
requirements = None
url = None
if not pkg_dir:
name, requirements, url = lm.parse_pkg_input(library)
pkg_dir = lm.get_package_dir(name, requirements, url)
if not pkg_dir:
for library in _libraries:
spec = None
pkg = None
if isinstance(library, PackageItem):
pkg = library
else:
spec = PackageSpec(library)
pkg = lm.get_package(spec)
if not pkg:
continue
latest = lm.outdated(pkg_dir, requirements)
if not latest:
outdated = lm.outdated(pkg, spec)
if not outdated.is_outdated(allow_incompatible=True):
continue
manifest = lm.load_manifest(pkg_dir)
manifest['versionLatest'] = latest
manifest = lm.legacy_load_manifest(pkg)
manifest["versionWanted"] = (
str(outdated.wanted) if outdated.wanted else None
)
manifest["versionLatest"] = (
str(outdated.latest) if outdated.latest else None
)
result.append(manifest)
return click.echo(json.dumps(result))
else:
for library in libraries:
lm.update(library, only_check=only_check)
json_result[storage_dir] = result
return click.echo(
json.dumps(
json_result[storage_dirs[0]] if len(storage_dirs) == 1 else json_result
)
)
def print_lib_item(item):
click.secho(item['name'], fg="cyan")
click.echo("=" * len(item['name']))
if "id" in item:
click.secho("#ID: %d" % item['id'], bold=True)
if "description" in item or "url" in item:
click.echo(item.get("description", item.get("url", "")))
click.echo()
@cli.command("list", short_help="List installed libraries")
@click.option("--json-output", is_flag=True)
@click.pass_context
def lib_list(ctx, json_output):
if not json_output:
click.secho(
"\nWARNING: This command is deprecated and will be removed in "
"the next releases. \nPlease use `pio pkg list` instead.\n",
fg="yellow",
)
return invoke_command(ctx, package_list_cmd, only_libraries=True)
for key in ("version", "homepage", "license", "keywords"):
if key not in item or not item[key]:
continue
if isinstance(item[key], list):
click.echo("%s: %s" % (key.title(), ", ".join(item[key])))
else:
click.echo("%s: %s" % (key.title(), item[key]))
for key in ("frameworks", "platforms"):
if key not in item:
continue
click.echo("Compatible %s: %s" % (key, ", ".join(
[i['title'] if isinstance(i, dict) else i for i in item[key]])))
if "authors" in item or "authornames" in item:
click.echo("Authors: %s" % ", ".join(
item.get("authornames",
[a.get("name", "") for a in item.get("authors", [])])))
if "__src_url" in item:
click.secho("Source: %s" % item['__src_url'])
click.echo()
storage_dirs = ctx.meta[CTX_META_STORAGE_DIRS_KEY]
json_result = {}
for storage_dir in storage_dirs:
lm = LibraryPackageManager(storage_dir)
json_result[storage_dir] = lm.legacy_get_installed()
return click.echo(
json.dumps(
json_result[storage_dirs[0]] if len(storage_dirs) == 1 else json_result
)
)
@cli.command("search", short_help="Search for a library")
@click.argument("query", required=False, nargs=-1)
@click.option("--json-output", is_flag=True)
@click.option("--page", type=click.INT, default=1)
@click.option("--id", multiple=True)
@click.option("-o", "--owner", multiple=True)
@click.option("-n", "--name", multiple=True)
@click.option("-a", "--author", multiple=True)
@click.option("-k", "--keyword", multiple=True)
@ -187,280 +311,149 @@ def print_lib_item(item):
@click.option(
"--noninteractive",
is_flag=True,
help="Do not prompt, automatically paginate with delay")
def lib_search(query, json_output, page, noninteractive, **filters):
help="Do not prompt, automatically paginate with delay",
)
@click.pass_context
def lib_search( # pylint: disable=unused-argument
ctx, query, json_output, page, noninteractive, **filters
):
if not query:
query = []
if not isinstance(query, list):
query = list(query)
for key, values in filters.iteritems():
for key, values in filters.items():
for value in values:
query.append('%s:"%s"' % (key, value))
result = get_api_result(
"/v2/lib/search",
dict(query=" ".join(query), page=page),
cache_valid="3d")
if json_output:
click.echo(json.dumps(result))
return
if result['total'] == 0:
if not json_output:
click.secho(
"Nothing has been found by your request\n"
"Try a less-specific search or use truncation (or wildcard) "
"operator",
"\nWARNING: This command is deprecated and will be removed in "
"the next releases. \nPlease use `pio pkg search` instead.\n",
fg="yellow",
nl=False)
click.secho(" *", fg="green")
click.secho("For example: DS*, PCA*, DHT* and etc.\n", fg="yellow")
click.echo("For more examples and advanced search syntax, "
"please use documentation:")
click.secho(
"http://docs.platformio.org/page/userguide/lib/cmd_search.html\n",
fg="cyan")
return
)
query.append("type:library")
return ctx.invoke(package_search_cmd, query=" ".join(query), page=page)
click.secho(
"Found %d libraries:\n" % result['total'],
fg="green" if result['total'] else "yellow")
while True:
for item in result['items']:
print_lib_item(item)
if (int(result['page']) * int(result['perpage']) >=
int(result['total'])):
break
if noninteractive:
click.echo()
click.secho(
"Loading next %d libraries... Press Ctrl+C to stop!" %
result['perpage'],
fg="yellow")
click.echo()
sleep(5)
elif not click.confirm("Show next libraries?"):
break
result = get_api_result(
"/v2/lib/search",
{"query": " ".join(query),
"page": int(result['page']) + 1},
cache_valid="3d")
@cli.command("list", short_help="List installed libraries")
@click.option("--json-output", is_flag=True)
@click.pass_obj
def lib_list(lm, json_output):
items = lm.get_installed()
if json_output:
return click.echo(json.dumps(items))
if not items:
return
for item in sorted(items, key=lambda i: i['name']):
print_lib_item(item)
@util.memoized
def get_builtin_libs(storage_names=None):
items = []
storage_names = storage_names or []
pm = PlatformManager()
for manifest in pm.get_installed():
p = PlatformFactory.newPlatform(manifest['__pkg_dir'])
for storage in p.get_lib_storages():
if storage_names and storage['name'] not in storage_names:
continue
lm = LibraryManager(storage['path'])
items.append({
"name": storage['name'],
"path": storage['path'],
"items": lm.get_installed()
})
return items
regclient = LibraryPackageManager().get_registry_client_instance()
result = regclient.fetch_json_data(
"get",
"/v2/lib/search",
params=dict(query=" ".join(query), page=page),
x_cache_valid="1d",
)
return click.echo(json.dumps(result))
@cli.command("builtin", short_help="List built-in libraries")
@click.option("--storage", multiple=True)
@click.option("--json-output", is_flag=True)
def lib_builtin(storage, json_output):
items = get_builtin_libs(storage)
items = LibraryPackageManager.get_builtin_libs(storage)
if json_output:
return click.echo(json.dumps(items))
for storage in items:
if not storage['items']:
for storage_ in items:
if not storage_["items"]:
continue
click.secho(storage['name'], fg="green")
click.echo("*" * len(storage['name']))
click.secho(storage_["name"], fg="green")
click.echo("*" * len(storage_["name"]))
click.echo()
for item in sorted(storage['items'], key=lambda i: i['name']):
for item in sorted(storage_["items"], key=lambda i: i["name"]):
print_lib_item(item)
return True
@cli.command("show", short_help="Show detailed info about a library")
@click.argument("library", metavar="[LIBRARY]")
@click.option("--json-output", is_flag=True)
def lib_show(library, json_output):
lm = LibraryManager()
name, requirements, _ = lm.parse_pkg_input(library)
lib_id = lm.get_pkg_id_by_name(
name, requirements, silent=json_output, interactive=not json_output)
lib = get_api_result("/lib/info/%d" % lib_id, cache_valid="1d")
if json_output:
return click.echo(json.dumps(lib))
click.secho(lib['name'], fg="cyan")
click.echo("=" * len(lib['name']))
click.secho("#ID: %d" % lib['id'], bold=True)
click.echo(lib['description'])
click.echo()
click.echo("Version: %s, released %s" %
(lib['version']['name'],
arrow.get(lib['version']['released']).humanize()))
click.echo("Manifest: %s" % lib['confurl'])
for key in ("homepage", "repository", "license"):
if key not in lib or not lib[key]:
continue
if isinstance(lib[key], list):
click.echo("%s: %s" % (key.title(), ", ".join(lib[key])))
else:
click.echo("%s: %s" % (key.title(), lib[key]))
blocks = []
_authors = []
for author in lib.get("authors", []):
_data = []
for key in ("name", "email", "url", "maintainer"):
if not author[key]:
continue
if key == "email":
_data.append("<%s>" % author[key])
elif key == "maintainer":
_data.append("(maintainer)")
else:
_data.append(author[key])
_authors.append(" ".join(_data))
if _authors:
blocks.append(("Authors", _authors))
blocks.append(("Keywords", lib['keywords']))
for key in ("frameworks", "platforms"):
if key not in lib or not lib[key]:
continue
blocks.append(("Compatible %s" % key, [i['title'] for i in lib[key]]))
blocks.append(("Headers", lib['headers']))
blocks.append(("Examples", lib['examples']))
blocks.append(("Versions", [
"%s, released %s" % (v['name'], arrow.get(v['released']).humanize())
for v in lib['versions']
]))
blocks.append(("Unique Downloads", [
"Today: %s" % lib['dlstats']['day'], "Week: %s" %
lib['dlstats']['week'], "Month: %s" % lib['dlstats']['month']
]))
for (title, rows) in blocks:
click.echo()
click.secho(title, bold=True)
click.echo("-" * len(title))
for row in rows:
click.echo(row)
@cli.command("register", short_help="Register a new library")
@click.argument("config_url")
def lib_register(config_url):
if (not config_url.startswith("http://") and
not config_url.startswith("https://")):
raise exception.InvalidLibConfURL(config_url)
result = get_api_result("/lib/register", data=dict(config_url=config_url))
if "message" in result and result['message']:
@click.pass_context
def lib_show(ctx, library, json_output):
if not json_output:
click.secho(
result['message'],
fg="green"
if "successed" in result and result['successed'] else "red")
"\nWARNING: This command is deprecated and will be removed in "
"the next releases. \nPlease use `pio pkg show` instead.\n",
fg="yellow",
)
return ctx.invoke(package_show_cmd, pkg_type="library", spec=library)
lm = LibraryPackageManager()
lm.set_log_level(logging.ERROR if json_output else logging.DEBUG)
lib_id = lm.reveal_registry_package_id(library)
regclient = lm.get_registry_client_instance()
lib = regclient.fetch_json_data(
"get", "/v2/lib/info/%d" % lib_id, x_cache_valid="1h"
)
return click.echo(json.dumps(lib))
@cli.command("register", short_help="Deprecated")
@click.argument("config_url")
def lib_register(config_url): # pylint: disable=unused-argument
raise exception.UserSideException(
"This command is deprecated. Please use `pio pkg publish` command."
)
@cli.command("stats", short_help="Library Registry Statistics")
@click.option("--json-output", is_flag=True)
def lib_stats(json_output):
result = get_api_result("/lib/stats", cache_valid="1h")
if not json_output:
click.secho(
"\nWARNING: This command is deprecated and will be removed in "
"the next releases. \nPlease visit "
"https://registry.platformio.org\n",
fg="yellow",
)
return None
if json_output:
return click.echo(json.dumps(result))
regclient = LibraryPackageManager().get_registry_client_instance()
result = regclient.fetch_json_data("get", "/v2/lib/stats", x_cache_valid="1h")
return click.echo(json.dumps(result))
printitem_tpl = "{name:<33} {url}"
printitemdate_tpl = "{name:<33} {date:23} {url}"
def _print_title(title):
click.secho(title.upper(), bold=True)
click.echo("*" * len(title))
def print_lib_item(item):
click.secho(item["name"], fg="cyan")
click.echo("=" * len(item["name"]))
if "id" in item:
click.secho("#ID: %d" % item["id"], bold=True)
if "description" in item or "url" in item:
click.echo(item.get("description", item.get("url", "")))
click.echo()
def _print_header(with_date=False):
click.echo((printitemdate_tpl if with_date else printitem_tpl).format(
name=click.style("Name", fg="cyan"),
date="Date",
url=click.style("Url", fg="blue")))
for key in ("version", "homepage", "license", "keywords"):
if key not in item or not item[key]:
continue
if isinstance(item[key], list):
click.echo("%s: %s" % (key.capitalize(), ", ".join(item[key])))
else:
click.echo("%s: %s" % (key.capitalize(), item[key]))
terminal_width, _ = click.get_terminal_size()
click.echo("-" * terminal_width)
def _print_lib_item(item):
click.echo((
printitemdate_tpl if "date" in item else printitem_tpl
).format(
name=click.style(item['name'], fg="cyan"),
date=str(
arrow.get(item['date']).humanize() if "date" in item else ""),
url=click.style(
"http://platformio.org/lib/show/%s/%s" % (item['id'],
quote(item['name'])),
fg="blue")))
def _print_tag_item(name):
for key in ("frameworks", "platforms"):
if key not in item:
continue
click.echo(
printitem_tpl.format(
name=click.style(name, fg="cyan"),
url=click.style(
"http://platformio.org/lib/search?query=" + quote(
"keyword:%s" % name),
fg="blue")))
"Compatible %s: %s"
% (
key,
", ".join(
[i["title"] if isinstance(i, dict) else i for i in item[key]]
),
)
)
for key in ("updated", "added"):
_print_title("Recently " + key)
_print_header(with_date=True)
for item in result.get(key, []):
_print_lib_item(item)
click.echo()
if "authors" in item or "authornames" in item:
click.echo(
"Authors: %s"
% ", ".join(
item.get(
"authornames", [a.get("name", "") for a in item.get("authors", [])]
)
)
)
_print_title("Recent keywords")
_print_header(with_date=False)
for item in result.get("lastkeywords"):
_print_tag_item(item)
if "__src_url" in item:
click.secho("Source: %s" % item["__src_url"])
click.echo()
_print_title("Popular keywords")
_print_header(with_date=False)
for item in result.get("topkeywords"):
_print_tag_item(item)
click.echo()
for key, title in (("dlday", "Today"), ("dlweek", "Week"),
("dlmonth", "Month")):
_print_title("Featured: " + title)
_print_header(with_date=False)
for item in result.get(key, []):
_print_lib_item(item)
click.echo()

View File

@ -1,4 +1,4 @@
# Copyright 2014-present PlatformIO <contact@platformio.org>
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -13,159 +13,44 @@
# limitations under the License.
import json
from os.path import dirname, isdir
import logging
import os
import click
from platformio import app, exception, util
from platformio.commands.boards import print_boards
from platformio.managers.platform import PlatformFactory, PlatformManager
from platformio.exception import UserSideException
from platformio.package.commands.install import package_install_cmd
from platformio.package.commands.list import package_list_cmd
from platformio.package.commands.search import package_search_cmd
from platformio.package.commands.show import package_show_cmd
from platformio.package.commands.uninstall import package_uninstall_cmd
from platformio.package.commands.update import package_update_cmd
from platformio.package.manager.platform import PlatformPackageManager
from platformio.package.meta import PackageItem, PackageSpec
from platformio.package.version import get_original_version
from platformio.platform.exception import UnknownPlatform
from platformio.platform.factory import PlatformFactory
@click.group(short_help="Platform Manager")
@click.group(short_help="Platform manager", hidden=True)
def cli():
pass
def _print_platforms(platforms):
for platform in platforms:
click.echo("{name} ~ {title}".format(
name=click.style(platform['name'], fg="cyan"),
title=platform['title']))
click.echo("=" * (3 + len(platform['name'] + platform['title'])))
click.echo(platform['description'])
click.echo()
if "homepage" in platform:
click.echo("Home: %s" % platform['homepage'])
if "frameworks" in platform and platform['frameworks']:
click.echo("Frameworks: %s" % ", ".join(platform['frameworks']))
if "packages" in platform:
click.echo("Packages: %s" % ", ".join(platform['packages']))
if "version" in platform:
click.echo("Version: " + platform['version'])
click.echo()
def _get_registry_platforms():
platforms = util.get_api_result("/platforms", cache_valid="30d")
pm = PlatformManager()
for platform in platforms or []:
platform['versions'] = pm.get_all_repo_versions(platform['name'])
return platforms
def _original_version(version):
if version.count(".") != 2:
return None
_, y = version.split(".")[:2]
if int(y) < 100:
return None
if len(y) % 2 != 0:
y = "0" + y
parts = [str(int(y[i * 2:i * 2 + 2])) for i in range(len(y) / 2)]
return ".".join(parts)
def _get_platform_data(*args, **kwargs):
try:
return _get_installed_platform_data(*args, **kwargs)
except exception.UnknownPlatform:
return _get_registry_platform_data(*args, **kwargs)
def _get_installed_platform_data(platform,
with_boards=True,
expose_packages=True):
p = PlatformFactory.newPlatform(platform)
data = dict(
name=p.name,
title=p.title,
description=p.description,
version=p.version, # comment before dump
homepage=p.homepage,
repository=p.repository_url,
url=p.vendor_url,
license=p.license,
forDesktop=not p.is_embedded(),
frameworks=sorted(p.frameworks.keys() if p.frameworks else []),
packages=p.packages.keys() if p.packages else [])
# if dump to API
# del data['version']
# return data
# overwrite VCS version and add extra fields
manifest = PlatformManager().load_manifest(dirname(p.manifest_path))
assert manifest
for key in manifest:
if key == "version" or key.startswith("__"):
data[key] = manifest[key]
if with_boards:
data['boards'] = [c.get_brief_data() for c in p.get_boards().values()]
if not data['packages'] or not expose_packages:
return data
data['packages'] = []
installed_pkgs = p.get_installed_packages()
for name, opts in p.packages.items():
item = dict(
name=name,
type=p.get_package_type(name),
requirements=opts.get("version"),
optional=opts.get("optional") is True)
if name in installed_pkgs:
for key, value in installed_pkgs[name].items():
if key not in ("url", "version", "description"):
continue
item[key] = value
if key == "version":
item["originalVersion"] = _original_version(value)
data['packages'].append(item)
return data
def _get_registry_platform_data( # pylint: disable=unused-argument
platform,
with_boards=True,
expose_packages=True):
_data = None
for p in _get_registry_platforms():
if p['name'] == platform:
_data = p
break
if not _data:
return None
data = dict(
name=_data['name'],
title=_data['title'],
description=_data['description'],
homepage=_data['homepage'],
repository=_data['repository'],
url=_data['url'],
license=_data['license'],
forDesktop=_data['forDesktop'],
frameworks=_data['frameworks'],
packages=_data['packages'],
versions=_data['versions'])
if with_boards:
data['boards'] = [
board for board in PlatformManager().get_registered_boards()
if board['platform'] == _data['name']
]
return data
@cli.command("search", short_help="Search for development platform")
@click.argument("query", required=False)
@click.option("--json-output", is_flag=True)
def platform_search(query, json_output):
@click.pass_context
def platform_search(ctx, query, json_output):
if not json_output:
click.secho(
"\nWARNING: This command is deprecated and will be removed in "
"the next releases. \nPlease use `pio pkg search` instead.\n",
fg="yellow",
)
query = query or ""
return ctx.invoke(package_search_cmd, query=f"type:platform {query}".strip())
platforms = []
for platform in _get_registry_platforms():
if query == "all":
@ -175,114 +60,89 @@ def platform_search(query, json_output):
continue
platforms.append(
_get_registry_platform_data(
platform['name'], with_boards=False, expose_packages=False))
if json_output:
click.echo(json.dumps(platforms))
else:
_print_platforms(platforms)
platform["name"], with_boards=False, expose_packages=False
)
)
click.echo(json.dumps(platforms))
return None
@cli.command("frameworks", short_help="List supported frameworks, SDKs")
@click.argument("query", required=False)
@click.option("--json-output", is_flag=True)
def platform_frameworks(query, json_output):
if not json_output:
click.secho(
"\nWARNING: This command is deprecated and will be removed in "
"the next releases. \nPlease visit https://docs.platformio.org"
"/en/latest/frameworks/index.html\n",
fg="yellow",
)
return
regclient = PlatformPackageManager().get_registry_client_instance()
frameworks = []
for framework in util.get_api_result("/frameworks", cache_valid="30d"):
for framework in regclient.fetch_json_data(
"get", "/v2/frameworks", x_cache_valid="1d"
):
if query == "all":
query = ""
search_data = json.dumps(framework)
if query and query.lower() not in search_data.lower():
continue
framework['homepage'] = (
"http://platformio.org/frameworks/" + framework['name'])
framework['platforms'] = [
platform['name'] for platform in _get_registry_platforms()
if framework['name'] in platform['frameworks']
framework["homepage"] = "https://platformio.org/frameworks/" + framework["name"]
framework["platforms"] = [
platform["name"]
for platform in _get_registry_platforms()
if framework["name"] in platform["frameworks"]
]
frameworks.append(framework)
if json_output:
click.echo(json.dumps(frameworks))
else:
_print_platforms(frameworks)
frameworks = sorted(frameworks, key=lambda manifest: manifest["name"])
click.echo(json.dumps(frameworks))
@cli.command("list", short_help="List installed development platforms")
@click.option("--json-output", is_flag=True)
def platform_list(json_output):
@click.pass_context
def platform_list(ctx, json_output):
if not json_output:
click.secho(
"\nWARNING: This command is deprecated and will be removed in "
"the next releases. \nPlease use `pio pkg list` instead.\n",
fg="yellow",
)
return ctx.invoke(package_list_cmd, **{"global": True, "only_platforms": True})
platforms = []
pm = PlatformManager()
for manifest in pm.get_installed():
pm = PlatformPackageManager()
for pkg in pm.get_installed():
platforms.append(
_get_installed_platform_data(
manifest['__pkg_dir'],
with_boards=False,
expose_packages=False))
if json_output:
click.echo(json.dumps(platforms))
else:
_print_platforms(platforms)
_get_installed_platform_data(pkg, with_boards=False, expose_packages=False)
)
platforms = sorted(platforms, key=lambda manifest: manifest["name"])
click.echo(json.dumps(platforms))
return None
@cli.command("show", short_help="Show details about development platform")
@click.argument("platform")
@click.option("--json-output", is_flag=True)
def platform_show(platform, json_output): # pylint: disable=too-many-branches
@click.pass_context
def platform_show(ctx, platform, json_output): # pylint: disable=too-many-branches
if not json_output:
click.secho(
"\nWARNING: This command is deprecated and will be removed in "
"the next releases. \nPlease use `pio pkg show` instead.\n",
fg="yellow",
)
return ctx.invoke(package_show_cmd, pkg_type="platform", spec=platform)
data = _get_platform_data(platform)
if not data:
raise exception.UnknownPlatform(platform)
if json_output:
return click.echo(json.dumps(data))
click.echo("{name} ~ {title}".format(
name=click.style(data['name'], fg="cyan"), title=data['title']))
click.echo("=" * (3 + len(data['name'] + data['title'])))
click.echo(data['description'])
click.echo()
if "version" in data:
click.echo("Version: %s" % data['version'])
if data['homepage']:
click.echo("Home: %s" % data['homepage'])
if data['repository']:
click.echo("Repository: %s" % data['repository'])
if data['url']:
click.echo("Vendor: %s" % data['url'])
if data['license']:
click.echo("License: %s" % data['license'])
if data['frameworks']:
click.echo("Frameworks: %s" % ", ".join(data['frameworks']))
if not data['packages']:
return
if not isinstance(data['packages'][0], dict):
click.echo("Packages: %s" % ", ".join(data['packages']))
else:
click.echo()
click.secho("Packages", bold=True)
click.echo("--------")
for item in data['packages']:
click.echo()
click.echo("Package %s" % click.style(item['name'], fg="yellow"))
click.echo("-" * (8 + len(item['name'])))
if item['type']:
click.echo("Type: %s" % item['type'])
click.echo("Requirements: %s" % item['requirements'])
click.echo("Installed: %s" % ("Yes" if item.get("version") else
"No (optional)"))
if "version" in item:
click.echo("Version: %s" % item['version'])
if "originalVersion" in item:
click.echo("Original version: %s" % item['originalVersion'])
if "description" in item:
click.echo("Description: %s" % item['description'])
if data['boards']:
click.echo()
click.secho("Boards", bold=True)
click.echo("------")
print_boards(data['boards'])
raise UnknownPlatform(platform)
return click.echo(json.dumps(data))
@cli.command("install", short_help="Install new development platform")
@ -290,85 +150,242 @@ def platform_show(platform, json_output): # pylint: disable=too-many-branches
@click.option("--with-package", multiple=True)
@click.option("--without-package", multiple=True)
@click.option("--skip-default-package", is_flag=True)
def platform_install(platforms, with_package, without_package,
skip_default_package):
pm = PlatformManager()
for platform in platforms:
if pm.install(
name=platform,
with_packages=with_package,
without_packages=without_package,
skip_default_package=skip_default_package):
click.secho(
"The platform '%s' has been successfully installed!\n"
"The rest of packages will be installed automatically "
"depending on your build environment." % platform,
fg="green")
@click.option("--with-all-packages", is_flag=True)
@click.option("-s", "--silent", is_flag=True, help="Suppress progress reporting")
@click.option(
"-f",
"--force",
is_flag=True,
help="Reinstall/redownload dev/platform and its packages if exist",
)
@click.pass_context
def platform_install( # pylint: disable=too-many-arguments,too-many-positional-arguments
ctx,
platforms,
with_package,
without_package,
skip_default_package,
with_all_packages,
silent,
force,
):
click.secho(
"\nWARNING: This command is deprecated and will be removed in "
"the next releases. \nPlease use `pio pkg install` instead.\n",
fg="yellow",
)
ctx.invoke(
package_install_cmd,
**{
"global": True,
"platforms": platforms,
"skip_dependencies": (
not with_all_packages
and (with_package or without_package or skip_default_package)
),
"silent": silent,
"force": force,
},
)
@cli.command("uninstall", short_help="Uninstall development platform")
@click.argument("platforms", nargs=-1, required=True, metavar="[PLATFORM...]")
def platform_uninstall(platforms):
pm = PlatformManager()
for platform in platforms:
if pm.uninstall(platform):
click.secho(
"The platform '%s' has been successfully "
"uninstalled!" % platform,
fg="green")
@click.pass_context
def platform_uninstall(ctx, platforms):
click.secho(
"\nWARNING: This command is deprecated and will be removed in "
"the next releases. \nPlease use `pio pkg uninstall` instead.\n",
fg="yellow",
)
ctx.invoke(
package_uninstall_cmd,
**{
"global": True,
"platforms": platforms,
},
)
@cli.command("update", short_help="Update installed development platforms")
@click.argument("platforms", nargs=-1, required=False, metavar="[PLATFORM...]")
@click.option(
"-p",
"--only-packages",
is_flag=True,
help="Update only the platform packages")
"-p", "--only-packages", is_flag=True, help="Update only the platform packages"
)
@click.option(
"-c",
"--only-check",
is_flag=True,
help="Do not update, only check for a new version")
help="DEPRECATED. Please use `--dry-run` instead",
)
@click.option(
"--dry-run", is_flag=True, help="Do not update, only check for the new versions"
)
@click.option("-s", "--silent", is_flag=True, help="Suppress progress reporting")
@click.option("--json-output", is_flag=True)
def platform_update(platforms, only_packages, only_check, json_output):
pm = PlatformManager()
pkg_dir_to_name = {}
if not platforms:
platforms = []
for manifest in pm.get_installed():
platforms.append(manifest['__pkg_dir'])
pkg_dir_to_name[manifest['__pkg_dir']] = manifest.get(
"title", manifest['name'])
@click.pass_context
def platform_update( # pylint: disable=too-many-locals,too-many-arguments,too-many-positional-arguments
ctx, platforms, only_check, dry_run, silent, json_output, **_
):
only_check = dry_run or only_check
if only_check and json_output:
result = []
for platform in platforms:
pkg_dir = platform if isdir(platform) else None
requirements = None
url = None
if not pkg_dir:
name, requirements, url = pm.parse_pkg_input(platform)
pkg_dir = pm.get_package_dir(name, requirements, url)
if not pkg_dir:
continue
latest = pm.outdated(pkg_dir, requirements)
if (not latest and not PlatformFactory.newPlatform(pkg_dir)
.are_outdated_packages()):
continue
data = _get_installed_platform_data(
pkg_dir, with_boards=False, expose_packages=False)
if latest:
data['versionLatest'] = latest
result.append(data)
return click.echo(json.dumps(result))
else:
# cleanup cached board and platform lists
app.clean_cache()
for platform in platforms:
click.echo("Platform %s" % click.style(
pkg_dir_to_name.get(platform, platform), fg="cyan"))
click.echo("--------")
pm.update(
platform, only_packages=only_packages, only_check=only_check)
click.echo()
if only_check and not json_output:
raise UserSideException(
"This command is deprecated, please use `pio pkg outdated` instead"
)
if not json_output:
click.secho(
"\nWARNING: This command is deprecated and will be removed in "
"the next releases. \nPlease use `pio pkg update` instead.\n",
fg="yellow",
)
return ctx.invoke(
package_update_cmd,
**{
"global": True,
"platforms": platforms,
"silent": silent,
},
)
pm = PlatformPackageManager()
pm.set_log_level(logging.WARN if silent else logging.DEBUG)
platforms = platforms or pm.get_installed()
result = []
for platform in platforms:
spec = None
pkg = None
if isinstance(platform, PackageItem):
pkg = platform
else:
spec = PackageSpec(platform)
pkg = pm.get_package(spec)
if not pkg:
continue
outdated = pm.outdated(pkg, spec)
if (
not outdated.is_outdated(allow_incompatible=True)
and not PlatformFactory.new(pkg).are_outdated_packages()
):
continue
data = _get_installed_platform_data(
pkg, with_boards=False, expose_packages=False
)
if outdated.is_outdated(allow_incompatible=True):
data["versionLatest"] = str(outdated.latest) if outdated.latest else None
result.append(data)
click.echo(json.dumps(result))
return True
#
# Helpers
#
def _get_registry_platforms():
regclient = PlatformPackageManager().get_registry_client_instance()
return regclient.fetch_json_data("get", "/v2/platforms", x_cache_valid="1d")
def _get_platform_data(*args, **kwargs):
try:
return _get_installed_platform_data(*args, **kwargs)
except UnknownPlatform:
return _get_registry_platform_data(*args, **kwargs)
def _get_installed_platform_data(platform, with_boards=True, expose_packages=True):
p = PlatformFactory.new(platform)
data = dict(
name=p.name,
title=p.title,
description=p.description,
version=p.version,
homepage=p.homepage,
url=p.homepage,
repository=p.repository_url,
license=p.license,
forDesktop=not p.is_embedded(),
frameworks=sorted(list(p.frameworks) if p.frameworks else []),
packages=list(p.packages) if p.packages else [],
)
# if dump to API
# del data['version']
# return data
# overwrite VCS version and add extra fields
manifest = PlatformPackageManager().legacy_load_manifest(
os.path.dirname(p.manifest_path)
)
assert manifest
for key in manifest:
if key == "version" or key.startswith("__"):
data[key] = manifest[key]
if with_boards:
data["boards"] = [c.get_brief_data() for c in p.get_boards().values()]
if not data["packages"] or not expose_packages:
return data
data["packages"] = []
installed_pkgs = {
pkg.metadata.name: p.pm.load_manifest(pkg) for pkg in p.get_installed_packages()
}
for name, options in p.packages.items():
item = dict(
name=name,
type=p.get_package_type(name),
requirements=options.get("version"),
optional=options.get("optional") is True,
)
if name in installed_pkgs:
for key, value in installed_pkgs[name].items():
if key not in ("url", "version", "description"):
continue
item[key] = value
if key == "version":
item["originalVersion"] = get_original_version(value)
data["packages"].append(item)
return data
def _get_registry_platform_data( # pylint: disable=unused-argument
platform, with_boards=True, expose_packages=True
):
_data = None
for p in _get_registry_platforms():
if p["name"] == platform:
_data = p
break
if not _data:
return None
data = dict(
ownername=_data.get("ownername"),
name=_data["name"],
title=_data["title"],
description=_data["description"],
homepage=_data["homepage"],
repository=_data["repository"],
url=_data["url"],
license=_data["license"],
forDesktop=_data["forDesktop"],
frameworks=_data["frameworks"],
packages=_data["packages"],
versions=_data.get("versions"),
)
if with_boards:
data["boards"] = [
board
for board in PlatformPackageManager().get_registered_boards()
if board["platform"] == _data["name"]
]
return data

View File

@ -1,209 +0,0 @@
# Copyright 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import sys
import threading
from os import getcwd
from os.path import isfile, join
from tempfile import mkdtemp
from time import sleep
import click
from platformio import exception, util
from platformio.commands.device import device_monitor as cmd_device_monitor
from platformio.managers.core import pioplus_call
# pylint: disable=unused-argument
@click.group("remote", short_help="PIO Remote")
@click.option("-a", "--agent", multiple=True)
def cli(**kwargs):
pass
@cli.group("agent", short_help="Start new agent or list active")
def remote_agent():
pass
@remote_agent.command("start", short_help="Start agent")
@click.option("-n", "--name")
@click.option("-s", "--share", multiple=True, metavar="E-MAIL")
@click.option(
"-d",
"--working-dir",
envvar="PLATFORMIO_REMOTE_AGENT_DIR",
type=click.Path(
file_okay=False, dir_okay=True, writable=True, resolve_path=True))
def remote_agent_start(**kwargs):
pioplus_call(sys.argv[1:])
@remote_agent.command("reload", short_help="Reload agents")
def remote_agent_reload():
pioplus_call(sys.argv[1:])
@remote_agent.command("list", short_help="List active agents")
def remote_agent_list():
pioplus_call(sys.argv[1:])
@cli.command(
"update", short_help="Update installed Platforms, Packages and Libraries")
@click.option(
"-c",
"--only-check",
is_flag=True,
help="Do not update, only check for new version")
def remote_update(only_check):
pioplus_call(sys.argv[1:])
@cli.command("run", short_help="Process project environments remotely")
@click.option("-e", "--environment", multiple=True)
@click.option("-t", "--target", multiple=True)
@click.option("--upload-port")
@click.option(
"-d",
"--project-dir",
default=getcwd,
type=click.Path(
exists=True,
file_okay=True,
dir_okay=True,
writable=True,
resolve_path=True))
@click.option("--disable-auto-clean", is_flag=True)
@click.option("-r", "--force-remote", is_flag=True)
@click.option("-s", "--silent", is_flag=True)
@click.option("-v", "--verbose", is_flag=True)
def remote_run(**kwargs):
pioplus_call(sys.argv[1:])
@cli.command("test", short_help="Remote Unit Testing")
@click.option("--environment", "-e", multiple=True, metavar="<environment>")
@click.option("--ignore", "-i", multiple=True, metavar="<pattern>")
@click.option("--upload-port")
@click.option("--test-port")
@click.option(
"-d",
"--project-dir",
default=getcwd,
type=click.Path(
exists=True,
file_okay=False,
dir_okay=True,
writable=True,
resolve_path=True))
@click.option("-r", "--force-remote", is_flag=True)
@click.option("--without-building", is_flag=True)
@click.option("--without-uploading", is_flag=True)
@click.option("--verbose", "-v", is_flag=True)
def remote_test(**kwargs):
pioplus_call(sys.argv[1:])
@cli.group("device", short_help="Monitor remote device or list existing")
def remote_device():
pass
@remote_device.command("list", short_help="List remote devices")
@click.option("--json-output", is_flag=True)
def device_list(json_output):
pioplus_call(sys.argv[1:])
@remote_device.command("monitor", short_help="Monitor remote device")
@click.option("--port", "-p", help="Port, a number or a device name")
@click.option(
"--baud", "-b", type=int, default=9600, help="Set baud rate, default=9600")
@click.option(
"--parity",
default="N",
type=click.Choice(["N", "E", "O", "S", "M"]),
help="Set parity, default=N")
@click.option(
"--rtscts", is_flag=True, help="Enable RTS/CTS flow control, default=Off")
@click.option(
"--xonxoff",
is_flag=True,
help="Enable software flow control, default=Off")
@click.option(
"--rts",
default=None,
type=click.IntRange(0, 1),
help="Set initial RTS line state")
@click.option(
"--dtr",
default=None,
type=click.IntRange(0, 1),
help="Set initial DTR line state")
@click.option("--echo", is_flag=True, help="Enable local echo, default=Off")
@click.option(
"--encoding",
default="UTF-8",
help="Set the encoding for the serial port (e.g. hexlify, "
"Latin1, UTF-8), default: UTF-8")
@click.option("--filter", "-f", multiple=True, help="Add text transformation")
@click.option(
"--eol",
default="CRLF",
type=click.Choice(["CR", "LF", "CRLF"]),
help="End of line mode, default=CRLF")
@click.option(
"--raw", is_flag=True, help="Do not apply any encodings/transformations")
@click.option(
"--exit-char",
type=int,
default=3,
help="ASCII code of special character that is used to exit "
"the application, default=3 (Ctrl+C)")
@click.option(
"--menu-char",
type=int,
default=20,
help="ASCII code of special character that is used to "
"control miniterm (menu), default=20 (DEC)")
@click.option(
"--quiet",
is_flag=True,
help="Diagnostics: suppress non-error messages, default=Off")
@click.pass_context
def device_monitor(ctx, **kwargs):
def _tx_target(sock_dir):
try:
pioplus_call(sys.argv[1:] + ["--sock", sock_dir])
except exception.ReturnErrorCode:
pass
sock_dir = mkdtemp(suffix="pioplus")
sock_file = join(sock_dir, "sock")
try:
t = threading.Thread(target=_tx_target, args=(sock_dir, ))
t.start()
while t.is_alive() and not isfile(sock_file):
sleep(0.1)
if not t.is_alive():
return
kwargs['port'] = open(sock_file).read()
ctx.invoke(cmd_device_monitor, **kwargs)
t.join(2)
finally:
util.rmtree_(sock_dir)

View File

@ -1,391 +0,0 @@
# Copyright 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from datetime import datetime
from hashlib import sha1
from os import getcwd, makedirs, walk
from os.path import getmtime, isdir, isfile, join
from time import time
import click
from platformio import __version__, exception, telemetry, util
from platformio.commands.lib import lib_install as cmd_lib_install
from platformio.commands.lib import get_builtin_libs
from platformio.commands.platform import \
platform_install as cmd_platform_install
from platformio.managers.lib import LibraryManager
from platformio.managers.platform import PlatformFactory
# pylint: disable=too-many-arguments,too-many-locals,too-many-branches
@click.command("run", short_help="Process project environments")
@click.option("-e", "--environment", multiple=True)
@click.option("-t", "--target", multiple=True)
@click.option("--upload-port")
@click.option(
"-d",
"--project-dir",
default=getcwd,
type=click.Path(
exists=True,
file_okay=True,
dir_okay=True,
writable=True,
resolve_path=True))
@click.option("-s", "--silent", is_flag=True)
@click.option("-v", "--verbose", is_flag=True)
@click.option("--disable-auto-clean", is_flag=True)
@click.pass_context
def cli(ctx, environment, target, upload_port, project_dir, silent, verbose,
disable_auto_clean):
# find project directory on upper level
if isfile(project_dir):
project_dir = util.find_project_dir_above(project_dir)
if not util.is_platformio_project(project_dir):
raise exception.NotPlatformIOProject(project_dir)
with util.cd(project_dir):
# clean obsolete .pioenvs dir
if not disable_auto_clean:
try:
_clean_pioenvs_dir(util.get_projectpioenvs_dir())
except: # pylint: disable=bare-except
click.secho(
"Can not remove temporary directory `%s`. Please remove "
"`.pioenvs` directory from the project manually to avoid "
"build issues" % util.get_projectpioenvs_dir(force=True),
fg="yellow")
config = util.load_project_config()
check_project_defopts(config)
assert check_project_envs(config, environment)
env_default = None
if config.has_option("platformio", "env_default"):
env_default = [
e.strip()
for e in config.get("platformio", "env_default").split(",")
]
results = []
start_time = time()
for section in config.sections():
if not section.startswith("env:"):
continue
envname = section[4:]
skipenv = any([
environment and envname not in environment, not environment and
env_default and envname not in env_default
])
if skipenv:
results.append((envname, None))
continue
if not silent and results:
click.echo()
options = {}
for k, v in config.items(section):
options[k] = v
if "piotest" not in options and "piotest" in ctx.meta:
options['piotest'] = ctx.meta['piotest']
ep = EnvironmentProcessor(ctx, envname, options, target,
upload_port, silent, verbose)
results.append((envname, ep.process()))
found_error = any([status is False for (_, status) in results])
if (found_error or not silent) and len(results) > 1:
click.echo()
print_summary(results, start_time)
if found_error:
raise exception.ReturnErrorCode(1)
return True
class EnvironmentProcessor(object):
KNOWN_OPTIONS = (
"platform", "framework", "board", "board_mcu", "board_f_cpu",
"board_f_flash", "board_flash_mode", "build_flags", "src_build_flags",
"build_unflags", "src_filter", "extra_script", "targets",
"upload_port", "upload_protocol", "upload_speed", "upload_flags",
"upload_resetmethod", "lib_install", "lib_deps", "lib_force",
"lib_ignore", "lib_extra_dirs", "lib_ldf_mode", "lib_compat_mode",
"test_ignore", "test_port", "piotest")
REMAPED_OPTIONS = {"framework": "pioframework", "platform": "pioplatform"}
RENAMED_OPTIONS = {"lib_use": "lib_deps", "lib_force": "lib_deps"}
RENAMED_PLATFORMS = {"espressif": "espressif8266"}
def __init__(
self, # pylint: disable=R0913
cmd_ctx,
name,
options,
targets,
upload_port,
silent,
verbose):
self.cmd_ctx = cmd_ctx
self.name = name
self.options = options
self.targets = targets
self.upload_port = upload_port
self.silent = silent
self.verbose = verbose
def process(self):
terminal_width, _ = click.get_terminal_size()
start_time = time()
# multi-line values to one line
for k, v in self.options.items():
if "\n" in v:
self.options[k] = self.options[k].strip().replace("\n", ", ")
if not self.silent:
click.echo("[%s] Processing %s (%s)" % (
datetime.now().strftime("%c"), click.style(
self.name, fg="cyan", bold=True), ", ".join(
["%s: %s" % (k, v) for k, v in self.options.items()])))
click.secho("-" * terminal_width, bold=True)
self.options = self._validate_options(self.options)
result = self._run()
is_error = result['returncode'] != 0
if self.silent and not is_error:
return True
if is_error or "piotest_processor" not in self.cmd_ctx.meta:
print_header(
"[%s] Took %.2f seconds" % ((click.style(
"ERROR", fg="red", bold=True) if is_error else click.style(
"SUCCESS", fg="green", bold=True)),
time() - start_time),
is_error=is_error)
return not is_error
def _validate_options(self, options):
result = {}
for k, v in options.items():
# process obsolete options
if k in self.RENAMED_OPTIONS:
click.secho(
"Warning! `%s` option is deprecated and will be "
"removed in the next release! Please use "
"`%s` instead." % (k, self.RENAMED_OPTIONS[k]),
fg="yellow")
k = self.RENAMED_OPTIONS[k]
# process renamed platforms
if k == "platform" and v in self.RENAMED_PLATFORMS:
click.secho(
"Warning! Platform `%s` is deprecated and will be "
"removed in the next release! Please use "
"`%s` instead." % (v, self.RENAMED_PLATFORMS[v]),
fg="yellow")
v = self.RENAMED_PLATFORMS[v]
# warn about unknown options
if k not in self.KNOWN_OPTIONS:
click.secho(
"Detected non-PlatformIO `%s` option in `[env:]` section" %
k,
fg="yellow")
result[k] = v
return result
def _get_build_variables(self):
variables = {"pioenv": self.name}
if self.upload_port:
variables['upload_port'] = self.upload_port
for k, v in self.options.items():
if k in self.REMAPED_OPTIONS:
k = self.REMAPED_OPTIONS[k]
if k == "targets" or (k == "upload_port" and self.upload_port):
continue
variables[k] = v
return variables
def _get_build_targets(self):
targets = []
if self.targets:
targets = [t for t in self.targets]
elif "targets" in self.options:
targets = self.options['targets'].split()
return targets
def _run(self):
if "platform" not in self.options:
raise exception.UndefinedEnvPlatform(self.name)
build_vars = self._get_build_variables()
build_targets = self._get_build_targets()
telemetry.on_run_environment(self.options, build_targets)
if "nobuild" not in build_targets:
# install dependent libraries
if "lib_install" in self.options:
_autoinstall_libdeps(self.cmd_ctx, [
int(d.strip())
for d in self.options['lib_install'].split(",")
if d.strip()
], self.verbose)
if "lib_deps" in self.options:
_autoinstall_libdeps(self.cmd_ctx, [
d.strip() for d in self.options['lib_deps'].split(", ")
if d.strip()
], self.verbose)
try:
p = PlatformFactory.newPlatform(self.options['platform'])
except exception.UnknownPlatform:
self.cmd_ctx.invoke(
cmd_platform_install,
platforms=[self.options['platform']],
skip_default_package=True)
p = PlatformFactory.newPlatform(self.options['platform'])
return p.run(build_vars, build_targets, self.silent, self.verbose)
def _autoinstall_libdeps(ctx, libraries, verbose=False):
storage_dir = util.get_projectlibdeps_dir()
ctx.obj = LibraryManager(storage_dir)
if verbose:
click.echo("Library Storage: " + storage_dir)
for lib in libraries:
try:
ctx.invoke(cmd_lib_install, libraries=[lib], silent=not verbose)
except exception.LibNotFound as e:
if not _is_builtin_lib(lib):
click.secho("Warning! %s" % e, fg="yellow")
def _is_builtin_lib(lib_name):
for storage in get_builtin_libs():
if any([l.get("name") == lib_name for l in storage['items']]):
return True
return False
def _clean_pioenvs_dir(pioenvs_dir):
structhash_file = join(pioenvs_dir, "structure.hash")
proj_hash = calculate_project_hash()
# if project's config is modified
if (isdir(pioenvs_dir) and
getmtime(join(util.get_project_dir(), "platformio.ini")) >
getmtime(pioenvs_dir)):
util.rmtree_(pioenvs_dir)
# check project structure
if isdir(pioenvs_dir) and isfile(structhash_file):
with open(structhash_file) as f:
if f.read() == proj_hash:
return
util.rmtree_(pioenvs_dir)
if not isdir(pioenvs_dir):
makedirs(pioenvs_dir)
with open(structhash_file, "w") as f:
f.write(proj_hash)
def print_header(label, is_error=False):
terminal_width, _ = click.get_terminal_size()
width = len(click.unstyle(label))
half_line = "=" * ((terminal_width - width - 2) / 2)
click.echo("%s %s %s" % (half_line, label, half_line), err=is_error)
def print_summary(results, start_time):
print_header("[%s]" % click.style("SUMMARY"))
envname_max_len = 0
for (envname, _) in results:
if len(envname) > envname_max_len:
envname_max_len = len(envname)
successed = True
for (envname, status) in results:
status_str = click.style("SUCCESS", fg="green")
if status is False:
successed = False
status_str = click.style("ERROR", fg="red")
elif status is None:
status_str = click.style("SKIP", fg="yellow")
format_str = (
"Environment {0:<" + str(envname_max_len + 9) + "}\t[{1}]")
click.echo(
format_str.format(click.style(envname, fg="cyan"), status_str),
err=status is False)
print_header(
"[%s] Took %.2f seconds" % ((click.style(
"SUCCESS", fg="green", bold=True) if successed else click.style(
"ERROR", fg="red", bold=True)), time() - start_time),
is_error=not successed)
def check_project_defopts(config):
if not config.has_section("platformio"):
return True
known = ("home_dir", "lib_dir", "libdeps_dir", "src_dir", "envs_dir",
"data_dir", "test_dir", "env_default", "lib_extra_dirs")
unknown = set([k for k, _ in config.items("platformio")]) - set(known)
if not unknown:
return True
click.secho(
"Warning! Ignore unknown `%s` option from `[platformio]` section" %
", ".join(unknown),
fg="yellow")
return False
def check_project_envs(config, environments):
if not config.sections():
raise exception.ProjectEnvsNotAvailable()
known = set([s[4:] for s in config.sections() if s.startswith("env:")])
unknown = set(environments) - known
if unknown:
raise exception.UnknownEnvNames(", ".join(unknown), ", ".join(known))
return True
def calculate_project_hash():
structure = [__version__]
for d in (util.get_projectsrc_dir(), util.get_projectlib_dir()):
if not isdir(d):
continue
for root, _, files in walk(d):
for f in files:
path = join(root, f)
if not any([s in path for s in (".git", ".svn", ".pioenvs")]):
structure.append(path)
return sha1(",".join(sorted(structure))).hexdigest() if structure else ""

View File

@ -1,4 +1,4 @@
# Copyright 2014-present PlatformIO <contact@platformio.org>
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -13,11 +13,21 @@
# limitations under the License.
import click
from tabulate import tabulate
from platformio import app
from platformio.compat import string_types
@click.group(short_help="Manage PlatformIO settings")
def format_value(raw):
if isinstance(raw, bool):
return "Yes" if raw else "No"
if isinstance(raw, string_types):
return raw
return str(raw)
@click.group(short_help="Manage system settings")
def cli():
pass
@ -25,41 +35,31 @@ def cli():
@cli.command("get", short_help="Get existing setting/-s")
@click.argument("name", required=False)
def settings_get(name):
tabular_data = []
for key, options in sorted(app.DEFAULT_SETTINGS.items()):
if name and name != key:
continue
raw_value = app.get_setting(key)
formatted_value = format_value(raw_value)
list_tpl = "{name:<40} {value:<35} {description}"
terminal_width, _ = click.get_terminal_size()
if raw_value != options["value"]:
default_formatted_value = format_value(options["value"])
formatted_value += "%s" % (
"\n" if len(default_formatted_value) > 10 else " "
)
formatted_value += "[%s]" % click.style(
default_formatted_value, fg="yellow"
)
tabular_data.append(
(click.style(key, fg="cyan"), formatted_value, options["description"])
)
click.echo(
list_tpl.format(
name=click.style("Name", fg="cyan"),
value=(click.style("Value", fg="green") + click.style(
" [Default]", fg="yellow")),
description="Description"))
click.echo("-" * terminal_width)
for _name, _data in sorted(app.DEFAULT_SETTINGS.items()):
if name and name != _name:
continue
_value = app.get_setting(_name)
_value_str = str(_value)
if isinstance(_value, bool):
_value_str = "Yes" if _value else "No"
_value_str = click.style(_value_str, fg="green")
if _value != _data['value']:
_defvalue_str = str(_data['value'])
if isinstance(_data['value'], bool):
_defvalue_str = "Yes" if _data['value'] else "No"
_value_str += click.style(" [%s]" % _defvalue_str, fg="yellow")
else:
_value_str += click.style(" ", fg="yellow")
click.echo(
list_tpl.format(
name=click.style(_name, fg="cyan"),
value=_value_str,
description=_data['description']))
tabulate(
tabular_data, headers=["Name", "Current value [Default]", "Description"]
)
)
@cli.command("set", short_help="Set new value for the setting")
@ -76,5 +76,5 @@ def settings_set(ctx, name, value):
@click.pass_context
def settings_reset(ctx):
app.reset_settings()
click.secho("The settings have been reseted!", fg="green")
click.secho("The settings have been reset!", fg="green")
ctx.invoke(settings_get)

View File

@ -1,56 +0,0 @@
# Copyright 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import sys
from os import getcwd
import click
from platformio.managers.core import pioplus_call
@click.command("test", short_help="Local Unit Testing")
@click.option("--environment", "-e", multiple=True, metavar="<environment>")
@click.option("--ignore", "-i", multiple=True, metavar="<pattern>")
@click.option("--upload-port")
@click.option("--test-port")
@click.option(
"-d",
"--project-dir",
default=getcwd,
type=click.Path(
exists=True,
file_okay=False,
dir_okay=True,
writable=True,
resolve_path=True))
@click.option("--without-building", is_flag=True)
@click.option("--without-uploading", is_flag=True)
@click.option(
"--no-reset",
is_flag=True,
help="Disable software reset via Serial.DTR/RST")
@click.option(
"--monitor-rts",
default=None,
type=click.IntRange(0, 1),
help="Set initial RTS line state for Serial Monitor")
@click.option(
"--monitor-dtr",
default=None,
type=click.IntRange(0, 1),
help="Set initial DTR line state for Serial Monitor")
@click.option("--verbose", "-v", is_flag=True)
def cli(*args, **kwargs): # pylint: disable=unused-argument
pioplus_call(sys.argv[1:])

Some files were not shown because too many files have changed in this diff Show More