diff options
author | Christian Kandeler <christian.kandeler@digia.com> | 2014-02-20 17:31:47 +0100 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@digia.com> | 2014-02-20 17:47:19 +0100 |
commit | a912fa1ebc75ea2472142fd52545a0953853db00 (patch) | |
tree | 52650997769911b369a478b49551fd40780e7afe | |
parent | 559fb802ea0688c3104cbfcd4146598c6ac95610 (diff) |
Serialize information about rules with changed inputs.
This was simply missing.
Also amend the "trackRemoveFile" autotest so that it catches such an
omission.
Change-Id: Ic3187bf17337cf792bb6ccfd324635d1a43f4d82
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
-rw-r--r-- | src/lib/corelib/buildgraph/productbuilddata.cpp | 23 | ||||
-rw-r--r-- | src/lib/corelib/buildgraph/productbuilddata.h | 1 | ||||
-rw-r--r-- | src/lib/corelib/language/language.h | 1 | ||||
-rw-r--r-- | src/lib/corelib/tools/persistence.cpp | 2 | ||||
-rw-r--r-- | tests/auto/blackbox/tst_blackbox.cpp | 2 |
5 files changed, 22 insertions, 7 deletions
diff --git a/src/lib/corelib/buildgraph/productbuilddata.cpp b/src/lib/corelib/buildgraph/productbuilddata.cpp index cdd3874e7..eb0e4c03b 100644 --- a/src/lib/corelib/buildgraph/productbuilddata.cpp +++ b/src/lib/corelib/buildgraph/productbuilddata.cpp @@ -68,10 +68,10 @@ void ProductBuildData::load(PersistentPool &pool) { nodes.load(pool); roots.load(pool); - int rescuableArtifactCount; - pool.stream() >> rescuableArtifactCount; - rescuableArtifactData.reserve(rescuableArtifactCount); - for (int i = 0; i < rescuableArtifactCount; ++i) { + int count; + pool.stream() >> count; + rescuableArtifactData.reserve(count); + for (int i = 0; i < count; ++i) { const QString filePath = pool.idLoadString(); RescuableArtifactData elem; elem.load(pool); @@ -79,6 +79,14 @@ void ProductBuildData::load(PersistentPool &pool) } loadArtifactSetByFileTag(pool, addedArtifactsByFileTag); loadArtifactSetByFileTag(pool, removedArtifactsByFileTag); + + pool.stream() >> count; + for (int i = 0; i < count; ++i) { + const RulePtr r = pool.idLoadS<Rule>(); + ArtifactSet s; + pool.loadContainer(s); + artifactsWithChangedInputsPerRule.insert(r, s); + } } static void storeArtifactSetByFileTag(PersistentPool &pool, @@ -104,6 +112,13 @@ void ProductBuildData::store(PersistentPool &pool) const } storeArtifactSetByFileTag(pool, addedArtifactsByFileTag); storeArtifactSetByFileTag(pool, removedArtifactsByFileTag); + + pool.stream() << artifactsWithChangedInputsPerRule.count(); + for (ArtifactSetByRule::ConstIterator it = artifactsWithChangedInputsPerRule.constBegin(); + it != artifactsWithChangedInputsPerRule.constEnd(); ++it) { + pool.store(it.key()); + pool.storeContainer(it.value()); + } } void addArtifactToSet(Artifact *artifact, ProductBuildData::ArtifactSetByFileTag &container) diff --git a/src/lib/corelib/buildgraph/productbuilddata.h b/src/lib/corelib/buildgraph/productbuilddata.h index 10b4655be..8d1810b2b 100644 --- a/src/lib/corelib/buildgraph/productbuilddata.h +++ b/src/lib/corelib/buildgraph/productbuilddata.h @@ -66,7 +66,6 @@ public: ArtifactSetByFileTag addedArtifactsByFileTag; ArtifactSetByFileTag removedArtifactsByFileTag; - // TODO: Serialize. typedef QHash<RuleConstPtr, ArtifactSet> ArtifactSetByRule; ArtifactSetByRule artifactsWithChangedInputsPerRule; diff --git a/src/lib/corelib/language/language.h b/src/lib/corelib/language/language.h index c1e4f63fb..d2b79a74f 100644 --- a/src/lib/corelib/language/language.h +++ b/src/lib/corelib/language/language.h @@ -303,7 +303,6 @@ public: FileTags staticOutputFileTags() const; FileTags collectedOutputFileTags() const; bool isDynamic() const; - private: Rule() : multiplex(false), ruleGraphId(-1) {} diff --git a/src/lib/corelib/tools/persistence.cpp b/src/lib/corelib/tools/persistence.cpp index cc751f889..22fe6e168 100644 --- a/src/lib/corelib/tools/persistence.cpp +++ b/src/lib/corelib/tools/persistence.cpp @@ -40,7 +40,7 @@ namespace qbs { namespace Internal { -static const char QBS_PERSISTENCE_MAGIC[] = "QBSPERSISTENCE-62"; +static const char QBS_PERSISTENCE_MAGIC[] = "QBSPERSISTENCE-63"; PersistentPool::PersistentPool(const Logger &logger) : m_logger(logger) { diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp index 105af71a8..b4364cddc 100644 --- a/tests/auto/blackbox/tst_blackbox.cpp +++ b/tests/auto/blackbox/tst_blackbox.cpp @@ -856,6 +856,8 @@ void TestBlackbox::trackRemoveFile() QFile::copy("../before/main.cpp", "main.cpp"); QVERIFY(QFile::remove("zort.h")); QVERIFY(QFile::remove("zort.cpp")); + QCOMPARE(runQbs(QbsRunParameters(QLatin1String("resolve"))), 0); + touch("main.cpp"); touch("project.qbs"); QCOMPARE(runQbs(), 0); |