diff --git a/src/utils/source_resolver.py b/src/utils/source_resolver.py new file mode 100644 index 0000000..e55a3f3 --- /dev/null +++ b/src/utils/source_resolver.py @@ -0,0 +1,19 @@ +import glob +import os +from typing import List, Tuple +from models.project import SourceFile + +def expand_sources(sources: List[SourceFile]) -> List[Tuple[str, str]]: + """ + Expandiert eine Liste von SourceFile-Objekten mit Wildcards in echte Pfade. + + Returns: + List of (library, filepath) + """ + expanded = [] + for source in sources: + matched_files = glob.glob(source.path, recursive=True) + for file in matched_files: + normalized_path = os.path.normpath(file) + expanded.append((source.library, normalized_path)) + return expanded