aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/corelib/buildgraph/buildgraphloader.cpp
diff options
context:
space:
mode:
authorRichard Weickelt <richard@weickelt.de>2023-10-10 23:43:40 +0200
committerRichard Weickelt <richard@weickelt.de>2023-11-01 13:59:32 +0000
commit1490cf65966007ec7564475da9d606d3ae6475fc (patch)
treebc5909d6668db396dc37185cd833042ade8d45bd /src/lib/corelib/buildgraph/buildgraphloader.cpp
parent913a52b48dbf1c92684de9546fab39a4d43148a2 (diff)
Consolidate expansion and modification test in SourceWildcard
In order to make use of SourceWildcard in other contexts, any special relationship to ResolvedGroup is now removed. All information needed to re-expand the wildcards is stored inside the object. The re-expansion test has been moved into the class and the API has been simplified. SourceArtifact objects, no matter if wildcard-based or not are now stored inside ResolvedGroup and are marked by a boolean flag. Task-number: QBS-1749 Change-Id: I53bf2776685b5abf4713341387d1efa23ad316b2 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/lib/corelib/buildgraph/buildgraphloader.cpp')
-rw-r--r--src/lib/corelib/buildgraph/buildgraphloader.cpp24
1 files changed, 5 insertions, 19 deletions
diff --git a/src/lib/corelib/buildgraph/buildgraphloader.cpp b/src/lib/corelib/buildgraph/buildgraphloader.cpp
index f263a3dbd..023931e5c 100644
--- a/src/lib/corelib/buildgraph/buildgraphloader.cpp
+++ b/src/lib/corelib/buildgraph/buildgraphloader.cpp
@@ -598,25 +598,11 @@ bool BuildGraphLoader::hasProductFileChanged(const std::vector<ResolvedProductPt
AccumulatingTimer wildcardTimer(m_parameters.logElapsedTime()
? &m_wildcardExpansionEffort : nullptr);
for (const GroupPtr &group : product->groups) {
- if (!group->wildcards)
- continue;
- const bool reExpansionRequired = Internal::any_of(group->wildcards->dirTimeStamps,
- [](const std::pair<QString, FileTime> &pair) {
- return FileInfo(pair.first).lastModified() > pair.second;
- });
- if (!reExpansionRequired)
- continue;
- const Set<QString> files = group->wildcards->expandPatterns(group->prefix,
- FileInfo::path(group->location.filePath()),
- product->topLevelProject()->buildDirectory);
- Set<QString> wcFiles;
- for (const auto &sourceArtifact : group->wildcards->files)
- wcFiles += sourceArtifact->absoluteFilePath;
- if (files == wcFiles)
- continue;
- hasChanged = true;
- changedProducts.push_back(product);
- break;
+ if (group->wildcards && group->wildcards->hasChangedSinceExpansion()) {
+ hasChanged = true;
+ changedProducts.push_back(product);
+ break;
+ }
}
}
}