-
Notifications
You must be signed in to change notification settings - Fork 15
/
axrcore.qbs
82 lines (68 loc) · 3.06 KB
/
axrcore.qbs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
import qbs 1.0
import qbs.TextFile
Project {
references: [
"src/cocoa/cocoa.qbs",
"src/core/core.qbs",
"src/qt/qt.qbs",
"src/layout-tests/layout-tests.qbs"
]
property int axr_version_major: 0
property int axr_version_minor: 4
property int axr_version_patch: 8
property int axr_version_build: 0
property string axr_version_string: "0.4.8"
property string axr_version_string_real: axr_version_major + "." + axr_version_minor + "." + axr_version_patch + "." + axr_version_build
property string axr_vendor: "AXR Project Contributors"
property string axr_domain: "axrproject.org"
property string axr_contact: "[email protected]"
property string axr_web_url: "http://" + axr_domain + "/"
Product {
name: "config_header"
type: "hpp"
files: "config.in.h"
property int axr_version_major: project.axr_version_major
property int axr_version_minor: project.axr_version_minor
property int axr_version_patch: project.axr_version_patch
property int axr_version_build: project.axr_version_build
property string axr_version_string: project.axr_version_string
property string axr_version_string_real: project.axr_version_string_real
property string axr_vendor: project.axr_vendor
property string axr_domain: project.axr_domain
property string axr_contact: project.axr_contact
property string axr_web_url: project.axr_web_url
Transformer {
inputs: [ "config.in.h" ]
Artifact {
fileName: "axr-config.h"
fileTags: "hpp"
}
prepare: {
var cmd = new JavaScriptCommand();
cmd.description = "generating axr-config.h";
cmd.highlight = "codegen";
cmd.sourceCode = function() {
var file = new TextFile(input.fileName);
var content = file.readAll();
content = content.replace("@AXR_VERSION_MAJOR@", product.axr_version_major);
content = content.replace("@AXR_VERSION_MINOR@", product.axr_version_minor);
content = content.replace("@AXR_VERSION_PATCH@", product.axr_version_patch);
content = content.replace("@AXR_VERSION_BUILD@", product.axr_version_build);
content = content.replace("@AXR_VERSION_STRING@", product.axr_version_string);
content = content.replace("@AXR_VENDOR@", product.axr_vendor);
content = content.replace("@AXR_DOMAIN@", product.axr_domain);
content = content.replace("@AXR_CONTACT@", product.axr_contact);
file = new TextFile(output.fileName, TextFile.WriteOnly);
file.truncate();
file.write(content);
file.close();
}
return cmd;
}
}
Export {
Depends { name: "cpp" }
cpp.includePaths: product.buildDirectory
}
}
}