summaryrefslogtreecommitdiff
path: root/src/lib/buildgraph/artifactcleaner.cpp
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@digia.com>2013-04-08 18:18:16 +0200
committerJoerg Bornemann <joerg.bornemann@digia.com>2013-04-12 14:19:12 +0200
commit1d9c080428dcd5e8c1d08598d6542d87f1ca1819 (patch)
tree38282acbb95c921595dffec93a6dd99aaa61c24f /src/lib/buildgraph/artifactcleaner.cpp
parentf17fd5d56a758a28ef5da04b2be83ed558f7cba6 (diff)
downloadqbs-1d9c080428dcd5e8c1d08598d6542d87f1ca1819.tar.gz
Remove structural redundancy in project and product classes.
We had two project classes, each holding a list of products that was structurally identical, except that no BuildProduct object existed for a disabled ResolvedProduct. The same kind of duplication also happened for product dependencies. This patch gets rid of these parallel structures. BuildProject and BuildProduct are largely being demoted to data holders and are aggregated by ResolvedProject and ResolvedProduct, respectively. The resulting project structure should be easier to understand and maintain. Change-Id: I68beef60b9e0d62258f6a8337c9015864e18bd80 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'src/lib/buildgraph/artifactcleaner.cpp')
-rw-r--r--src/lib/buildgraph/artifactcleaner.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/lib/buildgraph/artifactcleaner.cpp b/src/lib/buildgraph/artifactcleaner.cpp
index 1fe5013b5..12228144a 100644
--- a/src/lib/buildgraph/artifactcleaner.cpp
+++ b/src/lib/buildgraph/artifactcleaner.cpp
@@ -30,14 +30,10 @@
#include "artifact.h"
#include "artifactvisitor.h"
-#include "buildproduct.h"
-#include "buildproject.h"
-#include "rulesevaluationcontext.h"
-#include "transformer.h"
+#include "projectbuilddata.h"
#include <language/language.h>
#include <logging/translator.h>
-#include <tools/buildoptions.h>
#include <tools/cleanoptions.h>
#include <tools/error.h>
#include <tools/fileinfo.h>
@@ -65,7 +61,7 @@ static void invalidateArtifactTimestamp(Artifact *artifact)
{
if (artifact->timestamp.isValid()) {
artifact->timestamp.clear();
- artifact->project->markDirty();
+ artifact->project->buildData->isDirty = true;
}
}
@@ -97,7 +93,7 @@ public:
{
}
- void visitProduct(const BuildProductConstPtr &product)
+ void visitProduct(const ResolvedProductConstPtr &product)
{
m_product = product;
ArtifactVisitor::visitProduct(product);
@@ -127,7 +123,7 @@ private:
const CleanOptions m_options;
Logger m_logger;
bool m_hasError;
- BuildProductConstPtr m_product;
+ ResolvedProductConstPtr m_product;
QSet<QString> m_directories;
};
@@ -136,19 +132,20 @@ ArtifactCleaner::ArtifactCleaner(const Logger &logger, ProgressObserver *observe
{
}
-void ArtifactCleaner::cleanup(const QList<BuildProductPtr> &products, const CleanOptions &options)
+void ArtifactCleaner::cleanup(const QList<ResolvedProductPtr> &products,
+ const CleanOptions &options)
{
m_hasError = false;
QString configString;
if (!products.isEmpty()) {
configString = Tr::tr(" for configuration %1")
- .arg(products.first()->project->resolvedProject()->id());
+ .arg(products.first()->project->id());
}
m_observer->initialize(Tr::tr("Cleaning up%1").arg(configString), products.count() + 1);
QSet<QString> directories;
- foreach (const BuildProductConstPtr &product, products) {
+ foreach (const ResolvedProductPtr &product, products) {
CleanupVisitor visitor(options, m_logger);
visitor.visitProduct(product);
directories.unite(visitor.directories());