Skip to content

Commit

Permalink
Project generator for NetBeans IDE // Resolve #541
Browse files Browse the repository at this point in the history
  • Loading branch information
ivankravets committed Feb 27, 2016
1 parent fdff0af commit 6190f1a
Show file tree
Hide file tree
Showing 10 changed files with 234 additions and 4 deletions.
2 changes: 2 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ PlatformIO 2.0
2.8.5 (2016-02-??)
~~~~~~~~~~~~~~~~~~

* Project generator for `NetBeans IDE <http://docs.platformio.org/en/latest/ide/netbeans.html>`__
(`issue #541 <https://github.com/platformio/platformio/issues/541>`_)
* Added support for the ESP8266 ESP-07 board to
`Espressif <http://docs.platformio.org/en/latest/platforms/espressif.html>`__
(`issue #527 <https://github.com/platformio/platformio/issues/527>`_)
Expand Down
Binary file removed docs/_static/ide-platformio-netbeans.jpg
Binary file not shown.
Binary file added docs/_static/ide-platformio-netbeans.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 24 additions & 3 deletions docs/ide/netbeans.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,28 @@ for details.
Integration
-----------

Please follow to `How to Integrate PlatformIO with Netbeans <http://www.instructables.com/id/How-to-Integrate-PlatformIO-With-Netbeans/>`_ instructions.
Choose board ``type`` using :ref:`cmd_boards` or `Embedded Boards Explorer <http://platformio.org/#!/boards>`_
command and generate project via :option:`platformio init --ide` command:

.. code-block:: shell
platformio init --ide netbeans --board %TYPE%
# For example, generate project for Arduino UNO
platformio init --ide netbeans --board uno
Then:

1. Open this project via ``Menu: File > Open Project...``
2. Add new files to ``src`` directory (``*.c, *.cpp, *.ino, etc.``) via
right-click on ``src`` folder in the "Projects" pane
3. Build project using ``Menu: Run > Build Project``
4. Upload firmware using ``Menu: Run > Run Project``

.. warning::
The libraries which are added, installed or used in the project
after generating process wont be reflected in IDE. To fix it you
need to reinitialize project using :ref:`cmd_init` (repeat it).

Articles / Manuals
------------------
Expand All @@ -41,5 +62,5 @@ See the full list with :ref:`articles`.
Screenshot
-----------

.. image:: ../_static/ide-platformio-netbeans.jpg
:target: http://www.instructables.com/id/How-to-Integrate-PlatformIO-With-Netbeans/
.. image:: ../_static/ide-platformio-netbeans.png
:target: http://docs.platformio.org/en/latest/_images/ide-platformio-netbeans.png
2 changes: 1 addition & 1 deletion platformio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import sys

VERSION = (2, 8, "5.dev1")
VERSION = (2, 8, "5.dev2")
__version__ = ".".join([str(s) for s in VERSION])

