diff options
author | Christian Kandeler <christian.kandeler@digia.com> | 2014-01-22 15:35:56 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-22 15:35:56 +0100 |
commit | 1567610922907a7fc927a107d31fb6a383e7d4e1 (patch) | |
tree | 068366ac68bc66e361dfae989601a402e455d1b1 /src/lib | |
parent | 58c04597bfbd244aa245630a56f7f29d5a8fafbb (diff) | |
parent | fb5632e3930cbb5d93296d2df31ea0c369b3de41 (diff) |
Merge "Merge remote-tracking branch 'origin/1.1'"
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/corelib/api/internaljobs.cpp | 4 | ||||
-rw-r--r-- | src/lib/corelib/api/internaljobs.h | 2 | ||||
-rw-r--r-- | src/lib/corelib/buildgraph/buildgraph.cpp | 9 | ||||
-rw-r--r-- | src/lib/corelib/buildgraph/executor.cpp | 5 | ||||
-rw-r--r-- | src/lib/corelib/qbs.h | 1 |
5 files changed, 16 insertions, 5 deletions
diff --git a/src/lib/corelib/api/internaljobs.cpp b/src/lib/corelib/api/internaljobs.cpp index a28bee72e..b8e4bdef9 100644 --- a/src/lib/corelib/api/internaljobs.cpp +++ b/src/lib/corelib/api/internaljobs.cpp @@ -31,6 +31,7 @@ #include "jobs.h" #include <buildgraph/artifactcleaner.h> +#include <buildgraph/buildgraph.h> #include <buildgraph/buildgraphloader.h> #include <buildgraph/productbuilddata.h> #include <buildgraph/projectbuilddata.h> @@ -138,9 +139,10 @@ void InternalJob::shareObserverWith(InternalJob *otherJob) m_observer = otherJob->m_observer; } -void InternalJob::storeBuildGraph(const TopLevelProjectConstPtr &project) +void InternalJob::storeBuildGraph(const TopLevelProjectPtr &project) { try { + doSanityChecks(project, logger()); project->store(logger()); } catch (const ErrorInfo &error) { logger().printWarning(error); diff --git a/src/lib/corelib/api/internaljobs.h b/src/lib/corelib/api/internaljobs.h index ef112662f..dfb594e54 100644 --- a/src/lib/corelib/api/internaljobs.h +++ b/src/lib/corelib/api/internaljobs.h @@ -72,7 +72,7 @@ protected: JobObserver *observer() const { return m_observer; } void setTimed(bool timed) { m_timed = timed; } - void storeBuildGraph(const TopLevelProjectConstPtr &project); + void storeBuildGraph(const TopLevelProjectPtr &project); signals: void finished(Internal::InternalJob *job); diff --git a/src/lib/corelib/buildgraph/buildgraph.cpp b/src/lib/corelib/buildgraph/buildgraph.cpp index c29b74d7c..490539d0c 100644 --- a/src/lib/corelib/buildgraph/buildgraph.cpp +++ b/src/lib/corelib/buildgraph/buildgraph.cpp @@ -247,6 +247,9 @@ bool findPath(Artifact *u, Artifact *v, QList<Artifact*> &path) void connect(Artifact *p, Artifact *c) { QBS_CHECK(p != c); + foreach (const Artifact * const child, p->children) + if (child != c && child->filePath() == c->filePath()) + throw ErrorInfo(QString::fromLocal8Bit("Artifact %1 already has a child artifact %2 as different object.").arg(p->filePath(), c->filePath()), CodeLocation(), true); p->children.insert(c); c->parents.insert(p); p->product->topLevelProject()->buildData->isDirty = true; @@ -445,8 +448,12 @@ static void doSanityChecksForProduct(const ResolvedProductConstPtr &product, con QBS_CHECK(artifact->product == product); foreach (const Artifact * const parent, artifact->parents) QBS_CHECK(parent->children.contains(artifact)); - foreach (const Artifact * const child, artifact->children) + foreach (Artifact * const child, artifact->children) { QBS_CHECK(child->parents.contains(artifact)); + QBS_CHECK(!child->product.isNull()); + QBS_CHECK(child->product->buildData); + QBS_CHECK(child->product->buildData->artifacts.contains(child)); + } foreach (Artifact * const child, artifact->childrenAddedByScanner) QBS_CHECK(artifact->children.contains(child)); const TransformerConstPtr transformer = artifact->transformer; diff --git a/src/lib/corelib/buildgraph/executor.cpp b/src/lib/corelib/buildgraph/executor.cpp index 76adbbc95..8e9334020 100644 --- a/src/lib/corelib/buildgraph/executor.cpp +++ b/src/lib/corelib/buildgraph/executor.cpp @@ -408,9 +408,10 @@ bool Executor::mustExecuteTransformer(const TransformerPtr &transformer) const { bool hasAlwaysUpdatedArtifacts = false; foreach (Artifact *artifact, transformer->outputs) { - if (!artifact->alwaysUpdated) + if (artifact->alwaysUpdated) + hasAlwaysUpdatedArtifacts = true; + else if (!m_buildOptions.forceTimestampCheck()) continue; - hasAlwaysUpdatedArtifacts = true; const bool upToDate = isUpToDate(artifact); // The invariant is that all output artifacts of a transformer have the same diff --git a/src/lib/corelib/qbs.h b/src/lib/corelib/qbs.h index 56ae00990..591fe557d 100644 --- a/src/lib/corelib/qbs.h +++ b/src/lib/corelib/qbs.h @@ -38,6 +38,7 @@ #include "tools/error.h" #include "tools/installoptions.h" #include "tools/preferences.h" +#include "tools/profile.h" #include "tools/processresult.h" #include "tools/settings.h" #include "tools/setupprojectparameters.h" |