Merge branch 'develop' into feature/platformio-30

* develop:
  Remove debug info
  Add "Rebuild C/C++ Project Index" target to CLion and Eclipse IDEs
  Iterating the dictionary directly instead of calling .keys()
  Iterating the dictionary directly instead of calling .keys()
  Add example dynamic `build_flags`
  Add new articles
  Update examples
This commit is contained in:
Ivan Kravets
2016-07-09 19:01:43 +03:00
17 changed files with 115 additions and 75 deletions

View File

@ -32,6 +32,7 @@ PlatformIO 2.0
* Updated Microchip PIC32 Arduino framework to v1.2.1 * Updated Microchip PIC32 Arduino framework to v1.2.1
* Documented `uploading of EEPROM data <http://docs.platformio.org/en/latest/platforms/atmelavr.html#upload-eeprom-data>`__ * Documented `uploading of EEPROM data <http://docs.platformio.org/en/latest/platforms/atmelavr.html#upload-eeprom-data>`__
(from EEMEM directive) (from EEMEM directive)
* Added ``Rebuild C/C++ Project Index`` target to CLion and Eclipse IDEs
* Improved project generator for `CLion IDE <http://docs.platformio.org/en/latest/ide/clion.html>`__ * Improved project generator for `CLion IDE <http://docs.platformio.org/en/latest/ide/clion.html>`__
* Auto-remove project cache when PlatformIO is upgraded * Auto-remove project cache when PlatformIO is upgraded
* Keep user changes for ``.gitignore`` file when re-generate/update project data * Keep user changes for ``.gitignore`` file when re-generate/update project data

View File

@ -23,6 +23,9 @@ Here are recent articles about PlatformIO:
2016 2016
^^^^ ^^^^
* Jul 5, 2016 - **Ivan Kravets, Ph.D.** - `Explore the new development instruments for Arduino with PlatformIO ecosystem <http://www.slideshare.net/ivankravets/explore-the-new-development-instruments-for-arduino-with-platformio-ecosystem>`_
* Jul 5, 2016 - **Belinda** - `Monte Bianco Arduino Developer Summit <http://www.arduino.org/blog/arduino-developer-summit>`_
* Jul 1, 2016 - **Tam Hanna** - `Mikrocontroller-Gipfel in den Alpen: Arduino Developer Summit, Tag eins (Microcontroller peaks in the Alps: Arduino Developer Summit, Day One, German) <http://www.heise.de/make/meldung/Mikrocontroller-Gipfel-in-den-Alpen-Arduino-Developer-Summit-Tag-eins-3252421.html>`_
* Jun 14, 2016 - **Glyn Hudson** - `OpenEnergyMonitor Part 2/3: Firmware Continuous Test & Build <https://blog.openenergymonitor.org/2016/06/auto-build-continuous-test-firmware/>`_ * Jun 14, 2016 - **Glyn Hudson** - `OpenEnergyMonitor Part 2/3: Firmware Continuous Test & Build <https://blog.openenergymonitor.org/2016/06/auto-build-continuous-test-firmware/>`_
* Jun 13, 2016 - **Daniel Eichhorn** - `New Weather Station Demo on Github <http://blog.squix.org/2016/06/new-weather-station-demo-on-github.html>`_ * Jun 13, 2016 - **Daniel Eichhorn** - `New Weather Station Demo on Github <http://blog.squix.org/2016/06/new-weather-station-demo-on-github.html>`_
* Jun 12, 2016 - **Glyn Hudson** - `OpenEnergyMonitor Part 1/3: PlatformIO open-source embedded development ecosystem <https://blog.openenergymonitor.org/2016/06/platformio/>`_ * Jun 12, 2016 - **Glyn Hudson** - `OpenEnergyMonitor Part 1/3: PlatformIO open-source embedded development ecosystem <https://blog.openenergymonitor.org/2016/06/platformio/>`_

View File