__title__ = "platformio"
Expand Down
70 changes: 70 additions & 0 deletions platformio/ide/tpls/netbeans/nbproject/configurations.xml.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="UTF-8"?>
<configurationDescriptor version="97">
<logicalFolder name="root" displayName="root" projectFiles="true" kind="ROOT">
<df root="." name="0">
<in>platformio.ini</in>
</df>
<logicalFolder name="ExternalFiles"
displayName="Important Files"
projectFiles="false"
kind="IMPORTANT_FILES_FOLDER">
<itemPath>nbproject/private/launcher.properties</itemPath>
</logicalFolder>
</logicalFolder>
<sourceFolderFilter>^(nbproject|.pioenvs)$</sourceFolderFilter>
<sourceRootList>
<Elem>.</Elem>
</sourceRootList>
<projectmakefile></projectmakefile>
<confs>
<conf name="Default" type="0">
<toolsSet>
<compilerSet>default</compilerSet>
<dependencyChecking>false</dependencyChecking>
<rebuildPropChanged>false</rebuildPropChanged>
</toolsSet>
<codeAssistance>
</codeAssistance>
<makefileType>
<makeTool>
<buildCommandWorkingDir>.</buildCommandWorkingDir>
<buildCommand>{{platformio_path}} -f -c netbeans run</buildCommand>
<cleanCommand>{{platformio_path}} -f -c netbeans run --target clean</cleanCommand>
<executablePath></executablePath>
<cTool>
<incDir>
<pElem>src</pElem>
% for include in includes:
<pElem>{{include}}</pElem>
% end
</incDir>
<preprocessorList>
% for define in defines:
<Elem>{{define}}</Elem>
% end
</preprocessorList>
</cTool>
<ccTool>
<incDir>
<pElem>src</pElem>
% for include in includes:
<pElem>{{include}}</pElem>
% end
</incDir>
<preprocessorList>
% for define in defines:
<Elem>{{define}}</Elem>
% end
</preprocessorList>
</ccTool>
</makeTool>
<preBuild>
<preBuildCommandWorkingDir>.</preBuildCommandWorkingDir>
<preBuildCommand></preBuildCommand>
</preBuild>
</makefileType>
<item path="platformio.ini" ex="false" tool="3" flavor2="0">
</item>
</conf>
</confs>
</configurationDescriptor>
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8"?>
<configurationDescriptor version="97">
<logicalFolder name="root" displayName="root" projectFiles="true" kind="ROOT">
<df root="." name="0">
<df name="lib">
</df>
<df name="src">
</df>
<in>platformio.ini</in>
</df>
</logicalFolder>
<projectmakefile></projectmakefile>
<confs>
<conf name="Default" type="0">
<toolsSet>
<developmentServer>localhost</developmentServer>
<platform>{{4 if "darwin" in systype else 2 if "linux" in systype else 1}}</platform>
</toolsSet>
<compile>
<compiledirpicklist>
<compiledirpicklistitem>.</compiledirpicklistitem>
<compiledirpicklistitem>${AUTO_FOLDER}</compiledirpicklistitem>
</compiledirpicklist>
<compiledir>${AUTO_FOLDER}</compiledir>
<compilecommandpicklist>
<compilecommandpicklistitem>${MAKE} ${ITEM_NAME}.o</compilecommandpicklistitem>
<compilecommandpicklistitem>${AUTO_COMPILE}</compilecommandpicklistitem>
</compilecommandpicklist>
<compilecommand>${AUTO_COMPILE}</compilecommand>
</compile>
<dbx_gdbdebugger version="1">
<gdb_pathmaps>
</gdb_pathmaps>
<gdb_interceptlist>
<gdbinterceptoptions gdb_all="false" gdb_unhandled="true" gdb_unexpected="true"/>
</gdb_interceptlist>
<gdb_options>
<DebugOptions>
</DebugOptions>
</gdb_options>
<gdb_buildfirst gdb_buildfirst_overriden="false" gdb_buildfirst_old="false"/>
</dbx_gdbdebugger>
<nativedebugger version="1">
<engine>gdb</engine>
</nativedebugger>
<runprofile version="9">
<runcommandpicklist>
<runcommandpicklistitem>"${OUTPUT_PATH}"</runcommandpicklistitem>
<runcommandpicklistitem>{{platformio_path}} -f -c netbeans run --target upload</runcommandpicklistitem>
</runcommandpicklist>
<runcommand>{{platformio_path}} -f -c netbeans run --target upload</runcommand>
<rundir>.</rundir>
<buildfirst>false</buildfirst>
<terminal-type>0</terminal-type>
<remove-instrumentation>0</remove-instrumentation>
<environment>
</environment>
</runprofile>
</conf>
</confs>
</configurationDescriptor>
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Launchers File syntax:
#
# [Must-have property line]
# launcher1.runCommand=<Run Command>
# [Optional extra properties]
# launcher1.displayName=<Display Name, runCommand by default>
# launcher1.buildCommand=<Build Command, Build Command specified in project properties by default>
# launcher1.runDir=<Run Directory, ${PROJECT_DIR} by default>
# launcher1.symbolFiles=<Symbol Files loaded by debugger, ${OUTPUT_PATH} by default>
# launcher1.env.<Environment variable KEY>=<Environment variable VALUE>
# (If this value is quoted with ` it is handled as a native command which execution result will become the value)
# [Common launcher properties]
# common.runDir=<Run Directory>
# (This value is overwritten by a launcher specific runDir value if the latter exists)
# common.env.<Environment variable KEY>=<Environment variable VALUE>
# (Environment variables from common launcher are merged with launcher specific variables)
# common.symbolFiles=<Symbol Files loaded by debugger>
# (This value is overwritten by a launcher specific symbolFiles value if the latter exists)
#
# In runDir, symbolFiles and env fields you can use these macroses:
# ${PROJECT_DIR} - project directory absolute path
# ${OUTPUT_PATH} - linker output path (relative to project directory path)
# ${OUTPUT_BASENAME}- linker output filename
# ${TESTDIR} - test files directory (relative to project directory path)
# ${OBJECTDIR} - object files directory (relative to project directory path)
# ${CND_DISTDIR} - distribution directory (relative to project directory path)
# ${CND_BUILDDIR} - build directory (relative to project directory path)
# ${CND_PLATFORM} - platform name
# ${CND_CONF} - configuration name
# ${CND_DLIB_EXT} - dynamic library extension
#
# All the project launchers must be listed in the file!
#
# launcher1.runCommand=...
# launcher2.runCommand=...
# ...
# common.runDir=...
# common.env.KEY=VALUE

# launcher1.runCommand=<type your run command here>
10 changes: 10 additions & 0 deletions platformio/ide/tpls/netbeans/nbproject/private/private.xml.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
<code-assistance-data xmlns="http://www.netbeans.org/ns/make-project-private/1">
<code-model-enabled>true</code-model-enabled>
</code-assistance-data>
<data xmlns="http://www.netbeans.org/ns/make-project-private/1">
<activeConfTypeElem>0</activeConfTypeElem>
<activeConfIndexElem>0</activeConfIndexElem>
</data>
</project-private>
26 changes: 26 additions & 0 deletions platformio/ide/tpls/netbeans/nbproject/project.xml.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.cnd.makeproject</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/make-project/1">
<name>{{project_name}}</name>
<c-extensions/>
<cpp-extensions/>
<header-extensions/>
<sourceEncoding>UTF-8</sourceEncoding>
<make-dep-projects/>
<sourceRootList>
<sourceRootElem>.</sourceRootElem>
</sourceRootList>
<confList>
<confElem>
<name>Default</name>
<type>0</type>
</confElem>
</confList>
<formatting>
<project-formatting-style>false</project-formatting-style>
</formatting>
</data>
</configuration>
</project>

0 comments on commit 6190f1a

Please sign in to comment.