|
| | validate_enum_type (value, data_type) |
| | Verify a value is a specific data type.
|
| | regex_dict (value) |
| | Convert *.cpp keys to regex keys.
|
| | validate_boolean (value) |
| | Verify a value is a boolean.
|
| | validate_string (value) |
| | Verify a value is a string.
|
| | clear_build_rules_cache () |
| | Clear the build rules cache.
|
| | load_build_rules (path_name, clear_cache=False) |
| | Load build_rules using a cache.
|
| | _do_getattr_build_rules (build_rules, attribute) |
| | Internal function to test attributes.
|
| | getattr_build_rules (build_rules, attributes, fallback=None) |
| | Find an attribute in a build rules module.
|
| | getattr_build_rules_list (build_rules_list, attributes, fallback) |
| | Find an attribute in a list of build rules.
|
| | add_build_rules (build_rules_list, file_name, verbose, is_root, basename) |
| | Load in the file build_rules.py
|
| | get_build_rules (working_directory, verbose, build_rules_name, basename) |
| | Find all build_rules.py files that apply to this directory.
|
| | remove_ending_os_sep (input_list) |
| | Iterate over a string list and remove trailing os separator characters.
|
| | was_processed (processed, path_name, verbose) |
| | Check if a file or directory has already been processed.
|
| | fixup_args (args) |
| | Check unused args if they are directories, files or configurations.
|
| | convert_file_name (item, source_file) |
| | Convert macros to literal filename strings.
|
| | do_generate_build_rules (parsed, working_directory) |
| | Test if the parsed parameters have –generate-rules.
|
| | iterate_configurations (solution) |
| | Iterate all configurations in a solution.
|
The util module contains subroutines used everywhere.
| makeprojects.util.add_build_rules |
( |
| build_rules_list, |
|
|
| file_name, |
|
|
| verbose, |
|
|
| is_root, |
|
|
| basename ) |
Load in the file build_rules.py
Load the build_rules.py file. If the variable *_GENERIC is True or if is_root is True, append the module to build_rules_list. If the variable *_CONTINUE was found in the file, check if it is set to True. If so, return True to allow processing to continue. If the file is not found, return True to allow processing the parent folder.
Since this is called from buildme, cleanme, and makeprojects, the prefix needed for the tool is passed in basename. An example is "CLEANME".
- Parameters
-
| build_rules_list | List to add build_rules.py instances. |
| file_name | Full path name of the build_rules.py to load. |
| verbose | True for verbose output. |
| is_root | True if *_GENERIC is ignored. |
| basename | Variable prefix to substitute * in *_GENERIC |
- Returns
- True if the parent folder should be checked, False if not.
| makeprojects.util.fixup_args |
( |
| args | ) |
|
Check unused args if they are directories, files or configurations.
The args object has the attributes args, directories, configurations, and files. The attribute args has all the unparsed arguments that will be tested to see if they are a file, directory or a string. The entries will be added to their appropriate attribute, with strings appended to configurations. Attribute args is set to None.
- Parameters
-
| args | args class from argparser |
| makeprojects.util.getattr_build_rules |
( |
| build_rules, |
|
|
| attributes, |
|
|
| fallback = None ) |
Find an attribute in a build rules module.
Scan the build rules until an attribute value is found. It will return the first one found. If none are found, this function returns fallback.
This function returns two values, the first is the attribute value, the second is a boolean of True meaning the attribute was found, or False if the default value was returned.
- Parameters
-
| build_rules | build_rules.py module instance. |
| attributes | String or list of strings, attribute name(s). |
| fallback | Value to return if the attribute was not found. |
- Returns
- Tuple of attribute value found in build_rules, or fallback and the second value is True if found, False if default was
-
used.
| makeprojects.util.was_processed |
( |
| processed, |
|
|
| path_name, |
|
|
| verbose ) |
Check if a file or directory has already been processed.
To prevent recursion, expand the path name to an absolution path call this function with a set that will store all the entries and the entry to test. If the entry is already in the set, report the issue and return True. Otherwise, add the entry to the set and return False to allow the path to be processed.
- Parameters
-
| processed | Set to store processed pathnames |
| path_name | Path to a directory or file |
| verbose | True if verbose output is requested |
- Returns
- True if it's already in the set. False if not.