From 071e04c18f1218a01a88f0dffe8be83301f74f7a Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Wed, 15 Jun 2016 02:18:24 -0700 Subject: Generate a proper install tree for the dist target. Now adds Incredibuild files and Windows import libraries, and removes some unnecessary files which bloat the distribution. Change-Id: I5ec15b0bc5ae29fa1f6a5ecca314fc083756eb17 Reviewed-by: Christian Kandeler --- dist/dist.qbs | 39 ++++++++++++++++++++-- qbs-resources/imports/QbsLibrary.qbs | 6 ++++ .../modules/qbsbuildconfig/qbsbuildconfig.qbs | 1 + share/share.qbs | 10 ++++++ 4 files changed, 53 insertions(+), 3 deletions(-) diff --git a/dist/dist.qbs b/dist/dist.qbs index 3278cd2c3..94f25fbce 100644 --- a/dist/dist.qbs +++ b/dist/dist.qbs @@ -23,6 +23,23 @@ Product { Depends { name: "archiver" } Depends { name: "Qt.core" } + property stringList windeployqtArgs: [ + "--no-svg", + "--no-system-d3d-compiler", + "--no-angle", + "--no-opengl-sw", + "--no-compiler-runtime", + ] + + // List of path prefixes to be excluded from the generated archive + property stringList excludedPathPrefixes: [ + "bin/icudt", + "bin/icuin", + "bin/icuuc", + "bin/iconengines/", + "bin/imageformats/", + ] + condition: qbs.targetOS.contains("windows") builtByDefault: false type: ["archiver.archive"] @@ -46,10 +63,14 @@ Product { cmd.description = "windeployqt"; cmd.outputFilePath = output.filePath; cmd.installRoot = product.moduleProperty("qbs", "installRoot"); + cmd.windeployqtArgs = product.windeployqtArgs; cmd.binaryFilePaths = inputs.installable.filter(function (artifact) { return artifact.fileTags.contains("application") || artifact.fileTags.contains("dynamiclibrary"); }).map(function(a) { return ModUtils.artifactInstalledFilePath(a); }); + cmd.extendedDescription = FileInfo.joinPaths( + product.moduleProperty("Qt.core", "binPath"), "windeployqt") + ".exe " + + ["--json"].concat(cmd.windeployqtArgs).concat(cmd.binaryFilePaths).join(" "); cmd.sourceCode = function () { var out; var process; @@ -57,7 +78,7 @@ Product { process = new Process(); process.exec(FileInfo.joinPaths(product.moduleProperty("Qt.core", "binPath"), "windeployqt"), ["--json"] - .concat(binaryFilePaths), true); + .concat(windeployqtArgs).concat(binaryFilePaths), true); out = process.readStdOut(); } finally { if (process) @@ -90,6 +111,7 @@ Product { prepare: { var cmd = new JavaScriptCommand(); cmd.silent = true; + cmd.excludedPathPrefixes = product.excludedPathPrefixes; cmd.inputFilePaths = inputs.installable.map(function(a) { return ModUtils.artifactInstalledFilePath(a); }); @@ -119,8 +141,19 @@ Product { try { tf = new TextFile(outputFilePath, TextFile.ReadWrite); - for (var i = 0; i < inputFilePaths.length; ++i) - tf.writeLine(FileInfo.relativePath(installRoot, inputFilePaths[i])); + for (var i = 0; i < inputFilePaths.length; ++i) { + var ignore = false; + var relativePath = FileInfo.relativePath(installRoot, inputFilePaths[i]); + for (var j = 0; j < excludedPathPrefixes.length; ++j) { + if (relativePath.startsWith(excludedPathPrefixes[j])) { + ignore = true; + break; + } + } + + if (!ignore) + tf.writeLine(relativePath); + } } finally { if (tf) tf.close(); diff --git a/qbs-resources/imports/QbsLibrary.qbs b/qbs-resources/imports/QbsLibrary.qbs index 2d3e10fb1..b8649b2cc 100644 --- a/qbs-resources/imports/QbsLibrary.qbs +++ b/qbs-resources/imports/QbsLibrary.qbs @@ -19,6 +19,12 @@ QbsProduct { qbs.install: true qbs.installDir: qbsbuildconfig.libInstallDir } + Group { + fileTagsFilter: ["dynamiclibrary_import"] + qbs.install: true + qbs.installDir: qbsbuildconfig.importLibInstallDir + } + Export { Depends { name: "cpp" } Depends { name: "Qt"; submodules: ["core"] } diff --git a/qbs-resources/modules/qbsbuildconfig/qbsbuildconfig.qbs b/qbs-resources/modules/qbsbuildconfig/qbsbuildconfig.qbs index 0ceca7dd4..b90d9916a 100644 --- a/qbs-resources/modules/qbsbuildconfig/qbsbuildconfig.qbs +++ b/qbs-resources/modules/qbsbuildconfig/qbsbuildconfig.qbs @@ -8,6 +8,7 @@ Module { property string libDirName: "lib" property string appInstallDir: "bin" property string libInstallDir: qbs.targetOS.contains("windows") ? "bin" : libDirName + property string importLibInstallDir: libDirName property string libexecInstallDir: "libexec/qbs" property string relativeLibexecPath: "../" + libexecInstallDir property string relativePluginsPath: "../" + libDirName diff --git a/share/share.qbs b/share/share.qbs index 7c60a8784..8f1aa673f 100644 --- a/share/share.qbs +++ b/share/share.qbs @@ -6,6 +6,16 @@ Product { name: "qbs resources" type: ["copied qbs resources"] Depends { name: "qbsbuildconfig" } + + Group { + name: "Incredibuild" + prefix: "../bin/" + files: ["ibmsvc.xml", "ibqbs.bat"] + fileTags: [] + qbs.install: qbs.targetOS.contains("windows") + qbs.installDir: qbsbuildconfig.appInstallDir + } + Group { name: "Modules and imports" files: ["qbs/**/*"] -- cgit v1.2.3