Classes | |
class | CMakeSourceBlock |
class | DirectorySpec |
Functions | |
Path | relative_to_source (Path path) |
int | parse_block (List[str] lines, int start_idx) |
Optional[str] | parse_entry (str line) |
List[str] | gather_expected_sources (CMakeSourceBlock block) |
bool | should_ignore_path (Path path) |
bool | update_cmake_block (CMakeSourceBlock block, bool dry_run) |
Optional[Path] | find_self_header (Path source) |
bool | has_include (Sequence[str] lines, Iterable[str] header_variants) |
int | find_insert_index (List[str] lines) |
bool | ensure_self_header_include (Path source, bool dry_run) |
Set[Path] | collect_source_files () |
int | run (bool dry_run, bool cmake_only, bool includes_only) |
int | main () |
Variables | |
PROJECT_ROOT = Path(__file__).resolve().parent.parent | |
str | SOURCE_ROOT = PROJECT_ROOT / "src" |
tuple | SUPPORTED_EXTENSIONS = (".cc", ".c", ".cpp", ".cxx", ".mm") |
tuple | HEADER_EXTENSIONS = (".h", ".hh", ".hpp", ".hxx") |
str | BUILD_CLEANER_IGNORE_TOKEN = "build_cleaner:ignore" |
Automate source list maintenance and self-header includes for YAZE.
Path build_cleaner.relative_to_source | ( | Path | path | ) |
Definition at line 91 of file build_cleaner.py.
Referenced by gather_expected_sources().
int build_cleaner.parse_block | ( | List[str] | lines, |
int | start_idx | ||
) |
Return index of the closing ')' line for a set/list block.
Definition at line 95 of file build_cleaner.py.
Referenced by update_cmake_block().
Optional[str] build_cleaner.parse_entry | ( | str | line | ) |
Definition at line 103 of file build_cleaner.py.
Referenced by update_cmake_block().
List[str] build_cleaner.gather_expected_sources | ( | CMakeSourceBlock | block | ) |
Definition at line 116 of file build_cleaner.py.
References relative_to_source(), and should_ignore_path().
Referenced by update_cmake_block().
bool build_cleaner.should_ignore_path | ( | Path | path | ) |
Definition at line 129 of file build_cleaner.py.
Referenced by ensure_self_header_include(), and gather_expected_sources().
bool build_cleaner.update_cmake_block | ( | CMakeSourceBlock | block, |
bool | dry_run | ||
) |
Definition at line 138 of file build_cleaner.py.
References gather_expected_sources(), parse_block(), and parse_entry().
Referenced by run().
Optional[Path] build_cleaner.find_self_header | ( | Path | source | ) |
Definition at line 227 of file build_cleaner.py.
Referenced by ensure_self_header_include().
bool build_cleaner.has_include | ( | Sequence[str] | lines, |
Iterable[str] | header_variants | ||
) |
Definition at line 235 of file build_cleaner.py.
Referenced by ensure_self_header_include().
int build_cleaner.find_insert_index | ( | List[str] | lines | ) |
Definition at line 240 of file build_cleaner.py.
Referenced by ensure_self_header_include().
bool build_cleaner.ensure_self_header_include | ( | Path | source, |
bool | dry_run | ||
) |
Definition at line 274 of file build_cleaner.py.
References find_insert_index(), find_self_header(), has_include(), and should_ignore_path().
Referenced by run().
Set[Path] build_cleaner.collect_source_files | ( | ) |
Definition at line 310 of file build_cleaner.py.
Referenced by run().
int build_cleaner.run | ( | bool | dry_run, |
bool | cmake_only, | ||
bool | includes_only | ||
) |
Definition at line 326 of file build_cleaner.py.
References collect_source_files(), ensure_self_header_include(), and update_cmake_block().
Referenced by main().
int build_cleaner.main | ( | ) |
Definition at line 347 of file build_cleaner.py.
Referenced by main().
build_cleaner.PROJECT_ROOT = Path(__file__).resolve().parent.parent |
Definition at line 12 of file build_cleaner.py.
str build_cleaner.SOURCE_ROOT = PROJECT_ROOT / "src" |
Definition at line 13 of file build_cleaner.py.
tuple build_cleaner.SUPPORTED_EXTENSIONS = (".cc", ".c", ".cpp", ".cxx", ".mm") |
Definition at line 15 of file build_cleaner.py.
tuple build_cleaner.HEADER_EXTENSIONS = (".h", ".hh", ".hpp", ".hxx") |
Definition at line 16 of file build_cleaner.py.
str build_cleaner.BUILD_CLEANER_IGNORE_TOKEN = "build_cleaner:ignore" |
Definition at line 17 of file build_cleaner.py.