diff --git a/docs/ci/appveyor.rst b/docs/ci/appveyor.rst index ea603a46..65ca0eb9 100644 --- a/docs/ci/appveyor.rst +++ b/docs/ci/appveyor.rst @@ -4,7 +4,9 @@ AppVeyor ======== `AppVeyor `_ is an open-source hosted, -distributed continuous integration service used to build and test projects hosted at `GitHub `_ on Windows family systems. +distributed continuous integration service used to build and test projects +hosted at `GitHub `_ on Windows family +systems. AppVeyor is configured by adding a file named ``appveyor.yml``, which is a `YAML `_ format text file, to the root @@ -23,32 +25,7 @@ different :ref:`platforms`. Integration ----------- -Please put ``appveyor.yml`` to the root directory of the GitHub repository. - -.. code-block:: yaml - - build: off - environment: - matrix: - - PLATFORMIO_CI_SRC=pathto\\source\\file.c - - PLATFORMIO_CI_SRC=pathto\\source\\file.ino - - PLATFORMIO_CI_SRC=pathto\\source\\directory - - install: - cmd: python -c "$(curl -fsSL https://raw.githubusercontent.com/platformio/platformio/master/scripts/get-platformio.py)" - - script: - - platformio ci --lib="." --lib="c:\spi4teensy" --board=uno --board=teensy31 --board=due' - - -For more details as for PlatformIO build process please look into :ref:`cmd_ci` -command. - -Examples --------- - -1. Integration for `USB_Host_Shield_2.0 `_ - project. The ``appveyor.yml`` configuration file: +Put ``appveyor.yml`` to the root directory of the GitHub repository. .. code-block:: yaml @@ -57,8 +34,9 @@ Examples global: WITH_COMPILER: "cmd /E:ON /V:ON /C .\\scripts\\appveyor\\run_with_compiler.cmd" matrix: - - PLATFORMIO_CI_SRC: "examples\\Bluetooth\\PS3SPP\\PS3SPP.ino" - PLATFORMIO_CI_SRC: "examples\\pl2303\\pl2303_gps\\pl2303_gps.ino" + - PLATFORMIO_CI_SRC: "path\\to\\source\\file.c" + PLATFORMIO_CI_SRC: "path\\to\\source\\file.ino" + PLATFORMIO_CI_SRC: "path\\to\\source\\directory" WINDOWS_SDK_VERSION: "v7.0" PYTHON_HOME: "C:\\Python27-x64" PYTHON_VERSION: "2.7" @@ -68,14 +46,16 @@ Examples - "powershell scripts\\appveyor\\install.ps1" before_test: - cmd: SET PATH=%PATH%;%PYTHON_HOME%;%PYTHON_HOME%\Scripts - - cmd: git clone https://github.com/xxxajk/spi4teensy3.git c:\spi4teensy test_script: - - "%PYTHON_HOME%\\Scripts\\pip --version" - - '%WITH_COMPILER% %PYTHON_HOME%\\Scripts\\platformio ci --lib="." --lib="c:\spi4teensy" --board=uno --board=teensy31 --board=due' + - '%WITH_COMPILER% %PYTHON_HOME%\\Scripts\\platformio ci --board=TYPE_1 --board=TYPE_2 --board=TYPE_N' -The ``install.ps1`` script file: -.. code-block:: none +Then create ``scripts/appveyor`` folder and put these 2 scripts (they are the +same for the all projects, don't need to modify them): + +1. ``scripts/appveyor/install.ps1``: + +.. code-block:: PowerShell $BASE_URL = "https://www.python.org/ftp/python/" $GET_PIP_URL = "https://bootstrap.pypa.io/get-pip.py" @@ -148,7 +128,7 @@ The ``install.ps1`` script file: function InstallPackage ($python_home, $pkg) { $pip_path = $python_home + "/Scripts/pip.exe" - & $pip_path install $pkg + & $pip_path install -U $pkg } function InstallScons ($python_home) { @@ -162,14 +142,15 @@ The ``install.ps1`` script file: InstallPython $env:PYTHON_VERSION $env:PYTHON_ARCH $env:PYTHON_HOME InstallPip $env:PYTHON_HOME InstallPackage $env:PYTHON_HOME setuptools + InstallPackage $env:PYTHON_HOME platformio InstallScons $env:PYTHON_HOME } main -The ``run_with_compiler.cmd`` script file: +2. ``scripts/appveyor/run_with_compiler.cmd``: -.. code-block:: none +.. code-block:: guess @ECHO OFF @@ -199,3 +180,34 @@ The ``run_with_compiler.cmd`` script file: ECHO Executing: %COMMAND_TO_RUN% call %COMMAND_TO_RUN% || EXIT 1 ) + +For more details as for PlatformIO build process please look into :ref:`cmd_ci` +command. + +Examples +-------- + +1. Integration for `USB_Host_Shield_2.0 `_ + project. The ``appveyor.yml`` configuration file: + +.. code-block:: yaml + + build: off + environment: + global: + WITH_COMPILER: "cmd /E:ON /V:ON /C .\\scripts\\appveyor\\run_with_compiler.cmd" + matrix: + - PLATFORMIO_CI_SRC: "examples\\Bluetooth\\PS3SPP\\PS3SPP.ino" + PLATFORMIO_CI_SRC: "examples\\pl2303\\pl2303_gps\\pl2303_gps.ino" + WINDOWS_SDK_VERSION: "v7.0" + PYTHON_HOME: "C:\\Python27-x64" + PYTHON_VERSION: "2.7" + PYTHON_ARCH: "64" + install: + - "git submodule update --init --recursive" + - "powershell scripts\\appveyor\\install.ps1" + before_test: + - cmd: SET PATH=%PATH%;%PYTHON_HOME%;%PYTHON_HOME%\Scripts + - cmd: git clone https://github.com/xxxajk/spi4teensy3.git c:\spi4teensy + test_script: + - '%WITH_COMPILER% %PYTHON_HOME%\\Scripts\\platformio ci --lib="." --lib="c:\spi4teensy" --board=uno --board=teensy31 --board=due' diff --git a/docs/ci/circleci.rst b/docs/ci/circleci.rst index 357ae00d..61da49de 100644 --- a/docs/ci/circleci.rst +++ b/docs/ci/circleci.rst @@ -24,23 +24,23 @@ different :ref:`platforms`. Integration ----------- -Please put ``circle.yml`` to the root directory of the GitHub repository. +Put ``circle.yml`` to the root directory of the GitHub repository. .. code-block:: yaml machine: - environment: - PLATFORMIO_CI_SRC=path/to/source/file.c - PLATFORMIO_CI_SRC=path/to/source/file.ino - PLATFORMIO_CI_SRC=path/to/source/directory - dependencies: - pre: - - python -c "$(curl -fsSL https://raw.githubusercontent.com/platformio/platformio/master/scripts/get-platformio.py)" + dependencies: + pre: + - sudo apt-get install python2.7-dev + - sudo python -c "$(curl -fsSL https://raw.githubusercontent.com/platformio/platformio/master/scripts/get-platformio.py)" - test: - override: + test: + override: - platformio ci --board=TYPE_1 --board=TYPE_2 --board=TYPE_N @@ -56,18 +56,17 @@ Examples .. code-block:: yaml machine: - environment: - PLATFORMIO_CI_SRC: examples/Bluetooth/PS3SPP/PS3SPP.ino - PLATFORMIO_CI_SRC: examples/pl2303/pl2303_gps/pl2303_gps.ino + environment: + PLATFORMIO_CI_SRC: examples/Bluetooth/PS3SPP/PS3SPP.ino + PLATFORMIO_CI_SRC: examples/pl2303/pl2303_gps/pl2303_gps.ino dependencies: - pre: - - sudo apt-get install python2.7-dev - - python -c "$(curl -fsSL https://raw.githubusercontent.com/platformio/platformio/master/scripts/get-platformio.py)" - - sudo pip install --egg http://sourceforge.net/projects/scons/files/latest/download - - wget https://github.com/xxxajk/spi4teensy3/archive/master.zip -O /tmp/spi4teensy3.zip - - unzip /tmp/spi4teensy3.zip -d /tmp + pre: + - sudo apt-get install python2.7-dev + - sudo python -c "$(curl -fsSL https://raw.githubusercontent.com/platformio/platformio/master/scripts/get-platformio.py)" + - wget https://github.com/xxxajk/spi4teensy3/archive/master.zip -O /tmp/spi4teensy3.zip + - unzip /tmp/spi4teensy3.zip -d /tmp test: - override: - - platformio ci --lib="." --lib="/tmp/spi4teensy3-master" --board=uno --board=teensy31 --board=due + override: + - platformio ci --lib="." --lib="/tmp/spi4teensy3-master" --board=uno --board=teensy31 --board=due diff --git a/docs/ci/drone.rst b/docs/ci/drone.rst index f4792ef6..912b546b 100644 --- a/docs/ci/drone.rst +++ b/docs/ci/drone.rst @@ -62,7 +62,7 @@ Examples .. code-block:: bash - pip install --egg http://sourceforge.net/projects/scons/files/latest/download + python -c "$(curl -fsSL https://raw.githubusercontent.com/platformio/platformio/master/scripts/get-platformio.py)" wget https://github.com/xxxajk/spi4teensy3/archive/master.zip -O /tmp/spi4teensy3.zip unzip /tmp/spi4teensy3.zip -d /tmp platformio ci --lib="." --lib="/tmp/spi4teensy3-master" --board=uno --board=teensy31 --board=due diff --git a/docs/ide/eclipse.rst b/docs/ide/eclipse.rst index 6fd8fae1..2549c24d 100644 --- a/docs/ide/eclipse.rst +++ b/docs/ide/eclipse.rst @@ -15,15 +15,34 @@ registers, and disassembly viewers. This software can be used with: -* all availalbe :ref:`platforms` -* all availalbe :ref:`frameworks` +* all available :ref:`platforms` +* all available :ref:`frameworks` Refer to the `CDT Documentation `_ page for more detailed information. +.. contents:: + Integration ----------- +Project Generator +^^^^^^^^^^^^^^^^^ + +Since PlatformIO 2.0 you can generate Eclipse compatible project using +:option:`platformio init --ide` command: + +.. code-block:: shell + + platformio init --ide eclipse + +Then import this project via ``File > Import... > General > Existing Projects +into Workspace > Next`` and specify root directory where is located +:ref:`projectconf`. + +Manual Integration +^^^^^^^^^^^^^^^^^^ + More detailed information is located in PlatformIO blog: `Building and debugging Atmel AVR (Arduino-based) project using Eclipse IDE+PlatformIO `_. `More examples (TI MSP430, TI TIVA, etc.) `_ diff --git a/docs/ide/qtcreator.rst b/docs/ide/qtcreator.rst index 7a7e6269..31bc7cde 100644 --- a/docs/ide/qtcreator.rst +++ b/docs/ide/qtcreator.rst @@ -7,8 +7,8 @@ The `Qt Creator `_ is an open source cr This software can be used with: -* all availalbe :ref:`platforms` -* all availalbe :ref:`frameworks` +* all available :ref:`platforms` +* all available :ref:`frameworks` Refer to the `Qt-creator Manual `_ page for more detailed information. @@ -18,10 +18,26 @@ page for more detailed information. Integration ----------- -Setup New Project +Project Generator ^^^^^^^^^^^^^^^^^ -First of all, let's create new project from Qt Creator Start Page: ``New Project`` or using ``Menu: File → New File or Project``, then select project with ``Empty Qt Project`` type (``Other Project → Empty Qt Project``), fill ``Name``, ``Create in``. +Since PlatformIO 2.0 you can generate Eclipse compatible project using +:option:`platformio init --ide` command: + +.. code-block:: shell + + platformio init --ide qtcreator + +Then import this project via ``File > New File or Project > Import Project`` +and specify root directory where is located :ref:`projectconf`. + +Manual Integration +^^^^^^^^^^^^^^^^^^ + +Setup New Project +~~~~~~~~~~~~~~~~~ + +First of all, let's create new project from Qt Creator Start Page: ``New Project`` or using ``Menu: File > New File or Project``, then select project with ``Empty Qt Project`` type (``Other Project > Empty Qt Project``), fill ``Name``, ``Create in``. .. image:: ../_static/ide-platformio-qtcreator-1.png @@ -52,12 +68,12 @@ Thirdly, change project file by adding path to directories with header files. Pl .. image:: ../_static/ide-platformio-qtcreator-4.png First program in Qt Creator -^^^^^^^^^^^^^^^^^^^^^^^^^^^ +~~~~~~~~~~~~~~~~~~~~~~~~~~~ Simple "Blink" project will consist from two files: -1. In the console, navigate to the root of your project folder and initialize platformio project with ``platformio init`` +1. In the console, navigate to the root of your project folder and initialize platformio project with ``platformio init`` 2. The main "C" source file named ``main.c`` must be located in the ``src`` directory. -Let's create new text file named ``main.c`` using ``Menu: New File or Project → General → Text File``: +Let's create new text file named ``main.c`` using ``Menu: New File or Project > General > Text File``: .. image:: ../_static/ide-platformio-qtcreator-5.png @@ -108,6 +124,6 @@ Edit the content to match the code described below. Conclusion ---------- -Taking everything into account, we can build project with shortcut ``Ctrl+Shift+B`` or using ``Menu: Build → Build All``: +Taking everything into account, we can build project with shortcut ``Ctrl+Shift+B`` or using ``Menu: Build > Build All``: .. image:: ../_static/ide-platformio-qtcreator-7.png diff --git a/docs/ide/sublimetext.rst b/docs/ide/sublimetext.rst index 7e25f61c..af39f328 100644 --- a/docs/ide/sublimetext.rst +++ b/docs/ide/sublimetext.rst @@ -7,8 +7,8 @@ The `Sublime Text `_ is a cross-platform text and s This software can be used with: -* all availalbe :ref:`platforms` -* all availalbe :ref:`frameworks` +* all available :ref:`platforms` +* all available :ref:`frameworks` Refer to the `Sublime Text Documentation `_ page for more detailed information. @@ -18,11 +18,27 @@ page for more detailed information. Integration ----------- +Project Generator +^^^^^^^^^^^^^^^^^ + +Since PlatformIO 2.0 you can generate Eclipse compatible project using +:option:`platformio init --ide` command: + +.. code-block:: shell + + platformio init --ide sublimetext + +Then import this project via ``Project > Open Project...`` and specify root +directory where is located :ref:`projectconf`. + +Manual Integration +^^^^^^^^^^^^^^^^^^ + Initial configuration -^^^^^^^^^^^^^^^^^^^^^ +~~~~~~~~~~~~~~~~~~~~~ First of all, we need to create "New Build System" with name "PlatformIO" -from ``Menu: Tools → Build System → New Build System`` and fill it like +from ``Menu: Tools > Build System > New Build System`` and fill it like described below: .. code-block:: bash @@ -48,16 +64,16 @@ Secondly, we need to select "PlatformIO" Build System from a list: .. image:: ../_static/ide-sublime-text-platformio-newproject-2.png After that, we can use the necessary commands from -``Menu: Tools → Command Palette`` or with ``Ctrl+Shift+P`` (Windows/Linux) +``Menu: Tools > Command Palette`` or with ``Ctrl+Shift+P`` (Windows/Linux) ``Cmd+Shift+P`` (Mac) shortcut. .. image:: ../_static/ide-sublime-text-platformio-newproject-3.png Command Hotkeys -~~~~~~~~~~~~~~~ +''''''''''''''' Sublime Text allows to bind own hotkey per command. Let's setup them -for PlatformIO commands using shortcut ``Menu: Preferences → Key-Bindings - User``: +for PlatformIO commands using shortcut ``Menu: Preferences > Key-Bindings - User``: .. image:: ../_static/ide-sublime-text-platformio-newproject-4.png @@ -76,12 +92,12 @@ In this case, the final code will look like: ] First program in Sublime Text -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Simple "Blink" project will consist from two files: 1. Main "C" source file named ``main.c`` must be located in the ``src`` directory. -Let's create new file named ``main.c`` using ``Menu: File → New File`` or shortcut ``Ctrl+N`` (Windows/Linux) ``Cmd+N`` (Mac) with the next contents: +Let's create new file named ``main.c`` using ``Menu: File > New File`` or shortcut ``Ctrl+N`` (Windows/Linux) ``Cmd+N`` (Mac) with the next contents: .. code-block:: c @@ -124,6 +140,6 @@ Copy the source code which is described below to it. Conclusion ---------- -Taking everything into account, we can open project directory in Sublime Text using ``Menu: File → Open Folder`` and build it with shortcut ``Ctrl+B`` (Windows/Linux) or ``Cmd+B`` (Mac), clean project with shortcut ``F11`` and upload firmware to target with shortcut ``F12``. +Taking everything into account, we can open project directory in Sublime Text using ``Menu: File > Open Folder`` and build it with shortcut ``Ctrl+B`` (Windows/Linux) or ``Cmd+B`` (Mac), clean project with shortcut ``F11`` and upload firmware to target with shortcut ``F12``. .. image:: ../_static/ide-sublime-text-platformio-newproject-5.png diff --git a/docs/ide/vim.rst b/docs/ide/vim.rst index 1840e510..ae1116f6 100644 --- a/docs/ide/vim.rst +++ b/docs/ide/vim.rst @@ -9,8 +9,8 @@ standalone application in a graphical user interface. This software can be used with: -* all availalbe :ref:`platforms` -* all availalbe :ref:`frameworks` +* all available :ref:`platforms` +* all available :ref:`frameworks` Integration ----------- diff --git a/docs/ide/visualstudio.rst b/docs/ide/visualstudio.rst index c5fc28d3..f5275532 100644 --- a/docs/ide/visualstudio.rst +++ b/docs/ide/visualstudio.rst @@ -7,8 +7,8 @@ The `Microsoft Visual Studio (Free) `_ is an integ This software can be used with: -* all availalbe :ref:`platforms` -* all availalbe :ref:`frameworks` +* all available :ref:`platforms` +* all available :ref:`frameworks` Refer to the `Visual Studio Documentation `_ page for more detailed information. @@ -18,10 +18,26 @@ page for more detailed information. Integration ----------- -Setup New Project +Project Generator ^^^^^^^^^^^^^^^^^ -First of all, let's create new project from Visual Studio Start Page: ``Start → New Project`` or using ``Menu: File → New → Project``, then select project with ``Makefile`` type (``Visual C++ → General → Makefile Project``), fill ``Project name``, ``Solution name``, ``Location`` fields and press OK button. +Since PlatformIO 2.0 you can generate Eclipse compatible project using +:option:`platformio init --ide` command: + +.. code-block:: shell + + platformio init --ide visualstudio + +Then import this project via ``File > Import ...`` and specify root directory +where is located :ref:`projectconf`. + +Manual Integration +^^^^^^^^^^^^^^^^^^ + +Setup New Project +~~~~~~~~~~~~~~~~~ + +First of all, let's create new project from Visual Studio Start Page: ``Start > New Project`` or using ``Menu: File > New > Project``, then select project with ``Makefile`` type (``Visual C++ > General > Makefile Project``), fill ``Project name``, ``Solution name``, ``Location`` fields and press OK button. .. image:: ../_static/ide-vs-platformio-newproject.png @@ -37,7 +53,7 @@ Release Configuration is the same as Debug, so on the next step we check "Same a .. image:: ../_static/ide-vs-platformio-newproject-3.png -Thirdly, we need to add directories with header files using project properties (right click on the project name or ``Alt-Enter`` shortcut) and add two directories to ``Configuration Properties → NMake → Include Search Path``: +Thirdly, we need to add directories with header files using project properties (right click on the project name or ``Alt-Enter`` shortcut) and add two directories to ``Configuration Properties > NMake > Include Search Path``: .. code-block:: none @@ -47,12 +63,12 @@ Thirdly, we need to add directories with header files using project properties ( .. image:: ../_static/ide-vs-platformio-newproject-5.png First program in Visual Studio -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Simple "Blink" project will consist from two files: 1. Main "C" source file named ``main.c`` must be located in the ``src`` directory. -Let's create new file named ``main.c`` using ``Menu: File → New File`` or shortcut ``Ctrl+N``: +Let's create new file named ``main.c`` using ``Menu: File > New File`` or shortcut ``Ctrl+N``: .. image:: ../_static/ide-vs-platformio-newproject-6.png @@ -103,6 +119,6 @@ Copy the source code which is described below to it. Conclusion ---------- -Taking everything into account, we can build project with shortcut ``Ctrl+Shift+B`` or using ``Menu: Build → Build Solution``: +Taking everything into account, we can build project with shortcut ``Ctrl+Shift+B`` or using ``Menu: Build > Build Solution``: .. image:: ../_static/ide-vs-platformio-newproject-8.png diff --git a/docs/quickstart.rst b/docs/quickstart.rst index f9296061..a2336d16 100644 --- a/docs/quickstart.rst +++ b/docs/quickstart.rst @@ -9,8 +9,8 @@ Quickstart 1. :ref:`Install PlatformIO `. -2. Find board ``type`` on this :ref:`Embedded Boards ` page or - via :ref:`cmd_boards` command. +2. Find board ``type`` using `Embedded Boards Explorer `_ + or via :ref:`cmd_boards` command. 3. Initialize new PlatformIO based project via :ref:`cmd_init` command with the pre-configured environments for your boards: diff --git a/docs/userguide/cmd_ci.rst b/docs/userguide/cmd_ci.rst index 021ebc15..77d9d08b 100644 --- a/docs/userguide/cmd_ci.rst +++ b/docs/userguide/cmd_ci.rst @@ -107,229 +107,4 @@ Shows details about the results of processing environments. More details Examples -------- -1. Integration `Travis.CI `_, `Shippable `_ for GitHub - `USB_Host_Shield_2.0 `_ - project. The ``.travis.yml`` configuration file: - -.. code-block:: yaml - - language: python - python: - - "2.7" - - env: - - PLATFORMIO_CI_SRC=examples/Bluetooth/PS3SPP/PS3SPP.ino - - PLATFORMIO_CI_SRC=examples/pl2303/pl2303_gps/pl2303_gps.ino - - install: - - python -c "$(curl -fsSL https://raw.githubusercontent.com/platformio/platformio/master/scripts/get-platformio.py)" - - pip install --egg http://sourceforge.net/projects/scons/files/latest/download - - wget https://github.com/xxxajk/spi4teensy3/archive/master.zip -O /tmp/spi4teensy3.zip - - unzip /tmp/spi4teensy3.zip -d /tmp - - script: - - platformio ci --lib="." --lib="/tmp/spi4teensy3-master" --board=uno --board=teensy31 --board=due - -2. Integration `CircleCI `_ for GitHub - `USB_Host_Shield_2.0 `_ - project. The ``circle.yml`` configuration file: - -.. code-block:: yaml - - machine: - - environment: - PLATFORMIO_CI_SRC: examples/Bluetooth/PS3SPP/PS3SPP.ino - PLATFORMIO_CI_SRC: examples/pl2303/pl2303_gps/pl2303_gps.ino - - dependencies: - pre: - - sudo apt-get install python2.7-dev - - sudo python -c "$(curl -fsSL https://raw.githubusercontent.com/platformio/platformio/master/scripts/get-platformio.py)" - - sudo pip install --egg http://sourceforge.net/projects/scons/files/latest/download - - wget https://github.com/xxxajk/spi4teensy3/archive/master.zip -O /tmp/spi4teensy3.zip - - unzip /tmp/spi4teensy3.zip -d /tmp - test: - override: - - platformio ci --lib="." --lib="/tmp/spi4teensy3-master" --board=uno --board=teensy31 --board=due - -3. Integration `AppVeyor CI `_ for GitHub - `USB_Host_Shield_2.0 `_ - project. The ``appveyor.yml`` configuration file: - -.. code-block:: yaml - - build: off - environment: - global: - WITH_COMPILER: "cmd /E:ON /V:ON /C .\\scripts\\appveyor\\run_with_compiler.cmd" - matrix: - - PLATFORMIO_CI_SRC: "examples\\Bluetooth\\PS3SPP\\PS3SPP.ino" - PLATFORMIO_CI_SRC: "examples\\pl2303\\pl2303_gps\\pl2303_gps.ino" - WINDOWS_SDK_VERSION: "v7.0" - PYTHON_HOME: "C:\\Python27-x64" - PYTHON_VERSION: "2.7" - PYTHON_ARCH: "64" - init: - - ps: "ls C:\\Python*" - install: - - "git submodule update --init --recursive" - - "powershell scripts\\appveyor\\install.ps1" - before_test: - - cmd: SET PATH=%PATH%;%PYTHON_HOME%;%PYTHON_HOME%\Scripts - - cmd: git clone https://github.com/xxxajk/spi4teensy3.git c:\spi4teensy - test_script: - - "%PYTHON_HOME%\\Scripts\\pip --version" - - '%WITH_COMPILER% %PYTHON_HOME%\\Scripts\\platformio ci --lib="." --lib="c:\spi4teensy" --board=uno --board=teensy31 --board=due' - -The ``run_with_compiler.cmd`` script file: - -.. code-block:: none - - @ECHO OFF - - SET COMMAND_TO_RUN=%* - SET WIN_SDK_ROOT=C:\Program Files\Microsoft SDKs\Windows - - SET MAJOR_PYTHON_VERSION="%PYTHON_VERSION:~0,1%" - IF %MAJOR_PYTHON_VERSION% == "2" ( - SET WINDOWS_SDK_VERSION="v7.0" - ) ELSE IF %MAJOR_PYTHON_VERSION% == "3" ( - SET WINDOWS_SDK_VERSION="v7.1" - ) ELSE ( - ECHO Unsupported Python version: "%MAJOR_PYTHON_VERSION%" - EXIT 1 - ) - - IF "%PYTHON_ARCH%"=="64" ( - ECHO Configuring Windows SDK %WINDOWS_SDK_VERSION% for Python %MAJOR_PYTHON_VERSION% on a 64 bit architecture - SET DISTUTILS_USE_SDK=1 - SET MSSdk=1 - "%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Setup\WindowsSdkVer.exe" -q -version:%WINDOWS_SDK_VERSION% - "%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Bin\SetEnv.cmd" /x64 /release - ECHO Executing: %COMMAND_TO_RUN% - call %COMMAND_TO_RUN% || EXIT 1 - ) ELSE ( - ECHO Using default MSVC build environment for 32 bit architecture - ECHO Executing: %COMMAND_TO_RUN% - call %COMMAND_TO_RUN% || EXIT 1 - ) - - -The ``install.ps1`` script file: - -.. code-block:: none - - $BASE_URL = "https://www.python.org/ftp/python/" - $GET_PIP_URL = "https://bootstrap.pypa.io/get-pip.py" - $GET_PIP_PATH = "C:\get-pip.py" - - - function DownloadPython ($python_version, $platform_suffix) { - $webclient = New-Object System.Net.WebClient - $filename = "python-" + $python_version + $platform_suffix + ".msi" - $url = $BASE_URL + $python_version + "/" + $filename - - $basedir = $pwd.Path + "\" - $filepath = $basedir + $filename - if (Test-Path $filename) { - Write-Host "Reusing" $filepath - return $filepath - } - - # Download and retry up to 5 times in case of network transient errors. - Write-Host "Downloading" $filename "from" $url - $retry_attempts = 3 - for($i=0; $i -lt $retry_attempts; $i++){ - try { - $webclient.DownloadFile($url, $filepath) - break - } - Catch [Exception]{ - Start-Sleep 1 - } - } - Write-Host "File saved at" $filepath - return $filepath - } - - - function InstallPython ($python_version, $architecture, $python_home) { - Write-Host "Installing Python" $python_version "for" $architecture "bit architecture to" $python_home - if (Test-Path $python_home) { - Write-Host $python_home "already exists, skipping." - return $false - } - if ($architecture -eq "32") { - $platform_suffix = "" - } else { - $platform_suffix = ".amd64" - } - $filepath = DownloadPython $python_version $platform_suffix - Write-Host "Installing" $filepath "to" $python_home - $args = "/qn /i $filepath TARGETDIR=$python_home" - Write-Host "msiexec.exe" $args - Start-Process -FilePath "msiexec.exe" -ArgumentList $args -Wait -Passthru - Write-Host "Python $python_version ($architecture) installation complete" - return $true - } - - - function InstallPip ($python_home) { - $pip_path = $python_home + "/Scripts/pip.exe" - $python_path = $python_home + "/python.exe" - if (-not(Test-Path $pip_path)) { - Write-Host "Installing pip..." - $webclient = New-Object System.Net.WebClient - $webclient.DownloadFile($GET_PIP_URL, $GET_PIP_PATH) - Write-Host "Executing:" $python_path $GET_PIP_PATH - Start-Process -FilePath "$python_path" -ArgumentList "$GET_PIP_PATH" -Wait -Passthru - } else { - Write-Host "pip already installed." - } - } - - function InstallPackage ($python_home, $pkg) { - $pip_path = $python_home + "/Scripts/pip.exe" - & $pip_path install $pkg - } - - function InstallScons ($python_home) { - Write-Host "Start installing Scons" - $pip_path = $python_home + "/Scripts/pip.exe" - & $pip_path install --egg "http://sourceforge.net/projects/scons/files/latest/download" - Write-Host "Scons installed" - } - - function main () { - InstallPython $env:PYTHON_VERSION $env:PYTHON_ARCH $env:PYTHON_HOME - InstallPip $env:PYTHON_HOME - InstallPackage $env:PYTHON_HOME setuptools - InstallScons $env:PYTHON_HOME - InstallPackage $env:PYTHON_HOME "https://github.com/platformio/platformio/archive/develop.zip" - } - - main - -3. Integration `Drone CI `_ for GitHub - `USB_Host_Shield_2.0 `_ - project. The project settings: - -`Environment Variables`: - -.. code-block:: none - - PLATFORMIO_CI_SRC=examples/Bluetooth/PS3SPP/PS3SPP.ino - PLATFORMIO_CI_SRC=examples/pl2303/pl2303_gps/pl2303_gps.ino - -`Commands`: - -.. code-block:: none - - pip install --egg http://sourceforge.net/projects/scons/files/latest/download - python -c "$(curl -fsSL https://raw.githubusercontent.com/platformio/platformio/master/scripts/get-platformio.py)" - wget https://github.com/xxxajk/spi4teensy3/archive/master.zip -O /tmp/spi4teensy3.zip - unzip /tmp/spi4teensy3.zip -d /tmp - platformio ci --lib="." --lib="/tmp/spi4teensy3-master" --board=uno --board=teensy31 --board=due - - +For the examples please follow to :ref:`ci` page. diff --git a/docs/userguide/cmd_init.rst b/docs/userguide/cmd_init.rst index 6ca15cec..02e140de 100644 --- a/docs/userguide/cmd_init.rst +++ b/docs/userguide/cmd_init.rst @@ -56,6 +56,7 @@ Initialise PlatformIO project for the specified IDE which can be imported later via "Import Project" functionality. A list with supported IDE is available within ``platformio init --help`` command. +Also, please look into :ref:`ide` page. .. option:: --disable-auto-uploading