diff options
author | Christian Kandeler <christian.kandeler@digia.com> | 2013-01-07 15:48:45 +0100 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@digia.com> | 2013-01-22 12:21:38 +0100 |
commit | 5cdf94de300e72987dfbe5c0fec5b86317ad6280 (patch) | |
tree | e484cd9ccd2faae387dd3978b6eb7783c99b84b3 /share | |
parent | 49060f9b1e2881a5e7801f59f6d237fd85da1ae1 (diff) |
Introduce the "install" command.
This decouples building and installing, e.g. allowing
the latter to be executed by a privileged user
to a system-wide directory.
In addition, the ability to install build artifacts
(typically executables or libraries) has been added.
Change-Id: I28e725e4c1168eebe88e12c75e3d3e9f5fe28ca5
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'share')
-rw-r--r-- | share/qbs/imports/qbs/base/QmlApp.qbs | 7 | ||||
-rw-r--r-- | share/qbs/modules/qbs/common.qbs | 79 |
2 files changed, 3 insertions, 83 deletions
diff --git a/share/qbs/imports/qbs/base/QmlApp.qbs b/share/qbs/imports/qbs/base/QmlApp.qbs index a5a1c9603..76f97530a 100644 --- a/share/qbs/imports/qbs/base/QmlApp.qbs +++ b/share/qbs/imports/qbs/base/QmlApp.qbs @@ -1,7 +1,7 @@ import qbs.base 1.0 Product { - type: [qbs.targetOS == 'mac' ? "applicationbundle" : "application", "installed_content"] + type: [qbs.targetOS == 'mac' ? "applicationbundle" : "application"] Depends { name: "qt"; submodules: ["core", "declarative"] } Depends { name: "cpp" } property string appViewerPath: localPath + "/qmlapplicationviewer" @@ -22,10 +22,5 @@ Product { appViewerPath + "/qmlapplicationviewer_qt5.cpp" ] } - - FileTagger { - pattern: "*.qml" - fileTags: ["install"] - } } diff --git a/share/qbs/modules/qbs/common.qbs b/share/qbs/modules/qbs/common.qbs index 6a0f7b0ed..25d41ff00 100644 --- a/share/qbs/modules/qbs/common.qbs +++ b/share/qbs/modules/qbs/common.qbs @@ -27,11 +27,9 @@ Module { property string toolchain property string architecture property string endianness - property string installDir: '.' + property bool install: false + property string installDir property string sysroot - property string installPrefix: "" - property string deployRoot: "./deployRoot" - property string deployInfoFile PropertyOptions { name: "buildVariant" @@ -44,77 +42,4 @@ Module { allowedValues: ['none', 'fast', 'small'] description: "optimization level" } - - Rule { - inputs: ["install"] - Artifact { - fileTags: ["installed_content"] - fileName: { - var targetPath = input.modules.qbs.installDir + "/" + input.fileName - if (input.modules.qbs.installPrefix && !FileInfo.isAbsolutePath(targetPath)) - targetPath = input.modules.qbs.installPrefix + "/" + targetPath - if (product.module.sysroot && FileInfo.isAbsolutePath(targetPath)) - targetPath = product.module.sysroot + targetPath - return targetPath - } - } - - prepare: { - var cmd = new JavaScriptCommand(); - cmd.sourceCode = function() { - File.remove(output.fileName); - if (!File.copy(input.fileName, output.fileName)) - throw "Cannot install '" + input.fileName + "' as '" + output.fileName + "'"; - } - cmd.description = "installing " + FileInfo.fileName(output.fileName); - cmd.highlight = "linker"; - return cmd; - } - } - - Rule { - inputs: "deploy" - multiplex: deployInfoFile != null - Artifact { - fileTags: "installed_content" - fileName: { - if (product.modules.qbs.deployInfoFile) - return product.modules.qbs.deployInfoFile - return input.modules.qbs.deployRoot + "/" + input.modules.qbs.installPrefix - + "/" + input.modules.qbs.installDir + "/" + input.fileName - } - } - - prepare: { - var cmd = new JavaScriptCommand() - cmd.deployInfo = [] - if (product.modules.qbs.deployInfoFile) { - for (var i in inputs.deploy) { - var sourceFile = inputs.deploy[i].fileName - var destFile = product.modules.qbs.installPrefix + "/" - + inputs.deploy[i].modules.qbs.installDir + "/" - + FileInfo.fileName(sourceFile) - destFile = destFile.replace(/\/+/g, "/") - destFile = destFile.replace(/\/\.\//g, "/") - cmd.deployInfo.push(sourceFile + "|" + destFile) - } - cmd.description = "Writing deployment information to '" + output.fileName + "'" - cmd.sourceCode = function() { - var deployInfoFile = new TextFile(output.fileName, TextFile.WriteOnly) - for (var i in deployInfo) - deployInfoFile.writeLine(deployInfo[i]) - deployInfoFile.close() - } - } else { - cmd.description = "deploying " + FileInfo.fileName(output.fileName) - cmd.sourceCode = function() { - File.remove(output.fileName) - if (!File.copy(input.fileName, output.fileName)) - throw "Cannot deploy '" + input.fileName + "' to '" + output.fileName + "'" - } - } - cmd.highlight = "linker" - return cmd - } - } } |