summaryrefslogtreecommitdiff
path: root/src/lib/corelib/buildgraph
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2017-08-28 15:47:52 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2017-08-28 15:47:52 +0200
commit811edc5952caf265a4c56b52933165830838dab1 (patch)
tree787ef28916e4799083aa1b7e0d5076a35d130eca /src/lib/corelib/buildgraph
parent40787b4d077eea1211f43d9f247c560957bd6887 (diff)
parent0f647796788494947632c0874931e4d84bccad46 (diff)
downloadqbs-811edc5952caf265a4c56b52933165830838dab1.tar.gz
Merge 1.9 into master
Change-Id: I5320b7c62d6a80089df75c2caca79c15602c01e5
Diffstat (limited to 'src/lib/corelib/buildgraph')
-rw-r--r--src/lib/corelib/buildgraph/executor.cpp29
-rw-r--r--src/lib/corelib/buildgraph/productinstaller.cpp7
-rw-r--r--src/lib/corelib/buildgraph/rulesapplicator.cpp1
-rw-r--r--src/lib/corelib/buildgraph/transformer.cpp11
-rw-r--r--src/lib/corelib/buildgraph/transformer.h1
5 files changed, 34 insertions, 15 deletions
diff --git a/src/lib/corelib/buildgraph/executor.cpp b/src/lib/corelib/buildgraph/executor.cpp
index 1c50f7234..c5f652db5 100644
--- a/src/lib/corelib/buildgraph/executor.cpp
+++ b/src/lib/corelib/buildgraph/executor.cpp
@@ -860,24 +860,27 @@ void Executor::potentiallyRunTransformer(const TransformerPtr &transformer)
return;
}
- if (!mustExecuteTransformer(transformer)) {
+ const bool mustExecute = mustExecuteTransformer(transformer);
+ if (mustExecute || m_buildOptions.forceTimestampCheck()) {
+ for (Artifact * const output : qAsConst(transformer->outputs)) {
+ // Scan all input artifacts. If new dependencies were found during scanning, delay
+ // execution of this transformer.
+ InputArtifactScanner scanner(output, m_inputArtifactScanContext, m_logger);
+ AccumulatingTimer scanTimer(m_buildOptions.logElapsedTime()
+ ? &m_elapsedTimeScanners : nullptr);
+ scanner.scan();
+ scanTimer.stop();
+ if (scanner.newDependencyAdded() && checkForUnbuiltDependencies(output))
+ return;
+ }
+ }
+
+ if (!mustExecute) {
qCDebug(lcExec) << "Up to date. Skipping.";
finishTransformer(transformer);
return;
}
- for (Artifact * const output : qAsConst(transformer->outputs)) {
- // Scan all input artifacts. If new dependencies were found during scanning, delay
- // execution of this transformer.
- InputArtifactScanner scanner(output, m_inputArtifactScanContext, m_logger);
- AccumulatingTimer scanTimer(m_buildOptions.logElapsedTime()
- ? &m_elapsedTimeScanners : nullptr);
- scanner.scan();
- scanTimer.stop();
- if (scanner.newDependencyAdded() && checkForUnbuiltDependencies(output))
- return;
- }
-
if (m_buildOptions.executeRulesOnly())
finishTransformer(transformer);
else
diff --git a/src/lib/corelib/buildgraph/productinstaller.cpp b/src/lib/corelib/buildgraph/productinstaller.cpp
index 1688dcc76..1b1e507bb 100644
--- a/src/lib/corelib/buildgraph/productinstaller.cpp
+++ b/src/lib/corelib/buildgraph/productinstaller.cpp
@@ -151,11 +151,14 @@ QString ProductInstaller::targetFilePath(const TopLevelProject *project,
localAbsBasePath));
}
- targetFilePath.remove(0, localAbsBasePath.length() + 1);
+ // Since there is a difference between X: and X:\\ on Windows, absolute paths can sometimes
+ // end with a slash, so only remove an extra character if there is no ending slash
+ targetFilePath.remove(0, localAbsBasePath.length()
+ + (localAbsBasePath.endsWith(QLatin1Char('/')) ? 0 : 1));
}
targetFilePath.prepend(targetDir + QLatin1Char('/'));
- return targetFilePath;
+ return QDir::cleanPath(targetFilePath);
}
void ProductInstaller::initInstallRoot(const TopLevelProject *project,
diff --git a/src/lib/corelib/buildgraph/rulesapplicator.cpp b/src/lib/corelib/buildgraph/rulesapplicator.cpp
index f4f57cb15..4a5954a73 100644
--- a/src/lib/corelib/buildgraph/rulesapplicator.cpp
+++ b/src/lib/corelib/buildgraph/rulesapplicator.cpp
@@ -354,6 +354,7 @@ Artifact *RulesApplicator::createOutputArtifact(const QString &filePath, const F
if (m_rule->declaresInputs() && m_rule->requiresInputs)
outputArtifact->clearTimestamp();
m_invalidatedArtifacts += outputArtifact;
+ m_transformer->rescueChangeTrackingData(outputArtifact->transformer);
} else {
QScopedPointer<Artifact> newArtifact(new Artifact);
newArtifact->artifactType = Artifact::Generated;
diff --git a/src/lib/corelib/buildgraph/transformer.cpp b/src/lib/corelib/buildgraph/transformer.cpp
index 0e5b4a084..b6e02e708 100644
--- a/src/lib/corelib/buildgraph/transformer.cpp
+++ b/src/lib/corelib/buildgraph/transformer.cpp
@@ -260,6 +260,17 @@ void Transformer::createCommands(ScriptEngine *engine, const ScriptFunctionConst
}
}
+void Transformer::rescueChangeTrackingData(const TransformerConstPtr &other)
+{
+ if (!other)
+ return;
+ propertiesRequestedInPrepareScript = other->propertiesRequestedInPrepareScript;
+ propertiesRequestedInCommands = other->propertiesRequestedInCommands;
+ propertiesRequestedFromArtifactInPrepareScript
+ = other->propertiesRequestedFromArtifactInPrepareScript;
+ propertiesRequestedFromArtifactInCommands = other->propertiesRequestedFromArtifactInCommands;
+}
+
void Transformer::load(PersistentPool &pool)
{
pool.load(rule);
diff --git a/src/lib/corelib/buildgraph/transformer.h b/src/lib/corelib/buildgraph/transformer.h
index e4ffcb83b..b83321bda 100644
--- a/src/lib/corelib/buildgraph/transformer.h
+++ b/src/lib/corelib/buildgraph/transformer.h
@@ -82,6 +82,7 @@ public:
void setupExplicitlyDependsOn(QScriptValue targetScriptValue);
void createCommands(ScriptEngine *engine, const ScriptFunctionConstPtr &script,
const QScriptValueList &args);
+ void rescueChangeTrackingData(const TransformerConstPtr &other);
private:
Transformer();