Commit 19c735a4 authored by Christian Kandeler's avatar Christian Kandeler
Browse files

Simplify app_version_header.qbs.



It's no longer necessary to forward the project properties like that.

Change-Id: I751388e042e6c5a3bfb23a29f56a4d8b34b422dd
Reviewed-by: default avatarJoerg Bornemann <joerg.bornemann@digia.com>
parent a5cd588e
......@@ -5,10 +5,6 @@ Product {
name: "app_version_header"
type: "hpp"
files: "app_version.h.in"
property string ide_version_major: project.ide_version_major
property string ide_version_minor: project.ide_version_minor
property string ide_version_release: project.ide_version_release
property string qtcreator_version: project.qtcreator_version
Transformer {
inputs: ["app_version.h.in"]
......@@ -20,10 +16,6 @@ Product {
var cmd = new JavaScriptCommand();
cmd.description = "generating app_version.h";
cmd.highlight = "codegen";
cmd.qtcreator_version = product.qtcreator_version;
cmd.ide_version_major = product.ide_version_major;
cmd.ide_version_minor = product.ide_version_minor;
cmd.ide_version_release = product.ide_version_release;
cmd.onWindows = (product.moduleProperty("qbs", "targetOS").contains("windows"));
cmd.sourceCode = function() {
var file = new TextFile(input.fileName);
......@@ -34,10 +26,10 @@ Product {
if (onWindows)
content = content.replace(/\r\n/g, "\n");
// replace the magic qmake incantations
content = content.replace(/(\n#define IDE_VERSION) .+\n/, "$1 " + qtcreator_version + "\n");
content = content.replace(/(\n#define IDE_VERSION_MAJOR) .+\n/, "$1 " + ide_version_major + "\n")
content = content.replace(/(\n#define IDE_VERSION_MINOR) .+\n/, "$1 " + ide_version_minor + "\n")
content = content.replace(/(\n#define IDE_VERSION_RELEASE) .+\n/, "$1 " + ide_version_release + "\n")
content = content.replace(/(\n#define IDE_VERSION) .+\n/, "$1 " + project.qtcreator_version + "\n");
content = content.replace(/(\n#define IDE_VERSION_MAJOR) .+\n/, "$1 " + project.ide_version_major + "\n")
content = content.replace(/(\n#define IDE_VERSION_MINOR) .+\n/, "$1 " + project.ide_version_minor + "\n")
content = content.replace(/(\n#define IDE_VERSION_RELEASE) .+\n/, "$1 " + project.ide_version_release + "\n")
file = new TextFile(output.fileName, TextFile.WriteOnly);
file.truncate();
file.write(content);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment