diff options
-rw-r--r-- | doc/doc.qbs | 5 | ||||
-rw-r--r-- | qbs.qbs | 25 | ||||
-rw-r--r-- | share/share.qbs | 24 | ||||
-rw-r--r-- | src/app/qbs/qbs.qbs | 3 | ||||
-rw-r--r-- | src/lib/lib.qbs | 3 | ||||
-rw-r--r-- | tests/auto/cmdlineparser/cmdlineparser.qbs | 3 | ||||
-rw-r--r-- | version.js | 1 |
7 files changed, 35 insertions, 29 deletions
diff --git a/doc/doc.qbs b/doc/doc.qbs index 0aa48b047..81aed1086 100644 --- a/doc/doc.qbs +++ b/doc/doc.qbs @@ -1,4 +1,5 @@ import qbs 1.0 +import "../version.js" as Version Product { name: "documentation" @@ -16,10 +17,10 @@ Product { fileTags: "qdocconf-main" } - property string versionTag: project.version.replace(/\.|-/g, "") + property string versionTag: Version.qbsVersion().replace(/\.|-/g, "") Qt.core.qdocQhpFileName: "qbs.qhp" Qt.core.qdocEnvironment: [ - "QBS_VERSION=" + project.version, + "QBS_VERSION=" + Version.qbsVersion(), "SRCDIR=" + path, "QT_INSTALL_DOCS=" + Qt.core.docPath, "QBS_VERSION_TAG=" + versionTag @@ -1,36 +1,13 @@ import qbs 1.0 Project { - property string version: "1.0.1" property bool enableUnitTests: false property bool enableRPath: true references: [ "src/src.qbs", "doc/doc.qbs", + "share/share.qbs", "tests/auto/auto.qbs" ] - - Product { - name: "share" - Group { - files: ["share/qbs"] - qbs.install: true - qbs.installDir: "share" - } - - Transformer { - inputs: "share/qbs" - Artifact { - fileName: "share/qbs" - } - prepare: { - var cmd = new JavaScriptCommand(); - cmd.description = "Copying share/qbs to build directory."; - cmd.highlight = "codegen"; - cmd.sourceCode = function() { File.copy(input.fileName, output.fileName); } - return cmd; - } - } - } } diff --git a/share/share.qbs b/share/share.qbs new file mode 100644 index 000000000..cdd571339 --- /dev/null +++ b/share/share.qbs @@ -0,0 +1,24 @@ +import qbs + +Product { + name: "share" + Group { + files: ["qbs"] + qbs.install: true + qbs.installDir: "share" + } + + Transformer { + inputs: "qbs" + Artifact { + fileName: "share/qbs" + } + prepare: { + var cmd = new JavaScriptCommand(); + cmd.description = "Copying share/qbs to build directory."; + cmd.highlight = "codegen"; + cmd.sourceCode = function() { File.copy(input.fileName, output.fileName); } + return cmd; + } + } +} diff --git a/src/app/qbs/qbs.qbs b/src/app/qbs/qbs.qbs index f6519d56a..8c0e26a93 100644 --- a/src/app/qbs/qbs.qbs +++ b/src/app/qbs/qbs.qbs @@ -1,9 +1,10 @@ import qbs 1.0 import "../apptemplate.qbs" as QbsApp +import "../../../version.js" as Version QbsApp { name: "qbs" - cpp.defines: ["QBS_VERSION=\"" + project.version + "\""] + cpp.defines: ["QBS_VERSION=\"" + Version.qbsVersion() + "\""] files: [ "../shared/qbssettings.h", "application.cpp", diff --git a/src/lib/lib.qbs b/src/lib/lib.qbs index faa3a4113..9fbcb5902 100644 --- a/src/lib/lib.qbs +++ b/src/lib/lib.qbs @@ -1,4 +1,5 @@ import qbs 1.0 +import "../../version.js" as Version Product { Depends { name: "cpp" } @@ -14,7 +15,7 @@ Product { ".." // for the plugin headers ] cpp.defines: [ - "QBS_VERSION=\"" + project.version + "\"", + "QBS_VERSION=\"" + Version.qbsVersion() + "\"", "QT_CREATOR", "QML_BUILD_STATIC_LIB", // needed for QmlJS "SRCDIR=\"" + path + "\"" ].concat(type == "staticlibrary" ? ["QBS_STATIC_LIB"] : ["QBS_LIBRARY"]) diff --git a/tests/auto/cmdlineparser/cmdlineparser.qbs b/tests/auto/cmdlineparser/cmdlineparser.qbs index 6d61dddb3..105d51be6 100644 --- a/tests/auto/cmdlineparser/cmdlineparser.qbs +++ b/tests/auto/cmdlineparser/cmdlineparser.qbs @@ -1,9 +1,10 @@ import "../autotest.qbs" as AutoTest +import "../../../version.js" as Version AutoTest { testName: "cmdlineparser" files: ["tst_cmdlineparser.cpp", "../../../src/app/qbs/qbstool.cpp"] - cpp.defines: base.concat(['SRCDIR="' + path + '"', "QBS_VERSION=\"" + project.version + "\""]) + cpp.defines: base.concat(['SRCDIR="' + path + '"', "QBS_VERSION=\"" + Version.qbsVersion() + "\""]) // TODO: Make parser a static library? Group { diff --git a/version.js b/version.js new file mode 100644 index 000000000..e7bf1464f --- /dev/null +++ b/version.js @@ -0,0 +1 @@ +function qbsVersion() { return "1.0.1"; } |