bake-toolkit 2.50.0 → 2.51.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/bake +3 -0
- data/lib/adapt/config/loader.rb +4 -0
- data/lib/bake/config/checks.rb +3 -5
- data/lib/bake/libElement.rb +36 -53
- data/lib/bake/mergeConfig.rb +21 -0
- data/lib/bake/model/metamodel.rb +5 -2
- data/lib/bake/model/metamodel_ext.rb +12 -0
- data/lib/bake/options/options.rb +3 -5
- data/lib/bake/options/usage.rb +1 -2
- data/lib/bake/toolchain/gcc.rb +1 -1
- data/lib/bakeqac/filter.rb +5 -1
- data/lib/blocks/block.rb +5 -10
- data/lib/blocks/blockBase.rb +8 -0
- data/lib/blocks/compile.rb +106 -58
- data/lib/blocks/convert.rb +2 -2
- data/lib/blocks/executable.rb +13 -14
- data/lib/blocks/makefile.rb +138 -138
- data/lib/blocks/showIncludes.rb +145 -141
- data/lib/common/version.rb +1 -1
- data/lib/tocxx.rb +179 -45
- metadata +2 -2
data/lib/common/version.rb
CHANGED
data/lib/tocxx.rb
CHANGED
@@ -113,25 +113,76 @@ module Bake
|
|
113
113
|
end if configSteps
|
114
114
|
end
|
115
115
|
|
116
|
-
def
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
if configRef.
|
122
|
-
|
123
|
-
|
116
|
+
def addSubDependencies(block, config)
|
117
|
+
subDeps = []
|
118
|
+
config.depInc.each do |dep|
|
119
|
+
if (Metamodel::Dependency === dep)
|
120
|
+
@referencedConfigs[dep.name].each do |configRef|
|
121
|
+
if configRef.name == dep.config
|
122
|
+
blockRef = Blocks::ALL_BLOCKS[configRef.qname]
|
123
|
+
break if blockRef.visited
|
124
|
+
blockRef.visited = true
|
125
|
+
|
126
|
+
subDeps += addSubDependencies(block, configRef)
|
127
|
+
subDeps << dep
|
128
|
+
break
|
124
129
|
end
|
130
|
+
end
|
131
|
+
else
|
132
|
+
subDeps << dep if dep.inherit
|
133
|
+
end
|
134
|
+
|
135
|
+
end
|
136
|
+
@correctOrder << Blocks::ALL_BLOCKS[config.qname] if @corOrderActive
|
137
|
+
return subDeps
|
138
|
+
end
|
139
|
+
|
140
|
+
def addIncludes(block, config)
|
141
|
+
return if !config.respond_to?("includeDir")
|
142
|
+
config.includeDir.each do |inc|
|
143
|
+
if inc.inject == "front" || inc.infix == "front"
|
144
|
+
|
145
|
+
elsif inc.inject == "back" || inc.infix == "back"
|
146
|
+
|
147
|
+
end
|
148
|
+
end
|
149
|
+
|
150
|
+
end
|
125
151
|
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
152
|
+
def addDependencies(block, config)
|
153
|
+
Blocks::ALL_BLOCKS.each do |bname, b|
|
154
|
+
b.visited = false
|
155
|
+
end
|
156
|
+
block.visited = true
|
157
|
+
|
158
|
+
block.bes = []
|
159
|
+
block.config.depInc.each do |dep|
|
160
|
+
if (Metamodel::Dependency === dep)
|
161
|
+
@referencedConfigs[dep.name].each do |configRef|
|
162
|
+
if configRef.name == dep.config
|
163
|
+
qname = configRef.qname
|
164
|
+
blockRef = Blocks::ALL_BLOCKS[qname]
|
165
|
+
|
166
|
+
if configRef.private && configRef.parent.name != config.parent.name
|
167
|
+
Bake.formatter.printError("#{config.parent.name} (#{config.name}) depends on #{configRef.parent.name} (#{configRef.name}) which is private.", configRef)
|
168
|
+
ExitHelper.exit(1)
|
169
|
+
end
|
170
|
+
|
171
|
+
block.dependencies << qname if not Bake.options.project# and not Bake.options.filename
|
172
|
+
if !blockRef.visited
|
173
|
+
blockRef.visited = true
|
174
|
+
subDeps = addSubDependencies(block, configRef)
|
175
|
+
block.bes += subDeps
|
176
|
+
end
|
177
|
+
block.bes << dep
|
178
|
+
break
|
179
|
+
end
|
132
180
|
end
|
181
|
+
else
|
182
|
+
block.bes << dep
|
133
183
|
end
|
134
184
|
end
|
185
|
+
|
135
186
|
end
|
136
187
|
|
137
188
|
def calcPrebuildBlocks
|
@@ -178,21 +229,59 @@ module Bake
|
|
178
229
|
end
|
179
230
|
end
|
180
231
|
end
|
232
|
+
|
233
|
+
def makeIncs
|
234
|
+
Blocks::ALL_BLOCKS.each do |name,block|
|
235
|
+
bes2 = []
|
236
|
+
block.bes.each do |inc|
|
237
|
+
rootsFound = false
|
238
|
+
if Metamodel::IncludeDir === inc
|
239
|
+
if inc.name == "___ROOTS___"
|
240
|
+
Bake.options.roots.each do |r|
|
241
|
+
i = Metamodel::IncludeDir.new
|
242
|
+
i.name = r.dir
|
243
|
+
i.inherit = inc.inherit
|
244
|
+
i.inject = inc.inject
|
245
|
+
i.infix = inc.infix
|
246
|
+
i.parent = inc.parent
|
247
|
+
bes2 << i
|
248
|
+
end
|
249
|
+
rootsFound = true
|
250
|
+
else
|
251
|
+
if inc.parent == block.config
|
252
|
+
Dir.chdir(block.projectDir) do
|
253
|
+
i = block.convPath(inc,nil,true)
|
254
|
+
inc.name = File.expand_path(Pathname.new(i).cleanpath)
|
255
|
+
end
|
256
|
+
end
|
257
|
+
end
|
258
|
+
end
|
259
|
+
bes2 << inc if !rootsFound
|
260
|
+
end
|
261
|
+
block.bes = bes2
|
262
|
+
end
|
263
|
+
end
|
181
264
|
|
182
265
|
def makeGraph
|
266
|
+
mainConfig = @referencedConfigs[Bake.options.main_project_name].select { |c| c.name == Bake.options.build_config }.first
|
183
267
|
@referencedConfigs.each do |projName, configs|
|
184
268
|
configs.each do |config|
|
185
269
|
block = Blocks::ALL_BLOCKS[config.qname]
|
186
|
-
|
270
|
+
if (config == mainConfig)
|
271
|
+
@correctOrder = []
|
272
|
+
@corOrderActive = true
|
273
|
+
end
|
274
|
+
addDependencies(block, config)
|
275
|
+
if (config == mainConfig)
|
276
|
+
@correctOrder.unshift(block)
|
277
|
+
@corOrderActive = false
|
278
|
+
end
|
187
279
|
end
|
188
280
|
end
|
189
281
|
Blocks::ALL_BLOCKS.each do |name,block|
|
190
282
|
block.dependencies.uniq!
|
191
|
-
block.childs.uniq!
|
192
|
-
block.parents.uniq!
|
193
283
|
end
|
194
284
|
|
195
|
-
|
196
285
|
# inject dependencies
|
197
286
|
num_interations = 0
|
198
287
|
begin
|
@@ -200,44 +289,74 @@ module Bake
|
|
200
289
|
puts "Inject dependencies, iteration #{num_interations}:"
|
201
290
|
Blocks::ALL_BLOCKS.each do |name,block|
|
202
291
|
puts block.config.qname
|
203
|
-
block.
|
292
|
+
block.bes.select{|b| Metamodel::Dependency === b}.each { |d| puts "- #{d.name},#{d.config}" }
|
204
293
|
end
|
205
294
|
end
|
206
295
|
|
207
296
|
counter = 0
|
208
|
-
|
209
|
-
block.
|
210
|
-
|
297
|
+
@correctOrder.reverse.each do |block|
|
298
|
+
name = block.config.qname
|
299
|
+
difr = []
|
300
|
+
diba = []
|
301
|
+
block.bes.each do |d|
|
302
|
+
if Metamodel::Dependency === d
|
211
303
|
next if d.inject == ""
|
212
|
-
|
213
304
|
dqname = "#{d.name},#{d.config}"
|
214
|
-
dblock = Blocks::ALL_BLOCKS[dqname]
|
215
305
|
next if name == dqname
|
216
|
-
next if block.childs.include? dblock
|
217
|
-
counter += 1
|
218
|
-
newD = MergeConfig::cloneModelElement(d)
|
219
|
-
newD.setInject("")
|
220
|
-
ls = block.config.getBaseElement
|
221
|
-
dblock.parents << block
|
222
|
-
|
223
306
|
if d.inject == "front"
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
307
|
+
difr << d
|
308
|
+
elsif d.inject == "back"
|
309
|
+
diba << d
|
310
|
+
end
|
311
|
+
d.inject = "" # this prevents injecting to injected deps
|
312
|
+
d.setInjected
|
313
|
+
elsif Metamodel::IncludeDir === d
|
314
|
+
if d.inject == "front" || d.infix == "front"
|
315
|
+
difr << d
|
316
|
+
elsif d.inject == "back" || d.infix == "back"
|
317
|
+
diba << d
|
231
318
|
end
|
232
|
-
|
319
|
+
d.inject = "" # this prevents injecting to injected deps
|
320
|
+
d.infix = ""
|
321
|
+
end
|
322
|
+
end
|
323
|
+
next if difr.empty? && diba.empty?
|
233
324
|
|
325
|
+
block.bes.each do |dep|
|
326
|
+
next unless Metamodel::Dependency === dep
|
327
|
+
if dep.injected?
|
328
|
+
difr2 = difr.select{|d| Metamodel::IncludeDir === d }
|
329
|
+
diba2 = diba.select{|d| Metamodel::IncludeDir === d }
|
330
|
+
else
|
331
|
+
difr2 = difr
|
332
|
+
diba2 = diba
|
234
333
|
end
|
334
|
+
|
335
|
+
fde = Blocks::ALL_BLOCKS[dep.name+","+dep.config]
|
336
|
+
l1 = fde.bes.length
|
337
|
+
fde.bes = (difr2 + fde.bes + diba2).uniq # .select{|d| !(Metamodel::Dependency===d) || d.name != dep.name || d.config != dep.config }
|
338
|
+
l2 = fde.bes.length
|
339
|
+
counter += 1 if (l2 != l1)
|
235
340
|
end
|
236
341
|
end
|
237
342
|
num_interations += 1
|
238
343
|
end while counter > 0
|
239
344
|
end
|
240
345
|
|
346
|
+
def makeUniq
|
347
|
+
Blocks::ALL_BLOCKS.each do |name,block|
|
348
|
+
bes2 = []
|
349
|
+
blockSet = Set.new
|
350
|
+
block.bes.each do |b|
|
351
|
+
n = Metamodel::Dependency === b ? b.name+","+b.config : b.name + "," + b.inherit.to_s
|
352
|
+
next if blockSet.include?n
|
353
|
+
blockSet << n
|
354
|
+
bes2 << b
|
355
|
+
end
|
356
|
+
block.bes = bes2
|
357
|
+
end
|
358
|
+
end
|
359
|
+
|
241
360
|
def makeDot
|
242
361
|
|
243
362
|
File.open(Bake.options.dot, 'w') do |file|
|
@@ -523,20 +642,33 @@ module Bake
|
|
523
642
|
Bake.options.analyze = @defaultToolchain[:COMPILER][:CPP][:COMPILE_FLAGS].include?"analyze"
|
524
643
|
Bake.options.eclipseOrder = @mainConfig.defaultToolchain.eclipseOrder
|
525
644
|
|
645
|
+
puts "Profiling #{Time.now - $timeStart}: create base toolchains..." if Bake.options.profiling
|
526
646
|
createBaseTcsForConfig
|
647
|
+
puts "Profiling #{Time.now - $timeStart}: substitute variables..." if Bake.options.profiling
|
527
648
|
substVars
|
649
|
+
puts "Profiling #{Time.now - $timeStart}: toolchains..." if Bake.options.profiling
|
528
650
|
createTcsForConfig
|
529
|
-
|
530
651
|
@@linkBlock = 0
|
531
|
-
|
532
652
|
@prebuild = nil
|
533
|
-
|
534
|
-
|
653
|
+
if Bake.options.prebuild
|
654
|
+
puts "Profiling #{Time.now - $timeStart}: create prebuild blocks..." if Bake.options.profiling
|
655
|
+
calcPrebuildBlocks
|
656
|
+
end
|
657
|
+
puts "Profiling #{Time.now - $timeStart}: make blocks..." if Bake.options.profiling
|
535
658
|
makeBlocks
|
659
|
+
puts "Profiling #{Time.now - $timeStart}: make graph..." if Bake.options.profiling
|
536
660
|
makeGraph
|
537
|
-
|
538
|
-
|
661
|
+
puts "Profiling #{Time.now - $timeStart}: make includes..." if Bake.options.profiling
|
662
|
+
makeIncs
|
663
|
+
puts "Profiling #{Time.now - $timeStart}: make uniq..." if Bake.options.profiling
|
664
|
+
makeUniq
|
665
|
+
if Bake.options.dot
|
666
|
+
puts "Profiling #{Time.now - $timeStart}: make dot..." if Bake.options.profiling
|
667
|
+
makeDot
|
668
|
+
end
|
669
|
+
puts "Profiling #{Time.now - $timeStart}: convert to building blocks..." if Bake.options.profiling
|
539
670
|
convert2bb
|
671
|
+
|
540
672
|
ensure
|
541
673
|
if Bake.options.show_includes || Bake.options.show_includes_and_defines
|
542
674
|
Thread.current[:stdout] = orgStdout
|
@@ -559,6 +691,8 @@ module Bake
|
|
559
691
|
ideAbort = false
|
560
692
|
Blocks::Block.reset_delayed_result
|
561
693
|
|
694
|
+
puts "Profiling #{Time.now - $timeStart}: start build..." if Bake.options.profiling
|
695
|
+
|
562
696
|
begin
|
563
697
|
Blocks::Block.init_threads()
|
564
698
|
result = callBlocks(startBlocks, :startup, true)
|
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.51.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: 2019-
|
11
|
+
date: 2019-03-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rtext
|