aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/corelib
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@digia.com>2014-04-17 12:22:32 +0200
committerChristian Kandeler <christian.kandeler@digia.com>2014-04-17 13:30:54 +0200
commitc9eb23a26d693da232f1ab96c23797f35ad16305 (patch)
tree5324375402d52c093a3f2e8b8add9b61892a20aa /src/lib/corelib
parentc2664b879d8aedf82e62b2f389ce107e18168235 (diff)
API: Do not present all root artifacts as target artifacts.
E.g. Transformer outputs are roots, but not target artifacts. Task-number: QBS-557 Change-Id: Ia2ab5567344911b0751deed465722deb182e4aaf Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'src/lib/corelib')
-rw-r--r--src/lib/corelib/api/project.cpp2
-rw-r--r--src/lib/corelib/buildgraph/artifactcleaner.cpp2
-rw-r--r--src/lib/corelib/buildgraph/productbuilddata.cpp2
-rw-r--r--src/lib/corelib/buildgraph/productbuilddata.h2
-rw-r--r--src/lib/corelib/buildgraph/rulesapplicator.cpp2
-rw-r--r--src/lib/corelib/buildgraph/timestampsupdater.cpp2
-rw-r--r--src/lib/corelib/language/language.cpp11
-rw-r--r--src/lib/corelib/language/language.h1
8 files changed, 18 insertions, 6 deletions
diff --git a/src/lib/corelib/api/project.cpp b/src/lib/corelib/api/project.cpp
index 22f4f7b51..bea570aa3 100644
--- a/src/lib/corelib/api/project.cpp
+++ b/src/lib/corelib/api/project.cpp
@@ -600,7 +600,7 @@ void ProjectPrivate::retrieveProjectData(ProjectData &projectData,
product.d->groups << createGroupDataFromGroup(resolvedGroup);
if (resolvedProduct->enabled) {
QBS_CHECK(resolvedProduct->buildData);
- foreach (const Artifact * const a, resolvedProduct->buildData->targetArtifacts()) {
+ foreach (const Artifact * const a, resolvedProduct->targetArtifacts()) {
TargetArtifact ta;
ta.d->filePath = a->filePath();
ta.d->fileTags = a->fileTags.toStringList();
diff --git a/src/lib/corelib/buildgraph/artifactcleaner.cpp b/src/lib/corelib/buildgraph/artifactcleaner.cpp
index 6995af22b..a38095c9e 100644
--- a/src/lib/corelib/buildgraph/artifactcleaner.cpp
+++ b/src/lib/corelib/buildgraph/artifactcleaner.cpp
@@ -113,7 +113,7 @@ private:
if (m_options.cleanType() == CleanOptions::CleanupTemporaries) {
QBS_CHECK(artifact->transformer);
foreach (Artifact * const sibling, artifact->transformer->outputs) {
- if (artifact->product->buildData->targetArtifacts().contains(sibling))
+ if (artifact->product->targetArtifacts().contains(sibling))
return;
}
}
diff --git a/src/lib/corelib/buildgraph/productbuilddata.cpp b/src/lib/corelib/buildgraph/productbuilddata.cpp
index eb0e4c03b..c0e23b2db 100644
--- a/src/lib/corelib/buildgraph/productbuilddata.cpp
+++ b/src/lib/corelib/buildgraph/productbuilddata.cpp
@@ -45,7 +45,7 @@ ProductBuildData::~ProductBuildData()
qDeleteAll(nodes);
}
-ArtifactSet ProductBuildData::targetArtifacts() const
+ArtifactSet ProductBuildData::rootArtifacts() const
{
return ArtifactSet::fromNodeSet(roots);
}
diff --git a/src/lib/corelib/buildgraph/productbuilddata.h b/src/lib/corelib/buildgraph/productbuilddata.h
index 5c05f2690..61b072c2d 100644
--- a/src/lib/corelib/buildgraph/productbuilddata.h
+++ b/src/lib/corelib/buildgraph/productbuilddata.h
@@ -49,7 +49,7 @@ class ProductBuildData : public PersistentObject
public:
~ProductBuildData();
- ArtifactSet targetArtifacts() const;
+ ArtifactSet rootArtifacts() const;
NodeSet nodes;
NodeSet roots;
diff --git a/src/lib/corelib/buildgraph/rulesapplicator.cpp b/src/lib/corelib/buildgraph/rulesapplicator.cpp
index 6c117a361..7cbcbf997 100644
--- a/src/lib/corelib/buildgraph/rulesapplicator.cpp
+++ b/src/lib/corelib/buildgraph/rulesapplicator.cpp
@@ -156,7 +156,7 @@ void RulesApplicator::doApply(ArtifactSet inputArtifacts, QScriptValue &prepareS
foreach (const ResolvedProductPtr &dep, m_product->dependencies) {
QBS_CHECK(dep->buildData);
ArtifactSet artifactsToCheck;
- foreach (Artifact *targetArtifact, dep->buildData->targetArtifacts())
+ foreach (Artifact *targetArtifact, dep->targetArtifacts())
artifactsToCheck.unite(targetArtifact->transformer->outputs);
foreach (Artifact *artifact, artifactsToCheck) {
if (artifact->fileTags.matches(usingsFileTags))
diff --git a/src/lib/corelib/buildgraph/timestampsupdater.cpp b/src/lib/corelib/buildgraph/timestampsupdater.cpp
index 2ba6bc8ee..25ee1aac5 100644
--- a/src/lib/corelib/buildgraph/timestampsupdater.cpp
+++ b/src/lib/corelib/buildgraph/timestampsupdater.cpp
@@ -54,7 +54,7 @@ public:
// For target artifacts, we have to update the on-disk timestamp, because
// the executor will look at it.
- foreach (Artifact * const targetArtifact, product->buildData->targetArtifacts()) {
+ foreach (Artifact * const targetArtifact, product->targetArtifacts()) {
if (FileInfo(targetArtifact->filePath()).exists())
QFile(targetArtifact->filePath()).open(QIODevice::WriteOnly | QIODevice::Append);
}
diff --git a/src/lib/corelib/language/language.cpp b/src/lib/corelib/language/language.cpp
index 37ed5380d..eb5ad9652 100644
--- a/src/lib/corelib/language/language.cpp
+++ b/src/lib/corelib/language/language.cpp
@@ -773,6 +773,17 @@ ArtifactSet ResolvedProduct::lookupArtifactsByFileTag(const FileTag &tag) const
return result;
}
+ArtifactSet ResolvedProduct::targetArtifacts() const
+{
+ QBS_CHECK(buildData);
+ ArtifactSet taSet;
+ foreach (Artifact * const a, buildData->rootArtifacts()) {
+ if (a->fileTags.matches(fileTags))
+ taSet << a;
+ }
+ return taSet;
+}
+
TopLevelProject *ResolvedProduct::topLevelProject() const
{
return project->topLevelProject();
diff --git a/src/lib/corelib/language/language.h b/src/lib/corelib/language/language.h
index 65fdde67d..780af8f47 100644
--- a/src/lib/corelib/language/language.h
+++ b/src/lib/corelib/language/language.h
@@ -392,6 +392,7 @@ public:
const ArtifactSet removedArtifactsByFileTag(const FileTag &tag) const;
bool isMarkedForReapplication(const RuleConstPtr &rule) const;
ArtifactSet lookupArtifactsByFileTag(const FileTag &tag) const;
+ ArtifactSet targetArtifacts() const;
TopLevelProject *topLevelProject() const;