コード例 #1
0
ファイル: test_basic.py プロジェクト: dagss/Bento
    def test_load_store_simple(self):
        """Test one can load and store the contexts."""
        ctx = get_cfg()
        ctx.store()

        ctx = get_bld()
        ctx.store()
コード例 #2
0
    def test_load_store_simple(self):
        """Test one can load and store the contexts."""
        ctx = get_cfg()
        ctx.store()

        ctx = get_bld()
        ctx.store()
コード例 #3
0
ファイル: test_build.py プロジェクト: abadger/Bento
    def setUp(self):
        super(TestBuildYaku, self).setUp()

        ctx = get_cfg()
        ctx.use_tools(["ctasks", "pyext"])
        ctx.store()

        self.yaku_build = get_bld()

        self._configure_context = ConfigureYakuContext
        self._build_context = BuildYakuContext
コード例 #4
0
import yaku.task_manager

from yaku.task_manager import get_extension_hook, set_file_hook
from yaku.context import get_cfg, get_bld
from yaku.scheduler import run_tasks

def file_hook(self, node):
    print("Yo mama", node.name)
    return get_extension_hook(".c")(self, node)

def configure(ctx):
    ctx.use_tools(["ctasks"])
    set_file_hook(ctx, "src/fubar.c", file_hook)

def build(ctx):
    builder = ctx.builders["ctasks"].program
    builder("src/main", sources=["src/main.c", "src/fubar.c"])

if __name__ == "__main__":
    cfg = get_cfg()
    configure(cfg)
    cfg.store()

    bld = get_bld()
    build(bld)
    run_tasks(bld)
    bld.store()
コード例 #5
0
ファイル: conf_fortran.py プロジェクト: dagss/Bento
    import \
        get_bld, get_cfg

from yaku.conftests.fconftests \
    import \
        check_fcompiler, check_fortran_verbose_flag, \
        check_fortran_runtime_flags, check_fortran_dummy_main, \
        check_fortran_mangling

def configure(ctx):
    ctx.use_tools(["fortran", "ctasks"])
    check_fcompiler(ctx)
    check_fortran_verbose_flag(ctx)
    check_fortran_runtime_flags(ctx)
    check_fortran_dummy_main(ctx)
    check_fortran_mangling(ctx)

def build(ctx):
    builder = ctx.builders["fortran"]
    #builder.program("fbar", ["src/bar.f"])

if __name__ == "__main__":
    ctx = get_cfg()
    configure(ctx)
    ctx.store()

    ctx = get_bld()
    build(ctx)
    run_tasks(ctx)
    ctx.store()
コード例 #6
0
ファイル: example4.py プロジェクト: yuhonghong7035/Bento
    import \
        run_tasks


def configure(ctx):
    # The tool ctask works as follows:
    # - When a tool is *loaded* (load_tool), get its configure function (dummy
    # is setup if no configure is found)
    # - When a tool is *used* (use_tool), run its configure function
    # - given a list of candidates, run the detect function for every candidate
    # until detect returns True
    # - if one candidate found, record its name and run its setup function
    # - if none found, fails
    tools = ctx.use_tools(["ctasks"])


def build(ctx):
    builder = ctx.builders["ctasks"]
    builder.program("main", [os.path.join("src", "main.c")])


if __name__ == "__main__":
    ctx = get_cfg()
    configure(ctx)
    ctx.store()

    ctx = get_bld()
    build(ctx)
    run_tasks(ctx)
    ctx.store()
コード例 #7
0
ファイル: test_basic.py プロジェクト: B-Rich/Bento
    def test_compiler(self):
        ctx = get_cfg()
        ctx.store()

        ctx = get_bld()
        ctx.store()
コード例 #8
0
    import \
        run_tasks
from yaku.context \
    import \
        get_bld, get_cfg


def configure(ctx):
    ctx.use_tools(["ctasks", "cxxtasks"])
    ctx.env.append("DEFINES", "_FOO")


def build(ctx):
    builder = ctx.builders["cxxtasks"]
    builder.program("foo", ["src/main.cxx"])

    builder = ctx.builders["ctasks"]
    builder.static_library("bar", ["src/bar.c"])


if __name__ == "__main__":
    build_path = "BBUILD"
    ctx = get_cfg(build_path=build_path)
    configure(ctx)
    ctx.store()

    ctx = get_bld(build_path=build_path)
    build(ctx)
    run_tasks(ctx)
    ctx.store()
コード例 #9
0
ファイル: example.py プロジェクト: B-Rich/Bento
from yaku.scheduler \
    import \
        run_tasks
from yaku.context \
    import \
        get_bld, get_cfg

def configure(ctx):
    ctx.use_tools(["ctasks", "cxxtasks"])
    ctx.env.append("DEFINES", "_FOO")

def build(ctx):
    builder = ctx.builders["cxxtasks"]
    builder.program("foo", ["src/main.cxx"])

    builder = ctx.builders["ctasks"]
    builder.static_library("bar", ["src/bar.c"])

if __name__ == "__main__":
    build_path = "BBUILD"
    ctx = get_cfg(build_path=build_path)
    configure(ctx)
    ctx.store()

    ctx = get_bld(build_path=build_path)
    build(ctx)
    run_tasks(ctx)
    ctx.store()
コード例 #10
0
    def test_compiler(self):
        ctx = get_cfg()
        ctx.store()

        ctx = get_bld()
        ctx.store()