diff options
| author | Christian Kandeler <christian.kandeler@digia.com> | 2013-11-20 13:47:55 +0100 |
|---|---|---|
| committer | Christian Kandeler <christian.kandeler@digia.com> | 2013-11-21 15:20:58 +0100 |
| commit | b9aca56026562b0fd6ff2fd2717e20666f40b98a (patch) | |
| tree | 467071fca4248a8b19e9396988336ce5a970398c /src/lib/buildgraph/buildgraphloader.cpp | |
| parent | 8b9026c3e8eca11b9859b17f152c8a01c93dc900 (diff) | |
| download | qbs-b9aca56026562b0fd6ff2fd2717e20666f40b98a.tar.gz | |
Take the qbs.install* properties into account when change tracking.
These are currently ignored, because we only look for properties that
were requested in prepare scripts. This does not typically happen for
installation parameters, but since they end up in the output artifacts,
changes to them still require re-setting up the respective build data.
Task-number: QBS-359
Change-Id: I571cb4c1a02ea790ddde2f244136c6a0fd6fb627
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'src/lib/buildgraph/buildgraphloader.cpp')
| -rw-r--r-- | src/lib/buildgraph/buildgraphloader.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/lib/buildgraph/buildgraphloader.cpp b/src/lib/buildgraph/buildgraphloader.cpp index 121cb7ca2..15e2e9d7f 100644 --- a/src/lib/buildgraph/buildgraphloader.cpp +++ b/src/lib/buildgraph/buildgraphloader.cpp @@ -37,6 +37,7 @@ #include "projectbuilddata.h" #include "rulesevaluationcontext.h" #include "transformer.h" +#include <language/artifactproperties.h> #include <language/language.h> #include <language/loader.h> #include <logging/translator.h> @@ -430,6 +431,23 @@ bool BuildGraphLoader::checkProductForChanges(const ResolvedProductPtr &restored // TODO: Check for more stuff. } +bool BuildGraphLoader::checkProductForInstallInfoChanges(const ResolvedProductPtr &restoredProduct, + const ResolvedProductPtr &newlyResolvedProduct) +{ + // These are not requested from rules at build time, but we still need to take + // them into account. + const QStringList specialProperties = QStringList() << QLatin1String("install") + << QLatin1String("installDir") << QLatin1String("installPrefix"); + foreach (const QString &key, specialProperties) { + if (restoredProduct->properties->qbsPropertyValue(key) + != newlyResolvedProduct->properties->qbsPropertyValue(key)) { + m_logger.qbsDebug() << "Product property 'qbs." << key << "' changed."; + return true; + } + } + return false; +} + bool BuildGraphLoader::checkForPropertyChanges(const ResolvedProductPtr &restoredProduct, const ResolvedProductPtr &newlyResolvedProduct) { @@ -437,6 +455,12 @@ bool BuildGraphLoader::checkForPropertyChanges(const ResolvedProductPtr &restore "product '" << restoredProduct->name << "'."; if (!restoredProduct->buildData) return false; + if (checkProductForInstallInfoChanges(restoredProduct, newlyResolvedProduct)) + return true; + if (!artifactPropertyListsAreEqual(restoredProduct->artifactProperties, + newlyResolvedProduct->artifactProperties)) { + return true; + } QSet<TransformerConstPtr> seenTransformers; foreach (Artifact * const artifact, restoredProduct->buildData->artifacts) { const TransformerConstPtr transformer = artifact->transformer; |
