aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/corelib/buildgraph/artifact.h
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@digia.com>2014-02-10 18:08:01 +0100
committerJoerg Bornemann <joerg.bornemann@digia.com>2014-02-13 15:33:27 +0100
commite73f60919079fc7cb0f0ad6d50b1a364c7b0d2a6 (patch)
tree3ce15f1f9b336063d591999ce325ce28a6e21320 /src/lib/corelib/buildgraph/artifact.h
parenta3634a6bbb193c47cdec887a6b29356c979961aa (diff)
support transformers with an unknown number of outputs
To support different types of nodes in the build graph, we introduce the base class BuildGraphNode. Artifact now derives from BuildGraphNode. A RuleNode class is introduced that represents a rule in the build graph. Rules are applied in the build phase and not in a pre-build phase anymore. The handling of moc has been revisited. The fixed automoc pre-build phase is no more. This is the squashed merge of a feature branch. Task-number: QBS-370 Change-Id: If27cdc51cba8c9542e4282c2caa456faa723aeff Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
Diffstat (limited to 'src/lib/corelib/buildgraph/artifact.h')
-rw-r--r--src/lib/corelib/buildgraph/artifact.h37
1 files changed, 15 insertions, 22 deletions
diff --git a/src/lib/corelib/buildgraph/artifact.h b/src/lib/corelib/buildgraph/artifact.h
index 93cfeec52..ca62daea7 100644
--- a/src/lib/corelib/buildgraph/artifact.h
+++ b/src/lib/corelib/buildgraph/artifact.h
@@ -32,12 +32,10 @@
#include "artifactset.h"
#include "filedependency.h"
+#include "buildgraphnode.h"
#include "forward_decls.h"
#include <language/filetags.h>
-#include <language/forward_decls.h>
#include <tools/filetime.h>
-#include <tools/persistentobject.h>
-#include <tools/weakpointer.h>
#include <QSet>
#include <QString>
@@ -54,18 +52,19 @@ class Logger;
*
*
*/
-class Artifact : public FileResourceBase
+class Artifact : public FileResourceBase, public BuildGraphNode
{
public:
Artifact();
~Artifact();
- ArtifactSet parents;
- ArtifactSet children;
+ Type type() const { return ArtifactNodeType; }
+ void accept(BuildGraphVisitor *visitor);
+ QString toString() const;
+
ArtifactSet childrenAddedByScanner;
QSet<FileDependency *> fileDependencies;
FileTags fileTags;
- WeakPointer<ResolvedProduct> product;
TransformerPtr transformer;
PropertyMapPtr properties;
@@ -76,22 +75,16 @@ public:
Generated = 4
};
- enum BuildState
- {
- Untouched = 0,
- Buildable,
- Building,
- Built
- };
-
ArtifactType artifactType;
- FileTime autoMocTimestamp;
- BuildState buildState; // Do not serialize. Will be refreshed for every build.
bool inputsScanned : 1; // Do not serialize. Will be refreshed for every build.
bool timestampRetrieved : 1; // Do not serialize. Will be refreshed for every build.
bool alwaysUpdated : 1;
+ bool oldDataPossiblyPresent : 1;
void initialize();
+ ArtifactSet parentArtifacts() const;
+ ArtifactSet childArtifacts() const;
+ void onChildDisconnected(BuildGraphNode *child);
private:
void load(PersistentPool &pool);
@@ -113,16 +106,16 @@ inline QString toString(Artifact::ArtifactType t)
}
// debugging helper
-inline QString toString(Artifact::BuildState s)
+inline QString toString(BuildGraphNode::BuildState s)
{
switch (s) {
- case Artifact::Untouched:
+ case BuildGraphNode::Untouched:
return QLatin1String("Untouched");
- case Artifact::Buildable:
+ case BuildGraphNode::Buildable:
return QLatin1String("Buildable");
- case Artifact::Building:
+ case BuildGraphNode::Building:
return QLatin1String("Building");
- case Artifact::Built:
+ case BuildGraphNode::Built:
return QLatin1String("Built");
default:
return QLatin1String("Unknown");