yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
build_cleaner Namespace Reference

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"
 

Detailed Description

Automate source list maintenance and self-header includes for YAZE.

Function Documentation

◆ relative_to_source()

Path build_cleaner.relative_to_source ( Path  path)

Definition at line 91 of file build_cleaner.py.

Referenced by gather_expected_sources().

◆ parse_block()

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().

◆ parse_entry()

Optional[str] build_cleaner.parse_entry ( str  line)

Definition at line 103 of file build_cleaner.py.

Referenced by update_cmake_block().

◆ gather_expected_sources()

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().

Here is the call graph for this function:

◆ should_ignore_path()

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().

◆ update_cmake_block()

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().

Here is the call graph for this function:

◆ find_self_header()

Optional[Path] build_cleaner.find_self_header ( Path  source)

Definition at line 227 of file build_cleaner.py.

Referenced by ensure_self_header_include().

◆ has_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().

◆ find_insert_index()

int build_cleaner.find_insert_index ( List[str]  lines)

Definition at line 240 of file build_cleaner.py.

Referenced by ensure_self_header_include().

◆ 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().

Here is the call graph for this function:

◆ collect_source_files()

Set[Path] build_cleaner.collect_source_files ( )

Definition at line 310 of file build_cleaner.py.

Referenced by run().

◆ 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().

Here is the call graph for this function:

◆ main()

int build_cleaner.main ( )

Definition at line 347 of file build_cleaner.py.

References main(), and run().

Referenced by main().

Here is the call graph for this function:

Variable Documentation

◆ PROJECT_ROOT

build_cleaner.PROJECT_ROOT = Path(__file__).resolve().parent.parent

Definition at line 12 of file build_cleaner.py.

◆ SOURCE_ROOT

str build_cleaner.SOURCE_ROOT = PROJECT_ROOT / "src"

Definition at line 13 of file build_cleaner.py.

◆ SUPPORTED_EXTENSIONS

tuple build_cleaner.SUPPORTED_EXTENSIONS = (".cc", ".c", ".cpp", ".cxx", ".mm")

Definition at line 15 of file build_cleaner.py.

◆ HEADER_EXTENSIONS

tuple build_cleaner.HEADER_EXTENSIONS = (".h", ".hh", ".hpp", ".hxx")

Definition at line 16 of file build_cleaner.py.

◆ BUILD_CLEANER_IGNORE_TOKEN

str build_cleaner.BUILD_CLEANER_IGNORE_TOKEN = "build_cleaner:ignore"

Definition at line 17 of file build_cleaner.py.