bake-toolkit 1.3.0 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/doc/further/change.html +7 -0
- data/doc/index.html +2 -1
- data/doc/syntax/filter.html +47 -0
- data/lib/bake/subst.rb +65 -59
- data/lib/bake/version.rb +1 -1
- metadata +3 -2
data/doc/further/change.html
CHANGED
@@ -7,6 +7,13 @@
|
|
7
7
|
<body>
|
8
8
|
<h1>Changelog</h1>
|
9
9
|
|
10
|
+
June 6, 2014 - bake-toolkit 1.4.0<br>
|
11
|
+
<ul>
|
12
|
+
<li><b>Bugfix: variables can be used in "Set" now</b>
|
13
|
+
<li><b>Added: variable "MainProjectDir"
|
14
|
+
</b>
|
15
|
+
</ul>
|
16
|
+
|
10
17
|
May 23, 2014 - bake-toolkit 1.3.0<br>
|
11
18
|
<ul>
|
12
19
|
<li><b>Added: defines can be filtered now via command line</b>
|
data/doc/index.html
CHANGED
@@ -52,6 +52,7 @@ bake is used to build software <font color="#009900"><b>fast</b></font> and <fon
|
|
52
52
|
<li><a href="syntax/syntax.html">Syntax of Project.meta</a>
|
53
53
|
<li><a href="syntax/subst.html">Variable substitution in Project.meta</a>
|
54
54
|
<li><a href="syntax/derive.html">Derive configs</a>
|
55
|
+
<li><a href="syntax/filter.html">Filter configs</a>
|
55
56
|
</ul>
|
56
57
|
|
57
58
|
<h3>Did you know?</h3>
|
@@ -72,7 +73,7 @@ bake is used to build software <font color="#009900"><b>fast</b></font> and <fon
|
|
72
73
|
|
73
74
|
<p>
|
74
75
|
<hr>
|
75
|
-
<table width="100%" border="0"><tr><td align="left">Described bake-toolkit version: 1.
|
76
|
+
<table width="100%" border="0"><tr><td align="left">Described bake-toolkit version: 1.4.0</td><td align="right">June 6, 2014</td></tr></table>
|
76
77
|
|
77
78
|
</body>
|
78
79
|
|
@@ -0,0 +1,47 @@
|
|
1
|
+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Documentation of the bake-tookit</title>
|
5
|
+
<style type="text/css">
|
6
|
+
#rundrum {
|
7
|
+
border-width:1px;
|
8
|
+
border-style:dashed;
|
9
|
+
border-color:blue;
|
10
|
+
padding:0.2cm;
|
11
|
+
text-align:justify; }
|
12
|
+
}
|
13
|
+
</style>
|
14
|
+
|
15
|
+
</head>
|
16
|
+
<body>
|
17
|
+
<h1>Filter configs</h1>
|
18
|
+
|
19
|
+
Currently pre and post steps as well as compiler can be filtered.<p>
|
20
|
+
|
21
|
+
This can be done by defining a filter name in the config, e.g.:
|
22
|
+
|
23
|
+
<pre id="rundrum"><code>ExecutableConfig A {
|
24
|
+
PreSteps {
|
25
|
+
CommandLine "doSomething /nice", filter: FILTER1
|
26
|
+
}
|
27
|
+
Toolchain {
|
28
|
+
Compiler CPP {
|
29
|
+
Define "X=Y", filter: FILTER2
|
30
|
+
Define "ABC", filter: FILTER2, default: off
|
31
|
+
}
|
32
|
+
}
|
33
|
+
}</code></pre>
|
34
|
+
|
35
|
+
The steps and defines can be forced to be included or excluded with the following command line parameters:
|
36
|
+
|
37
|
+
<pre id="rundrum"><code>--include_filter FILTER_ABC
|
38
|
+
--exclude_filter FILTER_XY</code></pre>
|
39
|
+
</body>
|
40
|
+
|
41
|
+
The parameters can be used multiple times. If the filter is not explicitly specified on command line, the steps and defines are included per default except they are marked with "default: off", see above.<p>
|
42
|
+
|
43
|
+
To include or exclude ALL pre and post steps, two special filter names are defined in bake: "PRE" and "POST".<p>
|
44
|
+
|
45
|
+
Please note, that when changing filter names on the command line, the source files will <b>not</b> be recompiled automatically. To do so, you may add a "--rebuild" on the command line.
|
46
|
+
|
47
|
+
</html>
|
data/lib/bake/subst.rb
CHANGED
@@ -23,75 +23,81 @@ module Cxxproject
|
|
23
23
|
end
|
24
24
|
|
25
25
|
@@userVarMap = {} if isMainProj
|
26
|
-
config.set.each
|
26
|
+
config.set.each do |s|
|
27
|
+
@@userVarMap[s.name] = substString(s.value)
|
28
|
+
end
|
27
29
|
|
28
30
|
subst(config)
|
29
31
|
end
|
30
32
|
|
31
|
-
def self.
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
33
|
+
def self.substString(str)
|
34
|
+
substStr = ""
|
35
|
+
posSubst = 0
|
36
|
+
while (true)
|
37
|
+
posStart = str.index("$(", posSubst)
|
38
|
+
break if posStart.nil?
|
39
|
+
posEnd = str.index(")", posStart)
|
40
|
+
break if posEnd.nil?
|
41
|
+
substStr << str[posSubst..posStart-1] if posStart>0
|
36
42
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
substStr <<
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
43
|
+
var = str[posStart+2..posEnd-1]
|
44
|
+
|
45
|
+
if @@userVarMap.has_key?(var)
|
46
|
+
substStr << @@userVarMap[var]
|
47
|
+
elsif var == "MainConfigName"
|
48
|
+
substStr << @@options.build_config
|
49
|
+
elsif var == "MainProjectName"
|
50
|
+
substStr << @@mainProjectName
|
51
|
+
elsif var == "MainProjectDir"
|
52
|
+
substStr << @@options.main_dir
|
53
|
+
elsif var == "ConfigName"
|
54
|
+
substStr << @@configName
|
55
|
+
elsif var == "ProjectName"
|
56
|
+
substStr << @@projName
|
57
|
+
elsif var == "ProjectDir"
|
58
|
+
substStr << @@projDir
|
59
|
+
elsif var == "OutputDir"
|
60
|
+
if @@projName == @@mainProjectName
|
51
61
|
substStr << @@options.build_config
|
52
|
-
elsif var == "MainProjectName"
|
53
|
-
substStr << @@mainProjectName
|
54
|
-
elsif var == "ConfigName"
|
55
|
-
substStr << @@configName
|
56
|
-
elsif var == "ProjectName"
|
57
|
-
substStr << @@projName
|
58
|
-
elsif var == "ProjectDir"
|
59
|
-
substStr << @@projDir
|
60
|
-
elsif var == "OutputDir"
|
61
|
-
if @@projName == @@mainProjectName
|
62
|
-
substStr << @@options.build_config
|
63
|
-
else
|
64
|
-
substStr << (@@options.build_config + "_" + @@mainProjectName)
|
65
|
-
end
|
66
|
-
elsif var == "Time"
|
67
|
-
substStr << Time.now.to_s
|
68
|
-
elsif var == "Hostname"
|
69
|
-
substStr << Socket.gethostname
|
70
|
-
elsif var == "ArtifactName"
|
71
|
-
substStr << @@artifactName
|
72
|
-
elsif var == "ArtifactNameBase"
|
73
|
-
substStr << @@artifactName.chomp(File.extname(@@artifactName))
|
74
|
-
elsif var == "Roots"
|
75
|
-
substStr << "___ROOTS___"
|
76
|
-
elsif var == "/"
|
77
|
-
if Cxxproject::OS.windows?
|
78
|
-
substStr << "\\"
|
79
|
-
else
|
80
|
-
substStr << "/"
|
81
|
-
end
|
82
|
-
elsif ENV[var]
|
83
|
-
substStr << ENV[var]
|
84
62
|
else
|
85
|
-
|
86
|
-
Printer.printInfo "Info: #{elem.file_name}(#{elem.line_number}): substitute variable '$(#{var})' with empty string"
|
87
|
-
end
|
88
|
-
substStr << ""
|
63
|
+
substStr << (@@options.build_config + "_" + @@mainProjectName)
|
89
64
|
end
|
90
|
-
|
91
|
-
|
65
|
+
elsif var == "Time"
|
66
|
+
substStr << Time.now.to_s
|
67
|
+
elsif var == "Hostname"
|
68
|
+
substStr << Socket.gethostname
|
69
|
+
elsif var == "ArtifactName"
|
70
|
+
substStr << @@artifactName
|
71
|
+
elsif var == "ArtifactNameBase"
|
72
|
+
substStr << @@artifactName.chomp(File.extname(@@artifactName))
|
73
|
+
elsif var == "Roots"
|
74
|
+
substStr << "___ROOTS___"
|
75
|
+
elsif var == "/"
|
76
|
+
if Cxxproject::OS.windows?
|
77
|
+
substStr << "\\"
|
78
|
+
else
|
79
|
+
substStr << "/"
|
80
|
+
end
|
81
|
+
elsif ENV[var]
|
82
|
+
substStr << ENV[var]
|
83
|
+
else
|
84
|
+
if @@options.verbose
|
85
|
+
Printer.printInfo "Info: #{elem.file_name}(#{elem.line_number}): substitute variable '$(#{var})' with empty string"
|
86
|
+
end
|
87
|
+
substStr << ""
|
92
88
|
end
|
93
|
-
substStr << str[posSubst..-1]
|
94
89
|
|
90
|
+
posSubst = posEnd + 1
|
91
|
+
end
|
92
|
+
substStr << str[posSubst..-1]
|
93
|
+
substStr
|
94
|
+
end
|
95
|
+
|
96
|
+
def self.subst(elem)
|
97
|
+
elem.class.ecore.eAllAttributes_derived.each do |a|
|
98
|
+
next if a.name == "file_name" or a.name == "line_number"
|
99
|
+
next if a.eType.name != "EString"
|
100
|
+
substStr = substString(elem.getGeneric(a.name))
|
95
101
|
elem.setGeneric(a.name, substStr)
|
96
102
|
end
|
97
103
|
|
data/lib/bake/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bake-toolkit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-06-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: cxxproject
|
@@ -145,6 +145,7 @@ files:
|
|
145
145
|
- doc/index.html
|
146
146
|
- doc/src/ok.png
|
147
147
|
- doc/syntax/derive.html
|
148
|
+
- doc/syntax/filter.html
|
148
149
|
- doc/syntax/subst.html
|
149
150
|
- doc/syntax/syntax.html
|
150
151
|
- doc/vs/create/cvsp.png
|