Compare commits

..

30 Commits

Author SHA1 Message Date
Ivan Kravets
09493ce196 Merge branch 'release/v0.10.2' 2015-01-06 18:33:36 +02:00
Ivan Kravets
be224d2d8a Bump to 0.10.2 (resolve issue #42, #45) 2015-01-06 18:32:06 +02:00
Ivan Kravets
4b7a7d0cf0 Fix an exception during platformio upgrade under Windows OS // Resolve #45 2015-01-06 17:45:07 +02:00
Ivan Kravets
8c53cf1d3c Fix an issue with `--json-output` // Resolve #42 2015-01-05 22:58:55 +02:00
Ivan Kravets
09159c3ac0 Add notice about Engduino Library 2015-01-03 01:16:19 +02:00
Ivan Kravets
0f1cd87deb Return to 0.11.0-dev 2015-01-02 23:19:26 +02:00
Ivan Kravets
e0cb0003dc Merge branch 'release/v0.10.1' into develop 2015-01-02 23:18:15 +02:00
Ivan Kravets
23017a22ec Merge branch 'release/v0.10.1' 2015-01-02 23:18:14 +02:00
Ivan Kravets
6c86bb4167 Bump to 0.10.1 (resolve issue #42) 2015-01-02 23:17:30 +02:00
Ivan Kravets
ca31230928 Improve lib scanner 2015-01-02 23:14:45 +02:00
Ivan Kravets
01f8795981 Add "--json-output" option to "platformio list", "platformio serialports list" and "platformio lib list" cmds // Resolve #42 2015-01-02 21:03:14 +02:00
Ivan Kravets
2566879a99 Fix indention 2015-01-02 20:27:34 +02:00
Ivan Kravets
418b693fe0 Fix missing auto-uploading by default within init command 2015-01-02 20:25:30 +02:00
Ivan Kravets
8686936a07 Revert lowercase to Quickstart 2015-01-02 17:18:32 +02:00
Ivan Kravets
79b8e6c24e Mention "boards" command on QuickStart page 2015-01-02 15:19:44 +02:00
Ivan Kravets
8c2dd44f44 Update platformio.ini for the examples 2015-01-02 00:16:29 +02:00
Ivan Kravets
f172019edc Disable blink for "thanks" 2015-01-01 22:57:02 +02:00
Ivan Kravets
44bf3e8479 Start 0.11.0-dev 2015-01-01 21:04:27 +02:00
Ivan Kravets
17d6c02d83 Merge branch 'release/v0.10.0' 2015-01-01 21:00:27 +02:00
Ivan Kravets
bd6a57095a Merge branch 'release/v0.10.0' into develop 2015-01-01 21:00:27 +02:00
Ivan Kravets
ac02348833 Merge branch 'release/v0.9.2' 2014-12-10 23:12:27 +02:00
Ivan Kravets
e521a691ae Merge branch 'release/v0.9.1' 2014-12-05 00:04:38 +02:00
Ivan Kravets
ce1b32e4e9 Merge branch 'release/v0.9.0' 2014-12-01 23:04:54 +02:00
Ivan Kravets
c867f9a90a Merge branch 'release/v0.8.0' 2014-10-19 17:59:44 +03:00
Ivan Kravets
8d491b4146 Merge branch 'release/v0.7.1' 2014-10-06 23:28:12 +03:00
Ivan Kravets
6404b02a5d Merge branch 'release/v0.7.0' 2014-09-24 22:25:58 +03:00
Ivan Kravets
e48c6744ed Merge branch 'release/v0.6.0' 2014-08-09 23:21:02 +03:00
Ivan Kravets
26e70ad2f9 Merge branch 'release/v0.5.0' 2014-08-04 11:56:43 +03:00
Ivan Kravets
693191770b Merge branch 'release/v0.4.0' 2014-07-31 16:26:35 +03:00
Ivan Kravets
7b2bc740ba Merge branch 'hotfix/v0.3.1' 2014-06-21 23:10:39 +03:00
25 changed files with 307 additions and 65 deletions

View File

@@ -1,15 +1,35 @@
Release History
===============
0.10.0 (2015-01-01) Happy New Year!
-----------------------------------
0.10.2 (2015-01-06)
-------------------
* Fixed an issue with ``--json-output`` (`issue #42 <https://github.com/ivankravets/platformio/issues/42>`_)
* Fixed an exception during `platformio upgrade <http://docs.platformio.org/en/latest/userguide/cmd_upgrade.html>`__ under Windows OS (`issue #45 <https://github.com/ivankravets/platformio/issues/45>`_)
0.10.1 (2015-01-02)
-------------------
* Added ``--json-output`` option to
`platformio list <http://docs.platformio.org/en/latest/userguide/cmd_list.html>`__,
`platformio serialports list <http://docs.platformio.org/en/latest/userguide/cmd_serialports.html>`__ and
`platformio lib list <http://docs.platformio.org/en/latest/userguide/cmd_lib_list.html>`__
commands which allows to return the output in `JSON <http://en.wikipedia.org/wiki/JSON>`_ format
(`issue #42 <https://github.com/ivankravets/platformio/issues/42>`_)
* Fixed missing auto-uploading by default after `platformio init <http://docs.platformio.org/en/latest/userguide/cmd_init.html>`__
command
0.10.0 (2015-01-01)
-------------------
**Happy New Year!**
* Implemented `platformio boards <http://docs.platformio.org/en/latest/userguide/cmd_boards.html>`_
command (`issue #11 <https://github.com/ivankravets/platformio/issues/11>`_)
* Added support of *Engduino* boards for
`atmelavr <http://docs.platformio.org/en/latest/platforms/atmelavr.html#engduino>`__
platform (`issue #38 <https://github.com/ivankravets/platformio/issues/38>`_)
* Added ``--board`` option to `platformio init <http://docs.platformio.org/en/latest/userguide/cmd_init.html>`_
* Added ``--board`` option to `platformio init <http://docs.platformio.org/en/latest/userguide/cmd_init.html>`__
command which allows to initialise project with the specified embedded boards
(`issue #21 <https://github.com/ivankravets/platformio/issues/21>`_)
* Added `example with uploading firmware <http://docs.platformio.org/en/latest/projectconf.html#examples>`_
@@ -22,7 +42,6 @@ Release History
* Fixed urllib3's *SSL* warning under Python <= 2.7.2 (`issue #39 <https://github.com/ivankravets/platformio/issues/39>`_)
* Fixed bug with *Arduino USB* boards (`issue #40 <https://github.com/ivankravets/platformio/issues/40>`_)
0.9.2 (2014-12-10)
------------------

View File

@@ -250,6 +250,11 @@ Engduino
- 32 Kb
- 2.5 Kb
.. note::
If you are going to use onboard sensors, please install
`Engduino library <http://platformio.org/#!/lib/show/123/EngduinoV3>`_
with the examples.
More detailed information you can find here
`Engduino Site <http://www.engduino.org>`_.

View File

@@ -9,15 +9,15 @@ Quickstart
1. :ref:`Install PlatformIO <installation>`.
2. Find board ``type`` from :ref:`platforms` (you can choose multiple board
types).
2. Find board ``type`` on this :ref:`Embedded Boards <platforms>` page or
via :ref:`cmd_boards` command.
3. Initialize new PlatformIO based project with the pre-configured
environments for your boards:
.. code-block:: bash
$ platformio init --board=TYPE1 --board=TYPE2
$ platformio init --board=TYPE_1 --board=TYPE_2 --board=TYPE_N
The current working directory *** will be used for the new project.
You can specify another project directory via

View File

@@ -10,7 +10,7 @@ Usage
.. code-block:: bash
platformio list
platformio list [OPTIONS]
Description
@@ -18,6 +18,13 @@ Description
List installed :ref:`Platforms <platforms>`
Options
~~~~~~~
.. option::
--json-output
Return the output in `JSON <http://en.wikipedia.org/wiki/JSON>`_ format
Examples
--------

View File

@@ -13,7 +13,7 @@ Usage
.. code-block:: bash
platformio serialports list
platformio serialports list [OPTIONS]
Description
@@ -21,6 +21,14 @@ Description
List available `Serial Ports <http://en.wikipedia.org/wiki/Serial_port>`_
Options
~~~~~~~
.. option::
--json-output
Return the output in `JSON <http://en.wikipedia.org/wiki/JSON>`_ format
Examples
~~~~~~~~

View File

@@ -10,7 +10,7 @@ Usage
.. code-block:: bash
platformio lib list
platformio lib list [OPTIONS]
Description
@@ -18,6 +18,13 @@ Description
List installed libraries
Options
~~~~~~~
.. option::
--json-output
Return the output in `JSON <http://en.wikipedia.org/wiki/JSON>`_ format
Examples
--------

View File

@@ -1,5 +1,21 @@
# Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details.
#
# Project Configuration File
#
# A detailed documentation with the EXAMPLES is located here:
# http://docs.platformio.org/en/latest/projectconf.html
#
# A sign `#` at the beginning of the line indicates a comment
# Comment lines are ignored.
# Simple and base environment
# [env:mybaseenv]
# platform = %INSTALLED_PLATFORM_NAME_HERE%
# framework =
# board =
#
# Automatic targets - enable auto-uploading
# targets = upload
[env:microduino]
platform = atmelavr

View File

@@ -1,5 +1,21 @@
# Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details.
#
# Project Configuration File
#
# A detailed documentation with the EXAMPLES is located here:
# http://docs.platformio.org/en/latest/projectconf.html
#
# A sign `#` at the beginning of the line indicates a comment
# Comment lines are ignored.
# Simple and base environment
# [env:mybaseenv]
# platform = %INSTALLED_PLATFORM_NAME_HERE%
# framework =
# board =
#
# Automatic targets - enable auto-uploading
# targets = upload
[env:arduino_pro5v]
platform = atmelavr

View File

@@ -1,13 +1,27 @@
# Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details.
#
# Project Configuration File
#
# A detailed documentation with the EXAMPLES is located here:
# http://docs.platformio.org/en/latest/projectconf.html
#
# A sign `#` at the beginning of the line indicates a comment
# Comment lines are ignored.
# Simple and base environment
# [env:mybaseenv]
# platform = %INSTALLED_PLATFORM_NAME_HERE%
# framework =
# board =
#
# Automatic targets - enable auto-uploading
# targets = upload
[env:arduino_pro5v]
platform = atmelavr
board_mcu = atmega168
board_f_cpu = 16000000L
upload_port = /dev/tty.SLAB_USBtoUART
# upload_port = COM3
upload_protocol = arduino
upload_speed = 19200

View File

@@ -1,5 +1,21 @@
# Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details.
#
# Project Configuration File
#
# A detailed documentation with the EXAMPLES is located here:
# http://docs.platformio.org/en/latest/projectconf.html
#
# A sign `#` at the beginning of the line indicates a comment
# Comment lines are ignored.
# Simple and base environment
# [env:mybaseenv]
# platform = %INSTALLED_PLATFORM_NAME_HERE%
# framework =
# board =
#
# Automatic targets - enable auto-uploading
# targets = upload
[env:arduino_pro5v]
platform = atmelavr

View File

@@ -1,14 +1,26 @@
# Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details.
#
# Project Configuration File
#
# A detailed documentation with the EXAMPLES is located here:
# http://docs.platformio.org/en/latest/projectconf.html
#
# A sign `#` at the beginning of the line indicates a comment
# Comment lines are ignored.
# Simple and base environment
# [env:mybaseenv]
# platform = %INSTALLED_PLATFORM_NAME_HERE%
# framework =
# board =
#
# Automatic targets - enable auto-uploading
# targets = upload
[env:atmelavr_atmega168]
platform = atmelavr
board_mcu = atmega168
board_f_cpu = 16000000L
# Allow autodetection for upload port or uncomment line below
# upload_port = /dev/ttyUSB0
# upload_port = COM3
upload_protocol = arduino
upload_speed = 19200

View File

@@ -1,5 +1,21 @@
# Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details.
#
# Project Configuration File
#
# A detailed documentation with the EXAMPLES is located here:
# http://docs.platformio.org/en/latest/projectconf.html
#
# A sign `#` at the beginning of the line indicates a comment
# Comment lines are ignored.
# Simple and base environment
# [env:mybaseenv]
# platform = %INSTALLED_PLATFORM_NAME_HERE%
# framework =
# board =
#
# Automatic targets - enable auto-uploading
# targets = upload
[env:launchpad_msp430g2]
platform = timsp430

View File

@@ -1,8 +1,23 @@
# Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details.
#
# Project Configuration File
#
# A detailed documentation with the EXAMPLES is located here:
# http://docs.platformio.org/en/latest/projectconf.html
#
# A sign `#` at the beginning of the line indicates a comment
# Comment lines are ignored.
# Simple and base environment
# [env:mybaseenv]
# platform = %INSTALLED_PLATFORM_NAME_HERE%
# framework =
# board =
#
# Automatic targets - enable auto-uploading
# targets = upload
[env:launchpad_lm4f120]
platform = titiva
framework = energia
board = lplm4f120h5qr
targets = upload

View File

@@ -1,5 +1,21 @@
# Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details.
#
# Project Configuration File
#
# A detailed documentation with the EXAMPLES is located here:
# http://docs.platformio.org/en/latest/projectconf.html
#
# A sign `#` at the beginning of the line indicates a comment
# Comment lines are ignored.
# Simple and base environment
# [env:mybaseenv]
# platform = %INSTALLED_PLATFORM_NAME_HERE%
# framework =
# board =
#
# Automatic targets - enable auto-uploading
# targets = upload
[env:launchpad_msp430g2]
platform = timsp430

View File

@@ -1,5 +1,21 @@
# Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details.
#
# Project Configuration File
#
# A detailed documentation with the EXAMPLES is located here:
# http://docs.platformio.org/en/latest/projectconf.html
#
# A sign `#` at the beginning of the line indicates a comment
# Comment lines are ignored.
# Simple and base environment
# [env:mybaseenv]
# platform = %INSTALLED_PLATFORM_NAME_HERE%
# framework =
# board =
#
# Automatic targets - enable auto-uploading
# targets = upload
[env:launchpad_lm4f120]
platform = titiva

View File

@@ -1,19 +1,34 @@
# Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details.
#
# Project Configuration File
#
# A detailed documentation with the EXAMPLES is located here:
# http://docs.platformio.org/en/latest/projectconf.html
#
[env:arduino_pro5v]
# A sign `#` at the beginning of the line indicates a comment
# Comment lines are ignored.
# Simple and base environment
# [env:mybaseenv]
# platform = %INSTALLED_PLATFORM_NAME_HERE%
# framework =
# board =
#
# Automatic targets - enable auto-uploading
# targets = upload
[env:arduino_uno]
platform = atmelavr
framework = arduino
board = pro16MHzatmega168
upload_port = /dev/tty.SLAB_USBtoUART
board = uno
[env:launchpad_msp430g2]
platform = timsp430
framework = energia
board = lpmsp430g2553
[env:launchpad_lm4f120]
[env:launchpad_tm4c1230c3pm]
platform = titiva
framework = energia
board = lplm4f120h5qr
build_flags = "-DLED_PIN=GREEN_LED"
board = lptm4c1230c3pm
build_flags = -DLED_PIN=GREEN_LED

View File

@@ -1,7 +1,7 @@
# Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details.
VERSION = (0, 10, 0)
VERSION = (0, 10, 2)
__version__ = ".".join([str(s) for s in VERSION])
__title__ = "platformio"

View File

@@ -35,9 +35,7 @@ def BuildFirmware(env, corelibs):
join("$BUILD_DIR", "src"), join("$PROJECT_DIR", "src"))
# build dependent libs
deplibs = []
for vdir in vdirs:
deplibs += src.BuildDependentLibraries(vdir)
deplibs = src.BuildDependentLibraries(vdirs)
src.MergeFlags(getenv("PIOSRCBUILD_FLAGS", "$SRCBUILD_FLAGS"))
@@ -67,9 +65,9 @@ def BuildLibrary(env, variant_dir, library_dir):
)
def BuildDependentLibraries(env, src_dir):
def BuildDependentLibraries(env, src_dirs):
libs = []
deplibs = env.GetDependentLibraries(src_dir)
deplibs = env.GetDependentLibraries(src_dirs)
env.Append(CPPPATH=[join("$BUILD_DIR", l) for (l, _) in deplibs])
for (libname, inc_dir) in deplibs:
@@ -80,10 +78,15 @@ def BuildDependentLibraries(env, src_dir):
return libs
def GetDependentLibraries(env, src_dir):
def GetDependentLibraries(env, src_dirs):
includes = {}
nodes = []
regexp = re.compile(r"^\s*#include\s+(?:\<|\")([^\>\"\']+)(?:\>|\")", re.M)
nodes = env.GlobCXXFiles(src_dir) + env.Glob(join(src_dir, "*.h"))
for item in src_dirs:
nodes += env.GlobCXXFiles(item)
nodes += env.Glob(join(item, "*.h"))
for node in nodes:
env.ParseIncludesRecurive(regexp, node, includes)
includes = sorted(includes.items(), key=lambda s: s[0])
@@ -108,10 +111,12 @@ def ParseIncludesRecurive(env, regexp, source_file, includes):
for inc_fname in matches:
if inc_fname in includes:
continue
for lsd_dir in env['LIBSOURCE_DIRS']:
lsd_dir = env.subst(lsd_dir)
if not isdir(lsd_dir):
continue
for libname in listdir(lsd_dir):
inc_dir = join(lsd_dir, libname)
inc_file = join(inc_dir, inc_fname)
@@ -121,6 +126,7 @@ def ParseIncludesRecurive(env, regexp, source_file, includes):
inc_file = join(inc_dir, inc_fname)
if not isfile(inc_file):
continue
includes[inc_fname] = (len(includes) + 1, libname, inc_dir)
env.ParseIncludesRecurive(regexp, env.File(inc_file), includes)

