mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-30 10:07:14 +02:00
Added native development platform
This commit is contained in:
@ -1,6 +1,13 @@
|
|||||||
Release History
|
Release History
|
||||||
===============
|
===============
|
||||||
|
|
||||||
|
2.3.0 (2015-??-??)
|
||||||
|
------------------
|
||||||
|
|
||||||
|
* Added `native <http://docs.platformio.org/en/latest/platforms/native.html>`_
|
||||||
|
development platform
|
||||||
|
(`issue #263 <https://github.com/platformio/platformio/issues/263>`_)
|
||||||
|
|
||||||
2.2.2 (2015-07-30)
|
2.2.2 (2015-07-30)
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
|
@ -11,6 +11,9 @@ Also it has pre-configured settings for most popular **Embedded Platform
|
|||||||
Boards**. You have no need to specify in :ref:`projectconf` type or frequency of
|
Boards**. You have no need to specify in :ref:`projectconf` type or frequency of
|
||||||
MCU, upload protocol or etc. Please use ``board`` option.
|
MCU, upload protocol or etc. Please use ``board`` option.
|
||||||
|
|
||||||
|
Embedded
|
||||||
|
--------
|
||||||
|
|
||||||
.. toctree::
|
.. toctree::
|
||||||
:maxdepth: 2
|
:maxdepth: 2
|
||||||
|
|
||||||
@ -25,5 +28,20 @@ MCU, upload protocol or etc. Please use ``board`` option.
|
|||||||
teensy
|
teensy
|
||||||
timsp430
|
timsp430
|
||||||
titiva
|
titiva
|
||||||
|
|
||||||
|
Desktop
|
||||||
|
-------
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
:maxdepth: 2
|
||||||
|
|
||||||
|
native
|
||||||
|
|
||||||
|
Own Platform/Board
|
||||||
|
------------------
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
:maxdepth: 2
|
||||||
|
|
||||||
creating_platform
|
creating_platform
|
||||||
creating_board
|
creating_board
|
||||||
|
9
docs/platforms/native.rst
Normal file
9
docs/platforms/native.rst
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
.. _platform_native:
|
||||||
|
|
||||||
|
Platform ``native``
|
||||||
|
===================
|
||||||
|
Native development platform is intended to be used for desktop OS. This platform uses built-in tool chains (preferable based on GCC), frameworks, libs from particular OS where it will be run.
|
||||||
|
|
||||||
|
For more detailed information please visit `vendor site <http://platformio.org/#!/platforms/native>`_.
|
||||||
|
|
||||||
|
.. contents::
|
36
platformio/builder/scripts/native.py
Normal file
36
platformio/builder/scripts/native.py
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
||||||
|
# See LICENSE for details.
|
||||||
|
|
||||||
|
"""
|
||||||
|
Builder for native platform
|
||||||
|
"""
|
||||||
|
|
||||||
|
from SCons.Script import DefaultEnvironment, AlwaysBuild, Default
|
||||||
|
|
||||||
|
env = DefaultEnvironment()
|
||||||
|
|
||||||
|
env.Replace(
|
||||||
|
|
||||||
|
SIZEPRINTCMD="size $SOURCES",
|
||||||
|
|
||||||
|
PROGNAME="program"
|
||||||
|
)
|
||||||
|
|
||||||
|
#
|
||||||
|
# Target: Build executable program
|
||||||
|
#
|
||||||
|
|
||||||
|
target_bin = env.BuildProgram()
|
||||||
|
|
||||||
|
#
|
||||||
|
# Target: Print binary size
|
||||||
|
#
|
||||||
|
|
||||||
|
target_size = env.Alias("size", target_bin, "$SIZEPRINTCMD")
|
||||||
|
AlwaysBuild(target_size)
|
||||||
|
|
||||||
|
#
|
||||||
|
# Target: Define targets
|
||||||
|
#
|
||||||
|
|
||||||
|
Default([target_bin])
|
18
platformio/platforms/native.py
Normal file
18
platformio/platforms/native.py
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
||||||
|
# See LICENSE for details.
|
||||||
|
|
||||||
|
from platformio.platforms.base import BasePlatform
|
||||||
|
|
||||||
|
|
||||||
|
class NativePlatform(BasePlatform):
|
||||||
|
|
||||||
|
"""
|
||||||
|
Native development platform is intended to be used for desktop OS.
|
||||||
|
This platform uses built-in tool chains (preferable based on GCC),
|
||||||
|
frameworks, libs from particular OS where it will be run.
|
||||||
|
|
||||||
|
http://platformio.org/#!/platforms/native
|
||||||
|
"""
|
||||||
|
|
||||||
|
PACKAGES = {
|
||||||
|
}
|
@ -67,8 +67,14 @@ def generate_boards(boards):
|
|||||||
|
|
||||||
|
|
||||||
def generate_packages(packages):
|
def generate_packages(packages):
|
||||||
|
if not packages:
|
||||||
|
return
|
||||||
allpackages = get_packages()
|
allpackages = get_packages()
|
||||||
lines = []
|
lines = []
|
||||||
|
lines.append("""
|
||||||
|
Packages
|
||||||
|
--------
|
||||||
|
""")
|
||||||
lines.append(""".. list-table::
|
lines.append(""".. list-table::
|
||||||
:header-rows: 1
|
:header-rows: 1
|
||||||
|
|
||||||
@ -116,13 +122,30 @@ For more detailed information please visit `vendor site <%s>`_.""" %
|
|||||||
p.get_vendor_url())
|
p.get_vendor_url())
|
||||||
lines.append("""
|
lines.append("""
|
||||||
.. contents::""")
|
.. contents::""")
|
||||||
lines.append("""
|
|
||||||
Packages
|
|
||||||
--------
|
|
||||||
""")
|
|
||||||
lines.append(generate_packages(p.get_packages()))
|
|
||||||
|
|
||||||
lines.append("""
|
#
|
||||||
|
# Packages
|
||||||
|
#
|
||||||
|
_packages_content = generate_packages(p.get_packages())
|
||||||
|
if _packages_content:
|
||||||
|
lines.append(_packages_content)
|
||||||
|
|
||||||
|
#
|
||||||
|
# Frameworks
|
||||||
|
#
|
||||||
|
_frameworks = util.get_frameworks()
|
||||||
|
_frameworks_lines = []
|
||||||
|
for framework in sorted(_frameworks.keys()):
|
||||||
|
if not is_compat_platform_and_framework(name, framework):
|
||||||
|
continue
|
||||||
|
_frameworks_lines.append("""
|
||||||
|
* - :ref:`framework_{type_}`
|
||||||
|
- {description}""".format(
|
||||||
|
type_=framework,
|
||||||
|
description=_frameworks[framework]['description']))
|
||||||
|
|
||||||
|
if _frameworks_lines:
|
||||||
|
lines.append("""
|
||||||
Frameworks
|
Frameworks
|
||||||
----------
|
----------
|
||||||
.. list-table::
|
.. list-table::
|
||||||
@ -130,18 +153,23 @@ Frameworks
|
|||||||
|
|
||||||
* - Name
|
* - Name
|
||||||
- Description""")
|
- Description""")
|
||||||
|
lines.extend(_frameworks_lines)
|
||||||
|
|
||||||
_frameworks = util.get_frameworks()
|
#
|
||||||
for framework in sorted(_frameworks.keys()):
|
# Boards
|
||||||
if not is_compat_platform_and_framework(name, framework):
|
#
|
||||||
continue
|
vendors = {}
|
||||||
|
for board, data in util.get_boards().items():
|
||||||
|
platform = data['platform']
|
||||||
|
vendor = data['vendor']
|
||||||
|
if name in platform:
|
||||||
|
if vendor in vendors:
|
||||||
|
vendors[vendor].append({board: data})
|
||||||
|
else:
|
||||||
|
vendors[vendor] = [{board: data}]
|
||||||
|
|
||||||
|
if vendors:
|
||||||
lines.append("""
|
lines.append("""
|
||||||
* - :ref:`framework_{type_}`
|
|
||||||
- {description}""".format(
|
|
||||||
type_=framework,
|
|
||||||
description=_frameworks[framework]['description']))
|
|
||||||
|
|
||||||
lines.append("""
|
|
||||||
Boards
|
Boards
|
||||||
------
|
------
|
||||||
|
|
||||||
@ -152,19 +180,11 @@ Boards
|
|||||||
horizontal.
|
horizontal.
|
||||||
""")
|
""")
|
||||||
|
|
||||||
vendors = {}
|
|
||||||
for board, data in util.get_boards().items():
|
|
||||||
platform = data['platform']
|
|
||||||
vendor = data['vendor']
|
|
||||||
if name in platform:
|
|
||||||
if vendor in vendors:
|
|
||||||
vendors[vendor].append({board: data})
|
|
||||||
else:
|
|
||||||
vendors[vendor] = [{board: data}]
|
|
||||||
for vendor, boards in sorted(vendors.iteritems()):
|
for vendor, boards in sorted(vendors.iteritems()):
|
||||||
lines.append(str(vendor))
|
lines.append(str(vendor))
|
||||||
lines.append("~" * len(vendor))
|
lines.append("~" * len(vendor))
|
||||||
lines.append(generate_boards(boards))
|
lines.append(generate_boards(boards))
|
||||||
|
|
||||||
return "\n".join(lines)
|
return "\n".join(lines)
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user