From b15408e6935df950e858d0f2188425af0233b9b9 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 8 Sep 2015 15:08:44 +0300 Subject: [PATCH 01/16] Depend on lockfile >= 0.9.1 --- platformio/__init__.py | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/platformio/__init__.py b/platformio/__init__.py index 3531ec67..7b31d423 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -1,7 +1,7 @@ # Copyright (C) Ivan Kravets # See LICENSE for details. -VERSION = (2, 3, 1) +VERSION = (2, 3, "2.dev0") __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" diff --git a/setup.py b/setup.py index fcf664e2..668ada4a 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ setup( install_requires=[ "bottle", "click>=3.2", - "lockfile", + "lockfile>=0.9.1", "pyserial", "requests>=2.4.0", "SCons" From 82a8bd01fc0e94adbb3bcd639244ba444a3d3345 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 9 Sep 2015 00:45:51 +0300 Subject: [PATCH 02/16] Fix `SConsNotInstalled` error for Linux Debian-based distributives --- HISTORY.rst | 5 +++++ docs/installation.rst | 2 +- platformio/__init__.py | 2 +- platformio/builder/main.py | 17 ++++++++++------- platformio/platforms/base.py | 17 +++++++++++++++++ 5 files changed, 34 insertions(+), 9 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 51201155..6572ee96 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -4,6 +4,11 @@ Release History PlatformIO 2.0 -------------- +2.3.2 (2015-09-??) +~~~~~~~~~~~~~~~~~~ + +* Fixed `SConsNotInstalled` error for Linux Debian-based distributives + 2.3.1 (2015-09-06) ~~~~~~~~~~~~~~~~~~ diff --git a/docs/installation.rst b/docs/installation.rst index 93999493..85b6e847 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -47,7 +47,7 @@ The latest stable version of PlatformIO may be done via .. code-block:: bash # update dependent packages to the latest versions - pip install -U pip setuptools + pip install -U pip setuptools virtualenv # install the latest version of PlatformIO pip install -U platformio diff --git a/platformio/__init__.py b/platformio/__init__.py index 7b31d423..8be279ed 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -1,7 +1,7 @@ # Copyright (C) Ivan Kravets # See LICENSE for details. -VERSION = (2, 3, "2.dev0") +VERSION = (2, 3, "2.dev1") __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" diff --git a/platformio/builder/main.py b/platformio/builder/main.py index 0dd206f3..4495e15b 100644 --- a/platformio/builder/main.py +++ b/platformio/builder/main.py @@ -6,13 +6,16 @@ try: except ImportError: import sys for p in sys.path: - _new_path = None - if not p.endswith("site-packages") and "site-packages" in p: - _new_path = p[:p.rfind("site-packages") + 13] - elif "platformio" in p: - _new_path = p[:p.rfind("platformio") - 1] - if _new_path and _new_path not in sys.path: - sys.path.insert(0, _new_path) + _new_paths = [] + for item in ("dist-packages", "site-packages"): + if not p.endswith(item) and item in p: + _new_paths.append(p[:p.rfind(item) + len(item)]) + if "platformio" in p: + _new_paths.append(p[:p.rfind("platformio") - 1]) + + for _p in _new_paths: + if _p not in sys.path: + sys.path.insert(0, _p) try: from platformio import util break diff --git a/platformio/platforms/base.py b/platformio/platforms/base.py index 6a71da0a..ddc21a5b 100644 --- a/platformio/platforms/base.py +++ b/platformio/platforms/base.py @@ -4,6 +4,7 @@ import os import re import sys +from glob import glob from imp import load_source from os.path import isdir, isfile, join @@ -400,6 +401,22 @@ class BasePlatform(object): def test_scons(): try: r = util.exec_command(["scons", "--version"]) + if "ImportError: No module named SCons.Script" in r['err']: + _PYTHONPATH = [] + for p in sys.path: + if not p.endswith("-packages"): + continue + for item in glob(join(p, "scons*")): + if isdir(join(item, "SCons")) and item not in sys.path: + _PYTHONPATH.append(item) + sys.path.insert(0, item) + if _PYTHONPATH: + _PYTHONPATH = str(os.pathsep).join(_PYTHONPATH) + if os.getenv("PYTHONPATH"): + os.environ['PYTHONPATH'] += os.pathsep + _PYTHONPATH + else: + os.environ['PYTHONPATH'] = _PYTHONPATH + r = util.exec_command(["scons", "--version"]) assert r['returncode'] == 0 return True except (OSError, AssertionError): From f5f97fe0fd06ed1c00b9dd3c351eb28d1e9170db Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 9 Sep 2015 01:01:41 +0300 Subject: [PATCH 03/16] More explanations about lib directory --- platformio/commands/init.py | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/platformio/commands/init.py b/platformio/commands/init.py index eac1e7c0..15d5f80a 100644 --- a/platformio/commands/init.py +++ b/platformio/commands/init.py @@ -90,8 +90,32 @@ Documentation: http://docs.platformio.org/en/latest/userguide/cmd_init.html 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. -For example, "lib/private_lib/[here are source files]". +The source code of each library should be placed in separate directory, like +"lib/private_lib/[here are source files]". + +For example, the library is named "Foo" and source code is placed to `lib/Foo` +directory: + +* lib +|-- + | Foo + -- + | Foo.h + | Foo.cpp + +Then in your project (within `src` directory) you should use: + +#include + +// rest H/C/CPP code + +PlatformIO will find your library automatically, configure path to includes for +preprocessor and build it. + +See additional options for PlatformIO Library Dependency Finder `lib_*`: + +http://docs.platformio.org/en/latest/projectconf.html#lib-install + """) if not isfile(project_file): From 0405ba3f3119712bbcd1bff936d915af7fb4173b Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 9 Sep 2015 01:28:43 +0300 Subject: [PATCH 04/16] Update virtualenv if exists --- platformio/commands/upgrade.py | 2 +- scripts/get-platformio.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/platformio/commands/upgrade.py b/platformio/commands/upgrade.py index 1140b096..5456979d 100644 --- a/platformio/commands/upgrade.py +++ b/platformio/commands/upgrade.py @@ -21,7 +21,7 @@ def cli(): fg="yellow") cmds = ( - ["pip", "install", "--upgrade", "pip", "setuptools"], + ["pip", "install", "--upgrade", "pip", "setuptools", "virtualenv"], ["pip", "install", "--upgrade", "platformio"], ["platformio", "--version"] ) diff --git a/scripts/get-platformio.py b/scripts/get-platformio.py index bcab3d14..1fad5117 100644 --- a/scripts/get-platformio.py +++ b/scripts/get-platformio.py @@ -97,7 +97,7 @@ def main(): ("Fixing Windows %PATH% Environment", fix_winpython_pathenv, []), ("Installing Python Package Manager", install_pip, []), ("Installing PlatformIO and dependencies", install_pypi_packages, - [["setuptools", "platformio"]]) + [["setuptools", "virtualenv", "platformio"]]) ] if not IS_WINDOWS: From 9c73e597723778c5e3794bf56e0c63fba322cbda Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 10 Sep 2015 15:20:29 +0300 Subject: [PATCH 05/16] Fix firmware uploading for Arduino Leonardo under Unix --- platformio/builder/tools/pioupload.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/platformio/builder/tools/pioupload.py b/platformio/builder/tools/pioupload.py index ddd82e25..4a416c09 100644 --- a/platformio/builder/tools/pioupload.py +++ b/platformio/builder/tools/pioupload.py @@ -2,14 +2,13 @@ # See LICENSE for details. from os.path import join -from platform import system from shutil import copyfile from time import sleep from SCons.Script import Exit from serial import Serial -from platformio.util import get_logicaldisks, get_serialports +from platformio.util import get_logicaldisks, get_serialports, get_systype def FlushSerialBuffer(env, port): @@ -24,7 +23,7 @@ def FlushSerialBuffer(env, port): def TouchSerialPort(env, port, baudrate): - if system() == "Linux": + if "windows" not in get_systype(): try: s = Serial(env.subst(port)) s.close() From 61ef27c345842cccc16d51581e8a98388bab64fe Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 10 Sep 2015 16:43:09 +0300 Subject: [PATCH 06/16] Allow to use ST-Link uploader for mbed-based projects --- HISTORY.rst | 1 + docs/projectconf.rst | 81 +++++---------------------- platformio/__init__.py | 2 +- platformio/builder/scripts/ststm32.py | 10 ++-- 4 files changed, 23 insertions(+), 71 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 6572ee96..378e03bc 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -7,6 +7,7 @@ PlatformIO 2.0 2.3.2 (2015-09-??) ~~~~~~~~~~~~~~~~~~ +* Allowed to use ST-Link uploader for mbed-based projects * Fixed `SConsNotInstalled` error for Linux Debian-based distributives 2.3.1 (2015-09-06) diff --git a/docs/projectconf.rst b/docs/projectconf.rst index a3641e5c..da5fb058 100644 --- a/docs/projectconf.rst +++ b/docs/projectconf.rst @@ -475,39 +475,7 @@ Examples targets = upload -2. :ref:`platform_atmelavr`: Microduino Core (ATmega168P, 3.3V) board with - auto pre-configured ``board_*`` and ``upload_*`` options (use only - ``board`` option) and Arduino Wiring-based Framework - -.. code-block:: ini - - [env:atmelavr_microduino_core_board] - platform = atmelavr - framework = arduino - board = 168pa8m - - # enable auto-uploading - targets = upload - - -3. :ref:`platform_atmelavr`: Raspduino board with - auto pre-configured ``board_*`` and ``upload_*`` options (use only - ``board`` option) and Arduino Wiring-based Framework - -.. code-block:: ini - - [env:atmelavr_raspduino_board] - platform = atmelavr - framework = arduino - board = raspduino - - upload_port = /dev/ttyS0 - - # enable auto-uploading - targets = upload - - -4. :ref:`platform_atmelavr`: Embedded board that is based on ATmega168 MCU with +2. :ref:`platform_atmelavr`: Embedded board that is based on ATmega168 MCU with "arduino" bootloader .. code-block:: ini @@ -527,7 +495,7 @@ Examples targets = upload -5. Upload firmware via USB programmer (USBasp) to :ref:`platform_atmelavr` +3. Upload firmware via USB programmer (USBasp) to :ref:`platform_atmelavr` microcontrollers .. code-block:: ini @@ -536,44 +504,25 @@ Examples platform = atmelavr framework = arduino board = pro8MHzatmega328 - upload_protocol = usbasp -B5 + upload_protocol = usbasp - B5 -6. :ref:`platform_timsp430`: TI MSP430G2553 LaunchPad with auto pre-configured - ``board_*`` and ``upload_*`` options (use only ``board`` option) and Energia - Wiring-based Framework +4. :ref:`platform_ststm32`: Upload firmware using GDB script ``upload.gdb``, + `issue #175 `_ .. code-block:: ini - [env:timsp430_g2553_launchpad] - platform = timsp430 - framework = energia - board = lpmsp430g2553 + [env:st_via_gdb] + platform = ststm32 + board = armstrap_eagle512 + upload_protocol = gdb - -7. :ref:`platform_timsp430`: Embedded board that is based on MSP430G2553 MCU +5. :ref:`platform_ststm32`: Upload firmware using ST-Link instead mbed's media + disk .. code-block:: ini - [env:timsp430_g2553_board] - platform = timsp430 - board_mcu = msp430g2553 - board_f_cpu = 16000000L - - upload_protocol = rf2500 - - # enable auto-uploading - targets = upload - - -8. :ref:`platform_titiva`: TI Tiva C ARM Series TM4C123G LaunchPad with auto - pre-configured ``board_*`` and ``upload_*`` options (use only ``board`` - option) and Energia Wiring-based Framework - -.. code-block:: ini - - [env:titiva_tm4c1230c3pm_launchpad] - platform = titiva - framework = energia - board = lptm4c1230c3pm - + [env:stlink_for_mbed] + platform = ststm32 + board = disco_f100rb + upload_protocol = stlink diff --git a/platformio/__init__.py b/platformio/__init__.py index 8be279ed..9a611cc9 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -1,7 +1,7 @@ # Copyright (C) Ivan Kravets # See LICENSE for details. -VERSION = (2, 3, "2.dev1") +VERSION = (2, 3, "2.dev2") __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" diff --git a/platformio/builder/scripts/ststm32.py b/platformio/builder/scripts/ststm32.py index aeff2818..cc0adfe6 100644 --- a/platformio/builder/scripts/ststm32.py +++ b/platformio/builder/scripts/ststm32.py @@ -15,7 +15,7 @@ env = DefaultEnvironment() SConscript(env.subst(join("$PIOBUILDER_DIR", "scripts", "basearm.py"))) -if env['UPLOAD_PROTOCOL'] == "gdb": +if env.get("UPLOAD_PROTOCOL") == "gdb": if not isfile(join(env.subst("$PROJECT_DIR"), "upload.gdb")): Exit( "You are using GDB as firmware uploader. " @@ -50,7 +50,8 @@ else: env.Append( CPPDEFINES=[ - "${BOARD_OPTIONS['build']['variant'].upper()}" + env.get("BOARD_OPTIONS", {}).get( + "build", {}).get("variant", "").upper() ], LIBS=["stdc++", "nosys"], @@ -87,8 +88,9 @@ AlwaysBuild(target_size) # Target: Upload by default .bin file # -disable_msd = (platform.system() == "Darwin" and - platform.release().startswith("14.")) +disable_msd = ( + (platform.system() == "Darwin" and platform.release().startswith("14.")) or + "UPLOAD_PROTOCOL" in env) if "mbed" in env.subst("$FRAMEWORK") and not disable_msd: upload = env.Alias(["upload", "uploadlazy"], target_firm, env.UploadToDisk) From d4f4d9c7892c21f235acf08ab38bfcb63b456cdc Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 10 Sep 2015 16:56:33 +0300 Subject: [PATCH 07/16] Fix using $UPLOAD_PROTOCOL env variable --- platformio/builder/scripts/ststm32.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platformio/builder/scripts/ststm32.py b/platformio/builder/scripts/ststm32.py index cc0adfe6..d9e7f6f5 100644 --- a/platformio/builder/scripts/ststm32.py +++ b/platformio/builder/scripts/ststm32.py @@ -15,7 +15,7 @@ env = DefaultEnvironment() SConscript(env.subst(join("$PIOBUILDER_DIR", "scripts", "basearm.py"))) -if env.get("UPLOAD_PROTOCOL") == "gdb": +if env.subst("$UPLOAD_PROTOCOL") == "gdb": if not isfile(join(env.subst("$PROJECT_DIR"), "upload.gdb")): Exit( "You are using GDB as firmware uploader. " @@ -90,7 +90,7 @@ AlwaysBuild(target_size) disable_msd = ( (platform.system() == "Darwin" and platform.release().startswith("14.")) or - "UPLOAD_PROTOCOL" in env) + env.subst("$UPLOAD_PROTOCOL")) if "mbed" in env.subst("$FRAMEWORK") and not disable_msd: upload = env.Alias(["upload", "uploadlazy"], target_firm, env.UploadToDisk) From c72bf9ea317b7a4c98eac48085b949fe9f796a1e Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 10 Sep 2015 17:47:19 +0300 Subject: [PATCH 08/16] =?UTF-8?q?Found=20solution=20for=20"pip/scons=20err?= =?UTF-8?q?or:=20option=20=E2=80=93single-version-externally-managed=20not?= =?UTF-8?q?=20recognized"=20//=20Resolve=20#279?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HISTORY.rst | 3 +++ docs/faq.rst | 41 +++++++++++++++++++++++++--------- docs/installation.rst | 15 ++++++++----- platformio/commands/upgrade.py | 6 ++--- platformio/exception.py | 13 ++++++++++- 5 files changed, 58 insertions(+), 20 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 378e03bc..a2db7de9 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -8,6 +8,9 @@ PlatformIO 2.0 ~~~~~~~~~~~~~~~~~~ * Allowed to use ST-Link uploader for mbed-based projects +* Found solution for "pip/scons error: option --single-version-externally-managed not + recognized" when install PlatformIO using ``pip`` package manager + (`issue #279 `_) * Fixed `SConsNotInstalled` error for Linux Debian-based distributives 2.3.1 (2015-09-06) diff --git a/docs/faq.rst b/docs/faq.rst index bea8d298..d1d7550a 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -75,6 +75,27 @@ There are a few options: - masking under Continuous Integration system via environment variable :envvar:`CI=true `. +PlatformIO and ``scons`` aren't installed properly +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Try these solutions: + +1. Upgrade SCons via `pip `_ + +.. code-block:: bash + + [sudo] pip uninstall scons + [sudo] pip install scons + +2. Install PlatformIO using :ref:`installation_installer_script`. + +.. _faq_troubleshooting_sconssingverextmanaged: + +PIP & SCons Error: option --single-version-externally-managed not recognized +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Answered in `issue #279 `_. + .. _faq_troubleshooting_pionotfoundinpath: Program ``platformio`` not found in PATH @@ -100,8 +121,8 @@ should contain ``/usr/local/bin`` directory. programs to the ``bin`` directory which is included in ``$PATH``. For example, see `issue #272 `_. -Windows: ``UnicodeDecodeError: 'ascii' codec can't decode byte`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Windows UnicodeDecodeError: 'ascii' codec can't decode byte +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Answered in `issue #143 `_. @@ -118,20 +139,20 @@ Please upgrade *SetupTools* package: .. code-block:: bash - $ [sudo] pip uninstall setuptools - $ [sudo] pip install setuptools + [sudo] pip uninstall setuptools + [sudo] pip install setuptools # Then re-install PlatformIO - $ [sudo] pip uninstall platformio - $ [sudo] pip install platformio + [sudo] pip uninstall platformio + [sudo] pip install platformio -Windows: ``AttributeError: 'module' object has no attribute 'packages'`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Windows AttributeError: 'module' object has no attribute 'packages' +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Answered in `issue #252 `_. -ARM toolchain: ``cc1plus: error while loading shared libraries`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +ARM toolchain: cc1plus: error while loading shared libraries +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ See related answers for `error while loading shared libraries `_. diff --git a/docs/installation.rst b/docs/installation.rst index 85b6e847..8d071240 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -47,11 +47,14 @@ The latest stable version of PlatformIO may be done via .. code-block:: bash # update dependent packages to the latest versions - pip install -U pip setuptools virtualenv + pip install -U pip setuptools - # install the latest version of PlatformIO + # install/upgrade the latest version of PlatformIO pip install -U platformio +.. warning:: + Known Issue: :ref:`faq_troubleshooting_sconssingverextmanaged` + Note that you may run into permissions issues running these commands. You have a few options here: @@ -61,6 +64,8 @@ a few options here: * Run the command in a `virtualenv `_ local to a specific project working set. +.. _installation_installer_script: + Installer Script ~~~~~~~~~~~~~~~~ @@ -134,9 +139,6 @@ For upgrading ``platformio`` to the latest version: Development Version ~~~~~~~~~~~~~~~~~~~ -.. warning:: - We don't recommend to use ``develop`` version in production. - Install the latest PlatformIO from the ``develop`` branch: .. code-block:: bash @@ -163,4 +165,5 @@ Troubleshooting **Windows OS**: Please check that you have correctly installed USB driver from board manufacturer -For further details, frequently questions, please refer to :ref:`faq`. +For further details, frequently questions, known issues, please +refer to :ref:`faq`. diff --git a/platformio/commands/upgrade.py b/platformio/commands/upgrade.py index 5456979d..dbfbee86 100644 --- a/platformio/commands/upgrade.py +++ b/platformio/commands/upgrade.py @@ -21,7 +21,7 @@ def cli(): fg="yellow") cmds = ( - ["pip", "install", "--upgrade", "pip", "setuptools", "virtualenv"], + ["pip", "install", "--upgrade", "pip", "setuptools"], ["pip", "install", "--upgrade", "platformio"], ["platformio", "--version"] ) @@ -42,7 +42,7 @@ def cli(): fg="cyan") except (OSError, AssertionError) as e: if not r: - raise exception.PlatformioException( + raise exception.PlatformioUpgradeError( "\n".join([str(cmd), str(e)])) if ("Permission denied" in r['err'] and "windows" not in util.get_systype()): @@ -58,7 +58,7 @@ WARNING! Don't use `sudo` for the rest PlatformIO commands. """, fg="yellow", err=True) raise exception.ReturnErrorCode() else: - raise exception.PlatformioException( + raise exception.PlatformioUpgradeError( "\n".join([str(cmd), r['out'], r['err']])) diff --git a/platformio/exception.py b/platformio/exception.py index 233e591a..11998176 100644 --- a/platformio/exception.py +++ b/platformio/exception.py @@ -182,6 +182,17 @@ class SConsNotInstalled(PlatformioException): MESSAGE = ( "The PlatformIO and `scons` aren't installed properly. " - "Please use official installation manual: " + "More details in FAQ/Troubleshooting section: " + "http://docs.platformio.org/en/latest/faq.html" + ) + + +class PlatformioUpgradeError(PlatformioException): + + MESSAGE = ( + "%s \n\n" + "1. Please report this issue here: " + "https://github.com/platformio/platformio/issues \n" + "2. Try different installation/upgrading steps: " "http://docs.platformio.org/en/latest/installation.html" ) From ed10ecd1429e5e9a3983ef90a7b545b2f8080d37 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 10 Sep 2015 18:19:23 +0300 Subject: [PATCH 09/16] Explain how to use "lib" directory from the PlatformIO based project // Issue #273 --- HISTORY.rst | 5 ++ .../adafruit-blink/lib/readme.txt | 38 +++++++++++++++ .../arduino-external-libs/lib/readme.txt | 38 +++++++++++++++ .../arduino-internal-libs/lib/readme.txt | 38 +++++++++++++++ .../arduino-own-src_dir/lib/readme.txt | 38 +++++++++++++++ .../atmelavr-native-blink/lib/readme.txt | 38 +++++++++++++++ .../digitstump-mouse/lib/readme.txt | 38 +++++++++++++++ .../engduino-magnetometer/lib/readme.txt | 38 +++++++++++++++ .../panstamp-blink/lib/readme.txt | 38 +++++++++++++++ examples/desktop/hello-world/lib/readme.txt | 38 +++++++++++++++ .../espressif/esp8266-native/lib/readme.txt | 38 +++++++++++++++ .../esp8266-webserver/lib/readme.txt | 38 +++++++++++++++ .../espressif/esp8266-wifiscan/lib/readme.txt | 38 +++++++++++++++ examples/ide/clion/lib/readme.txt | 38 +++++++++++++-- examples/ide/eclipse/lib/readme.txt | 38 +++++++++++++-- examples/ide/qtcreator/lib/readme.txt | 38 +++++++++++++-- examples/ide/sublimetext/lib/readme.txt | 38 +++++++++++++-- examples/ide/visualstudio/lib/readme.txt | 46 +++++++++++++++---- examples/mbed/mbed-blink/lib/readme.txt | 38 +++++++++++++++ examples/mbed/mbed-dsp/lib/readme.txt | 38 +++++++++++++++ examples/mbed/mbed-http-client/lib/readme.txt | 38 +++++++++++++++ examples/mbed/mbed-rtos/lib/readme.txt | 38 +++++++++++++++ examples/mbed/mbed-serial/lib/readme.txt | 38 +++++++++++++++ .../stm32/stm32-cmsis-blink/lib/readme.txt | 38 +++++++++++++++ .../stm32/stm32-opencm3-blink/lib/readme.txt | 38 +++++++++++++++ examples/stm32/stm32-spl-blink/lib/readme.txt | 38 +++++++++++++++ .../teensy-hid-usb-mouse/lib/readme.txt | 38 +++++++++++++++ .../teensy-internal-libs/lib/readme.txt | 38 +++++++++++++++ .../timsp430/panstamp-blink/lib/readme.txt | 38 +++++++++++++++ .../timsp430-energia-blink/lib/readme.txt | 38 +++++++++++++++ .../timsp430-native-blink/lib/readme.txt | 38 +++++++++++++++ .../titiva-energia-blink/lib/readme.txt | 38 +++++++++++++++ .../titiva/titiva-native-blink/lib/readme.txt | 38 +++++++++++++++ .../titiva-opencm3-blink/lib/readme.txt | 38 +++++++++++++++ examples/wiring-blink/lib/readme.txt | 38 +++++++++++++++ platformio/commands/init.py | 32 +++++++------ 36 files changed, 1300 insertions(+), 37 deletions(-) create mode 100644 examples/atmelavr-and-arduino/adafruit-blink/lib/readme.txt create mode 100644 examples/atmelavr-and-arduino/arduino-external-libs/lib/readme.txt create mode 100644 examples/atmelavr-and-arduino/arduino-internal-libs/lib/readme.txt create mode 100644 examples/atmelavr-and-arduino/arduino-own-src_dir/lib/readme.txt create mode 100644 examples/atmelavr-and-arduino/atmelavr-native-blink/lib/readme.txt create mode 100644 examples/atmelavr-and-arduino/digitstump-mouse/lib/readme.txt create mode 100644 examples/atmelavr-and-arduino/engduino-magnetometer/lib/readme.txt create mode 100644 examples/atmelavr-and-arduino/panstamp-blink/lib/readme.txt create mode 100644 examples/desktop/hello-world/lib/readme.txt create mode 100644 examples/espressif/esp8266-native/lib/readme.txt create mode 100644 examples/espressif/esp8266-webserver/lib/readme.txt create mode 100644 examples/espressif/esp8266-wifiscan/lib/readme.txt create mode 100644 examples/mbed/mbed-blink/lib/readme.txt create mode 100644 examples/mbed/mbed-dsp/lib/readme.txt create mode 100644 examples/mbed/mbed-http-client/lib/readme.txt create mode 100644 examples/mbed/mbed-rtos/lib/readme.txt create mode 100644 examples/mbed/mbed-serial/lib/readme.txt create mode 100644 examples/stm32/stm32-cmsis-blink/lib/readme.txt create mode 100644 examples/stm32/stm32-opencm3-blink/lib/readme.txt create mode 100644 examples/stm32/stm32-spl-blink/lib/readme.txt create mode 100644 examples/teensy/teensy-hid-usb-mouse/lib/readme.txt create mode 100644 examples/teensy/teensy-internal-libs/lib/readme.txt create mode 100644 examples/timsp430/panstamp-blink/lib/readme.txt create mode 100644 examples/timsp430/timsp430-energia-blink/lib/readme.txt create mode 100644 examples/timsp430/timsp430-native-blink/lib/readme.txt create mode 100644 examples/titiva/titiva-energia-blink/lib/readme.txt create mode 100644 examples/titiva/titiva-native-blink/lib/readme.txt create mode 100644 examples/titiva/titiva-opencm3-blink/lib/readme.txt create mode 100644 examples/wiring-blink/lib/readme.txt diff --git a/HISTORY.rst b/HISTORY.rst index a2db7de9..ad3dd7cc 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -8,6 +8,11 @@ PlatformIO 2.0 ~~~~~~~~~~~~~~~~~~ * Allowed to use ST-Link uploader for mbed-based projects +* Explained how to use ``lib`` directory from the PlatformIO based project in + ``readme.txt`` which will be automatically generated using + `platformio init `__ + command + (`issue #273 `_) * Found solution for "pip/scons error: option --single-version-externally-managed not recognized" when install PlatformIO using ``pip`` package manager (`issue #279 `_) diff --git a/examples/atmelavr-and-arduino/adafruit-blink/lib/readme.txt b/examples/atmelavr-and-arduino/adafruit-blink/lib/readme.txt new file mode 100644 index 00000000..b06c9408 --- /dev/null +++ b/examples/atmelavr-and-arduino/adafruit-blink/lib/readme.txt @@ -0,0 +1,38 @@ + +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 + diff --git a/examples/atmelavr-and-arduino/arduino-external-libs/lib/readme.txt b/examples/atmelavr-and-arduino/arduino-external-libs/lib/readme.txt new file mode 100644 index 00000000..b06c9408 --- /dev/null +++ b/examples/atmelavr-and-arduino/arduino-external-libs/lib/readme.txt @@ -0,0 +1,38 @@ + +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 + diff --git a/examples/atmelavr-and-arduino/arduino-internal-libs/lib/readme.txt b/examples/atmelavr-and-arduino/arduino-internal-libs/lib/readme.txt new file mode 100644 index 00000000..b06c9408 --- /dev/null +++ b/examples/atmelavr-and-arduino/arduino-internal-libs/lib/readme.txt @@ -0,0 +1,38 @@ + +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 + diff --git a/examples/atmelavr-and-arduino/arduino-own-src_dir/lib/readme.txt b/examples/atmelavr-and-arduino/arduino-own-src_dir/lib/readme.txt new file mode 100644 index 00000000..b06c9408 --- /dev/null +++ b/examples/atmelavr-and-arduino/arduino-own-src_dir/lib/readme.txt @@ -0,0 +1,38 @@ + +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 + diff --git a/examples/atmelavr-and-arduino/atmelavr-native-blink/lib/readme.txt b/examples/atmelavr-and-arduino/atmelavr-native-blink/lib/readme.txt new file mode 100644 index 00000000..b06c9408 --- /dev/null +++ b/examples/atmelavr-and-arduino/atmelavr-native-blink/lib/readme.txt @@ -0,0 +1,38 @@ + +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 + diff --git a/examples/atmelavr-and-arduino/digitstump-mouse/lib/readme.txt b/examples/atmelavr-and-arduino/digitstump-mouse/lib/readme.txt new file mode 100644 index 00000000..b06c9408 --- /dev/null +++ b/examples/atmelavr-and-arduino/digitstump-mouse/lib/readme.txt @@ -0,0 +1,38 @@ + +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 + diff --git a/examples/atmelavr-and-arduino/engduino-magnetometer/lib/readme.txt b/examples/atmelavr-and-arduino/engduino-magnetometer/lib/readme.txt new file mode 100644 index 00000000..b06c9408 --- /dev/null +++ b/examples/atmelavr-and-arduino/engduino-magnetometer/lib/readme.txt @@ -0,0 +1,38 @@ + +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 + diff --git a/examples/atmelavr-and-arduino/panstamp-blink/lib/readme.txt b/examples/atmelavr-and-arduino/panstamp-blink/lib/readme.txt new file mode 100644 index 00000000..b06c9408 --- /dev/null +++ b/examples/atmelavr-and-arduino/panstamp-blink/lib/readme.txt @@ -0,0 +1,38 @@ + +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 + diff --git a/examples/desktop/hello-world/lib/readme.txt b/examples/desktop/hello-world/lib/readme.txt new file mode 100644 index 00000000..b06c9408 --- /dev/null +++ b/examples/desktop/hello-world/lib/readme.txt @@ -0,0 +1,38 @@ + +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 + diff --git a/examples/espressif/esp8266-native/lib/readme.txt b/examples/espressif/esp8266-native/lib/readme.txt new file mode 100644 index 00000000..b06c9408 --- /dev/null +++ b/examples/espressif/esp8266-native/lib/readme.txt @@ -0,0 +1,38 @@ + +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 + diff --git a/examples/espressif/esp8266-webserver/lib/readme.txt b/examples/espressif/esp8266-webserver/lib/readme.txt new file mode 100644 index 00000000..b06c9408 --- /dev/null +++ b/examples/espressif/esp8266-webserver/lib/readme.txt @@ -0,0 +1,38 @@ + +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 + diff --git a/examples/espressif/esp8266-wifiscan/lib/readme.txt b/examples/espressif/esp8266-wifiscan/lib/readme.txt new file mode 100644 index 00000000..b06c9408 --- /dev/null +++ b/examples/espressif/esp8266-wifiscan/lib/readme.txt @@ -0,0 +1,38 @@ + +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 + diff --git a/examples/ide/clion/lib/readme.txt b/examples/ide/clion/lib/readme.txt index 413c26e5..b06c9408 100644 --- a/examples/ide/clion/lib/readme.txt +++ b/examples/ide/clion/lib/readme.txt @@ -1,8 +1,38 @@ -Documentation: http://docs.platformio.org/en/latest/userguide/cmd_init.html - 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. -For example, "lib/private_lib/[here are source files]". +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 + diff --git a/examples/ide/eclipse/lib/readme.txt b/examples/ide/eclipse/lib/readme.txt index 413c26e5..b06c9408 100644 --- a/examples/ide/eclipse/lib/readme.txt +++ b/examples/ide/eclipse/lib/readme.txt @@ -1,8 +1,38 @@ -Documentation: http://docs.platformio.org/en/latest/userguide/cmd_init.html - 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. -For example, "lib/private_lib/[here are source files]". +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 + diff --git a/examples/ide/qtcreator/lib/readme.txt b/examples/ide/qtcreator/lib/readme.txt index 413c26e5..b06c9408 100644 --- a/examples/ide/qtcreator/lib/readme.txt +++ b/examples/ide/qtcreator/lib/readme.txt @@ -1,8 +1,38 @@ -Documentation: http://docs.platformio.org/en/latest/userguide/cmd_init.html - 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. -For example, "lib/private_lib/[here are source files]". +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 + diff --git a/examples/ide/sublimetext/lib/readme.txt b/examples/ide/sublimetext/lib/readme.txt index 413c26e5..b06c9408 100644 --- a/examples/ide/sublimetext/lib/readme.txt +++ b/examples/ide/sublimetext/lib/readme.txt @@ -1,8 +1,38 @@ -Documentation: http://docs.platformio.org/en/latest/userguide/cmd_init.html - 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. -For example, "lib/private_lib/[here are source files]". +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 + diff --git a/examples/ide/visualstudio/lib/readme.txt b/examples/ide/visualstudio/lib/readme.txt index fa10918b..b06c9408 100644 --- a/examples/ide/visualstudio/lib/readme.txt +++ b/examples/ide/visualstudio/lib/readme.txt @@ -1,8 +1,38 @@ - -Documentation: http://docs.platformio.org/en/latest/userguide/cmd_init.html - -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. -For example, "lib/private_lib/[here are source files]". + +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 + diff --git a/examples/mbed/mbed-blink/lib/readme.txt b/examples/mbed/mbed-blink/lib/readme.txt new file mode 100644 index 00000000..b06c9408 --- /dev/null +++ b/examples/mbed/mbed-blink/lib/readme.txt @@ -0,0 +1,38 @@ + +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 + diff --git a/examples/mbed/mbed-dsp/lib/readme.txt b/examples/mbed/mbed-dsp/lib/readme.txt new file mode 100644 index 00000000..b06c9408 --- /dev/null +++ b/examples/mbed/mbed-dsp/lib/readme.txt @@ -0,0 +1,38 @@ + +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 + diff --git a/examples/mbed/mbed-http-client/lib/readme.txt b/examples/mbed/mbed-http-client/lib/readme.txt new file mode 100644 index 00000000..b06c9408 --- /dev/null +++ b/examples/mbed/mbed-http-client/lib/readme.txt @@ -0,0 +1,38 @@ + +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 + diff --git a/examples/mbed/mbed-rtos/lib/readme.txt b/examples/mbed/mbed-rtos/lib/readme.txt new file mode 100644 index 00000000..b06c9408 --- /dev/null +++ b/examples/mbed/mbed-rtos/lib/readme.txt @@ -0,0 +1,38 @@ + +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 + diff --git a/examples/mbed/mbed-serial/lib/readme.txt b/examples/mbed/mbed-serial/lib/readme.txt new file mode 100644 index 00000000..b06c9408 --- /dev/null +++ b/examples/mbed/mbed-serial/lib/readme.txt @@ -0,0 +1,38 @@ + +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 + diff --git a/examples/stm32/stm32-cmsis-blink/lib/readme.txt b/examples/stm32/stm32-cmsis-blink/lib/readme.txt new file mode 100644 index 00000000..b06c9408 --- /dev/null +++ b/examples/stm32/stm32-cmsis-blink/lib/readme.txt @@ -0,0 +1,38 @@ + +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 + diff --git a/examples/stm32/stm32-opencm3-blink/lib/readme.txt b/examples/stm32/stm32-opencm3-blink/lib/readme.txt new file mode 100644 index 00000000..b06c9408 --- /dev/null +++ b/examples/stm32/stm32-opencm3-blink/lib/readme.txt @@ -0,0 +1,38 @@ + +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 + diff --git a/examples/stm32/stm32-spl-blink/lib/readme.txt b/examples/stm32/stm32-spl-blink/lib/readme.txt new file mode 100644 index 00000000..b06c9408 --- /dev/null +++ b/examples/stm32/stm32-spl-blink/lib/readme.txt @@ -0,0 +1,38 @@ + +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 + diff --git a/examples/teensy/teensy-hid-usb-mouse/lib/readme.txt b/examples/teensy/teensy-hid-usb-mouse/lib/readme.txt new file mode 100644 index 00000000..b06c9408 --- /dev/null +++ b/examples/teensy/teensy-hid-usb-mouse/lib/readme.txt @@ -0,0 +1,38 @@ + +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 + diff --git a/examples/teensy/teensy-internal-libs/lib/readme.txt b/examples/teensy/teensy-internal-libs/lib/readme.txt new file mode 100644 index 00000000..b06c9408 --- /dev/null +++ b/examples/teensy/teensy-internal-libs/lib/readme.txt @@ -0,0 +1,38 @@ + +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 + diff --git a/examples/timsp430/panstamp-blink/lib/readme.txt b/examples/timsp430/panstamp-blink/lib/readme.txt new file mode 100644 index 00000000..b06c9408 --- /dev/null +++ b/examples/timsp430/panstamp-blink/lib/readme.txt @@ -0,0 +1,38 @@ + +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 + diff --git a/examples/timsp430/timsp430-energia-blink/lib/readme.txt b/examples/timsp430/timsp430-energia-blink/lib/readme.txt new file mode 100644 index 00000000..b06c9408 --- /dev/null +++ b/examples/timsp430/timsp430-energia-blink/lib/readme.txt @@ -0,0 +1,38 @@ + +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 + diff --git a/examples/timsp430/timsp430-native-blink/lib/readme.txt b/examples/timsp430/timsp430-native-blink/lib/readme.txt new file mode 100644 index 00000000..b06c9408 --- /dev/null +++ b/examples/timsp430/timsp430-native-blink/lib/readme.txt @@ -0,0 +1,38 @@ + +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 + diff --git a/examples/titiva/titiva-energia-blink/lib/readme.txt b/examples/titiva/titiva-energia-blink/lib/readme.txt new file mode 100644 index 00000000..b06c9408 --- /dev/null +++ b/examples/titiva/titiva-energia-blink/lib/readme.txt @@ -0,0 +1,38 @@ + +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 + diff --git a/examples/titiva/titiva-native-blink/lib/readme.txt b/examples/titiva/titiva-native-blink/lib/readme.txt new file mode 100644 index 00000000..b06c9408 --- /dev/null +++ b/examples/titiva/titiva-native-blink/lib/readme.txt @@ -0,0 +1,38 @@ + +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 + diff --git a/examples/titiva/titiva-opencm3-blink/lib/readme.txt b/examples/titiva/titiva-opencm3-blink/lib/readme.txt new file mode 100644 index 00000000..b06c9408 --- /dev/null +++ b/examples/titiva/titiva-opencm3-blink/lib/readme.txt @@ -0,0 +1,38 @@ + +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 + diff --git a/examples/wiring-blink/lib/readme.txt b/examples/wiring-blink/lib/readme.txt new file mode 100644 index 00000000..b06c9408 --- /dev/null +++ b/examples/wiring-blink/lib/readme.txt @@ -0,0 +1,38 @@ + +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 + diff --git a/platformio/commands/init.py b/platformio/commands/init.py index 15d5f80a..319f79b3 100644 --- a/platformio/commands/init.py +++ b/platformio/commands/init.py @@ -85,32 +85,38 @@ def cli(ctx, project_dir, board, ide, # pylint: disable=R0913 if not isfile(join(lib_dir, "readme.txt")): with open(join(lib_dir, "readme.txt"), "w") as f: f.write(""" -Documentation: http://docs.platformio.org/en/latest/userguide/cmd_init.html - 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, the library is named "Foo" and source code is placed to `lib/Foo` -directory: +For example, see how can be organised `Foo` and `Bar` libraries: -* lib -|-- - | Foo - -- - | Foo.h - | Foo.cpp +|--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 your project (within `src` directory) you should use: +Then in `src/main.c` you should use: #include +#include // rest H/C/CPP code -PlatformIO will find your library automatically, configure path to includes for -preprocessor and build it. +PlatformIO will find your libraries automatically, configure preprocessor's +include paths and build them. See additional options for PlatformIO Library Dependency Finder `lib_*`: From 4338bade5b8d7f75ef1fe4caca695052d9a9950f Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 10 Sep 2015 19:35:32 +0300 Subject: [PATCH 10/16] Allow PlatformIO to be run within Cygwin environment --- HISTORY.rst | 1 + platformio/__init__.py | 2 +- platformio/util.py | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/HISTORY.rst b/HISTORY.rst index ad3dd7cc..66b266ac 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -7,6 +7,7 @@ PlatformIO 2.0 2.3.2 (2015-09-??) ~~~~~~~~~~~~~~~~~~ +* Allowed PlatformIO to be run within Cygwin environment * Allowed to use ST-Link uploader for mbed-based projects * Explained how to use ``lib`` directory from the PlatformIO based project in ``readme.txt`` which will be automatically generated using diff --git a/platformio/__init__.py b/platformio/__init__.py index 9a611cc9..35c90956 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -1,7 +1,7 @@ # Copyright (C) Ivan Kravets # See LICENSE for details. -VERSION = (2, 3, "2.dev2") +VERSION = (2, 3, "2.dev3") __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" diff --git a/platformio/util.py b/platformio/util.py index 6fb9597e..69184943 100644 --- a/platformio/util.py +++ b/platformio/util.py @@ -114,6 +114,8 @@ def singleton(cls): def get_systype(): data = uname() systype = data[0] + if "cygwin" in systype.lower(): + systype = "windows" if data[4]: systype += "_" + data[4] return systype.lower() From 50984f1475a361ad062202a6bf20b262f20ab033 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 10 Sep 2015 19:47:14 +0300 Subject: [PATCH 11/16] Correct OS arch within Cygwin emu --- platformio/util.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/platformio/util.py b/platformio/util.py index 69184943..a10bfa44 100644 --- a/platformio/util.py +++ b/platformio/util.py @@ -113,12 +113,18 @@ def singleton(cls): def get_systype(): data = uname() - systype = data[0] - if "cygwin" in systype.lower(): - systype = "windows" - if data[4]: - systype += "_" + data[4] - return systype.lower() + type_ = data[0].lower() + arch = data[4].lower() if data[4] else "" + + # use native Windows binaries for Cygwin + if "cygwin" in type_: + if arch == "i686": + arch = "x86" + elif arch == "x86_64": + arch = "amd64" + type_ = "windows" + + return "%s_%s" % (type_, arch) if arch else type_ def pioversion_to_intstr(): From 3a8c515e21ab3839e795f33d8db7c50f3c5beab0 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 10 Sep 2015 20:22:54 +0300 Subject: [PATCH 12/16] Minor fix --- platformio/commands/serialports.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio/commands/serialports.py b/platformio/commands/serialports.py index 2e157110..f4232a1b 100644 --- a/platformio/commands/serialports.py +++ b/platformio/commands/serialports.py @@ -81,4 +81,4 @@ def serialports_monitor(**kwargs): try: miniterm.main() except Exception as e: # pylint: disable=W0702 - raise MinitermException("Miniterm: %s" % e) + raise MinitermException(e) From dcb6d8286ba0f798c67f303564ea4ef9ed386d20 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 10 Sep 2015 20:23:37 +0300 Subject: [PATCH 13/16] Disable Cygwin support --- HISTORY.rst | 1 - platformio/__init__.py | 2 +- platformio/exception.py | 8 ++++++++ platformio/util.py | 7 +------ 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 66b266ac..ad3dd7cc 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -7,7 +7,6 @@ PlatformIO 2.0 2.3.2 (2015-09-??) ~~~~~~~~~~~~~~~~~~ -* Allowed PlatformIO to be run within Cygwin environment * Allowed to use ST-Link uploader for mbed-based projects * Explained how to use ``lib`` directory from the PlatformIO based project in ``readme.txt`` which will be automatically generated using diff --git a/platformio/__init__.py b/platformio/__init__.py index 35c90956..0c80f511 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -1,7 +1,7 @@ # Copyright (C) Ivan Kravets # See LICENSE for details. -VERSION = (2, 3, "2.dev3") +VERSION = (2, 3, "2.dev4") __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" diff --git a/platformio/exception.py b/platformio/exception.py index 11998176..ce268018 100644 --- a/platformio/exception.py +++ b/platformio/exception.py @@ -196,3 +196,11 @@ class PlatformioUpgradeError(PlatformioException): "2. Try different installation/upgrading steps: " "http://docs.platformio.org/en/latest/installation.html" ) + + +class CygwinEnvDetected(PlatformioException): + + MESSAGE = ( + "PlatformIO does not work within Cygwin environment. " + "Use native Terminal instead." + ) diff --git a/platformio/util.py b/platformio/util.py index a10bfa44..d6657c15 100644 --- a/platformio/util.py +++ b/platformio/util.py @@ -116,13 +116,8 @@ def get_systype(): type_ = data[0].lower() arch = data[4].lower() if data[4] else "" - # use native Windows binaries for Cygwin if "cygwin" in type_: - if arch == "i686": - arch = "x86" - elif arch == "x86_64": - arch = "amd64" - type_ = "windows" + raise exception.CygwinEnvDetected() return "%s_%s" % (type_, arch) if arch else type_ From 57b877f445e79d4c45261bf3fefa76b83dc25bc0 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 10 Sep 2015 20:31:26 +0300 Subject: [PATCH 14/16] Fix Cygwin disabling --- platformio/__main__.py | 4 ++++ platformio/util.py | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/platformio/__main__.py b/platformio/__main__.py index d6674297..011f8549 100644 --- a/platformio/__main__.py +++ b/platformio/__main__.py @@ -3,6 +3,7 @@ from os import listdir from os.path import join +from platform import system from sys import exit as sys_exit from traceback import format_exc @@ -70,6 +71,9 @@ def process_result(ctx, result, force, caller): # pylint: disable=W0613 def main(): try: + if "cygwin" in system().lower(): + raise exception.CygwinEnvDetected() + # https://urllib3.readthedocs.org # /en/latest/security.html#insecureplatformwarning try: diff --git a/platformio/util.py b/platformio/util.py index d6657c15..f9ba07f9 100644 --- a/platformio/util.py +++ b/platformio/util.py @@ -115,10 +115,6 @@ def get_systype(): data = uname() type_ = data[0].lower() arch = data[4].lower() if data[4] else "" - - if "cygwin" in type_: - raise exception.CygwinEnvDetected() - return "%s_%s" % (type_, arch) if arch else type_ From fa33d531809ab8d9e0f5ffa9a7e9d27c252f8ca2 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 10 Sep 2015 20:41:23 +0300 Subject: [PATCH 15/16] Show float RAM values for boards // Issue #286 --- platformio/commands/boards.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/platformio/commands/boards.py b/platformio/commands/boards.py index 0681623a..dcec8f69 100644 --- a/platformio/commands/boards.py +++ b/platformio/commands/boards.py @@ -56,7 +56,10 @@ def cli(query, json_output): # pylint: disable=R0912 if "maximum_ram_size" in data.get("upload", None): ram_size = int(data['upload']['maximum_ram_size']) if ram_size >= 1024: - ram_size = "%dKb" % (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 From 2c5db646773699641ff646653c0687e250d1517b Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 10 Sep 2015 20:44:39 +0300 Subject: [PATCH 16/16] Version bump to 2.3.2 (issues #279) --- HISTORY.rst | 2 +- platformio/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index ad3dd7cc..d1137dcc 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -4,7 +4,7 @@ Release History PlatformIO 2.0 -------------- -2.3.2 (2015-09-??) +2.3.2 (2015-09-10) ~~~~~~~~~~~~~~~~~~ * Allowed to use ST-Link uploader for mbed-based projects diff --git a/platformio/__init__.py b/platformio/__init__.py index 0c80f511..90f39185 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -1,7 +1,7 @@ # Copyright (C) Ivan Kravets # See LICENSE for details. -VERSION = (2, 3, "2.dev4") +VERSION = (2, 3, 2) __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio"