Complete the build process in the build tool

This commit is contained in:
Veronica Berglyd Olsen
2023-06-05 23:39:28 +02:00
parent b0201c58e9
commit 9bc66128a7
6 changed files with 156 additions and 112 deletions
+7 -1
View File
@@ -123,6 +123,7 @@ class FilterMode(Enum):
INCLUDED = 2
EXCLUDED = 3
SKIPPED = 4
ROOT = 5
# END Enum FilterMode
@@ -311,7 +312,9 @@ class BuildSettings:
"""Check if a root handle is allowed in the build."""
return tHandle not in self._skipRoot
def buildItemFilter(self, project: NWProject) -> dict[str, tuple[bool, FilterMode]]:
def buildItemFilter(
self, project: NWProject, withRoots: bool = False
) -> dict[str, tuple[bool, FilterMode]]:
"""Return a dictionary of item handles with filter decissions
applied.
"""
@@ -333,6 +336,9 @@ class BuildSettings:
if item.isInactiveClass() or (item.itemRoot in self._skipRoot):
result[tHandle] = (False, FilterMode.SKIPPED)
continue
if withRoots and item.isRootType():
result[tHandle] = (True, FilterMode.ROOT)
continue
if not item.isFileType():
result[tHandle] = (False, FilterMode.SKIPPED)
continue