View File

@@ -17,7 +17,7 @@ from platformio.util import get_boards, get_source_dir
type=click.Path(exists=True, file_okay=False, dir_okay=True,
writable=True, resolve_path=True))
@click.option("--board", "-b", multiple=True, metavar="TYPE")
@click.option('--disable-auto-uploading', is_flag=True)
@click.option("--disable-auto-uploading", is_flag=True)
def cli(project_dir, board, disable_auto_uploading):
project_file = join(project_dir, "platformio.ini")
@@ -89,8 +89,8 @@ def fill_project_envs(project_file, board_types, disable_auto_uploading):
content.append("framework = %s" % framework)
content.append("board = %s" % type_)
content.append("%stargets = upload" % "# " if disable_auto_uploading
else "")
content.append("%stargets = upload" % ("# " if disable_auto_uploading
else ""))
with open(project_file, "a") as f:
f.write("\n".join(content))

View File

@@ -1,12 +1,15 @@
# Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details.
import json
import click
from platformio import app, exception
from platformio.libmanager import LibraryManager
from platformio.util import get_api_result, get_lib_dir
LIBLIST_TPL = ("[{id:^14}] {name:<25} {compatibility:<30} "
"\"{authornames}\": {description}")
@@ -154,9 +157,15 @@ def lib_uninstall(libid):
@cli.command("list", short_help="List installed libraries")
def lib_list():
@click.option("--json-output", is_flag=True)
def lib_list(json_output):
lm = LibraryManager(get_lib_dir())
items = lm.get_installed().values()
if json_output:
click.echo(json.dumps(items))
return
if not items:
return

