aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJake Petroules <jake.petroules@petroules.com>2014-07-16 11:27:16 -0400
committerJake Petroules <jake.petroules@petroules.com>2014-07-17 16:53:17 +0200
commitd256a3de2672e68ebb5c22d689488b332a293d04 (patch)
tree5b0e13aed4af686ad4f4fdc20cff4110916b2c67 /src
parentbae4d3de0f4bb18fc543767c462c47f07d1f600c (diff)
Expose additional properties in the ProductData API.
Change-Id: I825deb8f44aa8e0fa2a1e89cae7a1c0c3e314073 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/lib/corelib/api/project.cpp8
-rw-r--r--src/lib/corelib/api/projectdata.cpp36
-rw-r--r--src/lib/corelib/api/projectdata.h4
-rw-r--r--src/lib/corelib/api/projectdata_p.h4
4 files changed, 52 insertions, 0 deletions
diff --git a/src/lib/corelib/api/project.cpp b/src/lib/corelib/api/project.cpp
index 69cb2034a..80b5f6632 100644
--- a/src/lib/corelib/api/project.cpp
+++ b/src/lib/corelib/api/project.cpp
@@ -579,7 +579,11 @@ void ProjectPrivate::retrieveProjectData(ProjectData &projectData,
projectData.d->enabled = internalProject->enabled;
foreach (const ResolvedProductConstPtr &resolvedProduct, internalProject->products) {
ProductData product;
+ product.d->type = resolvedProduct->fileTags.toStringList();
product.d->name = resolvedProduct->name;
+ product.d->targetName = resolvedProduct->targetName;
+ product.d->version = resolvedProduct->productProperties
+ .value(QLatin1String("version")).toString();
product.d->profile = resolvedProduct->profile;
product.d->location = resolvedProduct->location;
product.d->isEnabled = resolvedProduct->enabled;
@@ -597,8 +601,12 @@ void ProjectPrivate::retrieveProjectData(ProjectData &projectData,
product.d->targetArtifacts << ta;
}
}
+ foreach (const ResolvedProductPtr &resolvedDependentProduct, resolvedProduct->dependencies)
+ product.d->dependencies << resolvedDependentProduct->name;
+ qSort(product.d->type);
qSort(product.d->groups);
qSort(product.d->targetArtifacts);
+ qSort(product.d->dependencies);
product.d->isValid = true;
projectData.d->products << product;
}
diff --git a/src/lib/corelib/api/projectdata.cpp b/src/lib/corelib/api/projectdata.cpp
index 105f144b5..6a43e363e 100644
--- a/src/lib/corelib/api/projectdata.cpp
+++ b/src/lib/corelib/api/projectdata.cpp
@@ -371,6 +371,22 @@ bool ProductData::isValid() const
}
/*!
+ * \brief The product type, which is the list of file tags matching the product's target artifacts.
+ */
+QStringList ProductData::type() const
+{
+ return d->type;
+}
+
+/*!
+ * \brief The names of dependent products.
+ */
+QStringList ProductData::dependencies() const
+{
+ return d->dependencies;
+}
+
+/*!
* \brief The name of the product as given in the qbs source file.
*/
QString ProductData::name() const
@@ -379,6 +395,22 @@ QString ProductData::name() const
}
/*!
+ * \brief The base name of the product's target file as given in the qbs source file.
+ */
+QString ProductData::targetName() const
+{
+ return d->targetName;
+}
+
+/*!
+ * \brief The version number of the product.
+ */
+QString ProductData::version() const
+{
+ return d->version;
+}
+
+/*!
* \brief The profile this product will be built for.
*/
QString ProductData::profile() const
@@ -431,6 +463,10 @@ bool ProductData::isRunnable() const
bool operator==(const ProductData &lhs, const ProductData &rhs)
{
return lhs.name() == rhs.name()
+ && lhs.targetName() == rhs.targetName()
+ && lhs.type() == rhs.type()
+ && lhs.version() == rhs.version()
+ && lhs.dependencies() == rhs.dependencies()
&& lhs.profile() == rhs.profile()
&& lhs.location() == rhs.location()
&& lhs.groups() == rhs.groups()
diff --git a/src/lib/corelib/api/projectdata.h b/src/lib/corelib/api/projectdata.h
index c1195e7f5..7d52ceaff 100644
--- a/src/lib/corelib/api/projectdata.h
+++ b/src/lib/corelib/api/projectdata.h
@@ -171,7 +171,11 @@ public:
bool isValid() const;
+ QStringList type() const;
+ QStringList dependencies() const;
QString name() const;
+ QString targetName() const;
+ QString version() const;
QString profile() const;
CodeLocation location() const;
QList<TargetArtifact> targetArtifacts() const;
diff --git a/src/lib/corelib/api/projectdata_p.h b/src/lib/corelib/api/projectdata_p.h
index 64f7a3084..13047036d 100644
--- a/src/lib/corelib/api/projectdata_p.h
+++ b/src/lib/corelib/api/projectdata_p.h
@@ -79,7 +79,11 @@ public:
ProductDataPrivate() : isValid(false)
{ }
+ QStringList type;
+ QStringList dependencies;
QString name;
+ QString targetName;
+ QString version;
QString profile;
CodeLocation location;
QList<GroupData> groups;