diff options
| author | Christian Kandeler <christian.kandeler@digia.com> | 2013-04-08 18:18:16 +0200 |
|---|---|---|
| committer | Joerg Bornemann <joerg.bornemann@digia.com> | 2013-04-12 14:19:12 +0200 |
| commit | 1d9c080428dcd5e8c1d08598d6542d87f1ca1819 (patch) | |
| tree | 38282acbb95c921595dffec93a6dd99aaa61c24f /src/lib/buildgraph/productinstaller.cpp | |
| parent | f17fd5d56a758a28ef5da04b2be83ed558f7cba6 (diff) | |
| download | qbs-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/productinstaller.cpp')
| -rw-r--r-- | src/lib/buildgraph/productinstaller.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/lib/buildgraph/productinstaller.cpp b/src/lib/buildgraph/productinstaller.cpp index e66d2c69e..81d40f4c9 100644 --- a/src/lib/buildgraph/productinstaller.cpp +++ b/src/lib/buildgraph/productinstaller.cpp @@ -29,15 +29,14 @@ #include "productinstaller.h" #include "artifact.h" -#include "buildproduct.h" -#include "buildproject.h" -#include "rulesevaluationcontext.h" +#include "productbuilddata.h" #include <language/language.h> #include <logging/translator.h> #include <tools/qbsassert.h> #include <tools/error.h> #include <tools/fileinfo.h> #include <tools/progressobserver.h> +#include <tools/qbsassert.h> #include <QDir> #include <QFileInfo> @@ -45,7 +44,7 @@ namespace qbs { namespace Internal { -ProductInstaller::ProductInstaller(const QList<BuildProductPtr> &products, +ProductInstaller::ProductInstaller(const QList<ResolvedProductPtr> &products, const InstallOptions &options, ProgressObserver *observer, const Logger &logger) : m_products(products), m_options(options), m_observer(observer), m_logger(logger) { @@ -65,11 +64,11 @@ ProductInstaller::ProductInstaller(const QList<BuildProductPtr> &products, if (m_products.isEmpty()) throw Error(Tr::tr("Cannot deduce install root, because there are no products.")); - const BuildProductConstPtr &product = m_products.first(); - m_options.installRoot = product->rProduct->properties - ->qbsPropertyValue(QLatin1String("sysroot")).toString(); + const ResolvedProductConstPtr &product = m_products.first(); + m_options.installRoot + = product->properties->qbsPropertyValue(QLatin1String("sysroot")).toString(); if (m_options.installRoot.isEmpty()) { - m_options.installRoot = product->project->resolvedProject()->buildDirectory + m_options.installRoot = product->project->buildDirectory + QLatin1Char('/') + InstallOptions::defaultInstallRoot(); } else if (m_options.removeFirst) { throw Error(Tr::tr("Refusing to remove sysroot.")); @@ -82,8 +81,9 @@ void ProductInstaller::install() removeInstallRoot(); QList<const Artifact *> artifactsToInstall; - foreach (const BuildProductConstPtr &product, m_products) { - foreach (const Artifact *artifact, product->artifacts) { + foreach (const ResolvedProductConstPtr &product, m_products) { + QBS_CHECK(product->buildData); + foreach (const Artifact *artifact, product->buildData->artifacts) { if (artifact->properties->qbsPropertyValue(QLatin1String("install")).toBool()) artifactsToInstall += artifact; } |
