Ejemplo n.º 1
0
def modules():
    """Generate modules to build.

    Each module is a directory with a SConscript file.
    """
    if not _CACHED_MODULES:
        # Build the cache
        def build_dir_skipper(dirpath):
            """Return True if `dirpath` is the build base dir."""
            return os.path.normpath(_BUILD_BASE) == os.path.normpath(dirpath)

        def hidden_dir_skipper(dirpath):
            """Return True if `dirpath` last dir component begins with '.'"""
            last_dir = os.path.basename(dirpath)
            return last_dir.startswith('.')

        for module_path in module_dirs_generator(
                max_depth=7,
                followlinks=False,
                dir_skip_list=[build_dir_skipper, hidden_dir_skipper],
                file_skip_list='.noscons'):
            _CACHED_MODULES.append(module_path)
    # Yield modules from cache
    for module in _CACHED_MODULES:
        yield module
Ejemplo n.º 2
0
def modules():
    """Generate modules to build.

    Each module is a directory with a SConscript file.
    """
    if not _CACHED_MODULES:
        # Build the cache
        build_dirs = [ENV_OVERRIDES[fla]['BUILDROOT'] for fla in flavors()]

        # print('build_dirs: {}'.format(build_dirs))

        def build_dir_skipper(dirpath):
            """Return True if `dirpath` is the build base dir."""
            return (os.path.normpath(_BUILD_BASE) == os.path.normpath(dirpath)) or \
                (os.path.normpath(dirpath) in build_dirs)

        def hidden_dir_skipper(dirpath):
            """Return True if `dirpath` last dir component begins with '.'"""
            last_dir = os.path.basename(dirpath)
            return last_dir.startswith('.')

        for module_path in module_dirs_generator(
                max_depth=_MAX_DEPTH,
                followlinks=False,
                dir_skip_list=[build_dir_skipper, hidden_dir_skipper] +
                _DIR_SKIP_LIST,
                file_skip_list='.noscons'):
            _CACHED_MODULES.append(module_path)
    # Yield modules from cache
    for module in _CACHED_MODULES:
        yield module
Ejemplo n.º 3
0
def modules():
    """Generate modules to build.

    Each module is a directory with a SConscript file.
    """
    if not _CACHED_MODULES:
        # Build the cache
        def build_dir_skipper(dirpath):
            """Return True if `dirpath` is the build base dir."""
            return os.path.normpath(_BUILD_BASE) == os.path.normpath(dirpath)
        def hidden_dir_skipper(dirpath):
            """Return True if `dirpath` last dir component begins with '.'"""
            last_dir = os.path.basename(dirpath)
            return last_dir.startswith('.')
        for module_path in module_dirs_generator(
                max_depth=7, followlinks=False,
                dir_skip_list=[build_dir_skipper, hidden_dir_skipper],
                file_skip_list='.noscons'):
            _CACHED_MODULES.append(module_path)
    # Yield modules from cache
    for module in _CACHED_MODULES:
        yield module