Example #1
0
    def test_buildsystem_narrowing_complex(self):
        self.complex_system()

        self.bsg.finalize()

        new_bsg = narrow_buildsystem('c', self.bsg)

        for i in ['c', 'r', 'l']:
            self.assertTrue(i in new_bsg._process_tree)

        self.assertTrue(len(new_bsg._process_tree) == 3)
Example #2
0
    def test_buildsystem_narrowing_complex(self):
        self.complex_system()

        self.bsg.finalize()

        new_bsg  = narrow_buildsystem('c', self.bsg)

        for i in ['c', 'r', 'l']:
            self.assertTrue(i in new_bsg._process_tree)

        self.assertTrue(len(new_bsg._process_tree) == 3)
Example #3
0
def stages(jobs, stages, file, check):
    """
    Main public function to generate and run a
    :class:`~system.BuildSystemGenerator()` build system.
    """

    if os.path.isdir('buildc') or os.path.exists('buildc.py'):
        try:
            from buildc import functions
        except ImportError:
            from buildc import funcs as functions
        else:
            functions = None
    else:
        functions = None

    strings = _import_strings()
    bsg = BuildSystemGenerator(functions)
    bsg.check_method = check

    if functions is None:
        logger.info('no python functions pre-loaded')

    for fn in file:
        if fn.endswith('json'):
            bsg.ingest_json(fn, strings)
        elif fn.endswith('yaml') or fn.endswith('yml'):
            bsg.ingest_yaml(fn, strings)
        else:
            logger.warning('format of {0} is unclear, not parsing'.format(fn))

    bsg.finalize()
    bsg.system.workers(jobs)

    if not stages:
        bsg.system.run()
    else:
        bsg = narrow_buildsystem(stages, bsg.system)
        bsg.system.workers(jobs)
        bsg.run()
Example #4
0
def stages(jobs, stages, file, check):
    """
    Main public function to generate and run a
    :class:`~system.BuildSystemGenerator()` build system.
    """

    if os.path.isdir('buildc') or os.path.exists('buildc.py'):
        try:
            from buildc import functions
        except ImportError:
            from buildc import funcs as functions
        else:
            functions = None
    else:
        functions = None

    strings = _import_strings()
    bsg = BuildSystemGenerator(functions)
    bsg.check_method = check

    if functions is None:
        logger.info('no python functions pre-loaded')

    for fn in file:
        if fn.endswith('json'):
            bsg.ingest_json(fn, strings)
        elif fn.endswith('yaml') or fn.endswith('yml'):
            bsg.ingest_yaml(fn, strings)
        else:
            logger.warning('format of {0} is unclear, not parsing'.format(fn))

    bsg.finalize()
    bsg.system.workers(jobs)

    if not stages:
        bsg.system.run()
    else:
        bsg = narrow_buildsystem(stages, bsg.system)
        bsg.system.workers(jobs)
        bsg.run()