summaryrefslogtreecommitdiff
path: root/src/lib/buildgraph/automoc.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/automoc.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/automoc.cpp')
-rw-r--r--src/lib/buildgraph/automoc.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/lib/buildgraph/automoc.cpp b/src/lib/buildgraph/automoc.cpp
index dab1f9e5f..bf97caf50 100644
--- a/src/lib/buildgraph/automoc.cpp
+++ b/src/lib/buildgraph/automoc.cpp
@@ -28,11 +28,10 @@
****************************************************************************/
#include "automoc.h"
-#include "buildproduct.h"
-#include "buildproject.h"
+#include "productbuilddata.h"
+#include "projectbuilddata.h"
#include "buildgraph.h"
#include "rulesapplicator.h"
-#include "rulesevaluationcontext.h"
#include "scanresultcache.h"
#include <buildgraph/artifact.h>
#include <buildgraph/transformer.h>
@@ -80,7 +79,7 @@ void AutoMoc::setScanResultCache(ScanResultCache *scanResultCache)
m_scanResultCache = scanResultCache;
}
-void AutoMoc::apply(const BuildProductPtr &product)
+void AutoMoc::apply(const ResolvedProductPtr &product)
{
if (scanners().isEmpty())
throw Error("C++ scanner cannot be loaded.");
@@ -90,8 +89,8 @@ void AutoMoc::apply(const BuildProductPtr &product)
QList<QPair<Artifact *, FileType> > artifactsToMoc;
QSet<QString> includedMocCppFiles;
const FileTime currentTime = FileTime::currentTime();
- ArtifactList::const_iterator it = product->artifacts.begin();
- for (; it != product->artifacts.end(); ++it) {
+ ArtifactList::const_iterator it = product->buildData->artifacts.begin();
+ for (; it != product->buildData->artifacts.end(); ++it) {
Artifact *artifact = *it;
if (!pchFile || !pluginMetaDataFile) {
foreach (const FileTag &fileTag, artifact->fileTags) {
@@ -164,8 +163,8 @@ void AutoMoc::apply(const BuildProductPtr &product)
if (!artifactsPerFileTag.isEmpty()) {
emit reportCommandDescription(QLatin1String("automoc"),
Tr::tr("Applying moc rules for '%1'.")
- .arg(product->rProduct->name));
- RulesApplicator(product.data(), artifactsPerFileTag, m_logger).applyAllRules();
+ .arg(product->name));
+ RulesApplicator(product, artifactsPerFileTag, m_logger).applyAllRules();
}
if (pluginHeaderFile && pluginMetaDataFile) {
// Make every artifact that is dependent of the header file also
@@ -174,7 +173,7 @@ void AutoMoc::apply(const BuildProductPtr &product)
loggedConnect(outputOfHeader, pluginMetaDataFile, m_logger);
}
- product->project->updateNodesThatMustGetNewTransformer();
+ product->project->buildData->updateNodesThatMustGetNewTransformer(m_logger);
}
QString AutoMoc::generateMocFileName(Artifact *artifact, FileType fileType)
@@ -345,7 +344,7 @@ void AutoMoc::unmoc(Artifact *artifact, const FileTag &mocFileTag)
m_logger.qbsTrace() << "[AUTOMOC] removing moc obj artifact "
<< relativeArtifactFileName(mocObjArtifact);
}
- artifact->project->removeArtifact(mocObjArtifact);
+ artifact->project->buildData->removeArtifact(mocObjArtifact, m_logger);
}
}
@@ -353,7 +352,7 @@ void AutoMoc::unmoc(Artifact *artifact, const FileTag &mocFileTag)
m_logger.qbsTrace() << "[AUTOMOC] removing generated artifact "
<< relativeArtifactFileName(generatedMocArtifact);
}
- artifact->project->removeArtifact(generatedMocArtifact);
+ artifact->project->buildData->removeArtifact(generatedMocArtifact, m_logger);
delete generatedMocArtifact;
}