-
Notifications
You must be signed in to change notification settings - Fork 1
/
axrbrowser.qbs
65 lines (54 loc) · 2.42 KB
/
axrbrowser.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
import qbs 1.0
Project {
references: [
"../core/axrcore.qbs",
"src/browser/browser.qbs"
]
property int browser_version_major: 0
property int browser_version_minor: 1
property int browser_version_patch: 0
property int browser_version_build: 0
property string browser_version_string: "0.1"
property string browser_version_string_real: browser_version_major + "." + browser_version_minor + "." + browser_version_patch + "." + browser_version_build
Product {
name: "browser_config_header"
type: "hpp"
files: "config.in.h"
property int browser_version_major: project.browser_version_major
property int browser_version_minor: project.browser_version_minor
property int browser_version_patch: project.browser_version_patch
property int browser_version_build: project.browser_version_build
property string browser_version_string: project.browser_version_string
property string browser_version_string_real: project.browser_version_string_real
Transformer {
inputs: [ "config.in.h" ]
Artifact {
fileName: "config.h"
fileTags: "hpp"
}
prepare: {
var cmd = new JavaScriptCommand();
cmd.description = "generating config.h";
cmd.highlight = "codegen";
cmd.sourceCode = function() {
var file = new TextFile(input.fileName);
var content = file.readAll();
content = content.replace("@BROWSER_VERSION_MAJOR@", product.browser_version_major);
content = content.replace("@BROWSER_VERSION_MINOR@", product.browser_version_minor);
content = content.replace("@BROWSER_VERSION_PATCH@", product.browser_version_patch);
content = content.replace("@BROWSER_VERSION_BUILD@", product.browser_version_build);
content = content.replace("@BROWSER_VERSION_STRING@", product.browser_version_string);
file = new TextFile(output.fileName, TextFile.WriteOnly);
file.truncate();
file.write(content);
file.close();
}
return cmd;
}
}
Export {
Depends { name: "cpp" }
cpp.includePaths: product.buildDirectory
}
}
}