View File

@@ -1,21 +1,34 @@
# Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details.
import json
import click
from platformio.platforms.base import PlatformFactory
@click.command("list", short_help="List installed platforms")
def cli():
@click.option("--json-output", is_flag=True)
def cli(json_output):
installed_platforms = PlatformFactory.get_platforms(
installed=True).keys()
installed_platforms.sort()
data = []
for platform in installed_platforms:
p = PlatformFactory.newPlatform(platform)
click.echo("{name:<20} with packages: {pkgs}".format(
name=click.style(p.get_name(), fg="cyan"),
pkgs=", ".join(p.get_installed_packages())
))
data.append({
"name": platform,
"packages": p.get_installed_packages()
})
if json_output:
click.echo(json.dumps(data))
else:
for item in data:
click.echo("{name:<20} with packages: {pkgs}".format(
name=click.style(item['name'], fg="cyan"),
pkgs=", ".join(item['packages'])
))

View File

@@ -1,6 +1,7 @@
# Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details.
import json
import sys
import click
@@ -15,7 +16,12 @@ def cli():
@cli.command("list", short_help="List Serial ports")
def serialports_list():
@click.option("--json-output", is_flag=True)
def serialports_list(json_output):
if json_output:
click.echo(json.dumps(get_serialports()))
return
for item in get_serialports():
click.secho(item['port'], fg="cyan")

View File

@@ -23,9 +23,19 @@ def cli():
"newest version available." % __version__, fg="green"
)
else:
result = exec_command(["pip", "install", "--upgrade", "platformio"])
click.secho(result['out'], fg="green")
click.secho(result['err'], fg="red")
click.secho("Please wait while upgrading PlatformIO ...",
fg="yellow")
pip_result = exec_command(["pip", "install", "--upgrade",
"platformio"])
pio_result = exec_command(["platformio", "--version"])
if last in pio_result['out'].strip():
click.secho("PlatformIO has been successfully upgraded to %s" %
last, fg="green")
else:
click.secho(pip_result['out'], fg="green")
click.secho(pip_result['err'], fg="red")
def get_latest_version():

View File

@@ -98,7 +98,7 @@ def after_upgrade(ctx):
click.style("give", fg="cyan"),
click.style("https://github.com/ivankravets/platformio", fg="cyan")
))
click.secho("Thanks a lot!\n", fg="green", blink=True)
click.secho("Thanks a lot!\n", fg="green")
if not isdir(get_home_dir()):
return