aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/qtprofilesetup/templates
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@theqtcompany.com>2016-05-03 11:44:55 +0200
committerJoerg Bornemann <joerg.bornemann@theqtcompany.com>2016-05-03 11:44:55 +0200
commit9f303234d3bed1770d8b8fd17deb209d19eac1b7 (patch)
tree3fa994e1abae6beeada4d492e0b7b32b556f5165 /src/lib/qtprofilesetup/templates
parenta16582bd37475773f6c5ba7f1f643484cf5c3271 (diff)
parent5c9171ca2ef5bc538967c29246d5f35bf01cfea7 (diff)
Merge remote-tracking branch 'origin/1.5'
Conflicts: src/lib/corelib/jsextensions/environmentextension.cpp src/lib/corelib/language/scriptengine.h Change-Id: I77e4626218612656d0963d1bfc643d9f9e7f4edd
Diffstat (limited to 'src/lib/qtprofilesetup/templates')
-rw-r--r--src/lib/qtprofilesetup/templates/dbus.js61
-rw-r--r--src/lib/qtprofilesetup/templates/dbus.qbs69
-rw-r--r--src/lib/qtprofilesetup/templates/qdoc.js4
3 files changed, 133 insertions, 1 deletions
diff --git a/src/lib/qtprofilesetup/templates/dbus.js b/src/lib/qtprofilesetup/templates/dbus.js
new file mode 100644
index 000000000..86f43e712
--- /dev/null
+++ b/src/lib/qtprofilesetup/templates/dbus.js
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing
+**
+** This file is part of the Qt Build Suite.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms and
+** conditions see http://www.qt.io/terms-conditions. For further information
+** use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+****************************************************************************/
+
+var FileInfo = loadExtension("qbs.FileInfo");
+
+function outputFileName(input, suffix)
+{
+ var parts = input.fileName.split('.').filter(function(s) { return s.length > 0; });
+ if (parts.length === 0)
+ throw "Cannot run qdbusxml2cpp on '" + input.filePath + "': Unsuitable file name.";
+ var outputBaseName = parts.length === 1 ? parts[0] : parts[parts.length - 2];
+ return outputBaseName.toLowerCase() + suffix;
+}
+
+function createCommands(product, input, outputs, option)
+{
+ var exe = ModUtils.moduleProperty(product, "binPath") + '/'
+ + ModUtils.moduleProperty(product, "xml2cppName");
+ var hppOutput = outputs["hpp"][0];
+ var hppArgs = ModUtils.moduleProperty(product, "xml2CppHeaderFlags");
+ hppArgs.push(option, hppOutput.fileName + ':', input.filePath); // Can't use filePath on Windows
+ var hppCmd = new Command(exe, hppArgs)
+ hppCmd.description = "qdbusxml2cpp " + input.fileName + " -> " + hppOutput.fileName;
+ hppCmd.highlight = "codegen";
+ hppCmd.workingDirectory = FileInfo.path(hppOutput.filePath);
+ var cppOutput = outputs["cpp"][0];
+ var cppArgs = ModUtils.moduleProperty(product, "xml2CppSourceFlags");
+ cppArgs.push("-i", hppOutput.filePath, option, ':' + cppOutput.fileName, input.filePath);
+ var cppCmd = new Command(exe, cppArgs)
+ cppCmd.description = "qdbusxml2cpp " + input.fileName + " -> " + cppOutput.fileName;
+ cppCmd.highlight = "codegen";
+ cppCmd.workingDirectory = FileInfo.path(hppOutput.filePath);
+ return [hppCmd, cppCmd];
+}
diff --git a/src/lib/qtprofilesetup/templates/dbus.qbs b/src/lib/qtprofilesetup/templates/dbus.qbs
new file mode 100644
index 000000000..2f07e37c3
--- /dev/null
+++ b/src/lib/qtprofilesetup/templates/dbus.qbs
@@ -0,0 +1,69 @@
+import qbs 1.0
+import qbs.FileInfo
+import qbs.ModUtils
+import "../QtModule.qbs" as QtModule
+import "dbus.js" as DBus
+
+QtModule {
+ qtModuleName: "DBus"
+
+ property string xml2cppName: "qdbusxml2cpp"
+ property stringList xml2CppHeaderFlags: []
+ property stringList xml2CppSourceFlags: []
+
+ Rule {
+ inputs: ["qt.dbus.adaptor"]
+
+ Artifact {
+ filePath: "GeneratedFiles/" + DBus.outputFileName(input, "_adaptor.h")
+ fileTags: ["hpp"]
+ }
+ Artifact {
+ filePath: "GeneratedFiles/" + DBus.outputFileName(input, "_adaptor.cpp")
+ fileTags: ["cpp"]
+ }
+
+ prepare: {
+ return DBus.createCommands(product, input, outputs, "-a");
+ }
+ }
+
+ Rule {
+ inputs: ["qt.dbus.interface"]
+
+ Artifact {
+ filePath: "GeneratedFiles/" + DBus.outputFileName(input, "_interface.h")
+ fileTags: ["hpp"]
+ }
+ Artifact {
+ filePath: "GeneratedFiles/" + DBus.outputFileName(input, "_interface.cpp")
+ fileTags: ["cpp"]
+ }
+
+ prepare: {
+ return DBus.createCommands(product, input, outputs, "-p");
+ }
+ }
+
+ staticLibsDebug: @staticLibsDebug@
+ staticLibsRelease: @staticLibsRelease@
+ dynamicLibsDebug: @dynamicLibsDebug@
+ dynamicLibsRelease: @dynamicLibsRelease@
+ linkerFlagsDebug: @linkerFlagsDebug@
+ linkerFlagsRelease: @linkerFlagsRelease@
+ frameworksDebug: @frameworksDebug@
+ frameworksRelease: @frameworksRelease@
+ frameworkPathsDebug: @frameworkPathsDebug@
+ frameworkPathsRelease: @frameworkPathsRelease@
+ libNameForLinkerDebug: @libNameForLinkerDebug@
+ libNameForLinkerRelease: @libNameForLinkerRelease@
+ libFilePathDebug: @libFilePathDebug@
+ libFilePathRelease: @libFilePathRelease@
+
+ cpp.defines: @defines@
+ cpp.includePaths: @includes@
+ cpp.libraryPaths: @libraryPaths@
+
+ @special_properties@
+}
+
diff --git a/src/lib/qtprofilesetup/templates/qdoc.js b/src/lib/qtprofilesetup/templates/qdoc.js
index 6c7230233..0e37e259e 100644
--- a/src/lib/qtprofilesetup/templates/qdoc.js
+++ b/src/lib/qtprofilesetup/templates/qdoc.js
@@ -43,8 +43,9 @@ function qdocArgs(product, input, outputDir) {
return args;
}
+var _qdocDefaultFileTag = "qdoc-output";
function qdocFileTaggers() {
- var t = "qdoc-output";
+ var t = _qdocDefaultFileTag;
return {
".qhp": [t, "qhp"],
".qhp.sha1": [t, "qhp-sha1"],
@@ -59,6 +60,7 @@ function outputArtifacts(product, input) {
var tracker = new ModUtils.BlackboxOutputArtifactTracker();
tracker.hostOS = product.moduleProperty("qbs", "hostOS");
tracker.shellPath = product.moduleProperty("qbs", "shellPath");
+ tracker.defaultFileTags = [_qdocDefaultFileTag];
tracker.fileTaggers = qdocFileTaggers();
tracker.command = FileInfo.joinPaths(ModUtils.moduleProperty(product, "binPath"),
ModUtils.moduleProperty(product, "qdocName"));