diff options
author | Denis Klychkov <kd.snake@gmail.com> | 2016-11-25 23:52:22 +0300 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2016-12-02 09:37:21 +0000 |
commit | 94e0ccc24874d2571e074da9e2198bb24b2fad77 (patch) | |
tree | 362e646a74a8cf6a865a7abbd7965982321037cb | |
parent | 3329d245f6da3ee762574a9df6acc5c56a2ac9ed (diff) |
Add possibility to specify the base name of the generated qrc file
Task-number: QBS-1043
Change-Id: I5f537f148792b0e2647d08d6e8004d79ae402f07
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
-rw-r--r-- | doc/reference/modules/qt-modules.qdoc | 7 | ||||
-rw-r--r-- | share/qbs/imports/qbs/ModUtils/utils.js | 7 | ||||
-rw-r--r-- | src/lib/qtprofilesetup/templates/core.qbs | 5 |
3 files changed, 18 insertions, 1 deletions
diff --git a/doc/reference/modules/qt-modules.qdoc b/doc/reference/modules/qt-modules.qdoc index 5e40e7107..8effee5b6 100644 --- a/doc/reference/modules/qt-modules.qdoc +++ b/doc/reference/modules/qt-modules.qdoc @@ -347,6 +347,13 @@ \li For files tagged as \c{qt.core.resource_data}, this property determines the prefix under which they will be available in the generated \c qrc file. \row + \li resourceFileBaseName + \li \c{string} + \li \c{product.targetName} + \li For files tagged as \c{qt.core.resource_data}, this property determines the base name + of the generated \c qrc file. If this property needs to be changed, it must be set + in the corresponding product rather than in a Group. + \row \li staticBuild \li \c{bool} \li \c{undefined} diff --git a/share/qbs/imports/qbs/ModUtils/utils.js b/share/qbs/imports/qbs/ModUtils/utils.js index 30302e111..800a58bc0 100644 --- a/share/qbs/imports/qbs/ModUtils/utils.js +++ b/share/qbs/imports/qbs/ModUtils/utils.js @@ -355,6 +355,13 @@ var PropertyValidator = (function () { ? " component" : " components")); }; + PropertyValidator.prototype.addFileNameValidator = function (propertyName, propertyValue) { + this.addCustomValidator(propertyName, propertyValue, function (value) { + return !/[/?<>\\:*|"\u0000-\u001f\u0080-\u009f]/.test(propertyValue) + && propertyValue !== "." && propertyValue !== ".."; + }, "cannot contain reserved or control characters and cannot be \".\" or \"..\""); + }; + PropertyValidator.prototype.addCustomValidator = function (propertyName, propertyValue, validator, message) { this.propertyValidators.push({ propertyName: propertyName, diff --git a/src/lib/qtprofilesetup/templates/core.qbs b/src/lib/qtprofilesetup/templates/core.qbs index 98b3d3b3a..cd17e0eed 100644 --- a/src/lib/qtprofilesetup/templates/core.qbs +++ b/src/lib/qtprofilesetup/templates/core.qbs @@ -199,6 +199,8 @@ Module { }, " is '" + qtBuildVariant + "', but qbs.buildVariant is '" + qbs.buildVariant + "', which is not allowed when using MSVC"); + validator.addFileNameValidator("resourceFileBaseName", resourceFileBaseName); + validator.validate(); } @@ -278,11 +280,12 @@ Module { property path resourceSourceBase: product.sourceDirectory property string resourcePrefix: "/" + property string resourceFileBaseName: product.targetName Rule { multiplex: true inputs: ["qt.core.resource_data"] Artifact { - filePath: "__qbs_auto_" + product.name + ".qrc" + filePath: product.moduleProperty("Qt.core", "resourceFileBaseName") + ".qrc" fileTags: ["qrc"] } prepare: { |