Skip to content

Commit

Permalink
Added iterate_configurations()
Browse files Browse the repository at this point in the history
  • Loading branch information
burgerbecky committed Oct 6, 2024
1 parent c0f7872 commit 5c22577
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 2 deletions.
3 changes: 1 addition & 2 deletions docs/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -1030,8 +1030,7 @@ EXCLUDE_SYMLINKS = NO
# Note that the wildcards are matched against the file with absolute path, so to
# exclude all test directories for example use the pattern */test/*

EXCLUDE_PATTERNS = conf.py \
build_rules.py
EXCLUDE_PATTERNS = conf.py

# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
# (namespaces, classes, functions, etc.) that should be excluded from the
Expand Down
11 changes: 11 additions & 0 deletions docs/functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,17 @@ util.fixup_args
^^^^^^^^^^^^^^^
.. doxygenfunction:: makeprojects::util::fixup_args

util.convert_file_name
^^^^^^^^^^^^^^^^^^^^^^
.. doxygenfunction:: makeprojects::util::convert_file_name

util.do_generate_build_rules
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. doxygenfunction:: makeprojects::util::do_generate_build_rules

util.iterate_configurations
^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. doxygenfunction:: makeprojects::util::iterate_configurations

Defaults
--------
Expand Down
24 changes: 24 additions & 0 deletions makeprojects/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -589,3 +589,27 @@ def do_generate_build_rules(parsed, working_directory):
# Save the build_rules.py file
return save_default(working_directory,
destinationfile=parsed.rules_file)

########################################


def iterate_configurations(solution):
"""
Iterate all configurations in a solution.
Given a solution, iterate over all of the configurations within
the solution and return each object.
Args:
solution: Solution object.
Returns:
Iterator that returns configuration objects.
"""

# Test all the projects and configurations
for project in solution.project_list:

# Create sets of configuration names and projects
for configuration in project.configuration_list:
yield configuration
1 change: 1 addition & 0 deletions unittests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ def test_configuration(self):
Test Configuration class.
"""

# pylint: disable=no-value-for-parameter
# Must have a name
with self.assertRaises(TypeError):
c = Configuration()
Expand Down

0 comments on commit 5c22577

Please sign in to comment.