Skip to content

Commit

Permalink
Merge branch 'release/v2.4.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
ivankravets committed Dec 1, 2015
2 parents 1bf73c2 + ef5fa4d commit ec9b8f9
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 86 deletions.
5 changes: 5 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ Release History
PlatformIO 2.0
--------------

2.4.1 (2015-12-01)
~~~~~~~~~~~~~~~~~~

* Restored ``PLATFORMIO`` macros with the current version

2.4.0 (2015-12-01)
~~~~~~~~~~~~~~~~~~

Expand Down
2 changes: 1 addition & 1 deletion platformio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

VERSION = (2, 4, 0)
VERSION = (2, 4, 1)
__version__ = ".".join([str(s) for s in VERSION])

__title__ = "platformio"
Expand Down
6 changes: 0 additions & 6 deletions platformio/builder/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,6 @@

env = DefaultEnvironment()

# Append PlatformIO version
env.Append(
CPPDEFINES=["PLATFORMIO={0:02d}{1:02d}{2:02d}".format(
*util.pioversion_to_intstr())]
)

if "BOARD" in env:
try:
env.Replace(BOARD_OPTIONS=util.get_boards(env.subst("$BOARD")))
Expand Down
61 changes: 0 additions & 61 deletions platformio/builder/scripts/frameworks/platformio.py

This file was deleted.

40 changes: 22 additions & 18 deletions platformio/builder/tools/platformio.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
SConscript)
from SCons.Util import case_sensitive_suffixes

from platformio.util import pioversion_to_intstr

SRC_BUILD_EXT = ["c", "cpp", "S", "spp", "SPP", "sx", "s", "asm", "ASM"]
SRC_HEADER_EXT = ["h", "hpp"]
SRC_DEFAULT_FILTER = " ".join([
Expand All @@ -44,9 +46,7 @@ def BuildProgram(env):
env.get("BUILD_FLAGS"),
getenv("PLATFORMIO_BUILD_FLAGS"),
])

env.BuildFrameworks([
f.lower().strip() for f in env.get("FRAMEWORK", "").split(",")])
env.BuildFramework()

# build dependent libs
deplibs = env.BuildDependentLibraries("$PROJECTSRC_DIR")
Expand All @@ -73,6 +73,11 @@ def BuildProgram(env):
getenv("PLATFORMIO_SRC_BUILD_FLAGS"),
])

env.Append(
CPPDEFINES=["PLATFORMIO={0:02d}{1:02d}{2:02d}".format(
*pioversion_to_intstr())]
)

return env.Program(
join("$BUILD_DIR", env.subst("$PROGNAME")),
env.LookupSources(
Expand Down Expand Up @@ -166,24 +171,23 @@ def _match_sources(src_dir, src_filter):
return sources


def BuildFrameworks(env, frameworks):
if not frameworks or "uploadlazy" in COMMAND_LINE_TARGETS:
def BuildFramework(env):
if "FRAMEWORK" not in env or "uploadlazy" in COMMAND_LINE_TARGETS:
return

board_frameworks = env.get("BOARD_OPTIONS", {}).get("frameworks")
if frameworks == ["platformio"]:
if board_frameworks:
frameworks.insert(0, board_frameworks[0])

for f in frameworks:
if f in ("arduino", "energia"):
env.ConvertInoToCpp()
if env['FRAMEWORK'].lower() in ("arduino", "energia"):
env.ConvertInoToCpp()

if f in board_frameworks:
SConscript(env.subst(
join("$PIOBUILDER_DIR", "scripts", "frameworks", "%s.py" % f)))
for f in env['FRAMEWORK'].split(","):
framework = f.strip().lower()
if framework in env.get("BOARD_OPTIONS", {}).get("frameworks"):
SConscript(
env.subst(join("$PIOBUILDER_DIR", "scripts", "frameworks",
"%s.py" % framework))
)
else:
Exit("Error: This board doesn't support %s framework!" % f)
Exit("Error: This board doesn't support %s framework!" %
framework)


def BuildLibrary(env, variant_dir, src_dir, src_filter=None):
Expand Down Expand Up @@ -347,7 +351,7 @@ def generate(env):
env.AddMethod(IsFileWithExt)
env.AddMethod(VariantDirWrap)
env.AddMethod(LookupSources)
env.AddMethod(BuildFrameworks)
env.AddMethod(BuildFramework)
env.AddMethod(BuildLibrary)
env.AddMethod(BuildDependentLibraries)
return env

0 comments on commit ec9b8f9

Please sign in to comment.