summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@digia.com>2013-10-11 14:38:42 +0200
committerChristian Kandeler <christian.kandeler@digia.com>2013-10-11 17:50:54 +0200
commit129f9116a4d752c46ecb275e81f02e33cc61e2d0 (patch)
tree5ac3f493b4831df29129fc3c31b52fcf6946aacc /src
parentde0282e8bb280ed074822f37efbb0b72462bb6e0 (diff)
downloadqbs-129f9116a4d752c46ecb275e81f02e33cc61e2d0.tar.gz
in the scanner, only remove connections the scanner created
Task-number: QBS-394 Change-Id: I4659746be6004042949038450e2015fbb5f70b77 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/lib/buildgraph/artifact.cpp2
-rw-r--r--src/lib/buildgraph/artifact.h1
-rw-r--r--src/lib/buildgraph/buildgraph.cpp3
-rw-r--r--src/lib/buildgraph/inputartifactscanner.cpp8
-rw-r--r--src/lib/buildgraph/projectbuilddata.cpp2
-rw-r--r--src/lib/tools/persistence.cpp2
6 files changed, 12 insertions, 6 deletions
diff --git a/src/lib/buildgraph/artifact.cpp b/src/lib/buildgraph/artifact.cpp
index 9583f5f02..01bad8e36 100644
--- a/src/lib/buildgraph/artifact.cpp
+++ b/src/lib/buildgraph/artifact.cpp
@@ -82,6 +82,7 @@ void Artifact::load(PersistentPool &pool)
for (ArtifactList::const_iterator it = children.constBegin(); it != children.constEnd(); ++it)
(*it)->parents.insert(this);
+ pool.loadContainer(childrenAddedByScanner);
pool.loadContainer(fileDependencies);
properties = pool.idLoadS<PropertyMapInternal>();
transformer = pool.idLoadS<Transformer>();
@@ -99,6 +100,7 @@ void Artifact::store(PersistentPool &pool) const
FileResourceBase::store(pool);
// Do not store parents to avoid recursion.
pool.storeContainer(children);
+ pool.storeContainer(childrenAddedByScanner);
pool.storeContainer(fileDependencies);
pool.store(properties);
pool.store(transformer);
diff --git a/src/lib/buildgraph/artifact.h b/src/lib/buildgraph/artifact.h
index 0eb17741f..55b5c81bc 100644
--- a/src/lib/buildgraph/artifact.h
+++ b/src/lib/buildgraph/artifact.h
@@ -62,6 +62,7 @@ public:
ArtifactList parents;
ArtifactList children;
+ ArtifactList childrenAddedByScanner;
QSet<FileDependency *> fileDependencies;
FileTags fileTags;
WeakPointer<ResolvedProduct> product;
diff --git a/src/lib/buildgraph/buildgraph.cpp b/src/lib/buildgraph/buildgraph.cpp
index 5534fe5fa..04a9d3266 100644
--- a/src/lib/buildgraph/buildgraph.cpp
+++ b/src/lib/buildgraph/buildgraph.cpp
@@ -291,6 +291,7 @@ void disconnect(Artifact *u, Artifact *v, const Logger &logger)
.arg(relativeArtifactFileName(u), relativeArtifactFileName(v));
}
u->children.remove(v);
+ u->childrenAddedByScanner.remove(v);
v->parents.remove(u);
}
@@ -429,6 +430,8 @@ static void doSanityChecksForProduct(const ResolvedProductConstPtr &product, con
QBS_CHECK(parent->children.contains(artifact));
foreach (const Artifact * const child, artifact->children)
QBS_CHECK(child->parents.contains(artifact));
+ foreach (Artifact * const child, artifact->childrenAddedByScanner)
+ QBS_CHECK(artifact->children.contains(child));
const TransformerConstPtr transformer = artifact->transformer;
if (artifact->artifactType == Artifact::SourceFile)
continue;
diff --git a/src/lib/buildgraph/inputartifactscanner.cpp b/src/lib/buildgraph/inputartifactscanner.cpp
index e4f50322b..f40e378fe 100644
--- a/src/lib/buildgraph/inputartifactscanner.cpp
+++ b/src/lib/buildgraph/inputartifactscanner.cpp
@@ -158,13 +158,10 @@ void InputArtifactScanner::scan()
// clear file dependencies; they will be regenerated
m_artifact->fileDependencies.clear();
- // Remove all connections to children that do not belong to our transformer.
+ // Remove all connections to children that were added by the dependency scanner.
// They will be regenerated.
- foreach (Artifact *dependency, m_artifact->children) {
- if (m_artifact->transformer->inputs.contains(dependency))
- continue;
+ foreach (Artifact *dependency, m_artifact->childrenAddedByScanner)
disconnect(m_artifact, dependency, m_logger);
- }
ArtifactList::const_iterator it = m_artifact->transformer->inputs.begin();
for (; it != m_artifact->transformer->inputs.end(); ++it) {
@@ -358,6 +355,7 @@ void InputArtifactScanner::handleDependency(ResolvedDependency &dependency)
if (insertIntoProduct && !product->buildData->artifacts.contains(artifactDependency))
insertArtifact(product, artifactDependency, m_logger);
safeConnect(m_artifact, artifactDependency, m_logger);
+ m_artifact->childrenAddedByScanner += artifactDependency;
m_newDependencyAdded = true;
}
}
diff --git a/src/lib/buildgraph/projectbuilddata.cpp b/src/lib/buildgraph/projectbuilddata.cpp
index 1e28a4afa..1ad45c13a 100644
--- a/src/lib/buildgraph/projectbuilddata.cpp
+++ b/src/lib/buildgraph/projectbuilddata.cpp
@@ -113,6 +113,7 @@ static void disconnectArtifactChildren(Artifact *artifact, const Logger &logger)
foreach (Artifact * const child, artifact->children)
child->parents.remove(artifact);
artifact->children.clear();
+ artifact->childrenAddedByScanner.clear();
}
static void disconnectArtifactParents(Artifact *artifact, ProjectBuildData *projectBuildData,
@@ -124,6 +125,7 @@ static void disconnectArtifactParents(Artifact *artifact, ProjectBuildData *proj
}
foreach (Artifact * const parent, artifact->parents) {
parent->children.remove(artifact);
+ parent->childrenAddedByScanner.remove(artifact);
if (parent->transformer) {
parent->transformer->inputs.remove(artifact);
projectBuildData->artifactsThatMustGetNewTransformers += parent;
diff --git a/src/lib/tools/persistence.cpp b/src/lib/tools/persistence.cpp
index dd4938a07..074231603 100644
--- a/src/lib/tools/persistence.cpp
+++ b/src/lib/tools/persistence.cpp
@@ -40,7 +40,7 @@
namespace qbs {
namespace Internal {
-static const char QBS_PERSISTENCE_MAGIC[] = "QBSPERSISTENCE-51";
+static const char QBS_PERSISTENCE_MAGIC[] = "QBSPERSISTENCE-52";
PersistentPool::PersistentPool(const Logger &logger) : m_logger(logger)
{