bake-toolkit 2.5.0 → 2.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/doc/further/change.html +13 -0
- data/doc/index.html +1 -1
- data/doc/syntax/syntax.html +45 -5
- data/lib/bake/config/loader.rb +4 -2
- data/lib/bake/mergeConfig.rb +19 -0
- data/lib/bake/model/metamodel.rb +7 -1
- data/lib/bake/options/options.rb +2 -1
- data/lib/bake/options/usage.rb +2 -2
- data/lib/bake/subst.rb +2 -10
- data/lib/blocks/block.rb +51 -2
- data/lib/blocks/commandLine.rb +10 -1
- data/lib/blocks/compile.rb +36 -3
- data/lib/blocks/executable.rb +1 -1
- data/lib/blocks/has_execute_command.rb +2 -2
- data/lib/blocks/library.rb +1 -1
- data/lib/blocks/makefile.rb +11 -3
- data/lib/common/process.rb +3 -2
- data/lib/common/version.rb +1 -1
- data/lib/tocxx.rb +19 -3
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 39353992d790cb20e13ce12984ef23ff9951804b
|
|
4
|
+
data.tar.gz: f09033317b5ba518b7ec028d3e7752ab9412a693
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 51bb560b915a1d95bb84f964b3c0aea27b195489e2398492aa5ecc7f34e75005b0f32d463420cd58ccfd3058c61b2f9c1e7e08ebf9127e1e4961dfdf10bd51cd
|
|
7
|
+
data.tar.gz: 72389ef17d8a30ba53c2469cdccd0bc403ab41f832c335a068d7675c4997fe51048404e31e23398ff4ab9df17a6effae27267a04148e651d84450e90f4e4bcac
|
data/doc/further/change.html
CHANGED
|
@@ -7,6 +7,19 @@
|
|
|
7
7
|
<body>
|
|
8
8
|
<h1>Changelog</h1>
|
|
9
9
|
|
|
10
|
+
April 22, 2015 - bake-toolkit 2.7.0<br>
|
|
11
|
+
<ul>
|
|
12
|
+
<li><b>Added: possibility to use Eclipse file ordering for compilation (<i>eclipseOrder</i> attribute for <i>DefaultToolchain</i>)</b>
|
|
13
|
+
<li><b>Changed: $(:) and $(/) are now mapped to Ruby internal variables File::PATH_SEPARATOR and File::SEPARATOR.<br>
|
|
14
|
+
This fixes the result in Cygwin/MinGW environments</b>
|
|
15
|
+
<li><b>Bugfix: cmdline files are now written even if the build step fails</b>
|
|
16
|
+
</ul>
|
|
17
|
+
|
|
18
|
+
April 14, 2015 - bake-toolkit 2.6.0<br>
|
|
19
|
+
<ul>
|
|
20
|
+
<li><b>Added: validExitCodes attribute to steps (if a step has valid exit codes != 0)</b>
|
|
21
|
+
<li><b>Added: StartupSteps and ExitSteps (always executed before and after a build)</b>
|
|
22
|
+
</ul>
|
|
10
23
|
|
|
11
24
|
April 8, 2015 - bake-toolkit 2.5.0<br>
|
|
12
25
|
<ul>
|
data/doc/index.html
CHANGED
|
@@ -74,7 +74,7 @@ bake is used to build software <font color="#009900"><b>fast</b></font> and <fon
|
|
|
74
74
|
|
|
75
75
|
<p>
|
|
76
76
|
<hr>
|
|
77
|
-
<table width="100%" border="0"><tr><td align="left">Described bake-toolkit version: 2.
|
|
77
|
+
<table width="100%" border="0"><tr><td align="left">Described bake-toolkit version: 2.7.0</td><td align="right">April 22, 2015</td></tr></table>
|
|
78
78
|
|
|
79
79
|
</body>
|
|
80
80
|
|
data/doc/syntax/syntax.html
CHANGED
|
@@ -94,17 +94,25 @@ z-index: 100;
|
|
|
94
94
|
<span class="help" onMouseover="showMakefileTarget()" onMouseout="notip()">target</span>: <target>,
|
|
95
95
|
<span class="help" onMouseover="showMakefilePathTo()" onMouseout="notip()">pathTo</span>: <paths>,
|
|
96
96
|
<span class="help" onMouseover="showStepDefault()" onMouseout="notip()">default</span>: on|off,
|
|
97
|
-
<span class="help" onMouseover="showStepFilter()" onMouseout="notip()">filter</span>: <name>
|
|
97
|
+
<span class="help" onMouseover="showStepFilter()" onMouseout="notip()">filter</span>: <name>,
|
|
98
|
+
<span class="help" onMouseover="showValidExitCodes()" onMouseout="notip()">validExitCodes</span>: <[array]> {<br>
|
|
98
99
|
<span class="help" onMouseover="showMakefileFlags()" onMouseout="notip()">Flags</span> <flags><br>
|
|
99
100
|
}<br>
|
|
100
101
|
<span class="help" onMouseover="showCommandLine()" onMouseout="notip()">CommandLine</span> <line>,
|
|
101
102
|
<span class="help" onMouseover="showStepDefault()" onMouseout="notip()">default</span>: on|off,
|
|
102
|
-
<span class="help" onMouseover="showStepFilter()" onMouseout="notip()">filter</span>: <name>
|
|
103
|
+
<span class="help" onMouseover="showStepFilter()" onMouseout="notip()">filter</span>: <name>,
|
|
104
|
+
<span class="help" onMouseover="showValidExitCodes()" onMouseout="notip()">validExitCodes</span>: <[array]><br>
|
|
103
105
|
}<br>
|
|
104
106
|
<span class="help" onMouseover="showPostSteps()" onMouseout="notip()">PostSteps</span> {<br>
|
|
105
107
|
<span class="mycomment"># Same as for PreSteps</span><br>
|
|
106
108
|
}<br>
|
|
107
|
-
<span class="help" onMouseover="
|
|
109
|
+
<span class="help" onMouseover="showStartupSteps()" onMouseout="notip()">StartupSteps</span> {<br>
|
|
110
|
+
<span class="mycomment"># Same as for PreSteps</span><br>
|
|
111
|
+
}<br>
|
|
112
|
+
<span class="help" onMouseover="showExitSteps()" onMouseout="notip()">ExitSteps</span> {<br>
|
|
113
|
+
<span class="mycomment"># Same as for PreSteps</span><br>
|
|
114
|
+
}<br>
|
|
115
|
+
<span class="help" onMouseover="showDefaultToolchain()" onMouseout="notip()">DefaultToolchain</span> <basedOn>, <span class="help" onMouseover="showOutputDir()" onMouseout="notip()">outputDir</span>: <dir>, <span class="help" onMouseover="showEclipseOrder()" onMouseout="notip()">eclipseOrder</span>: true|false {<br>
|
|
108
116
|
<span class="help" onMouseover="showDefaultCompiler()" onMouseout="notip()">Compiler</span> ASM | CPP | C,
|
|
109
117
|
<span class="help" onMouseover="showCommand()" onMouseout="notip()">command</span>: <cmd> {</i><br>
|
|
110
118
|
<span class="help" onMouseover="showDefaultFlags()" onMouseout="notip()">Flags</span> <flags><br>
|
|
@@ -174,13 +182,15 @@ z-index: 100;
|
|
|
174
182
|
<span class="help" onMouseover="showMakefileTarget()" onMouseout="notip()">target</span>: <target>,
|
|
175
183
|
<span class="help" onMouseover="showMakefilePathTo()" onMouseout="notip()">pathTo</span>: <paths>,
|
|
176
184
|
<span class="help" onMouseover="showStepDefault()" onMouseout="notip()">default</span>: on|off,
|
|
177
|
-
<span class="help" onMouseover="showStepFilter()" onMouseout="notip()">filter</span>: <name>
|
|
185
|
+
<span class="help" onMouseover="showStepFilter()" onMouseout="notip()">filter</span>: <name>,
|
|
186
|
+
<span class="help" onMouseover="showValidExitCodes()" onMouseout="notip()">validExitCodes</span>: <[array]> {<br>
|
|
178
187
|
<span class="help" onMouseover="showMakefileFlags()" onMouseout="notip()">Flags</span> <flags><br>
|
|
179
188
|
}<br>
|
|
180
189
|
</span>
|
|
181
190
|
<span style="background-color:#DDDDDD;" id="commandline_part" class="hide"><line>,
|
|
182
191
|
<span class="help" onMouseover="showStepDefault()" onMouseout="notip()">default</span>: on|off,
|
|
183
|
-
<span class="help" onMouseover="showStepFilter()" onMouseout="notip()">filter</span>: <name>
|
|
192
|
+
<span class="help" onMouseover="showStepFilter()" onMouseout="notip()">filter</span>: <name>,
|
|
193
|
+
<span class="help" onMouseover="showValidExitCodes()" onMouseout="notip()">validExitCodes</span>: <[array]>
|
|
184
194
|
</span>
|
|
185
195
|
<br></span><br></span>
|
|
186
196
|
}<br>
|
|
@@ -319,6 +329,20 @@ function showPostSteps() {
|
|
|
319
329
|
ddrivetip("PostSteps", "No","0..1","-",str)
|
|
320
330
|
}
|
|
321
331
|
|
|
332
|
+
function showStartupSteps() {
|
|
333
|
+
str = 'StartupSteps of ALL projects are executed before building the first project.<br>'+
|
|
334
|
+
'The number of steps are not limited.<br>'+
|
|
335
|
+
'If a step fails, all further startup steps of the project will be skipped.'
|
|
336
|
+
ddrivetip("StartupSteps", "No","0..1","-",str)
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
function showExitSteps() {
|
|
340
|
+
str = 'ExitSteps of ALL projects are executed after building complete workspace even if the build has failed.<br>'+
|
|
341
|
+
'The number of steps are not limited.<br>'+
|
|
342
|
+
'If a step fails, all further exit steps of the project will be skipped.'
|
|
343
|
+
ddrivetip("ExitSteps", "No","0..1","-",str)
|
|
344
|
+
}
|
|
345
|
+
|
|
322
346
|
function showStepDefault() {
|
|
323
347
|
str = 'Specifies if a step will be executed by default.<br>'+
|
|
324
348
|
'Disabling a step by default is useful if the step shall not be executed every build, e.g. special steps for releasing a software or some kind of developer test steps.'
|
|
@@ -332,6 +356,13 @@ function showStepFilter() {
|
|
|
332
356
|
ddrivetip("filter", "No","-","-",str)
|
|
333
357
|
}
|
|
334
358
|
|
|
359
|
+
function showValidExitCodes() {
|
|
360
|
+
str = 'Define it as an array, e.g.:<br>'+
|
|
361
|
+
'..., validExitCodes: [200,201,202]'
|
|
362
|
+
ddrivetip("validExitCodes", "No","-","[0]",str)
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
|
|
335
366
|
function getMakefileDesc() {
|
|
336
367
|
return 'Makefile to be started, e.g.:<br>'+
|
|
337
368
|
'<i> Makefile "subDir/makefile"</i><br>'
|
|
@@ -378,6 +409,15 @@ function showCommandLine() {
|
|
|
378
409
|
ddrivetip("CommandLine", "No","0..n","-",getCommandLineDesc())
|
|
379
410
|
}
|
|
380
411
|
|
|
412
|
+
|
|
413
|
+
function showEclipseOrder() {
|
|
414
|
+
str = 'If not specified or false, all files are compiled in alphabetical order using their full names.<p>'+
|
|
415
|
+
'If true, files are compiled in alphabetical order within a folder, '+
|
|
416
|
+
'but the folders are sorted in reverse alphabetical order.<br>'+
|
|
417
|
+
'This is only used for backward compatibility.'
|
|
418
|
+
ddrivetip("eclipseOrder", "No","-","false",str)
|
|
419
|
+
}
|
|
420
|
+
|
|
381
421
|
function showOutputDir() {
|
|
382
422
|
str = 'Specifies the output folder.<p>'+
|
|
383
423
|
'Use always relative paths, not absolute paths due to portability.<p>'+
|
data/lib/bake/config/loader.rb
CHANGED
|
@@ -229,8 +229,10 @@ module Bake
|
|
|
229
229
|
def filterSteps
|
|
230
230
|
@referencedConfigs.each do |projName, configs|
|
|
231
231
|
configs.each do |config|
|
|
232
|
-
config.
|
|
233
|
-
config.
|
|
232
|
+
config.startupSteps.step = config.startupSteps.step.delete_if { |step| filterStep(step, "STARTUP") } if config.startupSteps
|
|
233
|
+
config.preSteps.step = config.preSteps.step.delete_if { |step| filterStep(step, "PRE") } if config.preSteps
|
|
234
|
+
config.postSteps.step = config.postSteps.step.delete_if { |step| filterStep(step, "POST") } if config.postSteps
|
|
235
|
+
config.exitSteps.step = config.exitSteps.step.delete_if { |step| filterStep(step, "EXIT") } if config.exitSteps
|
|
234
236
|
if Metamodel::CustomConfig === config and config.step
|
|
235
237
|
config.step = nil if filterStep(config.step, nil)
|
|
236
238
|
end
|
data/lib/bake/mergeConfig.rb
CHANGED
|
@@ -64,6 +64,9 @@ module Bake
|
|
|
64
64
|
if ct.basedOn == "" and pt.basedOn != ""
|
|
65
65
|
ct.setBasedOn(pt.basedOn)
|
|
66
66
|
end
|
|
67
|
+
if pt.eclipseOrder # is that a good idea?
|
|
68
|
+
ct.setEclipseOrder(pt.eclipseOrder)
|
|
69
|
+
end
|
|
67
70
|
if ct.internalIncludes.nil? and not pt.internalIncludes.nil?
|
|
68
71
|
ct.setInternalIncludes(pt.internalIncludes)
|
|
69
72
|
end
|
|
@@ -95,6 +98,14 @@ module Bake
|
|
|
95
98
|
@child.setExLibSearchPath(@parent.exLibSearchPath + @child.exLibSearchPath)
|
|
96
99
|
@child.setUserLibrary(@parent.userLibrary + @child.userLibrary)
|
|
97
100
|
|
|
101
|
+
if not @parent.startupSteps.nil?
|
|
102
|
+
if (@child.startupSteps.nil?)
|
|
103
|
+
@child.setStartupSteps(@parent.startupSteps)
|
|
104
|
+
else
|
|
105
|
+
@child.startupSteps.setStep(@parent.startupSteps.step + @child.startupSteps.step)
|
|
106
|
+
end
|
|
107
|
+
end
|
|
108
|
+
|
|
98
109
|
if not @parent.preSteps.nil?
|
|
99
110
|
if (@child.preSteps.nil?)
|
|
100
111
|
@child.setPreSteps(@parent.preSteps)
|
|
@@ -110,6 +121,14 @@ module Bake
|
|
|
110
121
|
@child.postSteps.setStep(@parent.postSteps.step + @child.postSteps.step)
|
|
111
122
|
end
|
|
112
123
|
end
|
|
124
|
+
|
|
125
|
+
if not @parent.exitSteps.nil?
|
|
126
|
+
if (@child.exitSteps.nil?)
|
|
127
|
+
@child.setExitSteps(@parent.exitSteps)
|
|
128
|
+
else
|
|
129
|
+
@child.exitSteps.setStep(@parent.exitSteps.step + @child.exitSteps.step)
|
|
130
|
+
end
|
|
131
|
+
end
|
|
113
132
|
|
|
114
133
|
pt = @parent.defaultToolchain
|
|
115
134
|
ct = @child.defaultToolchain
|
data/lib/bake/model/metamodel.rb
CHANGED
|
@@ -85,6 +85,7 @@ module Bake
|
|
|
85
85
|
class DefaultToolchain < ModelElement
|
|
86
86
|
has_attr 'basedOn', String, :defaultValueLiteral => ""
|
|
87
87
|
has_attr 'outputDir', String, :defaultValueLiteral => ""
|
|
88
|
+
has_attr 'eclipseOrder', Boolean, :defaultValueLiteral => "false"
|
|
88
89
|
contains_many 'compiler', Compiler, 'parent'
|
|
89
90
|
contains_one 'archiver', Archiver, 'parent'
|
|
90
91
|
contains_one 'linker', Linker, 'parent'
|
|
@@ -142,7 +143,7 @@ module Bake
|
|
|
142
143
|
has_attr 'name', String, :defaultValueLiteral => ""
|
|
143
144
|
has_attr 'default', String, :defaultValueLiteral => "on"
|
|
144
145
|
has_attr 'filter', String, :defaultValueLiteral => ""
|
|
145
|
-
has_many_attr 'validExitCodes', Integer
|
|
146
|
+
has_many_attr 'validExitCodes', Integer
|
|
146
147
|
end
|
|
147
148
|
|
|
148
149
|
class Makefile < Step
|
|
@@ -167,6 +168,10 @@ module Bake
|
|
|
167
168
|
contains_many 'step', Step, 'parent'
|
|
168
169
|
end
|
|
169
170
|
|
|
171
|
+
class StartupSteps < ModelElement
|
|
172
|
+
contains_many 'step', Step, 'parent'
|
|
173
|
+
end
|
|
174
|
+
|
|
170
175
|
class UserLibrary < ModelElement
|
|
171
176
|
has_attr 'lib', String, :defaultValueLiteral => ""
|
|
172
177
|
end
|
|
@@ -193,6 +198,7 @@ module Bake
|
|
|
193
198
|
class BaseConfig_INTERNAL < ModelElement
|
|
194
199
|
has_attr 'name', String, :defaultValueLiteral => ""
|
|
195
200
|
has_attr 'extends', String, :defaultValueLiteral => ""
|
|
201
|
+
contains_one 'startupSteps', StartupSteps, 'parent'
|
|
196
202
|
contains_one 'preSteps', PreSteps, 'parent'
|
|
197
203
|
contains_one 'postSteps', PostSteps, 'parent'
|
|
198
204
|
contains_one 'exitSteps', ExitSteps, 'parent'
|
data/lib/bake/options/options.rb
CHANGED
|
@@ -17,7 +17,7 @@ module Bake
|
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
class Options < Parser
|
|
20
|
-
attr_accessor :build_config, :nocache, :analyze, :envToolchain
|
|
20
|
+
attr_accessor :build_config, :nocache, :analyze, :eclipseOrder, :envToolchain
|
|
21
21
|
attr_reader :main_dir, :project, :filename, :main_project_name, :cc2j_filename # String
|
|
22
22
|
attr_reader :roots, :include_filter, :exclude_filter # String List
|
|
23
23
|
attr_reader :stopOnFirstError, :clean, :rebuild, :show_includes, :show_includes_and_defines, :linkOnly, :no_autodir, :clobber, :lint, :docu, :debug, :prepro # Boolean
|
|
@@ -32,6 +32,7 @@ module Bake
|
|
|
32
32
|
|
|
33
33
|
@envToolchain = false
|
|
34
34
|
@analyze = false
|
|
35
|
+
@eclipseOrder = false
|
|
35
36
|
@showConfigs = false
|
|
36
37
|
@consoleOutput_fullnames = false
|
|
37
38
|
@consoleOutput_visualStudio = false
|
data/lib/bake/options/usage.rb
CHANGED
|
@@ -31,9 +31,9 @@ module Bake
|
|
|
31
31
|
puts " --toolchain_info <name> Prints default values of a toolchain."
|
|
32
32
|
puts " --toolchain_names Prints available toolchains."
|
|
33
33
|
puts " --include_filter <name> Includes steps with this filter name (can be used multiple times)."
|
|
34
|
-
puts " 'PRE' or '
|
|
34
|
+
puts " 'PRE', 'POST', 'STARTUP' or 'EXIT' includes all according steps."
|
|
35
35
|
puts " --exclude_filter <name> Excludes steps with this filter name (can be used multiple times)."
|
|
36
|
-
puts " 'PRE' or '
|
|
36
|
+
puts " 'PRE', 'POST', 'STARTUP' or 'EXIT' excludes all according steps."
|
|
37
37
|
puts " --show_abs_paths Compiler prints absolute filename paths instead of relative paths."
|
|
38
38
|
puts " --no_autodir Disable auto completion of paths like in IncludeDir"
|
|
39
39
|
puts " --set <key>=<value> Sets a variable. Overwrites variables defined in Project.metas (can be used multiple times)."
|
data/lib/bake/subst.rb
CHANGED
|
@@ -244,17 +244,9 @@ module Bake
|
|
|
244
244
|
elsif var == "Roots"
|
|
245
245
|
substStr << "___ROOTS___"
|
|
246
246
|
elsif var == "/"
|
|
247
|
-
|
|
248
|
-
substStr << "\\"
|
|
249
|
-
else
|
|
250
|
-
substStr << "/"
|
|
251
|
-
end
|
|
247
|
+
substStr << File::SEPARATOR
|
|
252
248
|
elsif var == ":"
|
|
253
|
-
|
|
254
|
-
substStr << ";"
|
|
255
|
-
else
|
|
256
|
-
substStr << ":"
|
|
257
|
-
end
|
|
249
|
+
substStr << File::PATH_SEPARATOR
|
|
258
250
|
elsif ENV[var]
|
|
259
251
|
substStr << ENV[var]
|
|
260
252
|
else
|
data/lib/blocks/block.rb
CHANGED
|
@@ -17,7 +17,11 @@ module Bake
|
|
|
17
17
|
|
|
18
18
|
attr_reader :lib_elements, :projectDir, :library, :config
|
|
19
19
|
attr_accessor :visited, :inDeps, :result
|
|
20
|
-
|
|
20
|
+
|
|
21
|
+
def startupSteps
|
|
22
|
+
@startupSteps ||= []
|
|
23
|
+
end
|
|
24
|
+
|
|
21
25
|
def preSteps
|
|
22
26
|
@preSteps ||= []
|
|
23
27
|
end
|
|
@@ -30,6 +34,10 @@ module Bake
|
|
|
30
34
|
@postSteps ||= []
|
|
31
35
|
end
|
|
32
36
|
|
|
37
|
+
def exitSteps
|
|
38
|
+
@exitSteps ||= []
|
|
39
|
+
end
|
|
40
|
+
|
|
33
41
|
def dependencies
|
|
34
42
|
@dependencies ||= []
|
|
35
43
|
end
|
|
@@ -213,9 +221,50 @@ module Bake
|
|
|
213
221
|
end
|
|
214
222
|
end
|
|
215
223
|
|
|
224
|
+
return (depResult && result)
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
def startup
|
|
228
|
+
return true if (@visited)
|
|
229
|
+
@visited = true
|
|
230
|
+
|
|
231
|
+
depResult = callDeps(:startup)
|
|
232
|
+
return false if not depResult and Bake.options.stopOnFirstError
|
|
233
|
+
|
|
234
|
+
if Bake.options.verbose >= 1 and not startupSteps.empty?
|
|
235
|
+
Bake.formatter.printAdditionalInfo "**** Starting up #{@projectName} (#{@configName}) ****"
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
result = true
|
|
239
|
+
startupSteps.each do |step|
|
|
240
|
+
result = executeStep(step, :startupStep) if result
|
|
241
|
+
return false if not result and Bake.options.stopOnFirstError
|
|
242
|
+
end
|
|
243
|
+
|
|
216
244
|
return (depResult && result)
|
|
217
245
|
end
|
|
218
|
-
|
|
246
|
+
|
|
247
|
+
def exits
|
|
248
|
+
return true if (@visited)
|
|
249
|
+
@visited = true
|
|
250
|
+
|
|
251
|
+
depResult = callDeps(:exits)
|
|
252
|
+
return false if not depResult and Bake.options.stopOnFirstError
|
|
253
|
+
|
|
254
|
+
if Bake.options.verbose >= 1 and not exitSteps.empty?
|
|
255
|
+
Bake.formatter.printAdditionalInfo "**** Exiting #{@projectName} (#{@configName}) ****"
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
result = true
|
|
259
|
+
exitSteps.each do |step|
|
|
260
|
+
result = executeStep(step, :exitStep) if result
|
|
261
|
+
return false if not result and Bake.options.stopOnFirstError
|
|
262
|
+
end
|
|
263
|
+
|
|
264
|
+
return (depResult && result)
|
|
265
|
+
end
|
|
266
|
+
|
|
267
|
+
|
|
219
268
|
end
|
|
220
269
|
|
|
221
270
|
|
data/lib/blocks/commandLine.rb
CHANGED
|
@@ -13,8 +13,17 @@ module Bake
|
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
def execute
|
|
16
|
-
executeCommand(@commandLine)
|
|
16
|
+
executeCommand(@commandLine, nil, @config.validExitCodes)
|
|
17
17
|
end
|
|
18
|
+
|
|
19
|
+
def startupStep
|
|
20
|
+
executeCommand(@commandLine, nil, @config.validExitCodes)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def exitStep
|
|
24
|
+
executeCommand(@commandLine, nil, @config.validExitCodes)
|
|
25
|
+
end
|
|
26
|
+
|
|
18
27
|
def clean
|
|
19
28
|
# nothing to do here
|
|
20
29
|
end
|
data/lib/blocks/compile.rb
CHANGED
|
@@ -16,6 +16,7 @@ module Bake
|
|
|
16
16
|
def initialize(block, config, referencedConfigs, tcs)
|
|
17
17
|
super(block, config, referencedConfigs, tcs)
|
|
18
18
|
@objects = []
|
|
19
|
+
@object_files = {}
|
|
19
20
|
|
|
20
21
|
calcFileTcs
|
|
21
22
|
calcIncludes
|
|
@@ -106,8 +107,7 @@ module Bake
|
|
|
106
107
|
type = get_source_type(source)
|
|
107
108
|
return true if type.nil?
|
|
108
109
|
|
|
109
|
-
object =
|
|
110
|
-
@objects << object
|
|
110
|
+
object = @object_files[source]
|
|
111
111
|
|
|
112
112
|
dep_filename = calcDepFile(object, type)
|
|
113
113
|
dep_filename_conv = calcDepFileConv(dep_filename) if type != :ASM
|
|
@@ -183,8 +183,8 @@ module Bake
|
|
|
183
183
|
return if cmdLineCheck and BlockBase.isCmdLineEqual?(cmd, cmdLineFile)
|
|
184
184
|
|
|
185
185
|
BlockBase.prepareOutput(object)
|
|
186
|
+
BlockBase.writeCmdLineFile(cmd, cmdLineFile)
|
|
186
187
|
success, consoleOutput = ProcessHelper.run(cmd, false, false)
|
|
187
|
-
BlockBase.writeCmdLineFile(cmd, cmdLineFile) if success
|
|
188
188
|
|
|
189
189
|
outputType = Bake.options.analyze ? "Analyzing" : (Bake.options.prepro ? "Preprocessing" : "Compiling")
|
|
190
190
|
incList = process_result(cmd, consoleOutput, compiler[:ERROR_PARSER], "#{outputType} #{source}", reason, success)
|
|
@@ -241,6 +241,7 @@ module Bake
|
|
|
241
241
|
Dir.chdir(@projectDir) do
|
|
242
242
|
|
|
243
243
|
calcSources
|
|
244
|
+
calcObjects
|
|
244
245
|
|
|
245
246
|
@error_strings = {}
|
|
246
247
|
|
|
@@ -326,6 +327,17 @@ module Bake
|
|
|
326
327
|
end
|
|
327
328
|
end
|
|
328
329
|
|
|
330
|
+
def calcObjects
|
|
331
|
+
@source_files.each do |source|
|
|
332
|
+
type = get_source_type(source)
|
|
333
|
+
if not type.nil?
|
|
334
|
+
object = get_object_file(source)
|
|
335
|
+
@object_files[source] = object
|
|
336
|
+
@objects << object
|
|
337
|
+
end
|
|
338
|
+
end
|
|
339
|
+
end
|
|
340
|
+
|
|
329
341
|
def calcSources(cleaning = false)
|
|
330
342
|
@source_files = []
|
|
331
343
|
|
|
@@ -362,6 +374,27 @@ module Bake
|
|
|
362
374
|
end
|
|
363
375
|
|
|
364
376
|
@source_files = source_files.sort.to_a
|
|
377
|
+
|
|
378
|
+
if Bake.options.eclipseOrder # directories reverse order, files in directories in alphabetical order
|
|
379
|
+
dirs = []
|
|
380
|
+
filemap = {}
|
|
381
|
+
@source_files.reverse.each do |o|
|
|
382
|
+
d = File.dirname(o)
|
|
383
|
+
if filemap.include?(d)
|
|
384
|
+
filemap[d] << o
|
|
385
|
+
else
|
|
386
|
+
filemap[d] = [o]
|
|
387
|
+
dirs << d
|
|
388
|
+
end
|
|
389
|
+
end
|
|
390
|
+
@source_files = []
|
|
391
|
+
dirs.each do |d|
|
|
392
|
+
filemap[d].reverse.each do |f|
|
|
393
|
+
@source_files << f
|
|
394
|
+
end
|
|
395
|
+
end
|
|
396
|
+
end
|
|
397
|
+
|
|
365
398
|
end
|
|
366
399
|
|
|
367
400
|
def calcIncludes
|
data/lib/blocks/executable.rb
CHANGED
|
@@ -137,8 +137,8 @@ module Bake
|
|
|
137
137
|
BlockBase.prepareOutput(@exe_name)
|
|
138
138
|
|
|
139
139
|
printCmd(cmdLinePrint, "Linking #{@exe_name}", reason, false)
|
|
140
|
+
BlockBase.writeCmdLineFile(cmd, cmdLineFile)
|
|
140
141
|
success, consoleOutput = ProcessHelper.run(cmd, false, false, outPipe)
|
|
141
|
-
BlockBase.writeCmdLineFile(cmd, cmdLineFile) if success
|
|
142
142
|
process_result(cmdLinePrint, consoleOutput, linker[:ERROR_PARSER], nil, reason, success)
|
|
143
143
|
|
|
144
144
|
check_config_file()
|
|
@@ -4,14 +4,14 @@ module Bake
|
|
|
4
4
|
|
|
5
5
|
module HasExecuteCommand
|
|
6
6
|
|
|
7
|
-
def executeCommand(commandLine, ignoreStr=nil)
|
|
7
|
+
def executeCommand(commandLine, ignoreStr=nil, exitCodeArray = [0])
|
|
8
8
|
puts commandLine if Bake.options.verbose >= 1
|
|
9
9
|
puts "(executed in '#{@projectDir}')" if Bake.options.verbose >= 3
|
|
10
10
|
cmd_result = false
|
|
11
11
|
output = ""
|
|
12
12
|
begin
|
|
13
13
|
Dir.chdir(@projectDir) do
|
|
14
|
-
cmd_result, output = ProcessHelper.run([commandLine], true)
|
|
14
|
+
cmd_result, output = ProcessHelper.run([commandLine], true, true, nil, exitCodeArray)
|
|
15
15
|
end
|
|
16
16
|
rescue Exception=>e
|
|
17
17
|
puts e.message
|
data/lib/blocks/library.rb
CHANGED
|
@@ -70,8 +70,8 @@ module Bake
|
|
|
70
70
|
|
|
71
71
|
BlockBase.prepareOutput(archive_name)
|
|
72
72
|
|
|
73
|
+
BlockBase.writeCmdLineFile(cmd, cmdLineFile)
|
|
73
74
|
success, consoleOutput = ProcessHelper.run(cmd, false, false)
|
|
74
|
-
BlockBase.writeCmdLineFile(cmd, cmdLineFile) if success
|
|
75
75
|
process_result(cmd, consoleOutput, archiver[:ERROR_PARSER], "Creating #{archive_name}", reason, success)
|
|
76
76
|
|
|
77
77
|
check_config_file()
|
data/lib/blocks/makefile.rb
CHANGED
|
@@ -74,11 +74,19 @@ module Bake
|
|
|
74
74
|
end
|
|
75
75
|
|
|
76
76
|
def execute
|
|
77
|
-
executeCommand(@commandLine)
|
|
77
|
+
executeCommand(@commandLine, nil, @config.validExitCodes)
|
|
78
78
|
end
|
|
79
|
-
|
|
79
|
+
|
|
80
|
+
def startupStep
|
|
81
|
+
executeCommand(@commandLine, nil, @config.validExitCodes)
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
def exitStep
|
|
85
|
+
executeCommand(@commandLine, nil, @config.validExitCodes)
|
|
86
|
+
end
|
|
87
|
+
|
|
80
88
|
def clean
|
|
81
|
-
executeCommand(@cleanLine, "No rule to make target 'clean'.") unless Bake.options.filename
|
|
89
|
+
executeCommand(@cleanLine, "No rule to make target 'clean'.", @config.validExitCodes) unless Bake.options.filename
|
|
82
90
|
end
|
|
83
91
|
|
|
84
92
|
end
|
data/lib/common/process.rb
CHANGED
|
@@ -4,7 +4,7 @@ module Bake
|
|
|
4
4
|
@@pid = nil
|
|
5
5
|
@@rd = nil
|
|
6
6
|
|
|
7
|
-
def self.run(cmdLineArray, immediateOutput=false, force=true, outpipe=nil)
|
|
7
|
+
def self.run(cmdLineArray, immediateOutput=false, force=true, outpipe=nil, exitCodeArray = [0])
|
|
8
8
|
rd, wr = IO.pipe
|
|
9
9
|
@@rd = rd if force
|
|
10
10
|
duppedCmdLineArray = cmdLineArray.dup
|
|
@@ -43,7 +43,8 @@ module Bake
|
|
|
43
43
|
@@pid = nil
|
|
44
44
|
@@rd = nil
|
|
45
45
|
return [false, output] if status.nil?
|
|
46
|
-
[
|
|
46
|
+
exitCodeArray = [0] if exitCodeArray.empty?
|
|
47
|
+
[(exitCodeArray.include?status.exitstatus), output]
|
|
47
48
|
end
|
|
48
49
|
|
|
49
50
|
def self.killProcess(force) # do not kill compile processes or implement rd and pid array if really needed
|
data/lib/common/version.rb
CHANGED
data/lib/tocxx.rb
CHANGED
|
@@ -102,6 +102,9 @@ module Bake
|
|
|
102
102
|
|
|
103
103
|
Blocks::ALL_BLOCKS[config.qname] = block
|
|
104
104
|
|
|
105
|
+
addSteps(block, block.startupSteps, config.startupSteps)
|
|
106
|
+
addSteps(block, block.exitSteps, config.exitSteps)
|
|
107
|
+
|
|
105
108
|
if not Bake.options.linkOnly and not Bake.options.prepro and not Bake.options.lint and not Bake.options.docu and not Bake.options.filename and not Bake.options.analyze
|
|
106
109
|
addSteps(block, block.preSteps, config.preSteps)
|
|
107
110
|
addSteps(block, block.postSteps, config.postSteps)
|
|
@@ -261,6 +264,7 @@ module Bake
|
|
|
261
264
|
|
|
262
265
|
# todo: cleanup this hack
|
|
263
266
|
Bake.options.analyze = @defaultToolchain[:COMPILER][:CPP][:COMPILE_FLAGS].include?"analyze"
|
|
267
|
+
Bake.options.eclipseOrder = @mainConfig.defaultToolchain.eclipseOrder
|
|
264
268
|
|
|
265
269
|
createBaseTcsForConfig
|
|
266
270
|
substVars
|
|
@@ -274,15 +278,27 @@ module Bake
|
|
|
274
278
|
|
|
275
279
|
Bake::IDEInterface.instance.set_build_info(@mainConfig.parent.name, @mainConfig.name, Blocks::ALL_BLOCKS.length)
|
|
276
280
|
|
|
281
|
+
ideAbort = false
|
|
277
282
|
begin
|
|
278
|
-
result =
|
|
283
|
+
result = callBlocks(startBlocks, :startup)
|
|
279
284
|
if Bake.options.clean or Bake.options.rebuild
|
|
280
|
-
|
|
285
|
+
if not Bake.options.stopOnFirstError or result
|
|
286
|
+
result = callBlocks(startBlocks, :clean) && result
|
|
287
|
+
end
|
|
281
288
|
end
|
|
282
289
|
if Bake.options.rebuild or not Bake.options.clean
|
|
283
|
-
|
|
290
|
+
if not Bake.options.stopOnFirstError or result
|
|
291
|
+
result = callBlocks(startBlocks, :execute) && result
|
|
292
|
+
end
|
|
284
293
|
end
|
|
285
294
|
rescue AbortException
|
|
295
|
+
ideAbort = true
|
|
296
|
+
end
|
|
297
|
+
if not Bake.options.stopOnFirstError or result
|
|
298
|
+
result = callBlocks(startBlocks, :exits) && result
|
|
299
|
+
end
|
|
300
|
+
|
|
301
|
+
if ideAbort
|
|
286
302
|
Bake.formatter.printError("\n#{taskType} aborted.")
|
|
287
303
|
ExitHelper.set_exit_code(1)
|
|
288
304
|
return
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: bake-toolkit
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.7.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Alexander Schaal
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-04-
|
|
11
|
+
date: 2015-04-22 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rtext
|