@ -53,16 +53,20 @@ There are 6 predefined targets for building (*NOT FOR RUNNING*, see marks on
the screenshot below): the screenshot below):
* ``PLATFORMIO_BUILD`` - Build project without auto-uploading * ``PLATFORMIO_BUILD`` - Build project without auto-uploading
* ``PLATFORMIO_UPLOAD`` - Build and upload (if no errors). * ``PLATFORMIO_UPLOAD`` - Build and upload (if no errors)
* ``PLATFORMIO_CLEAN`` - Clean compiled objects. * ``PLATFORMIO_CLEAN`` - Clean compiled objects
* ``PLATFORMIO_PROGRAM`` - Build and upload using external programmer (if no errors), see :ref:`atmelavr_upload_via_programmer`. * ``PLATFORMIO_PROGRAM`` - Build and upload using external programmer
* ``PLATFORMIO_UPLOADFS`` - Upload files to file system SPIFFS, see :ref:`platform_espressif_uploadfs`. (if no errors), see :ref:`atmelavr_upload_via_programmer`
* ``PLATFORMIO_UPDATE`` - Update installed platforms and libraries via :ref:`cmd_update`. * ``PLATFORMIO_UPLOADFS`` - Upload files to file system SPIFFS,
see :ref:`platform_espressif_uploadfs`
* ``PLATFORMIO_UPDATE`` - Update installed platforms and libraries via :ref:`cmd_update`
* ``PLATFORMIO_REBUILD_PROJECT_INDEX`` - Rebuild C/C++ Index for the Project.
Allows to fix code completion and code linting issues.
.. warning:: .. warning::
The libraries which are added, installed or used in the project The libraries which are added, installed or used in the project
after generating process wont be reflected in IDE. To fix it you after generating process wont be reflected in IDE. To fix it please run
need to reinitialize project using :ref:`cmd_init` (repeat it). ``PLATFORMIO_REBUILD_PROJECT_INDEX`` target.
Articles / Manuals Articles / Manuals
------------------ ------------------

View File

@ -51,7 +51,7 @@ Then:
``Menu: File > Import... > General > Existing Projects into Workspace > Next`` ``Menu: File > Import... > General > Existing Projects into Workspace > Next``
and specify root directory where is located :ref:`projectconf` and specify root directory where is located :ref:`projectconf`
2. Open source file from ``src`` directory (``*.c, *.cpp, *.ino, etc.``) 2. Open source file from ``src`` directory (``*.c, *.cpp, *.ino, etc.``)
3. Build project using ``Menu: Project > Build Project`` or preconfigured 3. Build project using ``Menu: Project > Build Project`` or pre-configured
Make Targets (see screenshot below): Make Targets (see screenshot below):
+ ``PlatformIO: Build`` - Build project without auto-uploading + ``PlatformIO: Build`` - Build project without auto-uploading
@ -59,17 +59,24 @@ Then:
+ ``PlatformIO: Upload`` - Build and upload (if no errors) + ``PlatformIO: Upload`` - Build and upload (if no errors)
+ ``PlatformIO: Upload using Programmer`` see :ref:`atmelavr_upload_via_programmer` + ``PlatformIO: Upload using Programmer`` see :ref:`atmelavr_upload_via_programmer`
+ ``PlatformIO: Upload SPIFFS image`` see :ref:`platform_espressif_uploadfs` + ``PlatformIO: Upload SPIFFS image`` see :ref:`platform_espressif_uploadfs`
+ ``PlatformIO: Update platforms and libraries`` - Update installed platforms and libraries via :ref:`cmd_update`. + ``PlatformIO: Update platforms and libraries`` - Update installed
platforms and libraries via :ref:`cmd_update`
+ ``PlatformIO: Rebuild C/C++ Project Index`` - Rebuild C/C++ Index for the Project.
Allows to fix code completion and code linting issues.
If you have some problems with unresolved includes, defines, etc., then If you have some problems with unresolved includes, defines, etc., then
* Restart Eclipse IDE 1. Rebuild PlatformIO Project Index:
* Rebuild index using ``Menu: Project > C/C++ Index > Rebuild``. ``PlatformIO: Rebuild C/C++ Project Index`` target
2. Rebuild Eclipse Project Index: ``Menu: Project > C/C++ Index > Rebuild``
3. Refresh Project, right click on the project ``Project > Refresh`` (F5) or
restart Eclipse IDE.
.. warning:: .. warning::
The libraries which are added, installed or used in the project The libraries which are added, installed or used in the project
after generating process wont be reflected in IDE. To fix it you after generating process wont be reflected in IDE. To fix it please run
need to reinitialize project using :ref:`cmd_init` (repeat it). ``PlatformIO: Rebuild C/C++ Project Index`` target and right click on the
project and ``Project > Refresh`` (F5).
Live Integration Live Integration
---------------- ----------------

