forked from platformio/platformio-core
Use "include" directories from toolchain when exporting project for IDE // Resolve #210
This commit is contained in:
@ -8,6 +8,8 @@ Release History
|
||||
`PLATFORMIO_BUILD_FLAGS <http://docs.platformio.org/en/latest/envvars.html#platformio-build-flags>`_
|
||||
* Pass to API requests information about Continuous Integration system. This
|
||||
information will be used by PlatformIO-API.
|
||||
* Use ``include`` directories from toolchain when exporting project for IDE
|
||||
(`issue #210 <https://github.com/platformio/platformio/issues/210>`_)
|
||||
* Updated `Arduino Framework <http://docs.platformio.org/en/latest/frameworks/arduino.html>`__ to
|
||||
1.6.4 version (`issue #212 <https://github.com/platformio/platformio/issues/212>`_)
|
||||
* Fixed bug with converting ``*.ino`` to ``*.cpp``
|
||||
|
@ -4,6 +4,7 @@
|
||||
import atexit
|
||||
import json
|
||||
import re
|
||||
from glob import glob
|
||||
from os import getenv, listdir, remove, sep, walk
|
||||
from os.path import basename, dirname, isdir, isfile, join, normpath
|
||||
|
||||
@ -66,6 +67,10 @@ def BuildFirmware(env):
|
||||
_data = {"defines": [], "includes": []}
|
||||
for item in env.get("VARIANT_DIRS", []):
|
||||
_data['includes'].append(env.subst(item[1]))
|
||||
for item in glob(env.subst(
|
||||
join("$PIOPACKAGES_DIR", "$PIOPACKAGE_TOOLCHAIN",
|
||||
"*", "include"))):
|
||||
_data['includes'].append(item)
|
||||
for item in env.get("CPPDEFINES", []):
|
||||
_data['defines'].append(env.subst(item))
|
||||
print json.dumps(_data)
|
||||
|
@ -44,7 +44,8 @@ class ProjectGenerator(object):
|
||||
if "env_name" not in envdata:
|
||||
return None
|
||||
result = util.exec_command(
|
||||
["platformio", "run", "-t", "idedata", "-e", envdata['env_name']]
|
||||
["platformio", "run", "-t", "idedata", "-e", envdata['env_name'],
|
||||
"--project-dir", self.project_dir]
|
||||
)
|
||||
if result['returncode'] != 0 or '{"includes":' not in result['out']:
|
||||
return None
|
||||
|
Reference in New Issue
Block a user