diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2018-05-24 14:45:14 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2018-05-28 12:10:19 +0000 |
commit | 73f8478c9844aaf1282cc7461075f9c73230af2f (patch) | |
tree | 3b27e8b11893d0b52ff52b489a60e84da65b9941 /src/lib/corelib/language/projectresolver.cpp | |
parent | 57fd0ab336f0d88c007e4d7f5d09230d9a9e460b (diff) |
Allow rules without output artifacts
It is occasionally useful to have a rule whose purpose lies solely in
its "side effects", that is, it does not produce any actual files.
This patch removes the necessity to declare a dummy artifact in that
case.
[ChangeLog] Added support for rules without output artifacts
Change-Id: I38e76a5ddc78ffa768e8ae1f270ae2f7461c5ee7
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'src/lib/corelib/language/projectresolver.cpp')
-rw-r--r-- | src/lib/corelib/language/projectresolver.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/lib/corelib/language/projectresolver.cpp b/src/lib/corelib/language/projectresolver.cpp index 5364184fc..b7535c2eb 100644 --- a/src/lib/corelib/language/projectresolver.cpp +++ b/src/lib/corelib/language/projectresolver.cpp @@ -1174,19 +1174,18 @@ void ProjectResolver::resolveRule(Item *item, ProjectContext *projectContext) rule->prepareScript.initialize(scriptFunctionValue(item, StringConstants::prepareProperty())); rule->outputArtifactsScript.initialize(scriptFunctionValue( item, StringConstants::outputArtifactsProperty())); + rule->outputFileTags = m_evaluator->fileTagsValue( + item, StringConstants::outputFileTagsProperty()); if (rule->outputArtifactsScript.isValid()) { if (hasArtifactChildren) throw ErrorInfo(Tr::tr("The Rule.outputArtifacts script is not allowed in rules " "that contain Artifact items."), item->location()); - rule->outputFileTags = m_evaluator->fileTagsValue( - item, StringConstants::outputFileTagsProperty()); - if (rule->outputFileTags.empty()) - throw ErrorInfo(Tr::tr("Rule.outputFileTags must be specified if " - "Rule.outputArtifacts is specified."), - item->location()); } - + if (!hasArtifactChildren && rule->outputFileTags.empty()) { + throw ErrorInfo(Tr::tr("A rule needs to have Artifact items or a non-empty " + "outputFileTags property."), item->location()); + } rule->multiplex = m_evaluator->boolValue(item, StringConstants::multiplexProperty()); rule->alwaysRun = m_evaluator->boolValue(item, StringConstants::alwaysRunProperty()); rule->inputs = m_evaluator->fileTagsValue(item, StringConstants::inputsProperty()); |