aboutsummaryrefslogtreecommitdiffstats
path: root/dist
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2016-09-01 12:27:41 +0200
committerJake Petroules <jake.petroules@qt.io>2016-09-02 08:27:27 +0000
commit38d8f7144783f4226cc502a5cddf6e38556fedff (patch)
tree2e060f7428cbe5ce6cfe94b4a73ba63188f77097 /dist
parent4057bd7874c166287143355571ccae2d57df5431 (diff)
Distribution package: Allow to have a single top-level directory
So extracting the archive will not pollute the working directory. Change-Id: I44ef120f5898630133c1242681ec07ded2ee4560 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Diffstat (limited to 'dist')
-rw-r--r--dist/dist.qbs9
1 files changed, 7 insertions, 2 deletions
diff --git a/dist/dist.qbs b/dist/dist.qbs
index 3ffd8baa9..c5c247caf 100644
--- a/dist/dist.qbs
+++ b/dist/dist.qbs
@@ -44,6 +44,7 @@ Product {
"bin/iconengines/",
"bin/imageformats/",
]
+ property bool includeTopLevelDir: false
condition: qbs.targetOS.contains("windows")
builtByDefault: false
@@ -52,6 +53,10 @@ Product {
destinationDirectory: project.buildDirectory
archiver.type: "zip"
+ Properties {
+ condition: includeTopLevelDir
+ archiver.workingDirectory: qbs.installRoot + "/.."
+ }
archiver.workingDirectory: qbs.installRoot
Rule {
@@ -121,7 +126,7 @@ Product {
return ModUtils.artifactInstalledFilePath(a);
});
cmd.outputFilePath = output.filePath;
- cmd.installRoot = product.moduleProperty("qbs", "installRoot");
+ cmd.baseDirectory = product.moduleProperty("archiver", "workingDirectory");
cmd.sourceCode = function() {
var tf;
for (var i = 0; i < inputs["dependencies.json"].length; ++i) {
@@ -148,7 +153,7 @@ Product {
tf = new TextFile(outputFilePath, TextFile.ReadWrite);
for (var i = 0; i < inputFilePaths.length; ++i) {
var ignore = false;
- var relativePath = FileInfo.relativePath(installRoot, inputFilePaths[i]);
+ var relativePath = FileInfo.relativePath(baseDirectory, inputFilePaths[i]);
for (var j = 0; j < excludedPathPrefixes.length; ++j) {
if (relativePath.startsWith(excludedPathPrefixes[j])) {
ignore = true;