forked from platformio/platformio-core
Handle AVR Symbols when initialising project for IDE // Resolve #216
This commit is contained in:
@ -8,10 +8,12 @@ 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
|
||||
* Use ``include`` directories from toolchain when initialising 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>`_)
|
||||
* Handle Atmel AVR Symbols when initialising project for IDE
|
||||
(`issue #216 <https://github.com/platformio/platformio/issues/216>`_)
|
||||
* Fixed bug with converting ``*.ino`` to ``*.cpp``
|
||||
|
||||
2.0.0 (2015-05-22)
|
||||
|
@ -1,7 +1,7 @@
|
||||
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
||||
# See LICENSE for details.
|
||||
|
||||
VERSION = (2, 0, "1.dev1")
|
||||
VERSION = (2, 0, "1a1")
|
||||
__version__ = ".".join([str(s) for s in VERSION])
|
||||
|
||||
__title__ = "platformio"
|
||||
|
@ -64,16 +64,7 @@ def BuildFirmware(env):
|
||||
Exit()
|
||||
|
||||
if "idedata" in COMMAND_LINE_TARGETS:
|
||||
_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)
|
||||
print json.dumps(env.DumpIDEData())
|
||||
Exit()
|
||||
|
||||
return firmenv.Program(
|
||||
@ -421,6 +412,38 @@ def ConvertInoToCpp(env):
|
||||
atexit.register(delete_tmpcpp_file, tmpcpp_file)
|
||||
|
||||
|
||||
def DumpIDEData(env):
|
||||
data = {
|
||||
"defines": [],
|
||||
"includes": []
|
||||
}
|
||||
|
||||
# includes from framework and libs
|
||||
for item in env.get("VARIANT_DIRS", []):
|
||||
data['includes'].append(env.subst(item[1]))
|
||||
|
||||
# includes from toolchain
|
||||
for item in glob(env.subst(
|
||||
join("$PIOPACKAGES_DIR", "$PIOPACKAGE_TOOLCHAIN",
|
||||
"*", "include"))):
|
||||
data['includes'].append(item)
|
||||
|
||||
# global symbols
|
||||
for item in env.get("CPPDEFINES", []):
|
||||
data['defines'].append(env.subst(item))
|
||||
|
||||
# special symbol for Atmel AVR MCU
|
||||
board = env.get("BOARD_OPTIONS", {})
|
||||
if board and board['platform'] == "atmelavr":
|
||||
data['defines'].append(
|
||||
"__AVR_%s__" % board['build']['mcu'].upper()
|
||||
.replace("ATMEGA", "ATmega")
|
||||
.replace("ATTINY", "ATtiny")
|
||||
)
|
||||
|
||||
return data
|
||||
|
||||
|
||||
def exists(_):
|
||||
return True
|
||||
|
||||
@ -435,4 +458,5 @@ def generate(env):
|
||||
env.AddMethod(BuildLibrary)
|
||||
env.AddMethod(BuildDependentLibraries)
|
||||
env.AddMethod(ConvertInoToCpp)
|
||||
env.AddMethod(DumpIDEData)
|
||||
return env
|
||||
|
Reference in New Issue
Block a user