From c670372b41f42a7eefd9fc89f36fd1f8f67cf329 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 2 Dec 2015 23:28:49 +0200 Subject: [PATCH 01/30] Move Library Manager to separate group --- docs/demo.rst | 2 +- docs/index.rst | 9 ++++++++- docs/librarymanager/index.rst | 38 ----------------------------------- docs/userguide/index.rst | 1 - docs/userguide/lib/index.rst | 11 +++++++++- 5 files changed, 19 insertions(+), 42 deletions(-) delete mode 100644 docs/librarymanager/index.rst diff --git a/docs/demo.rst b/docs/demo.rst index 6e84f7f9..1511b9c9 100644 --- a/docs/demo.rst +++ b/docs/demo.rst @@ -50,7 +50,7 @@ Library Manager Used in demo ~~~~~~~~~~~~ -1. :ref:`userguide_lib` +1. :ref:`librarymanager` 2. :ref:`platformio lib search 1-wire ` command 3. :ref:`platformio lib install 54 ` command 4. :ref:`platformio lib search -f mbed ` command diff --git a/docs/index.rst b/docs/index.rst index d393c262..5ba1b031 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -99,11 +99,18 @@ Contents Platforms & Boards frameworks/index +.. toctree:: + :caption: Library Manager + :maxdepth: 2 + + User Guide + librarymanager/config + librarymanager/creating + .. toctree:: :caption: Integration :maxdepth: 2 - librarymanager/index ci/index ide diff --git a/docs/librarymanager/index.rst b/docs/librarymanager/index.rst deleted file mode 100644 index c9dc5f15..00000000 --- a/docs/librarymanager/index.rst +++ /dev/null @@ -1,38 +0,0 @@ -.. Copyright 2014-2015 Ivan Kravets - 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. - -.. _librarymanager: - -Library Manager -=============== - -.. - - *"The missing library manager for development platforms"* [#]_ - -*PlatformIO Library Manager* allows you to organize external embedded libraries. -You can search for new libraries via - -* :ref:`Command Line interface ` -* `Web 2.0 Library Search `_ - -You don't need to bother for finding the latest version of library. Due to -:ref:`cmd_lib_update` command you will have up-to-date external libraries. - -.. toctree:: - :maxdepth: 2 - - config - creating - User Guide <../userguide/lib/index.rst> - -.. [#] Inspired by `npm `_ and `bower - `_ package managers for web. diff --git a/docs/userguide/index.rst b/docs/userguide/index.rst index 46449298..39f844a0 100644 --- a/docs/userguide/index.rst +++ b/docs/userguide/index.rst @@ -59,7 +59,6 @@ Commands cmd_boards cmd_ci cmd_init - platformio lib platformio platforms cmd_run cmd_serialports diff --git a/docs/userguide/lib/index.rst b/docs/userguide/lib/index.rst index 2267c1ad..e077e2eb 100644 --- a/docs/userguide/lib/index.rst +++ b/docs/userguide/lib/index.rst @@ -9,11 +9,20 @@ See the License for the specific language governing permissions and limitations under the License. -.. _userguide_lib: +.. _librarymanager: Library Manager =============== +*PlatformIO Library Manager* allows you to organize external embedded libraries. +You can search for new libraries via + +* :ref:`Command Line interface ` +* `Web 2.0 Library Search `_ + +You don't need to bother for finding the latest version of library. Due to +:ref:`cmd_lib_update` command you will have up-to-date external libraries. + To print all available commands and options use: .. code-block:: bash From bacb813b3168a90ac5afb378a2e6caef6697ff68 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 2 Dec 2015 23:51:07 +0200 Subject: [PATCH 02/30] Add "Articles/Manuals" for IDE docs --- docs/ide/arduino.rst | 9 +++++++++ docs/ide/atom.rst | 7 +++++++ docs/ide/clion.rst | 8 ++++++++ docs/ide/eclipse.rst | 10 +++++----- docs/ide/energia.rst | 9 +++++++++ docs/ide/vim.rst | 9 +++++++++ 6 files changed, 47 insertions(+), 5 deletions(-) diff --git a/docs/ide/arduino.rst b/docs/ide/arduino.rst index b2af515a..8348c046 100644 --- a/docs/ide/arduino.rst +++ b/docs/ide/arduino.rst @@ -28,12 +28,21 @@ This software can be used with: Refer to the `Arduino Getting Started `_ page for Installation instructions. +.. contents:: + Integration ----------- More detailed information is located in PlatformIO blog: `Integration of PlatformIO library manager to Arduino IDE `_. +Articles / Manuals +------------------ + +* `Integration of PlatformIO library manager to Arduino and Energia IDEs `_ + +See the full list with :ref:`articles`. + Screenshot ---------- diff --git a/docs/ide/atom.rst b/docs/ide/atom.rst index 346747d3..7c418b4d 100644 --- a/docs/ide/atom.rst +++ b/docs/ide/atom.rst @@ -34,6 +34,13 @@ Integration Using `Atom Packages `_ please install `platomformio `_ package. +Articles / Manuals +------------------ + +* `Arduino Development in Atom Editor `_ + +See a full list with :ref:`articles`. + Screenshot ---------- diff --git a/docs/ide/clion.rst b/docs/ide/clion.rst index 3360b1f6..01a6130d 100644 --- a/docs/ide/clion.rst +++ b/docs/ide/clion.rst @@ -73,6 +73,14 @@ There are 3 predefined targets for building: Active discussion is located in `PlatformIO issue #132 `_. +Articles / Manuals +------------------ + +* `Using PlatformIO to get started with Arduino in CLion IDE `_ +* `Programar con Arduino "The good way" (Programming with Arduino "The good way", Spanish) `_ + +See a full list with :ref:`articles`. + Screenshot ---------- diff --git a/docs/ide/eclipse.rst b/docs/ide/eclipse.rst index 62f9c045..61d69a16 100644 --- a/docs/ide/eclipse.rst +++ b/docs/ide/eclipse.rst @@ -37,9 +37,6 @@ page for more detailed information. Integration ----------- -Project Generator -^^^^^^^^^^^^^^^^^ - Since PlatformIO 2.0 you can generate Eclipse compatible project using :option:`platformio init --ide` command. Please choose board type using :ref:`cmd_boards` command and run: @@ -57,11 +54,14 @@ Then: 3. Build project: ``Menu: Project > Build Project``. -Manual Integration -^^^^^^^^^^^^^^^^^^ +Articles / Manuals +------------------ * `Building and debugging Atmel AVR (Arduino-based) project using Eclipse IDE+PlatformIO `_ * `Improvised MBED FRDM-K64F Eclipse/PlatformIO Setup and Software Installation `_ +* `Learning Arduino GitHub Repository `_ + +See a full list with :ref:`articles`. Screenshot ---------- diff --git a/docs/ide/energia.rst b/docs/ide/energia.rst index abad3d2a..e108ce99 100644 --- a/docs/ide/energia.rst +++ b/docs/ide/energia.rst @@ -28,12 +28,21 @@ This software can be used with: Refer to the `Energia Getting Started `_ page for Installation instructions. +.. contents:: + Integration ----------- More detailed information is located in PlatformIO blog: `Integration of PlatformIO library manager to Energia IDE `_. +Articles / Manuals +------------------ + +* `Integration of PlatformIO library manager to Arduino and Energia IDEs `_ + +See the full list with :ref:`articles`. + Screenshot ----------- diff --git a/docs/ide/vim.rst b/docs/ide/vim.rst index d97d3912..e0d06cde 100644 --- a/docs/ide/vim.rst +++ b/docs/ide/vim.rst @@ -23,6 +23,8 @@ This software can be used with: * all available :ref:`platforms` * all available :ref:`frameworks` +.. contents:: + Integration ----------- @@ -60,6 +62,13 @@ make firmware and upload it. If hotkey doesn't work for you, try to add this line ``nnoremap :make`` to ``~/.vimrc`` +Articles / Manuals +------------------ + +* `コマンドラインでArduino開発 : vim + platformio (Arduino development at the command line: VIM + PlatformIO, Japanese) `_ + +See a full list with :ref:`articles`. + Screenshot ---------- From 7e069afbb2020c183df6c236856bcb5088bc5f02 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 2 Dec 2015 23:58:21 +0200 Subject: [PATCH 03/30] Add new articles --- docs/articles.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/articles.rst b/docs/articles.rst index 8e2262a5..851522de 100644 --- a/docs/articles.rst +++ b/docs/articles.rst @@ -23,12 +23,15 @@ Here are recent articles about PlatformIO: 2015 ^^^^ +* Dec 01, 2015 - **Tateno Yuichi** - `ESP8266 を CUI で開発する (Develop a ESP8266 in CUI, Japanese) `_ * Nov 29, 2015 - **Keith Hughes** - `Using PlatformIO for Embedded Projects `_ * Nov 22, 2015 - **Michał Seroczyński** - `Using PlatformIO to get started with Arduino in CLion IDE `_ * Nov 09, 2015 - **ÁLvaro García Gómez** - `Programar con Arduino "The good way" (Programming with Arduino "The good way", Spanish) `_ * Nov 06, 2015 - **nocd5** - `PlatformIOでmbedをオフラインビルドしSTM32 Nucleoボードでmrubyを使う (Use mruby in the offline build for STM32 Nucleo board with mbed and PlatformIO, Japanese) `_ +* Oct 21, 2015 - **Vittorio Zaccaria** - `Using a cheap STM32 Nucleo to teach remote sensor monitoring `_ * Oct 18, 2015 - **Nico Coetzee** - `First Arduino I2C Experience with PlatformIO `_ * Oct 01, 2015 - **Mistan** - `Compile and Upload Arduino Sketch with PlatformIO for Raspberry Pi Running Arch Linux `_ +* Sep 30, 2015 - **Jay Wiggins** - `PlatformIO Investigation `_ * Sep 01, 2015 - **Thomas P. Weldon, Ph.D.** - `Improvised MBED FRDM-K64F Eclipse/PlatformIO Setup and Software Installation `_ * Aug 08, 2015 - **Josh Glendenning** - `Armstrap Eagle and PlatformIO `_ * Aug 01, 2015 - **Russell Davis** - `PlatformIO on the Raspberry Pi `_ From bf1751059cfd98062d5e27d6ef16c1730c09a72e Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 3 Dec 2015 00:28:35 +0200 Subject: [PATCH 04/30] Fix URL for article --- docs/articles.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/articles.rst b/docs/articles.rst index 851522de..104462a8 100644 --- a/docs/articles.rst +++ b/docs/articles.rst @@ -28,7 +28,7 @@ Here are recent articles about PlatformIO: * Nov 22, 2015 - **Michał Seroczyński** - `Using PlatformIO to get started with Arduino in CLion IDE `_ * Nov 09, 2015 - **ÁLvaro García Gómez** - `Programar con Arduino "The good way" (Programming with Arduino "The good way", Spanish) `_ * Nov 06, 2015 - **nocd5** - `PlatformIOでmbedをオフラインビルドしSTM32 Nucleoボードでmrubyを使う (Use mruby in the offline build for STM32 Nucleo board with mbed and PlatformIO, Japanese) `_ -* Oct 21, 2015 - **Vittorio Zaccaria** - `Using a cheap STM32 Nucleo to teach remote sensor monitoring `_ +* Oct 21, 2015 - **Vittorio Zaccaria** - `Using a cheap STM32 Nucleo to teach remote sensor monitoring `_ * Oct 18, 2015 - **Nico Coetzee** - `First Arduino I2C Experience with PlatformIO `_ * Oct 01, 2015 - **Mistan** - `Compile and Upload Arduino Sketch with PlatformIO for Raspberry Pi Running Arch Linux `_ * Sep 30, 2015 - **Jay Wiggins** - `PlatformIO Investigation `_ From 5b1ceccd1fbec127a638d4a29bf20eaf22731c99 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 3 Dec 2015 00:40:17 +0200 Subject: [PATCH 05/30] Add Quickstart for Library Manager --- docs/demo.rst | 2 +- docs/index.rst | 1 + docs/librarymanager/index.rst | 26 ++++++++++++++++++++++++++ docs/userguide/lib/index.rst | 11 +---------- 4 files changed, 29 insertions(+), 11 deletions(-) create mode 100644 docs/librarymanager/index.rst diff --git a/docs/demo.rst b/docs/demo.rst index 1511b9c9..6e84f7f9 100644 --- a/docs/demo.rst +++ b/docs/demo.rst @@ -50,7 +50,7 @@ Library Manager Used in demo ~~~~~~~~~~~~ -1. :ref:`librarymanager` +1. :ref:`userguide_lib` 2. :ref:`platformio lib search 1-wire ` command 3. :ref:`platformio lib install 54 ` command 4. :ref:`platformio lib search -f mbed ` command diff --git a/docs/index.rst b/docs/index.rst index 5ba1b031..b912dd51 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -103,6 +103,7 @@ Contents :caption: Library Manager :maxdepth: 2 + Quickstart User Guide librarymanager/config librarymanager/creating diff --git a/docs/librarymanager/index.rst b/docs/librarymanager/index.rst new file mode 100644 index 00000000..43974d67 --- /dev/null +++ b/docs/librarymanager/index.rst @@ -0,0 +1,26 @@ +.. Copyright 2014-2015 Ivan Kravets + 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. + +.. _librarymanager: + +Library Manager +=============== + +*PlatformIO Library Manager* allows you to organize external embedded libraries. +You can search for new libraries via + +* :ref:`Command Line interface ` +* `Web 2.0 Library Search `_ + +You don't need to bother for finding the latest version of library. Due to +:ref:`cmd_lib_update` command you will have up-to-date external libraries. + +.. image:: ../_static/platformio-demo-lib.gif diff --git a/docs/userguide/lib/index.rst b/docs/userguide/lib/index.rst index e077e2eb..2267c1ad 100644 --- a/docs/userguide/lib/index.rst +++ b/docs/userguide/lib/index.rst @@ -9,20 +9,11 @@ See the License for the specific language governing permissions and limitations under the License. -.. _librarymanager: +.. _userguide_lib: Library Manager =============== -*PlatformIO Library Manager* allows you to organize external embedded libraries. -You can search for new libraries via - -* :ref:`Command Line interface ` -* `Web 2.0 Library Search `_ - -You don't need to bother for finding the latest version of library. Due to -:ref:`cmd_lib_update` command you will have up-to-date external libraries. - To print all available commands and options use: .. code-block:: bash From 5dc1396f05ba03e0b697e7e606427bf2f6ece4c7 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 3 Dec 2015 17:19:43 +0200 Subject: [PATCH 06/30] Remove prompt with "auto-uploading" from `init` command and add `--enable-auto-uploading` option // Resolve #352 --- HISTORY.rst | 7 +++++++ docs/userguide/cmd_init.rst | 8 ++------ platformio/__init__.py | 2 +- platformio/commands/init.py | 25 ++++++++----------------- 4 files changed, 18 insertions(+), 24 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 2839f032..d369f15c 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -4,6 +4,13 @@ Release History PlatformIO 2.0 -------------- +2.4.2 (2015-12-??) +~~~~~~~~~~~~~~~~~~ + +* Removed prompt with "auto-uploading" from `platformio init `__ + command and added ``--enable-auto-uploading`` option + (`issue #352 `_) + 2.4.1 (2015-12-01) ~~~~~~~~~~~~~~~~~~ diff --git a/docs/userguide/cmd_init.rst b/docs/userguide/cmd_init.rst index 41c7b2ab..713ff39c 100644 --- a/docs/userguide/cmd_init.rst +++ b/docs/userguide/cmd_init.rst @@ -74,12 +74,11 @@ A list with supported IDE is available within ``platformio init --help`` command Also, please look into :ref:`ide` page. .. option:: - --disable-auto-uploading + --enable-auto-uploading If you initialise project with the specified :option:`platformio init --board`, then *PlatformIO* -will create environment with enabled firmware auto-uploading. This option -allows you to disable firmware auto-uploading by default. +will create environment with enabled firmware auto-uploading. .. option:: --env-prefix @@ -138,9 +137,6 @@ Examples $ platformio init --board uno - Would you like to enable firmware auto-uploading when project is successfully built using `platformio run` command? - Don't forget that you can upload firmware manually using `platformio run --target upload` command. [y/N]: y - The current working directory *** will be used for the new project. You can specify another project directory via `platformio init -d %PATH_TO_THE_PROJECT_DIR%` command. diff --git a/platformio/__init__.py b/platformio/__init__.py index 2b369209..5e23151c 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -VERSION = (2, 4, 1) +VERSION = (2, 4, "2.dev0") __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" diff --git a/platformio/commands/init.py b/platformio/commands/init.py index f58654db..a9ceeb23 100644 --- a/platformio/commands/init.py +++ b/platformio/commands/init.py @@ -45,21 +45,11 @@ def validate_boards(ctx, param, value): # pylint: disable=W0613 callback=validate_boards) @click.option("--ide", type=click.Choice(ProjectGenerator.get_supported_ides())) -@click.option("--disable-auto-uploading", is_flag=True) +@click.option("--enable-auto-uploading", is_flag=True) @click.option("--env-prefix", default="") @click.pass_context def cli(ctx, project_dir, board, ide, # pylint: disable=R0913 - disable_auto_uploading, env_prefix): - - # ask about auto-uploading - if board and app.get_setting("enable_prompts"): - disable_auto_uploading = not click.confirm( - "Would you like to enable firmware auto-uploading when project " - "is successfully built using `platformio run` command? \n" - "Don't forget that you can upload firmware manually using " - "`platformio run --target upload` command." - ) - click.echo("") + enable_auto_uploading, env_prefix): if project_dir == getcwd(): click.secho("\nThe current working directory", fg="yellow", nl=False) @@ -141,7 +131,7 @@ http://docs.platformio.org/en/latest/projectconf.html#lib-install if board: fill_project_envs( - ctx, project_file, board, disable_auto_uploading, env_prefix) + ctx, project_file, board, enable_auto_uploading, env_prefix) if ide: pg = ProjectGenerator(project_dir, ide, board[0] if board else None) @@ -154,12 +144,13 @@ http://docs.platformio.org/en/latest/projectconf.html#lib-install "`platformio run --target upload` or `platformio run -t upload` " "- upload firmware to embedded board\n" "`platformio run --target clean` - clean project (remove compiled " - "files)", + "files)\n" + "`platformio run --help` - additional information", fg="green" ) -def fill_project_envs(ctx, project_file, board_types, disable_auto_uploading, +def fill_project_envs(ctx, project_file, board_types, enable_auto_uploading, env_prefix): builtin_boards = get_boards() content = [] @@ -188,8 +179,8 @@ def fill_project_envs(ctx, project_file, board_types, disable_auto_uploading, content.append("framework = %s" % frameworks[0]) content.append("board = %s" % type_) - content.append("%stargets = upload" % ("# " if disable_auto_uploading - else "")) + if enable_auto_uploading: + content.append("targets = upload") _install_dependent_platforms(ctx, used_platforms) From c2d760bccbfd1f2fcd65d63ec41931044a24f0f2 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 3 Dec 2015 17:39:36 +0200 Subject: [PATCH 07/30] Fix tests for init command --- tests/commands/test_init.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/commands/test_init.py b/tests/commands/test_init.py index db1178d4..abf707d7 100644 --- a/tests/commands/test_init.py +++ b/tests/commands/test_init.py @@ -16,7 +16,7 @@ from os import makedirs, getcwd from os.path import getsize, isdir, isfile, join from platformio.commands.init import cli -from platformio import exception, util +from platformio import util def validate_pioproject(pioproject_dir): @@ -53,8 +53,7 @@ def test_init_special_board(platformio_setup, clirunner, validate_cliresult): expected_result = [ ("platform", str(uno['platform'])), ("framework", str(uno['frameworks'][0])), - ("board", "uno"), - ("targets", "upload") + ("board", "uno") ] assert config.has_section("env:uno") @@ -66,14 +65,15 @@ def test_init_disable_auto_uploading(platformio_setup, clirunner, validate_cliresult): with clirunner.isolated_filesystem(): result = clirunner.invoke(cli, - ["-b", "uno", "--disable-auto-uploading"]) + ["-b", "uno", "--enable-auto-uploading"]) validate_cliresult(result) validate_pioproject(getcwd()) config = util.get_project_config() expected_result = [ ("platform", "atmelavr"), ("framework", "arduino"), - ("board", "uno") + ("board", "uno"), + ("targets", "upload") ] assert config.has_section("env:uno") assert len(set(expected_result).symmetric_difference( From e721ebe171abf55616e1955ed761271ec10e5257 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 3 Dec 2015 17:49:26 +0200 Subject: [PATCH 08/30] Add warning to regenerate project when new libs are used --- docs/ide/clion.rst | 5 +++++ docs/ide/eclipse.rst | 4 ++++ docs/ide/qtcreator.rst | 5 +++++ docs/ide/visualstudio.rst | 5 +++++ 4 files changed, 19 insertions(+) diff --git a/docs/ide/clion.rst b/docs/ide/clion.rst index 01a6130d..84f8720f 100644 --- a/docs/ide/clion.rst +++ b/docs/ide/clion.rst @@ -57,6 +57,11 @@ There are 3 predefined targets for building: * ``PLATFORMIO_UPLOAD`` - build and upload (if no errors) * ``PLATFORMIO_CLEAN`` - clean compiled objects and etc. +.. warning:: + The libraries which are added, installed or used in the project + after generating process wont be reflected in IDE. To fix it you + need to reinitialize project using :ref:`cmd_init` (repeat it). + .. warning:: PlatformIO generates empty project by default and **code auto-completion will not work!** To enable auto-completion please choose one of: diff --git a/docs/ide/eclipse.rst b/docs/ide/eclipse.rst index 61d69a16..a2c9c227 100644 --- a/docs/ide/eclipse.rst +++ b/docs/ide/eclipse.rst @@ -53,6 +53,10 @@ Then: 2. Open source file from ``src`` directory (``*.c, *.cpp, *.ino, etc.``) 3. Build project: ``Menu: Project > Build Project``. +.. warning:: + The libraries which are added, installed or used in the project + after generating process wont be reflected in IDE. To fix it you + need to reinitialize project using :ref:`cmd_init` (repeat it). Articles / Manuals ------------------ diff --git a/docs/ide/qtcreator.rst b/docs/ide/qtcreator.rst index 6474bfd2..0ab90709 100644 --- a/docs/ide/qtcreator.rst +++ b/docs/ide/qtcreator.rst @@ -85,6 +85,11 @@ Then: .. image:: ../_static/ide-platformio-qtcreator-3.png :target: http://docs.platformio.org/en/latest/_static/ide-platformio-qtcreator-3.png +.. warning:: + The libraries which are added, installed or used in the project + after generating process wont be reflected in IDE. To fix it you + need to reinitialize project using :ref:`cmd_init` (repeat it). + Manual Integration ^^^^^^^^^^^^^^^^^^ diff --git a/docs/ide/visualstudio.rst b/docs/ide/visualstudio.rst index 2e680694..af40d21e 100644 --- a/docs/ide/visualstudio.rst +++ b/docs/ide/visualstudio.rst @@ -52,6 +52,11 @@ Then: 2. Open source file from ``src`` directory (``*.c, *.cpp, *.ino, etc.``) 3. Build project: ``Menu: Build > Build Solution``. +.. warning:: + The libraries which are added, installed or used in the project + after generating process wont be reflected in IDE. To fix it you + need to reinitialize project using :ref:`cmd_init` (repeat it). + Manual Integration ^^^^^^^^^^^^^^^^^^ From 67cbf25b96a202cf2032fbabf2c7761ccf6b70e5 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 3 Dec 2015 19:25:46 +0200 Subject: [PATCH 09/30] Fix broken ci command --- platformio/commands/ci.py | 3 +-- tests/commands/test_init.py | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/platformio/commands/ci.py b/platformio/commands/ci.py index 71d05fb2..8e409508 100644 --- a/platformio/commands/ci.py +++ b/platformio/commands/ci.py @@ -99,8 +99,7 @@ def cli(ctx, src, lib, exclude, board, # pylint: disable=R0913 _exclude_contents(build_dir, exclude) # initialise project - ctx.invoke(cmd_init, project_dir=build_dir, board=board, - disable_auto_uploading=True) + ctx.invoke(cmd_init, project_dir=build_dir, board=board) # process project ctx.invoke(cmd_run, project_dir=build_dir, verbose=verbose) diff --git a/tests/commands/test_init.py b/tests/commands/test_init.py index abf707d7..8812876f 100644 --- a/tests/commands/test_init.py +++ b/tests/commands/test_init.py @@ -61,8 +61,8 @@ def test_init_special_board(platformio_setup, clirunner, validate_cliresult): set(config.items("env:uno")))) == 0 -def test_init_disable_auto_uploading(platformio_setup, clirunner, - validate_cliresult): +def test_init_enable_auto_uploading(platformio_setup, clirunner, + validate_cliresult): with clirunner.isolated_filesystem(): result = clirunner.invoke(cli, ["-b", "uno", "--enable-auto-uploading"]) From e1396e57b619d8aa235deca5af2008c86f54266b Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 3 Dec 2015 20:02:17 +0200 Subject: [PATCH 10/30] Fix extension for example --- docs/librarymanager/config.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/librarymanager/config.rst b/docs/librarymanager/config.rst index db169136..d6ae06a6 100644 --- a/docs/librarymanager/config.rst +++ b/docs/librarymanager/config.rst @@ -336,6 +336,6 @@ A list of example patterns. This field is predefined with default value: .. code-block:: javascript "examples": [ - "[Ee]xamples/*/*.ini", + "[Ee]xamples/*/*.ino", "[Ee]xamples/*/*.pde" ] From b91f03f0829ac815c0a25a264d1f7b8ed816c479 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 4 Dec 2015 00:02:37 +0200 Subject: [PATCH 11/30] Add examples for "extra_script" --- docs/projectconf.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/projectconf.rst b/docs/projectconf.rst index b259395f..4258e340 100644 --- a/docs/projectconf.rst +++ b/docs/projectconf.rst @@ -440,7 +440,11 @@ Example, specify own upload command for :ref:`platform_atmelavr`: # uncomment line below to see environment variables # print env.Dump() -See built-in examples of `PlatformIO build scripts `_. + +* see built-in examples of `PlatformIO build scripts `_. +* take a look on related users questions: `#351 `_, + `#236 `_, + `#247 `_ ``targets`` ^^^^^^^^^^^ From a8ae5e4d03177239c946c3bdc0082e2ff28f7c5d Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 4 Dec 2015 15:18:31 +0200 Subject: [PATCH 12/30] Generate .travis.yml CI config for embedded projects by default // Resolve #354 --- HISTORY.rst | 5 +- docs/_static/ci-travis-logo.png | Bin 0 -> 20965 bytes docs/ci/travis.rst | 7 ++ platformio/__init__.py | 2 +- platformio/commands/init.py | 131 ++++++++++++++++++++++---------- 5 files changed, 102 insertions(+), 43 deletions(-) create mode 100644 docs/_static/ci-travis-logo.png diff --git a/HISTORY.rst b/HISTORY.rst index d369f15c..4cba0f05 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -4,9 +4,12 @@ Release History PlatformIO 2.0 -------------- -2.4.2 (2015-12-??) +2.5.0 (2015-12-??) ~~~~~~~~~~~~~~~~~~ +* Generate `.travis.yml `__ + CI config for embedded projects by default + (`issue #354 `_) * Removed prompt with "auto-uploading" from `platformio init `__ command and added ``--enable-auto-uploading`` option (`issue #352 `_) diff --git a/docs/_static/ci-travis-logo.png b/docs/_static/ci-travis-logo.png new file mode 100644 index 0000000000000000000000000000000000000000..7a6846343a96e0c5a37c29efadf837786be90479 GIT binary patch literal 20965 zcmeAS@N?(olHy`uVBq!ia0y~yU`SFbx5m+O@q>*W`v>l<2HTIw4Z=^Gj87Nw-=7FXt#Bv$C= z6)QswftllyTAW;zSx}OhpQivaH!&%{w8U0P31pE13_#tPTL8BxuNdm9(FKx$XaoBSVwX)tZh@6^QEFmIeo;t%evX|ZDC`tGa}(23gHjVy zDsA-9RUlky12WRezbG>`uOt!VBRfMIeGDZ$%SIm@3!oUW zbSYs-BS-CU(diyF-*O^aBt+PXYbuR~36)MftG2>l$Bh%MaBX9cV z=*w5~61%>6=#&L;6t6%3JToIhLSp0PrR$@9t=j+k@BXiaTR#537S+Gbi0Ooj$)%H5 zo0#tF^m|7?E66%tTGo4}^Jq^{P4SZb^)t9nzg@lR%q_+_YdKw$Rx>v~`g->4*^P#+ z8)B5&GykuB_+KfgqbJadmnG(M(PrD{%XuE(>Fc|2X5)pKW=k~!11HX(VY&EFbl9ZH zAttJiimXCHgMAhRG1kv~GRsA1C-33A*Tp}*xpP%2JL^^8_V;f-^yzBrpRZL=KK%Rp zzke5m4<@{NYk2?P+Y>+cw}>b;$0%wVs~@hda+~)1*1CBYPIk5^?p(M-V}eEU)tuT} zTZ;DXus9wYGi7DgtTd~+vkpJ45PiLl&A7MO_hB8c;l11d;e}c{^8Iwxv+v699x6xKkYBOZ2xmo|2~&(jaJS@ z?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VyKcj5n`N5vZ@=Ad6xnuWT{~|)-}39Z6^62XUXq^@ z=JpIlWNuU`mbIMqWS7lP8U)%{TD3 zuRZEi>Xpm7t?HA6y5GY`Te#L3Jq+V2;(UH>XAtZ68y96v3lF)JoNbGJSHEwksQcCA zUkWRW{r>WI{O_$0xX3qOO6U#Oo7HzcfB(F^XOmu8kBEEvlc^KV#vdr}t`t#<|q8Qm|uFyFLndW#rd+h0QBj`}DKF`i+ z;+I(-PE26YUR|!e`uf`@^&?z11*Y?^$RE7S+`;?ux=7*^mSgqNKgyMkz7r8N2opKO z*d~^=uTU#2bo%4P(`PViH>{hg_oLl<;tpAzYppkU99v(i6-p@`XDsGeUphpWi= zrNj|AH}-S!nio!SeU7;iv@kg{OQhILi*NJCxA|`lG%_Wx7SmnoYN?-?dhh=3-%aZm z>SV5ac*<i=s`IMf>b$yaC<-5ggoC+WrGmX9ZFzopr E05kEqE&u=k literal 0 HcmV?d00001 diff --git a/docs/ci/travis.rst b/docs/ci/travis.rst index 691018cf..ad1949ee 100644 --- a/docs/ci/travis.rst +++ b/docs/ci/travis.rst @@ -14,6 +14,13 @@ Travis CI ========= +.. image:: ../_static/ci-travis-logo.png + :target: https://docs.travis-ci.com/user/integration/platformio/ + + +**Travis CI** `officially supports `_ +**PlatformIO for Embedded Builds.** + `Travis CI `_ is an open-source hosted, distributed continuous integration service used to build and test projects hosted at `GitHub `_. diff --git a/platformio/__init__.py b/platformio/__init__.py index 5e23151c..3365b850 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -VERSION = (2, 4, "2.dev0") +VERSION = (2, 5, "0.dev0") __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" diff --git a/platformio/commands/init.py b/platformio/commands/init.py index a9ceeb23..c1f64055 100644 --- a/platformio/commands/init.py +++ b/platformio/commands/init.py @@ -83,47 +83,8 @@ def cli(ctx, project_dir, board, ide, # pylint: disable=R0913 if not isdir(d): makedirs(d) - if not isfile(join(lib_dir, "readme.txt")): - 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 organised `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 -#include - -// rest H/C/CPP code - -PlatformIO will find your libraries automatically, configure preprocessor's -include paths and build them. - -See additional options for PlatformIO Library Dependency Finder `lib_*`: - -http://docs.platformio.org/en/latest/projectconf.html#lib-install - -""") + init_lib_readme(lib_dir) + init_ci_conf(project_dir) if not isfile(project_file): copyfile(join(get_source_dir(), "projectconftpl.ini"), @@ -200,3 +161,91 @@ def _install_dependent_platforms(ctx, platforms): cli_platforms_install, platforms=list(set(platforms) - set(installed_platforms)) ) + + +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 organised `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 +#include + +// rest H/C/CPP code + +PlatformIO will find your libraries automatically, configure preprocessor's +include paths and build them. + +See additional options for PlatformIO Library Dependency Finder `lib_*`: + +http://docs.platformio.org/en/latest/projectconf.html#lib-install + +""") + + +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/en/latest/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/en/latest/ci/travis.html > +# +# * User Guide for `platformio ci` command +# < http://docs.platformio.org/en/latest/userguide/cmd_ci.html > +# + +language: python +python: + - "2.7" + +# Cache PlatformIO packages using Travis CI container-based infrastructure +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 --board=TYPE_1 --board=TYPE_2 --board=TYPE_N +""") From f4f65e4c8444d1402f55356797edda10b07c6233 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 4 Dec 2015 21:06:29 +0200 Subject: [PATCH 13/30] Improve code builder for parallel builds (up to 4 times faster than before) --- HISTORY.rst | 1 + platformio/__init__.py | 2 +- platformio/platforms/base.py | 9 +++++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/HISTORY.rst b/HISTORY.rst index 4cba0f05..06c18d5e 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -7,6 +7,7 @@ PlatformIO 2.0 2.5.0 (2015-12-??) ~~~~~~~~~~~~~~~~~~ +* Improved code builder for parallel builds (up to 4 times faster than before) * Generate `.travis.yml `__ CI config for embedded projects by default (`issue #354 `_) diff --git a/platformio/__init__.py b/platformio/__init__.py index 3365b850..ba9f8ca5 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -VERSION = (2, 5, "0.dev0") +VERSION = (2, 5, "0.dev1") __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" diff --git a/platformio/platforms/base.py b/platformio/platforms/base.py index c4488dd1..ccfe1364 100644 --- a/platformio/platforms/base.py +++ b/platformio/platforms/base.py @@ -15,6 +15,7 @@ import os import re from imp import load_source +from multiprocessing import cpu_count from os.path import isdir, isfile, join import click @@ -389,6 +390,8 @@ class BasePlatform(object): [ "scons", "-Q", + "-j %d" % self.get_job_nums(), + "--warn=no-no-parallel-support", "-f", join(util.get_source_dir(), "builder", "main.py") ] + variables + targets, stdout=util.AsyncPipe(self.on_run_out), @@ -432,3 +435,9 @@ class BasePlatform(object): self._last_echo_line = line click.secho(line, fg=fg, err=level < 3) + + def get_job_nums(self): + try: + return cpu_count() + except NotImplementedError: + return 1 From 8c8de45f3013c57a6155f93951a4fc43b38f5370 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 4 Dec 2015 22:35:22 +0200 Subject: [PATCH 14/30] Fix PyLint warning --- platformio/platforms/base.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/platformio/platforms/base.py b/platformio/platforms/base.py index ccfe1364..16c8901c 100644 --- a/platformio/platforms/base.py +++ b/platformio/platforms/base.py @@ -436,7 +436,8 @@ class BasePlatform(object): click.secho(line, fg=fg, err=level < 3) - def get_job_nums(self): + @staticmethod + def get_job_nums(): try: return cpu_count() except NotImplementedError: From 16abaccf96fc25d6eb7c7cd8437881571dbf7c34 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sat, 5 Dec 2015 23:21:16 +0200 Subject: [PATCH 15/30] Keep consign DB in .pioenvs --- platformio/builder/main.py | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/platformio/builder/main.py b/platformio/builder/main.py index b3c1b34a..dbe503ea 100644 --- a/platformio/builder/main.py +++ b/platformio/builder/main.py @@ -41,8 +41,7 @@ from os import environ from os.path import isfile, join from time import time -from SCons.Script import (COMMAND_LINE_TARGETS, DefaultEnvironment, Exit, - SConscript, SConscriptChdir, Variables) +from SCons.Script import COMMAND_LINE_TARGETS, DefaultEnvironment, Variables from platformio.exception import UnknownBoard @@ -141,10 +140,10 @@ if "BOARD" in env: ) if env['PLATFORM'] != env.get("BOARD_OPTIONS", {}).get("platform"): - Exit("Error: '%s' platform doesn't support this board. " - "Use '%s' platform instead." % ( - env['PLATFORM'], - env.get("BOARD_OPTIONS", {}).get("platform"))) + env.Exit( + "Error: '%s' platform doesn't support this board. " + "Use '%s' platform instead." % ( + env['PLATFORM'], env.get("BOARD_OPTIONS", {}).get("platform"))) for opt in ("LIB_IGNORE", "LIB_USE"): @@ -158,16 +157,18 @@ if env.subst("$PIOPACKAGE_TOOLCHAIN"): env.subst(join("$PIOPACKAGES_DIR", "$PIOPACKAGE_TOOLCHAIN", "bin")) ) -SConscriptChdir(0) -SConscript(env.subst("$BUILD_SCRIPT")) +env.SConscriptChdir(0) +env.SConsignFile(join("$PIOENVS_DIR", ".sconsign.dblite")) +env.SConscript("$BUILD_SCRIPT") -if environ.get("PLATFORMIO_EXTRA_SCRIPT", env.get("EXTRA_SCRIPT", None)): - SConscript(environ.get("PLATFORMIO_EXTRA_SCRIPT", env.get("EXTRA_SCRIPT"))) +if environ.get("PLATFORMIO_EXTRA_SCRIPT", env.get("EXTRA_SCRIPT")): + env.SConscript( + environ.get("PLATFORMIO_EXTRA_SCRIPT", env.get("EXTRA_SCRIPT"))) if "envdump" in COMMAND_LINE_TARGETS: print env.Dump() - Exit() + env.Exit() if "idedata" in COMMAND_LINE_TARGETS: print json.dumps(env.DumpIDEData()) - Exit() + env.Exit() From 2345eb3bb7703806b23c35e2300375cbc0bbc36b Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sat, 5 Dec 2015 23:30:42 +0200 Subject: [PATCH 16/30] Fix incorrect behaviour of "platformio serialports monitor" in pair with @PySerial 3.0 --- HISTORY.rst | 2 ++ platformio/commands/serialports.py | 9 +++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 06c18d5e..b8b78b8a 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -14,6 +14,8 @@ PlatformIO 2.0 * Removed prompt with "auto-uploading" from `platformio init `__ command and added ``--enable-auto-uploading`` option (`issue #352 `_) +* Fixed incorrect behaviour of `platformio serialports monitor `__ + in pair with PySerial 3.0 2.4.1 (2015-12-01) ~~~~~~~~~~~~~~~~~~ diff --git a/platformio/commands/serialports.py b/platformio/commands/serialports.py index 6c6e58ff..46d56f48 100644 --- a/platformio/commands/serialports.py +++ b/platformio/commands/serialports.py @@ -57,10 +57,10 @@ if int(PYSERIAL_VERSION[0]) == 3: 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="0", type=click.Choice(["0", "1"]), - help="Set initial RTS line state, default=0") - @click.option("--dtr", default="0", type=click.Choice(["0", "1"]), - help="Set initial DTR line state, default=0") + @click.option("--rts", default=None, type=click.Choice(["0", "1"]), + help="Set initial RTS line state") + @click.option("--dtr", default=None, type=click.Choice(["0", "1"]), + help="Set initial DTR line state") @click.option("--encoding", default="UTF-8", help="Set the encoding for the serial port (e.g. hexlify, " "Latin1, UTF-8), default: UTF-8") @@ -101,6 +101,7 @@ if int(PYSERIAL_VERSION[0]) == 3: sys.argv.extend([k, str(v)]) try: + print kwargs miniterm.main( # pylint: disable=E1123 default_port=kwargs['port'], default_baudrate=kwargs['baud'], From f6686f149bafe5c440d64a6a4b2174fc0805f6be Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sat, 5 Dec 2015 23:34:25 +0200 Subject: [PATCH 17/30] Generate ".gitignore" by default --- HISTORY.rst | 2 +- platformio/__init__.py | 2 +- platformio/commands/init.py | 8 ++++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index b8b78b8a..c8f53100 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -9,7 +9,7 @@ PlatformIO 2.0 * Improved code builder for parallel builds (up to 4 times faster than before) * Generate `.travis.yml `__ - CI config for embedded projects by default + CI and `.gitignore` files for embedded projects by default (`issue #354 `_) * Removed prompt with "auto-uploading" from `platformio init `__ command and added ``--enable-auto-uploading`` option diff --git a/platformio/__init__.py b/platformio/__init__.py index ba9f8ca5..54dfffdc 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -VERSION = (2, 5, "0.dev1") +VERSION = (2, 5, "0.dev2") __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" diff --git a/platformio/commands/init.py b/platformio/commands/init.py index c1f64055..b7f7200b 100644 --- a/platformio/commands/init.py +++ b/platformio/commands/init.py @@ -85,6 +85,7 @@ def cli(ctx, project_dir, board, ide, # pylint: disable=R0913 init_lib_readme(lib_dir) init_ci_conf(project_dir) + init_cvs_ignore(project_dir) if not isfile(project_file): copyfile(join(get_source_dir(), "projectconftpl.ini"), @@ -249,3 +250,10 @@ install: script: - platformio ci --board=TYPE_1 --board=TYPE_2 --board=TYPE_N """) + + +def init_cvs_ignore(project_dir): + if isfile(join(project_dir, ".gitignore")): + return + with open(join(project_dir, ".gitignore"), "w") as f: + f.write(".pioevs") From 7727562f44ae9f7741c684988aa9f85a403d25e1 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Mon, 7 Dec 2015 00:20:14 +0200 Subject: [PATCH 18/30] Simplify .travis.yml file --- platformio/commands/init.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/platformio/commands/init.py b/platformio/commands/init.py index b7f7200b..a8417b49 100644 --- a/platformio/commands/init.py +++ b/platformio/commands/init.py @@ -239,16 +239,11 @@ 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 --board=TYPE_1 --board=TYPE_2 --board=TYPE_N + - platformio run """) From 97ee8d55ce5ef4f9210e91477af11fe8368a8a83 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Mon, 7 Dec 2015 00:23:38 +0200 Subject: [PATCH 19/30] Remove debug code --- platformio/commands/serialports.py | 1 - 1 file changed, 1 deletion(-) diff --git a/platformio/commands/serialports.py b/platformio/commands/serialports.py index 46d56f48..5c091c26 100644 --- a/platformio/commands/serialports.py +++ b/platformio/commands/serialports.py @@ -101,7 +101,6 @@ if int(PYSERIAL_VERSION[0]) == 3: sys.argv.extend([k, str(v)]) try: - print kwargs miniterm.main( # pylint: disable=E1123 default_port=kwargs['port'], default_baudrate=kwargs['baud'], From a483ecdfdb070b1d7950933abd460ab243ef150b Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Mon, 7 Dec 2015 14:52:19 +0200 Subject: [PATCH 20/30] Warn about missing native support for the library // Resolve #358 --- platformio/__init__.py | 2 +- platformio/builder/scripts/frameworks/mbed.py | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/platformio/__init__.py b/platformio/__init__.py index 54dfffdc..f75f4864 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -VERSION = (2, 5, "0.dev2") +VERSION = (2, 5, "0.dev3") __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" diff --git a/platformio/builder/scripts/frameworks/mbed.py b/platformio/builder/scripts/frameworks/mbed.py index be0e4da2..0ae6cf47 100644 --- a/platformio/builder/scripts/frameworks/mbed.py +++ b/platformio/builder/scripts/frameworks/mbed.py @@ -26,13 +26,16 @@ the mbed Developer Community. http://mbed.org/ """ +from __future__ import print_function + import re +import sys import xml.etree.ElementTree as ElementTree from binascii import crc32 from os import getenv, walk from os.path import basename, isfile, join, normpath -from SCons.Script import DefaultEnvironment, Exit +from SCons.Script import DefaultEnvironment env = DefaultEnvironment() @@ -119,8 +122,9 @@ def add_mbedlib(libname, libar): lib_dir = join(env.subst("$PLATFORMFW_DIR"), "libs", libname) if not isfile(join(lib_dir, "TARGET_%s" % variant, "TOOLCHAIN_GCC_ARM", "lib%s.a" % libar)): - Exit("Error: %s board doesn't support %s library!" % - (env.get("BOARD"), libname)) + print ( + "Warning: %s board doesn't have native support for '%s' library!" % + (env.get("BOARD"), libname), file=sys.stderr) env.Append( LIBPATH=[ From 234517ee0a12be7e25ef4c26296e35c32f7b834c Mon Sep 17 00:00:00 2001 From: Valeriy Koval Date: Mon, 7 Dec 2015 15:09:43 +0200 Subject: [PATCH 21/30] Ignore unsupported mbed native library --- platformio/builder/scripts/frameworks/mbed.py | 1 + 1 file changed, 1 insertion(+) diff --git a/platformio/builder/scripts/frameworks/mbed.py b/platformio/builder/scripts/frameworks/mbed.py index 0ae6cf47..e300d5f2 100644 --- a/platformio/builder/scripts/frameworks/mbed.py +++ b/platformio/builder/scripts/frameworks/mbed.py @@ -125,6 +125,7 @@ def add_mbedlib(libname, libar): print ( "Warning: %s board doesn't have native support for '%s' library!" % (env.get("BOARD"), libname), file=sys.stderr) + return env.Append( LIBPATH=[ From 7eed6f56f6f92855f3b7fb037f1e7f96e284cd4d Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Mon, 7 Dec 2015 17:17:01 +0200 Subject: [PATCH 22/30] Update keywords --- setup.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/setup.py b/setup.py index 6696f001..edb70648 100644 --- a/setup.py +++ b/setup.py @@ -71,10 +71,9 @@ setup( "Topic :: Software Development :: Build Tools", "Topic :: Software Development :: Compilers" ], - keywords=( - "iot builder library manager embedded development ide continuous " - "integration atmel avr sam espressif esp freescale kinetis nordic " - "nrf51 nxp lpc silicon labs efm32 st stm32 ti msp430 tiva teensy " - "arduino mbed libopencm3" - ) + keywords=[ + "iot", "build tool", "compiler", "builder", "library manager", + "embedded", "ci", "continuous integration", "arduino", "mbed", + "framework", "ide", "ide integration" + ] ) From 28619a6ce7489f9a80558297a21e593d5eb56db7 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Mon, 7 Dec 2015 17:43:33 +0200 Subject: [PATCH 23/30] Add libray.json --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index edb70648..f9cefef4 100644 --- a/setup.py +++ b/setup.py @@ -74,6 +74,6 @@ setup( keywords=[ "iot", "build tool", "compiler", "builder", "library manager", "embedded", "ci", "continuous integration", "arduino", "mbed", - "framework", "ide", "ide integration" + "framework", "ide", "ide integration", "library.json" ] ) From b7ab82586028c025775c76ba99788df18e6e2140 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Mon, 7 Dec 2015 17:43:59 +0200 Subject: [PATCH 24/30] Use general exception for usage error --- platformio/__main__.py | 2 +- platformio/exception.py | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/platformio/__main__.py b/platformio/__main__.py index e5e35aee..813558bb 100644 --- a/platformio/__main__.py +++ b/platformio/__main__.py @@ -46,7 +46,7 @@ class PlatformioCLI(click.MultiCommand): # pylint: disable=R0904 try: return self._handle_obsolate_command(name) except AttributeError: - raise exception.UnknownCLICommand(name) + raise click.UsageError('No such command "%s"' % name, ctx) return mod.cli @staticmethod diff --git a/platformio/exception.py b/platformio/exception.py index 74491f70..175f430a 100644 --- a/platformio/exception.py +++ b/platformio/exception.py @@ -48,12 +48,6 @@ class PlatformNotInstalledYet(PlatformioException): "Use `platformio platforms install` command" -class UnknownCLICommand(PlatformioException): - - MESSAGE = "Unknown command '%s'. Please use `platformio --help`"\ - " to see all available commands" - - class UnknownBoard(PlatformioException): MESSAGE = "Unknown board type '%s'" From dfb93e9682af2ed7fa5822ea67316bd0a65aa20e Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Mon, 7 Dec 2015 22:23:20 +0200 Subject: [PATCH 25/30] Improve project initialisation --- docs/userguide/cmd_init.rst | 4 ++- platformio/commands/init.py | 58 +++++++++++++++++++++++++++++-------- platformio/maintenance.py | 4 +-- 3 files changed, 51 insertions(+), 15 deletions(-) diff --git a/docs/userguide/cmd_init.rst b/docs/userguide/cmd_init.rst index 713ff39c..69702b05 100644 --- a/docs/userguide/cmd_init.rst +++ b/docs/userguide/cmd_init.rst @@ -27,7 +27,7 @@ Usage Description ----------- -Initialize new PlatformIO based project. +Initialize new PlatformIO based project or update existing with new data. This command will create: @@ -36,6 +36,8 @@ This command will create: * ``src`` - a source directory. Put your source files here * ``lib`` - a directory for the project specific (private) libraries. PlatformIO will compile them to static libraries and link to executable file +* ``.travis.yml`` configuration file (template) for Continuous Integration + with :ref:`ci_travis` .. note:: The source code of each library should be placed in separate directory. diff --git a/platformio/commands/init.py b/platformio/commands/init.py index a8417b49..45fa1fe0 100644 --- a/platformio/commands/init.py +++ b/platformio/commands/init.py @@ -228,22 +228,56 @@ def init_ci_conf(project_dir): # * User Guide for `platformio ci` command # < http://docs.platformio.org/en/latest/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). +# -language: python -python: - - "2.7" -# Cache PlatformIO packages using Travis CI container-based infrastructure -sudo: false -cache: - directories: - - "~/.platformio" +# +# Template #1: General project. Test it using existing `platformio.ini`. +# -install: - - pip install -U platformio +# language: python +# python: +# - "2.7" +# +# sudo: false +# cache: +# directories: +# - "~/.platformio" +# +# install: +# - pip install -U platformio +# +# script: +# - platformio run -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=TYPE_1 --board=TYPE_2 --board=TYPE_N """) diff --git a/platformio/maintenance.py b/platformio/maintenance.py index dc5a2861..5d5d9496 100644 --- a/platformio/maintenance.py +++ b/platformio/maintenance.py @@ -141,8 +141,8 @@ def after_upgrade(ctx): (click.style("follow", fg="cyan"), click.style("https://twitter.com/PlatformIO_Org", fg="cyan")) ) - click.echo("- %s us a star on GitHub > %s" % ( - click.style("give", fg="cyan"), + click.echo("- %s it on GitHub! > %s" % ( + click.style("star", fg="cyan"), click.style("https://github.com/platformio/platformio", fg="cyan") )) click.echo("*" * terminal_width) From 68c64cd94235b8559796d359536ef64abc5a9676 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Mon, 7 Dec 2015 22:44:31 +0200 Subject: [PATCH 26/30] Improve upgrading command --- platformio/commands/upgrade.py | 9 ++++++--- platformio/exception.py | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/platformio/commands/upgrade.py b/platformio/commands/upgrade.py index 761644bb..eb190c50 100644 --- a/platformio/commands/upgrade.py +++ b/platformio/commands/upgrade.py @@ -32,7 +32,6 @@ def cli(): fg="yellow") cmds = ( - ["pip", "install", "--upgrade", "pip", "setuptools"], ["pip", "install", "--upgrade", "platformio"], ["platformio", "--version"] ) @@ -60,7 +59,11 @@ def cli(): if not r: raise exception.UpgradeError( "\n".join([str(cmd), str(e)])) - if ("Permission denied" in r['err'] and + permission_errors = ( + "permission denied", + "not permitted" + ) + if (any([m in r['err'].lower() for m in permission_errors]) and "windows" not in util.get_systype()): click.secho(""" ----------------- @@ -68,7 +71,7 @@ Permission denied ----------------- You need the `sudo` permission to install Python packages. Try -> sudo platformio upgrade +> sudo pip install -U platformio WARNING! Don't use `sudo` for the rest PlatformIO commands. """, fg="yellow", err=True) diff --git a/platformio/exception.py b/platformio/exception.py index 175f430a..afba9b61 100644 --- a/platformio/exception.py +++ b/platformio/exception.py @@ -195,6 +195,7 @@ class UpgradeError(PlatformioException): MESSAGE = """%s +* Upgrade using `pip install -U platformio` * Try different installation/upgrading steps: http://docs.platformio.org/en/latest/installation.html """ From c87c4691f361e40680cc771521109b834a228569 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 8 Dec 2015 18:42:23 +0200 Subject: [PATCH 27/30] Typo fix --- HISTORY.rst | 2 +- docs/projectconf.rst | 2 +- platformio/commands/lib.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index c8f53100..0bd16da2 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -232,7 +232,7 @@ PlatformIO 2.0 * Automatically detect upload port using VID:PID board settings (`issue #231 `_) * Improved detection of build changes -* Avoided ``LibInstallDependencyError`` when more then 1 library is found +* Avoided ``LibInstallDependencyError`` when more than 1 library is found (`issue #229 `_) 2.1.0 (2015-06-03) diff --git a/docs/projectconf.rst b/docs/projectconf.rst index 4258e340..448a0a2e 100644 --- a/docs/projectconf.rst +++ b/docs/projectconf.rst @@ -450,7 +450,7 @@ Example, specify own upload command for :ref:`platform_atmelavr`: ^^^^^^^^^^^ A list with targets which will be processed by :ref:`cmd_run` command by -default. You can enter more then one target separated with "space". Which +default. You can enter more than one target separated with "space". Which targets are supported is described in :option:`platformio run --target`. **Tip!** You can use these targets like an option to diff --git a/platformio/commands/lib.py b/platformio/commands/lib.py index 883f2c9f..7a988900 100644 --- a/platformio/commands/lib.py +++ b/platformio/commands/lib.py @@ -159,7 +159,7 @@ def lib_install_dependency(ctx, data): ctx.invoke(lib_install, libid=[result['items'][0]['id']]) else: click.secho( - "Conflict: More then one dependent libraries have been found " + "Conflict: More than one dependent libraries have been found " "by request %s:" % json.dumps(data), fg="red") echo_liblist_header() From 983db2f3c8996e63d80493876dd3c32b72670a5d Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 8 Dec 2015 18:42:50 +0200 Subject: [PATCH 28/30] Improve project initialisation --- platformio/commands/init.py | 23 +++++++++++++++++++---- platformio/exception.py | 7 +++++++ platformio/ide/projectgenerator.py | 19 +++++++++---------- 3 files changed, 35 insertions(+), 14 deletions(-) diff --git a/platformio/commands/init.py b/platformio/commands/init.py index 45fa1fe0..96493d49 100644 --- a/platformio/commands/init.py +++ b/platformio/commands/init.py @@ -93,10 +93,24 @@ def cli(ctx, project_dir, board, ide, # pylint: disable=R0913 if board: fill_project_envs( - ctx, project_file, board, enable_auto_uploading, env_prefix) + ctx, project_file, board, enable_auto_uploading, env_prefix, + ide is not None + ) if ide: - pg = ProjectGenerator(project_dir, ide, board[0] if board else None) + 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 lint)" + " 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() click.secho( @@ -113,7 +127,7 @@ def cli(ctx, project_dir, board, ide, # pylint: disable=R0913 def fill_project_envs(ctx, project_file, board_types, enable_auto_uploading, - env_prefix): + env_prefix, force_download): builtin_boards = get_boards() content = [] used_envs = [] @@ -144,7 +158,8 @@ def fill_project_envs(ctx, project_file, board_types, enable_auto_uploading, if enable_auto_uploading: content.append("targets = upload") - _install_dependent_platforms(ctx, used_platforms) + if force_download and used_platforms: + _install_dependent_platforms(ctx, used_platforms) if not content: return diff --git a/platformio/exception.py b/platformio/exception.py index afba9b61..48d109ae 100644 --- a/platformio/exception.py +++ b/platformio/exception.py @@ -48,6 +48,13 @@ class PlatformNotInstalledYet(PlatformioException): "Use `platformio platforms install` command" +class BoardNotDefined(PlatformioException): + + MESSAGE = "You need to specify board type using `-b` or `--board` "\ + "option. Supported boards list is available via "\ + " `platformio boards` command" + + class UnknownBoard(PlatformioException): MESSAGE = "Unknown board type '%s'" diff --git a/platformio/ide/projectgenerator.py b/platformio/ide/projectgenerator.py index 7e90574c..28132e58 100644 --- a/platformio/ide/projectgenerator.py +++ b/platformio/ide/projectgenerator.py @@ -20,12 +20,12 @@ from os.path import abspath, basename, expanduser, isdir, join, relpath import bottle import click -from platformio import util +from platformio import exception, util class ProjectGenerator(object): - def __init__(self, project_dir, ide, board=None): + def __init__(self, project_dir, ide, board): self.project_dir = project_dir self.ide = ide self.board = board @@ -50,7 +50,7 @@ class ProjectGenerator(object): data = {"env_name": section[4:]} for k, v in config.items(section): data[k] = v - if self.board and self.board == data.get("board"): + if self.board == data.get("board"): break return data @@ -68,16 +68,15 @@ class ProjectGenerator(object): ["platformio", "-f", "run", "-t", "idedata", "-e", envdata['env_name'], "-d", self.project_dir] ) + if result['returncode'] != 0 or '"includes":' not in result['out']: - return data + raise exception.PlatformioException( + "\n".join([result['out'], result['err']])) output = result['out'] - try: - start_index = output.index('\n{"') - stop_index = output.rindex('}') - data = json.loads(output[start_index + 1:stop_index + 1]) - except ValueError: - pass + start_index = output.index('\n{"') + stop_index = output.rindex('}') + data = json.loads(output[start_index + 1:stop_index + 1]) return data From eb1971fb17a1a6b1a496803b054608ac571d0fe3 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 8 Dec 2015 19:08:00 +0200 Subject: [PATCH 29/30] Fix PyLint --- platformio/commands/init.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/platformio/commands/init.py b/platformio/commands/init.py index 96493d49..9709b8ae 100644 --- a/platformio/commands/init.py +++ b/platformio/commands/init.py @@ -126,8 +126,9 @@ def cli(ctx, project_dir, board, ide, # pylint: disable=R0913 ) -def fill_project_envs(ctx, project_file, board_types, enable_auto_uploading, - env_prefix, force_download): +def fill_project_envs( # pylint: disable=too-many-arguments,too-many-locals + ctx, project_file, board_types, enable_auto_uploading, + env_prefix, force_download): builtin_boards = get_boards() content = [] used_envs = [] From c841ba1cba8e14458faae42705ffdcc5de6256a6 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 8 Dec 2015 19:28:08 +0200 Subject: [PATCH 30/30] Version bump to 2.5.0 (issues #352, #354, #358) --- HISTORY.rst | 2 +- platformio/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 0bd16da2..9e90581f 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -4,7 +4,7 @@ Release History PlatformIO 2.0 -------------- -2.5.0 (2015-12-??) +2.5.0 (2015-12-08) ~~~~~~~~~~~~~~~~~~ * Improved code builder for parallel builds (up to 4 times faster than before) diff --git a/platformio/__init__.py b/platformio/__init__.py index f75f4864..662e56a0 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -VERSION = (2, 5, "0.dev3") +VERSION = (2, 5, 0) __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio"