From 2530d46c5a8a9dfba6e02b48a376545cdaf7a361 Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Mon, 6 Nov 2017 22:22:42 -0800 Subject: Allow disabling pieces of the Qbs project by category This allows the "resources build" to not rely on a valid Qt profile. Task-number: QBS-1238 Change-Id: I1c743a95993099250da714c794b6e0ac16133609 Reviewed-by: Christian Kandeler --- qbs.qbs | 62 ++++++++++++++++++++++++-------------------------------------- 1 file changed, 24 insertions(+), 38 deletions(-) (limited to 'qbs.qbs') diff --git a/qbs.qbs b/qbs.qbs index 9e2fb1acd..c409eefb6 100644 --- a/qbs.qbs +++ b/qbs.qbs @@ -3,22 +3,26 @@ import qbs 1.0 Project { minimumQbsVersion: "1.6" qbsSearchPaths: ["qbs-resources"] + property bool withCode: true + property bool withDocumentation: true property bool withExamples: false + property bool withTests: withCode property stringList autotestArguments: [] property stringList autotestWrapper: [] references: [ - "doc/doc.qbs", - "doc/man/man.qbs", "docker/docker.qbs", "share/share.qbs", - "src/src.qbs", "scripts/scripts.qbs", - "tests/auto/auto.qbs", - "tests/fuzzy-test/fuzzy-test.qbs", - "tests/benchmarker/benchmarker.qbs", ] + SubProject { + filePath: "doc/doc.qbs" + Properties { + condition: parent.withDocumentation + } + } + SubProject { filePath: "examples/examples.qbs" Properties { @@ -26,6 +30,20 @@ Project { } } + SubProject { + filePath: "src/src.qbs" + Properties { + condition: parent.withCode + } + } + + SubProject { + filePath: "tests/tests.qbs" + Properties { + condition: parent.withTests + } + } + Product { name: "version" files: ["VERSION"] @@ -35,36 +53,4 @@ Project { name: "qmake project files for qbs" files: ["**/*.pr[io]"] } - - AutotestRunner { - Depends { name: "Qt.core" } - Depends { name: "qbs resources" } - Depends { name: "qbs_cpp_scanner" } - Depends { name: "qbs_qt_scanner" } - arguments: project.autotestArguments - wrapper: project.autotestWrapper - environment: { - var env = base; - if (qbs.hostOS.contains("windows") && qbs.targetOS.contains("windows")) { - var path = ""; - for (var i = 0; i < env.length; ++i) { - if (env[i].startsWith("PATH=")) { - path = env[i].substring(5); - break; - } - } - path = Qt.core.binPath + ";" + path; - var arrayElem = "PATH=" + path; - if (i < env.length) - env[i] = arrayElem; - else - env.push(arrayElem); - } - if (qbs.hostOS.contains("darwin") && qbs.targetOS.contains("darwin")) { - env.push("DYLD_FRAMEWORK_PATH=" + Qt.core.libPath); - env.push("DYLD_LIBRARY_PATH=" + Qt.core.libPath); - } - return env; - } - } } -- cgit v1.2.3