View File

@ -389,6 +389,10 @@ Example:
[env:specific_ld_script] [env:specific_ld_script]
build_flags = -Wl,-T/path/to/ld_script.ld build_flags = -Wl,-T/path/to/ld_script.ld
[env:exec_command]
# get VCS revision "on-the-fly"
build_flags = !echo "-DPIO_SRC_REV="$(git rev-parse HEAD)
For more detailed information about available flags/options go to: For more detailed information about available flags/options go to:

View File

@ -61,7 +61,7 @@ def LoadDevPlatform(env, variables):
installed_packages = p.get_installed_packages() installed_packages = p.get_installed_packages()
# Add toolchains and uploaders to $PATH # Add toolchains and uploaders to $PATH
for name in installed_packages.keys(): for name in installed_packages:
type_ = p.get_package_type(name) type_ = p.get_package_type(name)
if type_ not in ("toolchain", "uploader"): if type_ not in ("toolchain", "uploader"):
continue continue
@ -78,7 +78,7 @@ def LoadDevPlatform(env, variables):
return return
board_config = env.BoardConfig() board_config = env.BoardConfig()
for k in variables.keys(): for k in variables:
if (k in env or if (k in env or
not any([k.startswith("BOARD_"), k.startswith("UPLOAD_")])): not any([k.startswith("BOARD_"), k.startswith("UPLOAD_")])):
continue continue

View File

@ -163,7 +163,7 @@ def DumpIDEData(env):
# includes from toolchains # includes from toolchains
p = env.DevPlatform() p = env.DevPlatform()
for name in p.get_installed_packages().keys(): for name in p.get_installed_packages():
if p.get_package_type(name) != "toolchain": if p.get_package_type(name) != "toolchain":
continue continue
toolchain_dir = p.get_package_dir(name) toolchain_dir = p.get_package_dir(name)
@ -179,7 +179,9 @@ def DumpIDEData(env):
def get_defines(env_): def get_defines(env_):
defines = [] defines = []
# global symbols # global symbols
for item in env.Flatten(env_.get("CPPDEFINES", [])): for item in env_.get("CPPDEFINES", []):
if isinstance(item, list) or isinstance(item, tuple):
item = "=".join(item)
defines.append(env_.subst(item).replace('\\"', '"')) defines.append(env_.subst(item).replace('\\"', '"'))
# special symbol for Atmel AVR MCU # special symbol for Atmel AVR MCU
@ -200,13 +202,17 @@ def DumpIDEData(env):
"includes": get_includes(env_), "includes": get_includes(env_),
"cc_flags": env_.subst(LINTCCOM), "cc_flags": env_.subst(LINTCCOM),
"cxx_flags": env_.subst(LINTCXXCOM), "cxx_flags": env_.subst(LINTCXXCOM),
"cc_path": util.where_is_program(
env_.subst("$CC"), env_.subst("${ENV['PATH']}")),
"cxx_path": util.where_is_program( "cxx_path": util.where_is_program(
env_.subst("$CXX"), env_.subst("${ENV['PATH']}")) env_.subst("$CXX"), env_.subst("${ENV['PATH']}"))
} }
# https://github.com/platformio/platformio-atom-ide/issues/34 # https://github.com/platformio/platformio-atom-ide/issues/34
_new_defines = [] _new_defines = []
for item in env.Flatten(env_.get("CPPDEFINES", [])): for item in env_.get("CPPDEFINES", []):
if isinstance(item, list) or isinstance(item, tuple):
item = "=".join(item)
item = item.replace('\\"', '"') item = item.replace('\\"', '"')
if " " in item: if " " in item:
_new_defines.append(item.replace(" ", "\\\\ ")) _new_defines.append(item.replace(" ", "\\\\ "))

