Esempio n. 1
0
    def __call__(self, *args, **kw):

        denv = DefaultEnvironment()
        env = denv.Clone()
        if self.tool:
            env.Tool(self.tool)

        method = getattr(env, self.method_name)
        return method(*args, **kw)
Esempio n. 2
0
if "build.variants_dir" in env.BoardConfig():
    variants_dir = join("$PROJECT_DIR",
                        env.BoardConfig().get("build.variants_dir"))

if "build.variant" in env.BoardConfig():
    env.Append(
        CPPPATH=[join(variants_dir,
                      env.BoardConfig().get("build.variant"))])
    libs.append(
        env.BuildLibrary(
            join("$BUILD_DIR", "FrameworkArduinoVariant"),
            join(variants_dir,
                 env.BoardConfig().get("build.variant"))))

envsafe = env.Clone()

libs.append(
    envsafe.BuildLibrary(
        join("$BUILD_DIR", "FrameworkArduino"),
        join(FRAMEWORK_DIR, "cores",
             env.BoardConfig().get("build.core"))))

env.Prepend(LIBS=libs)

#
# Generate partition table
#

fwpartitions_dir = join(FRAMEWORK_DIR, "tools", "partitions")
partitions_csv = env.BoardConfig().get("build.arduino.partitions",
Esempio n. 3
0
# Remove project source files from following build stages as they're
# built as part of the framework
def _skip_prj_source_files(node):
    if (node.srcnode().get_path().lower().startswith(
            env.subst("$PROJECT_SRC_DIR").lower())):
        return None
    return node


env.AddBuildMiddleware(_skip_prj_source_files)

# Project files should be compiled only when a special
# option is enabled when running 'test' command
if "__test" not in COMMAND_LINE_TARGETS or env.GetProjectOption(
        "test_build_project_src"):
    project_env = env.Clone()
    if project_target_name != "__idf_main":
        # Manually add dependencies to CPPPATH since ESP-IDF build system doesn't generate
        # this info if the folder with sources is not named 'main'
        # https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/build-system.html#rename-main
        project_env.AppendUnique(CPPPATH=app_includes["plain_includes"])

    # Add include dirs from PlatformIO build system to project CPPPATH so
    # they're visible to PIOBUILDFILES
    project_env.Append(CPPPATH=["$PROJECT_INCLUDE_DIR", "$PROJECT_SRC_DIR"] +
                       project_lib_includes)

    env.Append(PIOBUILDFILES=compile_source_files(
        target_configs.get(project_target_name),
        project_env,
        project_env.subst("$PROJECT_DIR"),
Esempio n. 4
0
    def __call__(self, *args, **kw):

        denv = DefaultEnvironment()
        env = denv.Clone()
        env['BUILDERS']['_SLIM_BUILDER'] = self.builder
        return env._SLIM_BUILDER(*args, **kw)