mirror of https://github.com/ARMmbed/mbed-os.git
Exclude folders from build that contain .buildignore file (part of de-fork of mbed HAL+RTOS)
parent
cd4172a80b
commit
b57fbf4c68
|
@ -363,26 +363,24 @@ class mbedToolchain:
|
||||||
for d in copy(dirs):
|
for d in copy(dirs):
|
||||||
dir_path = join(root, d)
|
dir_path = join(root, d)
|
||||||
|
|
||||||
if d == '.hg':
|
if d == '.hg' or d == '.git':
|
||||||
resources.repo_dirs.append(dir_path)
|
resources.repo_dirs.append(dir_path)
|
||||||
resources.repo_files.extend(self.scan_repository(dir_path))
|
resources.repo_files.extend(self.scan_repository(dir_path))
|
||||||
|
|
||||||
should_exclude_path = False
|
if ((d.startswith('.') or d in self.legacy_ignore_dirs) or
|
||||||
|
(d.startswith('TARGET_') and d[7:] not in labels['TARGET']) or
|
||||||
|
(d.startswith('TOOLCHAIN_') and d[10:] not in labels['TOOLCHAIN']) or
|
||||||
|
(d.upper() == 'TESTS') or
|
||||||
|
exists(join(dir_path, '.buildignore'))):
|
||||||
|
dirs.remove(d)
|
||||||
|
|
||||||
if exclude_paths:
|
if exclude_paths:
|
||||||
for exclude_path in exclude_paths:
|
for exclude_path in exclude_paths:
|
||||||
rel_path = relpath(dir_path, exclude_path)
|
rel_path = relpath(dir_path, exclude_path)
|
||||||
if not (rel_path.startswith('..')):
|
if not (rel_path.startswith('..')):
|
||||||
should_exclude_path = True
|
dirs.remove(d)
|
||||||
break
|
break
|
||||||
|
|
||||||
if ((should_exclude_path) or
|
|
||||||
(d.startswith('.') or d in self.legacy_ignore_dirs) or
|
|
||||||
(d.startswith('TARGET_') and d[7:] not in labels['TARGET']) or
|
|
||||||
(d.startswith('TOOLCHAIN_') and d[10:] not in labels['TOOLCHAIN']) or
|
|
||||||
(d == 'TESTS')):
|
|
||||||
dirs.remove(d)
|
|
||||||
|
|
||||||
# Add root to include paths
|
# Add root to include paths
|
||||||
resources.inc_dirs.append(root)
|
resources.inc_dirs.append(root)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue