diff options
author | Jake Petroules <jake.petroules@qt.io> | 2017-11-06 22:22:42 -0800 |
---|---|---|
committer | Jake Petroules <jake.petroules@qt.io> | 2017-11-09 03:10:49 +0000 |
commit | 2530d46c5a8a9dfba6e02b48a376545cdaf7a361 (patch) | |
tree | 77a28150bb48119675311d07de46a5b5381f1b2d | |
parent | 842740d6ef482512df326e99c0d365b90ca503b0 (diff) |
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 <christian.kandeler@qt.io>
-rw-r--r-- | doc/doc.qbs | 92 | ||||
-rw-r--r-- | qbs.qbs | 62 | ||||
-rw-r--r-- | static-res.pro | 8 | ||||
-rw-r--r-- | tests/tests.qbs | 41 |
4 files changed, 116 insertions, 87 deletions
diff --git a/doc/doc.qbs b/doc/doc.qbs index 61e205f57..6d02d1cca 100644 --- a/doc/doc.qbs +++ b/doc/doc.qbs @@ -1,51 +1,55 @@ import qbs 1.0 -Product { - name: "qbs documentation" - builtByDefault: false - type: "qch" - Depends { name: "Qt.core" } - Depends { name: "qbsbuildconfig" } - Depends { name: "qbsversion" } +Project { + references: ["man/man.qbs"] - files: [ - "../README", - "classic.css", - "external-resources.qdoc", - "fixnavi.pl", - "howtos.qdoc", - "qbs.qdoc", - "qbs-online.qdocconf", - "config/*.qdocconf", - "config/style/qt5-sidebar.html", - "reference/**/*", - "templates/**/*", - "images/**", - "targets/**", - ] - Group { - name: "main qdocconf file" - files: "qbs.qdocconf" - fileTags: "qdocconf-main" - } + Product { + name: "qbs documentation" + builtByDefault: false + type: "qch" + Depends { name: "Qt.core" } + Depends { name: "qbsbuildconfig" } + Depends { name: "qbsversion" } - property string versionTag: qbsversion.version.replace(/\.|-/g, "") - Qt.core.qdocEnvironment: [ - "QBS_VERSION=" + qbsversion.version, - "SRCDIR=" + path, - "QT_INSTALL_DOCS=" + Qt.core.docPath, - "QBS_VERSION_TAG=" + versionTag - ] + files: [ + "../README", + "classic.css", + "external-resources.qdoc", + "fixnavi.pl", + "howtos.qdoc", + "qbs.qdoc", + "qbs-online.qdocconf", + "config/*.qdocconf", + "config/style/qt5-sidebar.html", + "reference/**/*", + "templates/**/*", + "images/**", + "targets/**", + ] + Group { + name: "main qdocconf file" + files: "qbs.qdocconf" + fileTags: "qdocconf-main" + } - Group { - fileTagsFilter: ["qdoc-output"] - qbs.install: qbsbuildconfig.installHtml - qbs.installDir: qbsbuildconfig.docInstallDir - qbs.installSourceBase: Qt.core.qdocOutputDir - } - Group { - fileTagsFilter: ["qch"] - qbs.install: qbsbuildconfig.installQch - qbs.installDir: qbsbuildconfig.docInstallDir + property string versionTag: qbsversion.version.replace(/\.|-/g, "") + Qt.core.qdocEnvironment: [ + "QBS_VERSION=" + qbsversion.version, + "SRCDIR=" + path, + "QT_INSTALL_DOCS=" + Qt.core.docPath, + "QBS_VERSION_TAG=" + versionTag + ] + + Group { + fileTagsFilter: ["qdoc-output"] + qbs.install: qbsbuildconfig.installHtml + qbs.installDir: qbsbuildconfig.docInstallDir + qbs.installSourceBase: Qt.core.qdocOutputDir + } + Group { + fileTagsFilter: ["qch"] + qbs.install: qbsbuildconfig.installQch + qbs.installDir: qbsbuildconfig.docInstallDir + } } } @@ -3,29 +3,47 @@ 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 { condition: parent.withExamples } } + 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; - } - } } diff --git a/static-res.pro b/static-res.pro index f65c82353..b35836ece 100644 --- a/static-res.pro +++ b/static-res.pro @@ -16,16 +16,14 @@ else: \ qbsres.target = $$builddirname/default/default.bg qbsres.commands = \ $$shell_quote($$shell_path($$qbsbindir/qbs)) \ - setup-qt \ - --settings-dir $$shell_quote($$builddirname/settings) \ - $(QMAKE) qt $$escape_expand(\\n\\t) \ - $$shell_quote($$shell_path($$qbsbindir/qbs)) \ build \ --settings-dir $$shell_quote($$builddirname/settings) \ -f $$shell_quote($$PWD/qbs.qbs) \ -d $$shell_quote($$builddirname) \ -p $$shell_quote("qbs resources") \ - profile:qt + project.withCode:false \ + project.withDocumentation:false \ + profile:none qbsqmltypes.target = $$typedescdir_dst/qbs.qmltypes qbsqmltypes.commands = \ diff --git a/tests/tests.qbs b/tests/tests.qbs new file mode 100644 index 000000000..77efb82a2 --- /dev/null +++ b/tests/tests.qbs @@ -0,0 +1,41 @@ +import qbs + +Project { + references: [ + "auto/auto.qbs", + "benchmarker/benchmarker.qbs", + "fuzzy-test/fuzzy-test.qbs", + ] + + 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; + } + } +} |