aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/corelib/buildgraph/transformer.h
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2018-01-29 14:04:56 +0100
committerChristian Kandeler <christian.kandeler@qt.io>2018-02-16 09:33:47 +0000
commit24471740f276fc7fb3b662bd18ae637127368a9f (patch)
tree18a5b7657db9cd6b4edbf62da7230434b946fa61 /src/lib/corelib/buildgraph/transformer.h
parentfc321f1cca3b9bbcbbf0200a16aff85a85a9a148 (diff)
Move transformer change tracking out of the build graph loader
The checks that determine whether to re-run prepare scripts and/or commands due to property or environment changes do not belong into the build graph loader. Instead, we now do them on demand during the build process. Advantages: - The code is at its "natural" place, making it easier to understand and less fragile. - There are a lot fewer unnecessary build data invalidations, speeding up both re-resolving and rebuilding in case only some rules/commands have changed. - Re-running commands due to property or environment changes no longer implies re-running prepare scripts. - We now catch property changes on generated artifacts, which was not possible before, because the build graph loader only had access to the source artifacts of the re-resolved project. Change-Id: I36b022cf631fa9e8293feec4d6f416c2686539c1 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'src/lib/corelib/buildgraph/transformer.h')
-rw-r--r--src/lib/corelib/buildgraph/transformer.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lib/corelib/buildgraph/transformer.h b/src/lib/corelib/buildgraph/transformer.h
index f1ef01ae7..180bc8d49 100644
--- a/src/lib/corelib/buildgraph/transformer.h
+++ b/src/lib/corelib/buildgraph/transformer.h
@@ -47,6 +47,7 @@
#include <language/forward_decls.h>
#include <language/property.h>
#include <language/scriptengine.h>
+#include <tools/filetime.h>
#include <QtCore/qhash.h>
@@ -76,7 +77,11 @@ public:
std::vector<QString> importedFilesUsedInCommands;
RequestedDependencies depsRequestedInPrepareScript;
RequestedDependencies depsRequestedInCommands;
+ FileTime lastPrepareScriptExecutionTime;
+ FileTime lastCommandExecutionTime;
bool alwaysRun;
+ bool prepareScriptNeedsChangeTracking = false;
+ bool commandsNeedChangeTracking = false;
static QScriptValue translateFileConfig(ScriptEngine *scriptEngine,
const Artifact *artifact,
@@ -94,6 +99,8 @@ public:
private:
Transformer();
+ AbstractCommandPtr createCommandFromScriptValue(const QScriptValue &scriptValue,
+ const CodeLocation &codeLocation);
static void setupInputs(QScriptValue targetScriptValue, const ArtifactSet &inputs,
const QString &defaultModuleName);