|
| 1 | +# Copyright 2014-present PlatformIO <contact@platformio.org> |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +"""Pumbaa |
| 16 | +
|
| 17 | +Pumbaa is Python on top of Simba. |
| 18 | +
|
| 19 | +The implementation is a port of MicroPython, designed for embedded |
| 20 | +devices with limited amount of RAM and code memory. |
| 21 | +
|
| 22 | +http://pumbaa.readthedocs.org |
| 23 | +
|
| 24 | +""" |
| 25 | + |
| 26 | +from os.path import join, sep |
| 27 | + |
| 28 | +from SCons.Script import DefaultEnvironment, SConscript |
| 29 | + |
| 30 | +from platformio.builder.tools import platformio as platformio_tool |
| 31 | + |
| 32 | +# |
| 33 | +# Backward compatibility with PlatformIO 2.0 |
| 34 | +# |
| 35 | +platformio_tool.SRC_DEFAULT_FILTER = " ".join([ |
| 36 | + "+<*>", "-<.git%s>" % sep, "-<svn%s>" % sep, |
| 37 | + "-<example%s>" % sep, "-<examples%s>" % sep, |
| 38 | + "-<test%s>" % sep, "-<tests%s>" % sep |
| 39 | +]) |
| 40 | + |
| 41 | + |
| 42 | +def LookupSources(env, variant_dir, src_dir, duplicate=True, src_filter=None): |
| 43 | + return env.CollectBuildFiles(variant_dir, src_dir, src_filter, duplicate) |
| 44 | + |
| 45 | + |
| 46 | +def VariantDirWrap(env, variant_dir, src_dir, duplicate=False): |
| 47 | + env.VariantDir(variant_dir, src_dir, duplicate) |
| 48 | + |
| 49 | + |
| 50 | +env = DefaultEnvironment() |
| 51 | + |
| 52 | +env.AddMethod(LookupSources) |
| 53 | +env.AddMethod(VariantDirWrap) |
| 54 | + |
| 55 | +env.Replace( |
| 56 | + PLATFORMFW_DIR=env.PioPlatform().get_package_dir("framework-pumbaa") |
| 57 | +) |
| 58 | + |
| 59 | +SConscript( |
| 60 | + [env.subst(join("$PLATFORMFW_DIR", "make", "platformio.sconscript"))]) |
0 commit comments