diff options
| author | Tobias Hunger <tobias.hunger@digia.com> | 2013-08-07 12:25:12 +0200 |
|---|---|---|
| committer | Tobias Hunger <tobias.hunger@digia.com> | 2013-08-09 10:50:44 +0200 |
| commit | 0f1717364b0b083369eb0d26348362a7949f9099 (patch) | |
| tree | 4d895cbffa86b7e8cbab6e43ae9c965d7e2c1e48 /src/lib/api | |
| parent | d5b44973885eec0a0fd1a56c0304688557c7a268 (diff) | |
| download | qbs-0f1717364b0b083369eb0d26348362a7949f9099.tar.gz | |
Add API to retrieve generated files.
Add an API to qbs::Project that can be used to retrieve generated
files (as known by the build system up to that point). This will
be used to e.g. get the name of header files generated from ui files
in Qt Creator.
Change-Id: I4ef1b99f511bb67f14029c90102630c0d498f1e5
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
Diffstat (limited to 'src/lib/api')
| -rw-r--r-- | src/lib/api/project.cpp | 15 | ||||
| -rw-r--r-- | src/lib/api/project.h | 4 |
2 files changed, 19 insertions, 0 deletions
diff --git a/src/lib/api/project.cpp b/src/lib/api/project.cpp index 9d7ebc3b7..0a6a184e8 100644 --- a/src/lib/api/project.cpp +++ b/src/lib/api/project.cpp @@ -488,6 +488,21 @@ void Project::updateTimestamps(const QList<ProductData> &products) d->logger); } +/*! + * \brief Finds files generated from the given file in the given product. + * The function returns files generated from the given file and the given product. To do so it will + * traverse the graph of generated files and the files generated from those files. + * + * If an empty list of tags is given, then all directly and indirectly generated files will be + * returned. If there are tags, then processing will stop once matching files were found. + */ +QStringList Project::generatedFiles(const ProductData &product, const QString &file, + const QStringList &tags) const +{ + const ResolvedProductConstPtr internalProduct = d->internalProduct(product); + return internalProduct->generatedFiles(file, FileTags::fromStringList(tags)); +} + QVariantMap Project::projectConfiguration() const { return d->internalProject->buildConfiguration(); diff --git a/src/lib/api/project.h b/src/lib/api/project.h index 291697259..134e26968 100644 --- a/src/lib/api/project.h +++ b/src/lib/api/project.h @@ -35,6 +35,7 @@ #include <QExplicitlySharedDataPointer> #include <QHash> #include <QList> +#include <QStringList> #include <QVariantMap> QT_BEGIN_NAMESPACE @@ -102,6 +103,9 @@ public: bool operator==(const Project &other) const { return d.data() == other.d.data(); } + QStringList generatedFiles(const ProductData &product, const QString &file, + const QStringList &tags = QStringList()) const; + QVariantMap projectConfiguration() const; QHash<QString, QString> usedEnvironment() const; |
