Exemplo n.º 1
0
def _get_builder():
    ###
    # Output collected recipe information in the builds logs
    ###
    recipe_is_installer = is_installer()
    printer.print_message(
        "Is the package an installer for executable(s)? {}".format(
            str(recipe_is_installer)))

    if not recipe_is_installer:
        recipe_is_unconditional_header_only = is_unconditional_header_only()
        printer.print_message("Is the package header only? {}".format(
            str(recipe_is_unconditional_header_only)))

        if not recipe_is_unconditional_header_only:
            recipe_is_conditional_header_only = is_conditional_header_only()
            printer.print_message(
                "Is the package conditionally header only ('header_only' option)? {}"
                .format(str(recipe_is_conditional_header_only)))

            recipe_is_pure_c = is_pure_c()
            printer.print_message("Is the package C-only? {}".format(
                str(recipe_is_pure_c)))

    _flush_output()

    ###
    # Create builder
    ###
    kwargs = {}

    if autodetect_directory_structure() == DIR_STRUCTURE_ONE_RECIPE_MANY_VERSIONS \
            or autodetect_directory_structure() == DIR_STRUCTURE_CCI:
        kwargs["stable_branch_pattern"] = os.getenv(
            "CONAN_STABLE_BRANCH_PATTERN", "main")

    if recipe_is_installer:
        arch = os.getenv("ARCH", "x86_64")
        builder = build_shared.get_builder(**kwargs)
        builder.add({
            "os": get_os(),
            "arch_build": arch,
            "arch": arch
        }, {}, {}, {})
    elif recipe_is_unconditional_header_only:
        builder = build_shared.get_builder(**kwargs)
        builder.add()
    else:
        builder = _get_default_builder(pure_c=recipe_is_pure_c, **kwargs)

    return builder
def get_builder(args=None, shared_option_name=None, pure_c=True, dll_with_static_runtime=False):

    builder = build_shared.get_builder(args)
    if shared_option_name is None and build_shared.is_shared():
        shared_option_name = "%s:shared" % build_shared.get_name_from_recipe()

    builder.add_common_builds(shared_option_name=shared_option_name, pure_c=pure_c, dll_with_static_runtime=dll_with_static_runtime)

    return builder
Exemplo n.º 3
0
def get_builder(shared_option_name=None,
                pure_c=True,
                dll_with_static_runtime=False,
                build_policy=None,
                cwd=None,
                **kwargs):
    recipe = build_shared.get_recipe_path(cwd)

    builder = build_shared.get_builder(build_policy, cwd=cwd, **kwargs)
    if shared_option_name is None and build_shared.is_shared():
        shared_option_name = "%s:shared" % build_shared.get_name_from_recipe(
            recipe=recipe)

    builder.add_common_builds(shared_option_name=shared_option_name,
                              pure_c=pure_c,
                              dll_with_static_runtime=dll_with_static_runtime,
                              **kwargs)

    return builder
def get_builder(**kwargs):
    return build_shared.get_builder(**kwargs)
def test_build_shared():
    builder = build_shared.get_builder()
    assert 0 == len(builder.items)
Exemplo n.º 6
0
# -*- coding: utf-8 -*-

from bincrafters import build_shared
from conans.util.env_reader import get_env
import os

if __name__ == "__main__":
    build_cpython_installer = get_env("BUILD_CPYTHON_INSTALLER", False)

    if build_cpython_installer:
        subdir = "cpython_installer"
    else:
        subdir = "cpython"

    builder = build_shared.get_builder(
        cwd=os.path.join(os.path.dirname(os.path.realpath(__file__)), subdir),
        docker_entry_script="cd {}".format(subdir))

    if build_cpython_installer:
        arch = get_env("ARCH", None)
        if arch is None:
            raise Exception(
                "cpython_installer does not support cross compilation.")
        builder.add(settings={
            "arch_build": arch,
        })
    else:
        builder.add_common_builds()

    builder.run()
def get_builder(**kwargs):
    builder = build_shared.get_builder(**kwargs)

    builder.add()

    return builder
Exemplo n.º 8
0
# Copyright (c) 2019, Kai Wolf - SW Consulting. All rights reserved.
# For the licensing terms see LICENSE file in the root directory. For the
# list of contributors see the AUTHORS file in the same directory.

from bincrafters import build_shared

if __name__ == "__main__":
    recipe = build_shared.get_recipe_path()
    bbuilder = build_shared.get_builder(build_policy=None)
    shared_option_name = None
    if (build_shared.is_shared()):
        shared_option_name = "%s:shared" % build_shared.get_name_from_recipe(
            recipe=recipe)

    bbuilder.add_common_builds(shared_option_name=shared_option_name,
                               pure_c=False,
                               dll_with_static_runtime=False)
    bbuilder.run()
def get_builder(args=None):
    builder = build_shared.get_builder(args)

    builder.add()

    return builder
def get_builder(args=None):
    return build_shared.get_builder(args)