bake-toolkit 2.27.0 → 2.28.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/bin/bakeqac +3 -3
- data/documentation/_build/html/_sources/changelog.txt +9 -1
- data/documentation/_build/html/_sources/concepts/prebuild.txt +1 -1
- data/documentation/_build/html/_sources/index.txt +1 -1
- data/documentation/_build/html/_sources/known_issues.txt +0 -2
- data/documentation/_build/html/_sources/tips_and_tricks/static_code_analysis.txt +122 -122
- data/documentation/_build/html/_sources/tips_and_tricks/tips_and_tricks.txt +0 -1
- data/documentation/_build/html/_static/syntax.html +18 -13
- data/documentation/_build/html/changelog.html +11 -1
- data/documentation/_build/html/concepts/build_hierarchy.html +1 -1
- data/documentation/_build/html/concepts/inject.html +1 -1
- data/documentation/_build/html/concepts/link_order.html +1 -1
- data/documentation/_build/html/concepts/prebuild.html +1 -1
- data/documentation/_build/html/concepts/the_main_project.html +1 -1
- data/documentation/_build/html/concepts/the_project_meta_file.html +1 -1
- data/documentation/_build/html/ide/eclipse/eclipse.html +1 -1
- data/documentation/_build/html/ide/eclipse/how_to_convert_existing_cdt_workspace.html +1 -1
- data/documentation/_build/html/ide/eclipse/how_to_create_a_new_project_in_eclipse.html +1 -1
- data/documentation/_build/html/ide/eclipse/how_to_create_a_workspace_in_eclipse.html +1 -1
- data/documentation/_build/html/ide/eclipse/how_to_debug_in_eclipse.html +1 -1
- data/documentation/_build/html/ide/eclipse/how_to_install_eclipse_plugin.html +1 -1
- data/documentation/_build/html/ide/eclipse/how_to_use_bake_in_eclipse.html +1 -1
- data/documentation/_build/html/ide/vs/how_to_create_vs_projects.html +1 -1
- data/documentation/_build/html/ide/vs/how_to_debug_in_vs.html +3 -3
- data/documentation/_build/html/ide/vs/how_to_used_bake_in_vs.html +1 -1
- data/documentation/_build/html/ide/vs/vs.html +1 -1
- data/documentation/_build/html/ide/vs/vs_install.html +1 -1
- data/documentation/_build/html/index.html +4 -5
- data/documentation/_build/html/install/install_bake.html +1 -1
- data/documentation/_build/html/internal.html +1 -1
- data/documentation/_build/html/known_issues.html +1 -3
- data/documentation/_build/html/license.html +1 -1
- data/documentation/_build/html/performance/performance.html +3 -3
- data/documentation/_build/html/quickstart/quickstart.html +1 -1
- data/documentation/_build/html/searchindex.js +1 -1
- data/documentation/_build/html/syntax/auto_adjustment.html +1 -1
- data/documentation/_build/html/syntax/derive_configs.html +1 -1
- data/documentation/_build/html/syntax/project_meta_syntax.html +18 -13
- data/documentation/_build/html/syntax/variable_substitutions.html +1 -1
- data/documentation/_build/html/tips_and_tricks/dot.html +4 -4
- data/documentation/_build/html/tips_and_tricks/how_to_use_bake_with_cygwin.html +4 -4
- data/documentation/_build/html/tips_and_tricks/static_code_analysis.html +284 -284
- data/documentation/_build/html/tips_and_tricks/the_bakery.html +6 -6
- data/documentation/_build/html/tips_and_tricks/the_clang.html +2 -2
- data/documentation/_build/html/tips_and_tricks/tips_and_tricks.html +0 -1
- data/documentation/_build/html/why_bake/why_bake.html +3 -3
- data/lib/bake/model/metamodel.rb +2 -6
- data/lib/bake/model/metamodel_ext.rb +9 -0
- data/lib/bake/options/options.rb +11 -38
- data/lib/bake/options/usage.rb +1 -10
- data/lib/bake/subst.rb +12 -3
- data/lib/bake/toolchain/provider.rb +1 -3
- data/lib/bake/util.rb +0 -7
- data/lib/blocks/block.rb +2 -0
- data/lib/blocks/blockBase.rb +2 -8
- data/lib/blocks/commandLine.rb +3 -3
- data/lib/blocks/compile.rb +0 -2
- data/lib/blocks/executable.rb +1 -3
- data/lib/blocks/fileList.rb +53 -0
- data/lib/blocks/has_execute_command.rb +2 -2
- data/lib/blocks/library.rb +0 -2
- data/lib/blocks/makefile.rb +4 -4
- data/lib/common/version.rb +1 -1
- data/lib/tocxx.rb +39 -37
- metadata +3 -6
- data/lib/bake/bundle.rb +0 -159
- data/lib/bake/toolchain/errorparser/lint_error_parser.rb +0 -34
- data/lib/bake/toolchain/lint.rb +0 -19
- data/lib/blocks/lint.rb +0 -56
data/lib/blocks/compile.rb
CHANGED
data/lib/blocks/executable.rb
CHANGED
|
@@ -35,7 +35,7 @@ module Bake
|
|
|
35
35
|
|
|
36
36
|
def calcMapFile
|
|
37
37
|
@mapfile = nil
|
|
38
|
-
if (not Bake.options.docu) and (not
|
|
38
|
+
if (not Bake.options.docu) and (not @config.mapFile.nil?)
|
|
39
39
|
if @config.mapFile.name == ""
|
|
40
40
|
@mapfile = @exe_name.chomp(File.extname(@exe_name)) + ".map"
|
|
41
41
|
else
|
|
@@ -153,8 +153,6 @@ module Bake
|
|
|
153
153
|
check_config_file()
|
|
154
154
|
end
|
|
155
155
|
|
|
156
|
-
Bake::Bundle.instance.addBinary(@exe_name, @linker_script, isMainProject? ? @config : nil)
|
|
157
|
-
|
|
158
156
|
return success
|
|
159
157
|
end
|
|
160
158
|
end
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
require 'blocks/compile'
|
|
2
|
+
|
|
3
|
+
module Bake
|
|
4
|
+
|
|
5
|
+
module Blocks
|
|
6
|
+
|
|
7
|
+
class FileList < Compile
|
|
8
|
+
|
|
9
|
+
def initialize(block, config, referencedConfigs, tcs)
|
|
10
|
+
super(block, config, referencedConfigs, tcs)
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def execute
|
|
14
|
+
Dir.chdir(@projectDir) do
|
|
15
|
+
calcSources
|
|
16
|
+
calcObjects
|
|
17
|
+
|
|
18
|
+
projDir = File.expand_path(@projectDir)
|
|
19
|
+
headers = Set.new
|
|
20
|
+
@source_files.sort.each do |s|
|
|
21
|
+
puts "FILE: " + projDir+"/"+s
|
|
22
|
+
type = get_source_type(s)
|
|
23
|
+
if type.nil?
|
|
24
|
+
Bake.formatter.printError("Error: could not get type of source file #{s}")
|
|
25
|
+
ExitHelper.exit(1)
|
|
26
|
+
end
|
|
27
|
+
object = @object_files[s]
|
|
28
|
+
dep_filename = calcDepFile(object, type)
|
|
29
|
+
if type != :ASM
|
|
30
|
+
dep_filename_conv = calcDepFileConv(dep_filename)
|
|
31
|
+
if not File.exist?(dep_filename_conv)
|
|
32
|
+
Bake.formatter.printError("Error: dependency file doesn't exist for #{s}")
|
|
33
|
+
ExitHelper.exit(1)
|
|
34
|
+
end
|
|
35
|
+
File.readlines(dep_filename_conv).map {|line| headers << line.strip}
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
headers.map do |h|
|
|
39
|
+
habs = File.is_absolute?(h) ? h : projDir+"/"+h
|
|
40
|
+
File.expand_path(h)
|
|
41
|
+
end.sort.each { |h| puts "HEADER: " + h }
|
|
42
|
+
end
|
|
43
|
+
return true
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def clean
|
|
47
|
+
# nothing to do here
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
end
|
|
53
|
+
end
|
|
@@ -4,8 +4,8 @@ module Bake
|
|
|
4
4
|
|
|
5
5
|
module HasExecuteCommand
|
|
6
6
|
|
|
7
|
-
def executeCommand(commandLine, ignoreStr=nil, exitCodeArray = [0])
|
|
8
|
-
puts commandLine if Bake.options.verbose >= 1
|
|
7
|
+
def executeCommand(commandLine, ignoreStr=nil, exitCodeArray = [0], echo = "on")
|
|
8
|
+
puts commandLine if (Bake.options.verbose >= 1 && echo != "off") || Bake.options.verbose >= 3
|
|
9
9
|
puts "(executed in '#{@projectDir}')" if Bake.options.verbose >= 3
|
|
10
10
|
cmd_result = false
|
|
11
11
|
output = ""
|
data/lib/blocks/library.rb
CHANGED
data/lib/blocks/makefile.rb
CHANGED
|
@@ -76,22 +76,22 @@ module Bake
|
|
|
76
76
|
|
|
77
77
|
def execute
|
|
78
78
|
return true if Bake.options.linkOnly
|
|
79
|
-
return executeCommand(@commandLine, nil, @config.validExitCodes)
|
|
79
|
+
return executeCommand(@commandLine, nil, @config.validExitCodes, @config.echo)
|
|
80
80
|
end
|
|
81
81
|
|
|
82
82
|
def startupStep
|
|
83
83
|
return true if Bake.options.linkOnly
|
|
84
|
-
return executeCommand(@commandLine, nil, @config.validExitCodes)
|
|
84
|
+
return executeCommand(@commandLine, nil, @config.validExitCodes, @config.echo)
|
|
85
85
|
end
|
|
86
86
|
|
|
87
87
|
def exitStep
|
|
88
88
|
return true if Bake.options.linkOnly
|
|
89
|
-
return executeCommand(@commandLine, nil, @config.validExitCodes)
|
|
89
|
+
return executeCommand(@commandLine, nil, @config.validExitCodes, @config.echo)
|
|
90
90
|
end
|
|
91
91
|
|
|
92
92
|
def clean
|
|
93
93
|
return true if Bake.options.linkOnly
|
|
94
|
-
return executeCommand(@cleanLine, "No rule to make target 'clean'.", @config.validExitCodes) unless Bake.options.filename
|
|
94
|
+
return executeCommand(@cleanLine, "No rule to make target 'clean'.", @config.validExitCodes, @config.echo) unless Bake.options.filename
|
|
95
95
|
end
|
|
96
96
|
|
|
97
97
|
end
|
data/lib/common/version.rb
CHANGED
data/lib/tocxx.rb
CHANGED
|
@@ -22,10 +22,9 @@ require 'blocks/commandLine'
|
|
|
22
22
|
require 'blocks/makefile'
|
|
23
23
|
require 'blocks/compile'
|
|
24
24
|
require 'blocks/convert'
|
|
25
|
+
require 'blocks/fileList'
|
|
25
26
|
require 'blocks/library'
|
|
26
27
|
require 'blocks/executable'
|
|
27
|
-
require 'blocks/lint'
|
|
28
|
-
require 'blocks/convert'
|
|
29
28
|
require 'blocks/docu'
|
|
30
29
|
|
|
31
30
|
require 'set'
|
|
@@ -97,6 +96,12 @@ module Bake
|
|
|
97
96
|
config.dependency.each do |dep|
|
|
98
97
|
@referencedConfigs[dep.name].each do |configRef|
|
|
99
98
|
if configRef.name == dep.config
|
|
99
|
+
|
|
100
|
+
if configRef.private && configRef.parent.name != config.parent.name
|
|
101
|
+
Bake.formatter.printError("#{config.parent.name} (#{config.name}) depends on #{configRef.parent.name} (#{configRef.name}) which is private.", configRef)
|
|
102
|
+
ExitHelper.exit(1)
|
|
103
|
+
end
|
|
104
|
+
|
|
100
105
|
block.dependencies << configRef.qname if not Bake.options.project# and not Bake.options.filename
|
|
101
106
|
blockRef = Blocks::ALL_BLOCKS[configRef.qname]
|
|
102
107
|
block.childs << blockRef
|
|
@@ -294,7 +299,7 @@ module Bake
|
|
|
294
299
|
addSteps(block, block.startupSteps, config.startupSteps)
|
|
295
300
|
addSteps(block, block.exitSteps, config.exitSteps)
|
|
296
301
|
|
|
297
|
-
if not Bake.options.prepro and not Bake.options.
|
|
302
|
+
if not Bake.options.prepro and not Bake.options.conversion_info and not Bake.options.file_list and not Bake.options.docu and not Bake.options.filename and not Bake.options.analyze
|
|
298
303
|
addSteps(block, block.preSteps, config.preSteps)
|
|
299
304
|
addSteps(block, block.postSteps, config.postSteps)
|
|
300
305
|
end
|
|
@@ -302,13 +307,13 @@ module Bake
|
|
|
302
307
|
if Bake.options.docu
|
|
303
308
|
block.mainSteps << Blocks::Docu.new(config, @configTcMap[config])
|
|
304
309
|
elsif Metamodel::CustomConfig === config
|
|
305
|
-
if not Bake.options.prepro and not Bake.options.
|
|
310
|
+
if not Bake.options.prepro and not Bake.options.conversion_info and not Bake.options.file_list and not Bake.options.docu and not Bake.options.filename and not Bake.options.analyze
|
|
306
311
|
addSteps(block, block.mainSteps, config) if config.step
|
|
307
312
|
end
|
|
313
|
+
elsif Bake.options.file_list
|
|
314
|
+
block.mainSteps << Blocks::FileList.new(block, config, @referencedConfigs, @configTcMap[config])
|
|
308
315
|
elsif Bake.options.conversion_info
|
|
309
316
|
block.mainSteps << Blocks::Convert.new(block, config, @referencedConfigs, @configTcMap[config])
|
|
310
|
-
elsif Bake.options.lint
|
|
311
|
-
block.mainSteps << Blocks::Lint.new(block, config, @referencedConfigs, @configTcMap[config])
|
|
312
317
|
else
|
|
313
318
|
compile = Blocks::Compile.new(block, config, @referencedConfigs, @configTcMap[config])
|
|
314
319
|
(Blocks::ALL_COMPILE_BLOCKS[projName] ||= []) << compile
|
|
@@ -401,8 +406,8 @@ module Bake
|
|
|
401
406
|
end
|
|
402
407
|
|
|
403
408
|
taskType = "Building"
|
|
404
|
-
if Bake.options.
|
|
405
|
-
taskType = "
|
|
409
|
+
if Bake.options.file_list
|
|
410
|
+
taskType = "Showing file list"
|
|
406
411
|
elsif Bake.options.conversion_info
|
|
407
412
|
taskType = "Showing conversion infos"
|
|
408
413
|
elsif Bake.options.docu
|
|
@@ -442,40 +447,37 @@ module Bake
|
|
|
442
447
|
|
|
443
448
|
@mainConfig = @referencedConfigs[Bake.options.main_project_name].select { |c| c.name == Bake.options.build_config }.first
|
|
444
449
|
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
basedOn
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
Bake.formatter.printError("DefaultToolchain based on unknown compiler '#{basedOn}'", @mainConfig.defaultToolchain)
|
|
452
|
-
ExitHelper.exit(1)
|
|
453
|
-
end
|
|
450
|
+
basedOn = @mainConfig.defaultToolchain.basedOn
|
|
451
|
+
basedOnToolchain = Bake::Toolchain::Provider[basedOn]
|
|
452
|
+
if basedOnToolchain.nil?
|
|
453
|
+
Bake.formatter.printError("DefaultToolchain based on unknown compiler '#{basedOn}'", @mainConfig.defaultToolchain)
|
|
454
|
+
ExitHelper.exit(1)
|
|
455
|
+
end
|
|
454
456
|
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
ExitHelper.exit(1)
|
|
467
|
-
end
|
|
468
|
-
rescue SystemExit
|
|
469
|
-
raise
|
|
470
|
-
rescue Exception => e
|
|
471
|
-
Bake.formatter.printError("Could not detect MSVC compiler")
|
|
457
|
+
# The flag "-FS" must only be set for VS2013 and above
|
|
458
|
+
ENV["MSVC_FORCE_SYNC_PDB_WRITES"] = ""
|
|
459
|
+
if basedOn == "MSVC"
|
|
460
|
+
begin
|
|
461
|
+
res = `cl.exe 2>&1`
|
|
462
|
+
raise Exception.new unless $?.success?
|
|
463
|
+
scan_res = res.scan(/ersion (\d+).(\d+).(\d+)/)
|
|
464
|
+
if scan_res.length > 0
|
|
465
|
+
ENV["MSVC_FORCE_SYNC_PDB_WRITES"] = "-FS" if scan_res[0][0].to_i >= 18 # 18 is the compiler major version in VS2013
|
|
466
|
+
else
|
|
467
|
+
Bake.formatter.printError("Could not read MSVC version")
|
|
472
468
|
ExitHelper.exit(1)
|
|
473
469
|
end
|
|
470
|
+
rescue SystemExit
|
|
471
|
+
raise
|
|
472
|
+
rescue Exception => e
|
|
473
|
+
Bake.formatter.printError("Could not detect MSVC compiler")
|
|
474
|
+
ExitHelper.exit(1)
|
|
474
475
|
end
|
|
475
|
-
|
|
476
|
-
@defaultToolchain = Utils.deep_copy(basedOnToolchain)
|
|
477
|
-
Bake.options.envToolchain = true if (basedOn.include?"_ENV")
|
|
478
476
|
end
|
|
477
|
+
|
|
478
|
+
@defaultToolchain = Utils.deep_copy(basedOnToolchain)
|
|
479
|
+
Bake.options.envToolchain = true if (basedOn.include?"_ENV")
|
|
480
|
+
|
|
479
481
|
integrateToolchain(@defaultToolchain, @mainConfig.defaultToolchain)
|
|
480
482
|
|
|
481
483
|
# todo: cleanup this hack
|
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.28.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: 2017-01-
|
|
11
|
+
date: 2017-01-03 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rtext
|
|
@@ -419,7 +419,6 @@ files:
|
|
|
419
419
|
- documentation/_build/html/tips_and_tricks/tips_and_tricks.html
|
|
420
420
|
- documentation/_build/html/why_bake/why_bake.html
|
|
421
421
|
- lib/adapt/config/loader.rb
|
|
422
|
-
- lib/bake/bundle.rb
|
|
423
422
|
- lib/bake/cache.rb
|
|
424
423
|
- lib/bake/config/checks.rb
|
|
425
424
|
- lib/bake/config/loader.rb
|
|
@@ -449,7 +448,6 @@ files:
|
|
|
449
448
|
- lib/bake/toolchain/errorparser/greenhills_linker_error_parser.rb
|
|
450
449
|
- lib/bake/toolchain/errorparser/keil_compiler_error_parser.rb
|
|
451
450
|
- lib/bake/toolchain/errorparser/keil_linker_error_parser.rb
|
|
452
|
-
- lib/bake/toolchain/errorparser/lint_error_parser.rb
|
|
453
451
|
- lib/bake/toolchain/errorparser/msvc_compiler_error_parser.rb
|
|
454
452
|
- lib/bake/toolchain/errorparser/msvc_linker_error_parser.rb
|
|
455
453
|
- lib/bake/toolchain/errorparser/process_output.rb
|
|
@@ -459,7 +457,6 @@ files:
|
|
|
459
457
|
- lib/bake/toolchain/gcc_env.rb
|
|
460
458
|
- lib/bake/toolchain/greenhills.rb
|
|
461
459
|
- lib/bake/toolchain/keil.rb
|
|
462
|
-
- lib/bake/toolchain/lint.rb
|
|
463
460
|
- lib/bake/toolchain/msvc.rb
|
|
464
461
|
- lib/bake/toolchain/provider.rb
|
|
465
462
|
- lib/bake/toolchain/ti.rb
|
|
@@ -479,9 +476,9 @@ files:
|
|
|
479
476
|
- lib/blocks/convert.rb
|
|
480
477
|
- lib/blocks/docu.rb
|
|
481
478
|
- lib/blocks/executable.rb
|
|
479
|
+
- lib/blocks/fileList.rb
|
|
482
480
|
- lib/blocks/has_execute_command.rb
|
|
483
481
|
- lib/blocks/library.rb
|
|
484
|
-
- lib/blocks/lint.rb
|
|
485
482
|
- lib/blocks/makefile.rb
|
|
486
483
|
- lib/blocks/showIncludes.rb
|
|
487
484
|
- lib/common/abortException.rb
|
data/lib/bake/bundle.rb
DELETED
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
require 'fileutils'
|
|
2
|
-
require 'common/ext/rtext'
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
module Bake
|
|
6
|
-
|
|
7
|
-
class Bundle
|
|
8
|
-
|
|
9
|
-
def initialize()
|
|
10
|
-
cleanup()
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
def cleanup
|
|
14
|
-
@outputDir = nil
|
|
15
|
-
@result = true
|
|
16
|
-
@sources = []
|
|
17
|
-
@libs = []
|
|
18
|
-
@ls = nil
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
def self.instance
|
|
22
|
-
@@bundle ||= Bundle.new
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
def setOutputDir(dir)
|
|
26
|
-
@outputDir = dir
|
|
27
|
-
FileUtils.mkdir_p(@outputDir)
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
def addLib(lib, mainConfig)
|
|
31
|
-
return unless @outputDir
|
|
32
|
-
dir = @outputDir+"/lib"
|
|
33
|
-
FileUtils.mkdir_p(dir)
|
|
34
|
-
FileUtils.cp(lib, dir)
|
|
35
|
-
@libs << "lib/" + File.basename(lib) unless mainConfig
|
|
36
|
-
createProjectMeta(mainConfig)
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
def addBinary(exe, ls, mainConfig)
|
|
40
|
-
return unless @outputDir
|
|
41
|
-
|
|
42
|
-
dir = @outputDir+"/bin"
|
|
43
|
-
FileUtils.mkdir_p(dir)
|
|
44
|
-
FileUtils.cp(exe, dir)
|
|
45
|
-
|
|
46
|
-
if (ls and mainConfig)
|
|
47
|
-
lsDir = @outputDir+"/ls"
|
|
48
|
-
FileUtils.mkdir_p(lsDir)
|
|
49
|
-
FileUtils.cp(ls, lsDir)
|
|
50
|
-
@ls = "ls/" + File.basename(ls)
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
createProjectMeta(mainConfig)
|
|
54
|
-
end
|
|
55
|
-
|
|
56
|
-
def addSource(source, includeList, depFilename)
|
|
57
|
-
return unless @outputDir
|
|
58
|
-
if File.is_absolute?(source)
|
|
59
|
-
Bake.formatter.printWarning("Warning: '#{source}' is an absolute filename, this is not supported by bundle feature. File will be ignored.")
|
|
60
|
-
return
|
|
61
|
-
end
|
|
62
|
-
sdir = File.dirname(source)
|
|
63
|
-
dir = @outputDir
|
|
64
|
-
dir = dir + "/" + sdir unless sdir.empty?
|
|
65
|
-
FileUtils.mkdir_p(dir)
|
|
66
|
-
FileUtils.cp(source, dir)
|
|
67
|
-
@sources << source
|
|
68
|
-
|
|
69
|
-
addHeaders(makeAbsolute(includeList), parseDepFile(depFilename))
|
|
70
|
-
end
|
|
71
|
-
|
|
72
|
-
def addHeaders(absIncs, deps)
|
|
73
|
-
deps.each do |d|
|
|
74
|
-
absIncs.each do |a|
|
|
75
|
-
if d.start_with?a
|
|
76
|
-
filename = d[a.length+1..-1]
|
|
77
|
-
hdir = File.dirname(filename)
|
|
78
|
-
dir = @outputDir + "/inc"
|
|
79
|
-
dir = dir + "/" + hdir unless hdir.empty?
|
|
80
|
-
FileUtils.mkdir_p(dir)
|
|
81
|
-
FileUtils.cp(d, dir)
|
|
82
|
-
next
|
|
83
|
-
end
|
|
84
|
-
end
|
|
85
|
-
end
|
|
86
|
-
end
|
|
87
|
-
|
|
88
|
-
def makeAbsolute(includeList)
|
|
89
|
-
includeList.map { |x| File.expand_path(x) }
|
|
90
|
-
end
|
|
91
|
-
|
|
92
|
-
def parseDepFile(depFilename)
|
|
93
|
-
res = []
|
|
94
|
-
begin
|
|
95
|
-
File.readlines(depFilename).map{|line| line.strip}.each do |dep|
|
|
96
|
-
if File.exist?(dep)
|
|
97
|
-
res << File.expand_path(dep)
|
|
98
|
-
end
|
|
99
|
-
end
|
|
100
|
-
rescue Exception => ex
|
|
101
|
-
end
|
|
102
|
-
res
|
|
103
|
-
end
|
|
104
|
-
|
|
105
|
-
def createProjectMeta(mainConfig)
|
|
106
|
-
return unless mainConfig
|
|
107
|
-
|
|
108
|
-
project = Bake::Metamodel::Project.new
|
|
109
|
-
project.setDefault("bundle")
|
|
110
|
-
project.file_name = ""
|
|
111
|
-
|
|
112
|
-
config = mainConfig.class.new
|
|
113
|
-
config.setName("bundle")
|
|
114
|
-
|
|
115
|
-
project.setConfig([config])
|
|
116
|
-
|
|
117
|
-
sourceElements = @sources.map do |s|
|
|
118
|
-
source = Bake::Metamodel::Files.new
|
|
119
|
-
source.setName(s)
|
|
120
|
-
source
|
|
121
|
-
end
|
|
122
|
-
config.setFiles(sourceElements)
|
|
123
|
-
|
|
124
|
-
idir = Bake::Metamodel::IncludeDir.new
|
|
125
|
-
idir.setName("inc")
|
|
126
|
-
config.setIncludeDir([idir])
|
|
127
|
-
|
|
128
|
-
exLibs = @libs.map do |s|
|
|
129
|
-
lib = Bake::Metamodel::ExternalLibrary.new
|
|
130
|
-
lib.setName(s)
|
|
131
|
-
lib.setSearch(false)
|
|
132
|
-
lib
|
|
133
|
-
end
|
|
134
|
-
config.setLibStuff(exLibs)
|
|
135
|
-
|
|
136
|
-
if (mainConfig.toolchain)
|
|
137
|
-
config.setToolchain(Bake::MergeConfig.clone(mainConfig.toolchain))
|
|
138
|
-
end
|
|
139
|
-
|
|
140
|
-
if (mainConfig.defaultToolchain)
|
|
141
|
-
config.setDefaultToolchain(Bake::MergeConfig.clone(mainConfig.defaultToolchain))
|
|
142
|
-
end
|
|
143
|
-
|
|
144
|
-
if (@ls)
|
|
145
|
-
ls = Bake::Metamodel::LinkerScript.new
|
|
146
|
-
ls.setName(@ls)
|
|
147
|
-
config.setLinkerScript(ls)
|
|
148
|
-
end
|
|
149
|
-
|
|
150
|
-
s = StringIO.new
|
|
151
|
-
ser = RText::Serializer.new(Language)
|
|
152
|
-
ser.serialize(project, s)
|
|
153
|
-
File.write(@outputDir + "/Project.meta", s.string)
|
|
154
|
-
|
|
155
|
-
end
|
|
156
|
-
|
|
157
|
-
end
|
|
158
|
-
|
|
159
|
-
end
|