View File

@ -123,7 +123,7 @@ void output_complete(void)
"Please remove it manually." % file_) "Please remove it manually." % file_)
framework = env.subst("$FRAMEWORK").lower() framework = env.subst("$FRAMEWORK").lower()
if framework not in FRAMEWORK_PARAMETERS.keys(): if framework not in FRAMEWORK_PARAMETERS:
env.Exit( env.Exit(
"Error: %s framework doesn't support testing feature!" % framework) "Error: %s framework doesn't support testing feature!" % framework)
else: else:

View File

@ -153,7 +153,7 @@ def ProcessUnFlags(env, flags):
all_flags.extend(items) all_flags.extend(items)
all_flags = set(all_flags) all_flags = set(all_flags)
for key in parsed_flags.keys(): for key in parsed_flags:
cur_flags = set(env.get(key, [])) cur_flags = set(env.get(key, []))
for item in cur_flags & all_flags: for item in cur_flags & all_flags:
while item in env[key]: while item in env[key]:

View File

@ -89,6 +89,10 @@ def cli(ctx, project_dir, board, ide, # pylint: disable=R0913
) )
if ide: if ide:
if not board:
board = get_first_board(project_dir)
if board:
board = [board]
if not board: if not board:
raise exception.BoardNotDefined() raise exception.BoardNotDefined()
if len(board) > 1: if len(board) > 1:
@ -100,8 +104,7 @@ def cli(ctx, project_dir, board, ide, # pylint: disable=R0913
"your list '%s'." % (board[0], ", ".join(board)), "your list '%s'." % (board[0], ", ".join(board)),
fg="yellow" fg="yellow"
) )
pg = ProjectGenerator( pg = ProjectGenerator(project_dir, ide, board[0])
project_dir, ide, board[0])
pg.generate() pg.generate()
click.secho( click.secho(
@ -117,6 +120,17 @@ def cli(ctx, project_dir, board, ide, # pylint: disable=R0913
) )
def get_first_board(project_dir):
with util.cd(project_dir):
config = util.get_project_config()
for section in config.sections():
if not section.startswith("env:"):
continue
elif config.has_option(section, "board"):
return config.get(section, "board")
return None
def init_base_project(project_dir): def init_base_project(project_dir):
platformio_ini = join(project_dir, "platformio.ini") platformio_ini = join(project_dir, "platformio.ini")
if not isfile(platformio_ini): if not isfile(platformio_ini):

View File

@ -153,7 +153,7 @@ def lib_install(ctx, libid, version):
def lib_install_dependency(ctx, data): def lib_install_dependency(ctx, data):
assert isinstance(data, dict) assert isinstance(data, dict)
query = [] query = []
for key in data.keys(): for key in data:
if key in ("authors", "frameworks", "platforms", "keywords"): if key in ("authors", "frameworks", "platforms", "keywords"):
values = data[key] values = data[key]
if not isinstance(values, list): if not isinstance(values, list):

View File

@ -32,6 +32,9 @@ class ProjectGenerator(object):
self.board = board self.board = board
self._tplvars = {} self._tplvars = {}
with util.cd(self.project_dir):
self.project_src_dir = util.get_projectsrc_dir()
self._gather_tplvars() self._gather_tplvars()
@staticmethod @staticmethod
@ -94,7 +97,7 @@ class ProjectGenerator(object):
def get_src_files(self): def get_src_files(self):
result = [] result = []
with util.cd(self.project_dir): with util.cd(self.project_dir):
for root, _, files in os.walk(util.get_projectsrc_dir()): for root, _, files in os.walk(self.project_src_dir):
for f in files: for f in files:
result.append(relpath(join(root, f))) result.append(relpath(join(root, f)))
return result return result
@ -157,6 +160,7 @@ class ProjectGenerator(object):
"src_files": self.get_src_files(), "src_files": self.get_src_files(),
"user_home_dir": abspath(expanduser("~")), "user_home_dir": abspath(expanduser("~")),
"project_dir": self.project_dir, "project_dir": self.project_dir,
"project_src_dir": self.project_src_dir,
"systype": util.get_systype(), "systype": util.get_systype(),
"platformio_path": self._fix_os_path( "platformio_path": self._fix_os_path(
util.where_is_program("platformio")), util.where_is_program("platformio")),

View File

@ -10,6 +10,7 @@
<config projectName="{{project_name}}" targetName="PLATFORMIO_PROGRAM" /> <config projectName="{{project_name}}" targetName="PLATFORMIO_PROGRAM" />
<config projectName="{{project_name}}" targetName="PLATFORMIO_UPLOADFS" /> <config projectName="{{project_name}}" targetName="PLATFORMIO_UPLOADFS" />
<config projectName="{{project_name}}" targetName="PLATFORMIO_UPDATE_ALL" /> <config projectName="{{project_name}}" targetName="PLATFORMIO_UPDATE_ALL" />
<config projectName="{{project_name}}" targetName="PLATFORMIO_REBUILD_PROJECT_INDEX" />
<config projectName="{{project_name}}" targetName="DEBUG" /> <config projectName="{{project_name}}" targetName="DEBUG" />
</generated> </generated>
</component> </component>
@ -39,28 +40,14 @@
</component> </component>
<component name="FileEditorManager"> <component name="FileEditorManager">
<leaf> <leaf>
<file leaf-file-name="CMakeLists.txt" pinned="false" current-in-tab="true"> <file leaf-file-name="platformio.ini" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/CMakeLists.txt"> <entry file="file://$PROJECT_DIR$/platformio.ini"></entry>
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.15758981">
<caret line="8" column="49" selection-start-line="8" selection-start-column="49" selection-end-line="8" selection-end-column="49" />
<folding />
</state>
</provider>
</entry>
</file> </file>
% for file in src_files: % for file in src_files:
<file leaf-file-name="{{file}}" pinned="false" current-in-tab="false"> <file leaf-file-name="file://$PROJECT_DIR$/{{file}}" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR/${{file}}"> <entry file="file://$PROJECT_DIR/${{file}}"></entry>
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="24" column="4" selection-start-line="24" selection-start-column="4" selection-end-line="24" selection-end-column="4" />
<folding />
</state>
</provider>
</entry>
</file> </file>
% end % end
</leaf> </leaf>
</component> </component>
<component name="JsBuildToolGruntFileManager" detection-done="true" /> <component name="JsBuildToolGruntFileManager" detection-done="true" />
@ -113,6 +100,8 @@
<autoscrollToSource /> <autoscrollToSource />
<autoscrollFromSource /> <autoscrollFromSource />
<sortByType /> <sortByType />
<manualOrder />
<foldersAlwaysOnTop value="true" />
</navigator> </navigator>
<panes> <panes>
<pane id="ProjectPane"> <pane id="ProjectPane">
@ -120,13 +109,13 @@
<PATH> <PATH>
<PATH_ELEMENT> <PATH_ELEMENT>
<option name="myItemId" value="{{project_name}}" /> <option name="myItemId" value="{{project_name}}" />
<option name="myItemType" value="com.jetbrains.cidr.projectView.CidrFilesViewHelper$1$1" /> <option name="myItemType" value="com.jetbrains.cidr.projectView.CidrFilesViewHelper$MyProjectTreeStructure$1" />
</PATH_ELEMENT> </PATH_ELEMENT>
</PATH> </PATH>
<PATH> <PATH>
<PATH_ELEMENT> <PATH_ELEMENT>
<option name="myItemId" value="{{project_name}}" /> <option name="myItemId" value="{{project_name}}" />
<option name="myItemType" value="com.jetbrains.cidr.projectView.CidrFilesViewHelper$1$1" /> <option name="myItemType" value="com.jetbrains.cidr.projectView.CidrFilesViewHelper$MyProjectTreeStructure$1" />
</PATH_ELEMENT> </PATH_ELEMENT>
<PATH_ELEMENT> <PATH_ELEMENT>
<option name="myItemId" value="{{project_name}}" /> <option name="myItemId" value="{{project_name}}" />
@ -136,7 +125,7 @@
<PATH> <PATH>
<PATH_ELEMENT> <PATH_ELEMENT>
<option name="myItemId" value="{{project_name}}" /> <option name="myItemId" value="{{project_name}}" />
<option name="myItemType" value="com.jetbrains.cidr.projectView.CidrFilesViewHelper$1$1" /> <option name="myItemType" value="com.jetbrains.cidr.projectView.CidrFilesViewHelper$MyProjectTreeStructure$1" />
</PATH_ELEMENT> </PATH_ELEMENT>
<PATH_ELEMENT> <PATH_ELEMENT>
<option name="myItemId" value="{{project_name}}" /> <option name="myItemId" value="{{project_name}}" />
@ -155,7 +144,7 @@
<property name="recentsLimit" value="5" /> <property name="recentsLimit" value="5" />
<property name="settings.editor.selected.configurable" value="CPPToolchains" /> <property name="settings.editor.selected.configurable" value="CPPToolchains" />
<property name="settings.editor.splitter.proportion" value="0.2" /> <property name="settings.editor.splitter.proportion" value="0.2" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/CMakeLists.txt" /> <property name="last_opened_file_path" value="$PROJECT_DIR$/platformio.ini" />
<property name="restartRequiresConfirmation" value="true" /> <property name="restartRequiresConfirmation" value="true" />
<property name="FullScreen" value="false" /> <property name="FullScreen" value="false" />
</component> </component>
@ -201,7 +190,11 @@
<envs /> <envs />
<method /> <method />
</configuration> </configuration>
<list size="7"> <configuration default="false" name="PLATFORMIO_REBUILD_PROJECT_INDEX" type="CMakeRunConfiguration" factoryName="Application" WORKING_DIR="" PASS_PARENT_ENVS="FALSE" PROJECT_NAME="{{project_name}}" TARGET_NAME="PLATFORMIO_REBUILD_PROJECT_INDEX" CONFIG_NAME="Debug">
<envs />
<method />
</configuration>
<list size="8">
<item index="0" class="java.lang.String" itemvalue="Application.Build All" /> <item index="0" class="java.lang.String" itemvalue="Application.Build All" />
<item index="1" class="java.lang.String" itemvalue="Application.PLATFORMIO_BUILD" /> <item index="1" class="java.lang.String" itemvalue="Application.PLATFORMIO_BUILD" />
<item index="3" class="java.lang.String" itemvalue="Application.PLATFORMIO_UPLOAD" /> <item index="3" class="java.lang.String" itemvalue="Application.PLATFORMIO_UPLOAD" />
@ -209,6 +202,7 @@
<item index="5" class="java.lang.String" itemvalue="Application.PLATFORMIO_PROGRAM" /> <item index="5" class="java.lang.String" itemvalue="Application.PLATFORMIO_PROGRAM" />
<item index="4" class="java.lang.String" itemvalue="Application.PLATFORMIO_UPLOADFS" /> <item index="4" class="java.lang.String" itemvalue="Application.PLATFORMIO_UPLOADFS" />
<item index="6" class="java.lang.String" itemvalue="Application.PLATFORMIO_UPDATE" /> <item index="6" class="java.lang.String" itemvalue="Application.PLATFORMIO_UPDATE" />
<item index="7" class="java.lang.String" itemvalue="Application.PLATFORMIO_REBUILD_PROJECT_INDEX" />
</list> </list>
</component> </component>
<component name="ShelveChangesManager" show_recycled="false" /> <component name="ShelveChangesManager" show_recycled="false" />
@ -225,27 +219,10 @@
<servers /> <servers />
</component> </component>
<component name="ToolWindowManager"> <component name="ToolWindowManager">
<frame x="252" y="21" width="1400" height="1000" extended-state="0" /> <frame x="181" y="23" width="1400" height="1000" extended-state="0" />
<editor active="true" /> <editor active="true" />
<layout> <layout>
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.25" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" /> <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.24945612" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="CMake" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32996634" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32996634" sideWeight="0.4631503" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32996634" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32996634" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.32996634" sideWeight="0.53684974" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
</layout> </layout>
</component> </component>
<component name="Vcs.Log.UiProperties"> <component name="Vcs.Log.UiProperties">
@ -280,4 +257,4 @@
</state> </state>
</states> </states>
</component> </component>
</project> </project>

View File

@ -3,10 +3,6 @@ project({{project_name}})
include(CMakeListsPrivate.txt) include(CMakeListsPrivate.txt)
% for define in defines:
add_definitions(-D{{!define}})
% end
add_custom_target( add_custom_target(
PLATFORMIO_BUILD ALL PLATFORMIO_BUILD ALL
COMMAND ${PLATFORMIO_CMD} -f -c clion run COMMAND ${PLATFORMIO_CMD} -f -c clion run
@ -43,5 +39,10 @@ add_custom_target(
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
) )
aux_source_directory(src SRC_LIST) add_custom_target(
PLATFORMIO_REBUILD_PROJECT_INDEX ALL
COMMAND ${PLATFORMIO_CMD} -f -c clion init --ide clion
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
add_executable(${PROJECT_NAME} ${SRC_LIST}) add_executable(${PROJECT_NAME} ${SRC_LIST})

View File

@ -1,6 +1,15 @@
set(ENV{PATH} "{{env_path}}") set(ENV{PATH} "{{env_path}}")
set(PLATFORMIO_CMD "{{platformio_path}}") set(PLATFORMIO_CMD "{{platformio_path}}")
SET(CMAKE_C_COMPILER "{{cc_path}}")
SET(CMAKE_CXX_COMPILER "{{cxx_path}}")
SET(CMAKE_CXX_FLAGS_DISTRIBUTION "{{cxx_flags}}")
SET(CMAKE_C_FLAGS_DISTRIBUTION "{{cc_flags}}")
% for define in defines:
add_definitions(-D{{!define}})
% end
% for include in includes: % for include in includes:
% if include.startswith(user_home_dir): % if include.startswith(user_home_dir):
% if "windows" in systype: % if "windows" in systype:
@ -11,4 +20,6 @@ include_directories("$ENV{HOME}{{include.replace(user_home_dir, '').replace("\\"
% else: % else:
include_directories("{{include.replace("\\", "/")}}") include_directories("{{include.replace("\\", "/")}}")
% end % end
% end % end
aux_source_directory({{project_src_dir}} SRC_LIST)

View File

@ -166,6 +166,14 @@
<useDefaultCommand>true</useDefaultCommand> <useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>false</runAllBuilders> <runAllBuilders>false</runAllBuilders>
</target> </target>
<target name="PlatformIO: Rebuild C/C++ Project Index" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>platformio</buildCommand>
<buildArguments>-f -c eclipse</buildArguments>
<buildTarget>init --ide eclipse</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>false</runAllBuilders>
</target>
</buildTargets> </buildTargets>
</storageModule> </storageModule>
</cproject> </cproject>

View File

@ -200,7 +200,7 @@ class PlatformPackagesMixin(object):
return True return True
def update_packages(self): def update_packages(self):
for name in self.get_installed_packages().keys(): for name in self.get_installed_packages():
self.pm.update(name, self.packages[name]['version']) self.pm.update(name, self.packages[name]['version'])
def are_outdated_packages(self): def are_outdated_packages(self):