summaryrefslogtreecommitdiff
path: root/src/lib/buildgraph/rulesapplicator.cpp
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@digia.com>2013-01-15 11:46:21 +0100
committerChristian Kandeler <christian.kandeler@digia.com>2013-01-18 14:38:21 +0100
commitf857a29bc9d064da54cdd540965a7d215e6c234e (patch)
tree263bfb7ff5cbe503ecaa7ea85013c2c40621ca58 /src/lib/buildgraph/rulesapplicator.cpp
parentefbd34a3a358e4ad60b0fcb27fb446789294be25 (diff)
downloadqbs-f857a29bc9d064da54cdd540965a7d215e6c234e.tar.gz
introduce property Group.fileTagsFilter
With fileTagsFilter one can set properties on a certain set of generated artifacts. This property is a list of file tags. All artifacts that have file tags that are in that list will get the properties that are bound in the rest of the item. Example: Group { fileTagsFilter: ["dynamiclibrary"] qbs.installDir: "mylibs" } Group.files and Group.fileTagsFilter are exclusive. Change-Id: I764e0a823f2cda4efe4ac3c985ecde5e178bab7b Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
Diffstat (limited to 'src/lib/buildgraph/rulesapplicator.cpp')
-rw-r--r--src/lib/buildgraph/rulesapplicator.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/lib/buildgraph/rulesapplicator.cpp b/src/lib/buildgraph/rulesapplicator.cpp
index eb4856a89..374aa67e5 100644
--- a/src/lib/buildgraph/rulesapplicator.cpp
+++ b/src/lib/buildgraph/rulesapplicator.cpp
@@ -34,6 +34,7 @@
#include "buildproject.h"
#include "rulesevaluationcontext.h"
#include "transformer.h"
+#include <language/artifactproperties.h>
#include <language/language.h>
#include <language/scriptengine.h>
#include <logging/logger.h>
@@ -267,6 +268,15 @@ Artifact *RulesApplicator::createOutputArtifact(const RuleArtifactConstPtr &rule
else
outputArtifact->properties= (*inputArtifacts.constBegin())->properties;
+ for (int i = 0; i < m_buildProduct->rProduct->artifactProperties.count(); ++i) {
+ const ArtifactPropertiesConstPtr &props = m_buildProduct->rProduct->artifactProperties.at(i);
+ QSet<QString> filter = props->fileTagsFilter().toSet();
+ if (!filter.intersect(outputArtifact->fileTags).isEmpty()) {
+ outputArtifact->properties = props->propertyMap();
+ break;
+ }
+ }
+
foreach (Artifact *inputArtifact, inputArtifacts) {
Q_ASSERT(outputArtifact != inputArtifact);
loggedConnect(outputArtifact, inputArtifact);