bake-toolkit 2.65.0 → 2.68.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.
data/lib/bake/subst.rb CHANGED
@@ -227,6 +227,13 @@ module Bake
227
227
  args = Bake.options.include_filter_args[splittedVar[1]]
228
228
  substStr << args if args
229
229
  end
230
+ elsif var == "OriginalDir"
231
+ org = File.dirname(elem.org_file_name)
232
+ if (org == @@projDir)
233
+ substStr << @@projDir
234
+ else
235
+ substStr << File.rel_from_to_project(@@projDir,File.dirname(elem.org_file_name),false)
236
+ end
230
237
  elsif var == "ProjectDir" or (splittedVar.length == 2 and splittedVar[0] == "ProjectDir")
231
238
  if (var == "ProjectDir")
232
239
  substStr << @@projDir
@@ -258,12 +265,18 @@ module Bake
258
265
  configs = @@referencedConfigs[out_proj_name]
259
266
  config = configs.select {|c| c.name == out_conf_name }.first
260
267
  if config
261
- out_dir = nil
262
- if (config.toolchain and config.toolchain.outputDir and config.toolchain.outputDir != "")
268
+
269
+ if config.toolchain && config.toolchain.outputDir && config.toolchain.outputDir != ""
263
270
  out_dir = config.toolchain.outputDir
264
271
  else
265
272
  out_dir = @@configTcMap[config][:OUTPUT_DIR]
266
273
  end
274
+ if config.toolchain && config.toolchain.outputDirPostfix && config.toolchain.outputDirPostfix != ""
275
+ out_dir_postfix = config.toolchain.outputDirPostfix
276
+ else
277
+ out_dir_postfix = @@configTcMap[config][:OUTPUT_DIR_POSTFIX]
278
+ end
279
+
267
280
  if not out_dir
268
281
  qacPart = Bake.options.qac ? (".qac" + Bake.options.buildDirDelimiter) : ""
269
282
  if out_proj_name == Bake.options.main_project_name and out_conf_name == Bake.options.build_config
@@ -272,6 +285,7 @@ module Bake
272
285
  out_dir = "build" + Bake.options.buildDirDelimiter + qacPart + out_conf_name + "_" + Bake.options.main_project_name + "_" + Bake.options.build_config
273
286
  end
274
287
  end
288
+ out_dir += out_dir_postfix if out_dir_postfix
275
289
 
276
290
  if (out_dir.include?"$(")
277
291
  if !elem
@@ -374,8 +388,14 @@ module Bake
374
388
  return if Metamodel::DefaultToolchain === elem
375
389
  return if Metamodel::Toolchain === elem.class
376
390
  next if a.eType.name != "EString"
377
- substStr = substString(elem.getGeneric(a.name), elem, a.name)
378
- elem.setGeneric(a.name, substStr)
391
+ value = elem.getGeneric(a.name)
392
+ if value.kind_of?(Array)
393
+ substArr = value.map { |s| substString(s, elem, a.name) }
394
+ elem.setGeneric(a.name, substArr)
395
+ else
396
+ substStr = substString(value, elem, a.name)
397
+ elem.setGeneric(a.name, substStr)
398
+ end
379
399
  end
380
400
 
381
401
  childsRefs = elem.class.ecore.eAllReferences.select{|r| r.containment}
@@ -32,6 +32,9 @@ module Bake
32
32
  if Bake::Utils::OS::name == "Mac"
33
33
  CLANG_CHAIN[:ARCHIVER][:COMMAND] = "libtool"
34
34
  CLANG_CHAIN[:ARCHIVER][:ARCHIVE_FLAGS] = "-static -o"
35
+ elsif Bake::Utils::OS::name == "Windows"
36
+ CLANG_CHAIN[:ARCHIVER][:COMMAND] = "clang"
37
+ CLANG_CHAIN[:ARCHIVER][:ARCHIVE_FLAGS] = "-fuse-ld=llvm-lib -o"
35
38
  else
36
39
  CLANG_CHAIN[:ARCHIVER][:COMMAND] = "ar"
37
40
  CLANG_CHAIN[:ARCHIVER][:ARCHIVE_FLAGS] = "r"
data/lib/bake/util.rb CHANGED
@@ -44,6 +44,7 @@ def integrateToolchain(tcs, toolchain)
44
44
 
45
45
  tcs[:KEEP_FILE_ENDINGS] = @mainConfig.defaultToolchain.keepObjFileEndings
46
46
  tcs[:OUTPUT_DIR] = toolchain.outputDir if toolchain.outputDir != ""
47
+ tcs[:OUTPUT_DIR_POSTFIX] = toolchain.outputDirPostfix if toolchain.outputDirPostfix != ""
47
48
  integrateLinker(tcs, toolchain.linker) if toolchain.respond_to?"linker"
48
49
  integrateArchiver(tcs, toolchain.archiver)
49
50
  toolchain.compiler.each do |c|
@@ -25,6 +25,10 @@ module Bake
25
25
  has_attr 'name', String, :defaultValueLiteral => ""
26
26
  has_attr 'config', String, :defaultValueLiteral => ""
27
27
  end
28
+
29
+ class ExcludeDir < ModelElement
30
+ has_attr 'name', String, :defaultValueLiteral => ""
31
+ end
28
32
  class SubCollection < ModelElement
29
33
  has_attr 'name', String, :defaultValueLiteral => ""
30
34
  end
@@ -32,6 +36,7 @@ module Bake
32
36
  has_attr 'name', String, :defaultValueLiteral => ""
33
37
  contains_many 'project', Project, 'collection'
34
38
  contains_many 'exclude', Exclude, 'collection'
39
+ contains_many 'exclude_dir', ExcludeDir, 'collection'
35
40
  contains_many 'collections', SubCollection, 'collection'
36
41
  end
37
42
 
data/lib/bakery/toBake.rb CHANGED
@@ -67,11 +67,18 @@ module Bake
67
67
  p.config = "^"+p.config.gsub("*","(\\w*)")+"$"
68
68
  end
69
69
 
70
+ col.exclude_dir.each do |e|
71
+ e.name = File.expand_path(e.name, @options.collection_dir)
72
+ end
73
+
70
74
  toBuild.delete_if do |bp|
71
75
  exclude = false
72
76
  col.exclude.each do |p|
73
77
  exclude = true if (bp.proj.match(p.name) != nil and bp.conf.match(p.config) != nil)
74
78
  end
79
+ col.exclude_dir.each do |e|
80
+ exclude = true if bp.proj.start_with?(e.name)
81
+ end
75
82
  exclude
76
83
  end
77
84
 
data/lib/blocks/block.rb CHANGED
@@ -598,6 +598,12 @@ module Bake
598
598
  @output_dir = "build" + Bake.options.buildDirDelimiter + qacPart + @config.name + "_" + Bake.options.main_project_name + "_" + Bake.options.build_config
599
599
  end
600
600
  end
601
+ if @tcs[:OUTPUT_DIR_POSTFIX] != nil
602
+ @output_dir = @output_dir + @tcs[:OUTPUT_DIR_POSTFIX]
603
+ end
604
+ if Bake.options.consoleOutput_fullnames
605
+ @output_dir = File.expand_path(@output_dir, @projectDir)
606
+ end
601
607
  end
602
608
 
603
609
  end
@@ -1,44 +1,44 @@
1
- require_relative 'has_execute_command'
2
-
3
- module Bake
4
- module Blocks
5
-
6
- class CommandLine
7
- include HasExecuteCommand
8
-
9
- def initialize(config)
10
- @config = config # Bake::Metamodel::CommandLine
11
- @commandLine = config.name
12
- @projectDir = config.get_project_dir
13
- end
14
-
15
- def run
16
- return true if Bake.options.linkOnly
17
- return executeCommand(@commandLine, nil, @config.validExitCodes, @config.echo)
18
- end
19
-
20
- def execute
21
- return run()
22
- end
23
-
24
- def startupStep
25
- return run()
26
- end
27
-
28
- def exitStep
29
- return run()
30
- end
31
-
32
- def cleanStep
33
- return run()
34
- end
35
-
36
- def clean
37
- # nothing to do here
38
- return true
39
- end
40
-
41
- end
42
-
43
- end
44
- end
1
+ require_relative 'has_execute_command'
2
+
3
+ module Bake
4
+ module Blocks
5
+
6
+ class CommandLine
7
+ include HasExecuteCommand
8
+
9
+ def initialize(config)
10
+ @config = config # Bake::Metamodel::CommandLine
11
+ @commandLine = config.name.kind_of?(Array) ? config.name.join(' ') : config.name
12
+ @projectDir = config.get_project_dir
13
+ end
14
+
15
+ def run
16
+ return true if Bake.options.linkOnly
17
+ return executeCommand(@commandLine, nil, @config.validExitCodes, @config.echo)
18
+ end
19
+
20
+ def execute
21
+ return run()
22
+ end
23
+
24
+ def startupStep
25
+ return run()
26
+ end
27
+
28
+ def exitStep
29
+ return run()
30
+ end
31
+
32
+ def cleanStep
33
+ return run()
34
+ end
35
+
36
+ def clean
37
+ # nothing to do here
38
+ return true
39
+ end
40
+
41
+ end
42
+
43
+ end
44
+ end
@@ -37,7 +37,7 @@ begin
37
37
  x = longname(shortname(file))
38
38
  end
39
39
 
40
- rescue Fiddle::DLError
40
+ rescue Exception
41
41
 
42
42
  def realname file
43
43
  file
@@ -255,7 +255,7 @@ module Bake
255
255
  cmdJson = cmd.is_a?(Array) ? cmd.join(' ') : cmd
256
256
  srcFilePath = source
257
257
  if Bake.options.consoleOutput_fullnames
258
- srcFilePath = File.join(@projectDir, srcFilePath)
258
+ srcFilePath = File.join(@projectDir, srcFilePath) if !File.is_absolute?(srcFilePath)
259
259
  cmdJson[source] = srcFilePath
260
260
  end
261
261
  cmdJson.gsub!("\"" , "\\\"")
@@ -524,10 +524,16 @@ module Bake
524
524
 
525
525
  def calcObjects
526
526
  @object_files_ignored_in_lib = []
527
- @source_files.each do |source|
527
+ @source_files.map! do |source|
528
528
  type = get_source_type(source)
529
529
  if not type.nil?
530
530
  object = get_object_file(source)
531
+
532
+ if Bake.options.consoleOutput_fullnames
533
+ object = File.expand_path(object, @projectDir)
534
+ source = File.expand_path(source, @projectDir)
535
+ end
536
+
531
537
  if @objects.include?object
532
538
  @object_files.each do |k,v|
533
539
  if (v == object) # will be found exactly once
@@ -545,6 +551,7 @@ module Bake
545
551
  @objects << object
546
552
  end
547
553
  end
554
+ source
548
555
  end
549
556
  end
550
557
 
@@ -629,16 +636,18 @@ module Bake
629
636
  end
630
637
 
631
638
  def calcIncludesInternal(block)
632
- # puts "#{block.projectName},#{block.configName} " + block.to_s
633
639
  noDeps = @blocksRead.include?(block)
634
640
  @blocksRead << block
635
641
  block.bes.each do |be|
636
642
  if Metamodel::IncludeDir === be
637
- # puts "-- #{be.name}"
638
643
  if be.inherit == true || block == @block
639
- mappedInc = File.rel_from_to_project(@projectDir,be.name,false)
640
- mappedInc = "." if mappedInc.empty?
641
- if !@include_set.include?(mappedInc) # todo set!!
644
+ if Bake.options.consoleOutput_fullnames
645
+ mappedInc = be.name
646
+ else
647
+ mappedInc = File.rel_from_to_project(@projectDir,be.name,false)
648
+ mappedInc = "." if mappedInc.empty?
649
+ end
650
+ if !@include_set.include?(mappedInc)
642
651
  @include_list << mappedInc
643
652
  @include_set << mappedInc
644
653
  if !@include_merge.has_key?(mappedInc)
@@ -674,15 +683,7 @@ module Bake
674
683
  @include_list = []
675
684
  @include_merge = {}
676
685
  @system_includes = Set.new
677
-
678
- #puts @block.bes.length
679
- #@block.bes.each {|b| puts "#{b.class}: #{b.name}, #{b.respond_to?(:config) ? b.config : ""}"}
680
- #exit(1)
681
-
682
-
683
-
684
686
  calcIncludesInternal(@block) # includeDir and child dependencies with inherit: true
685
- # exit(1)
686
687
  @include_list = @include_list.flatten.uniq
687
688
  end
688
689
 
@@ -43,6 +43,10 @@ module Bake
43
43
  baseFilename += ".#{@config.artifactExtension.name}"
44
44
  end
45
45
  @exe_name ||= File.join([@block.output_dir, baseFilename])
46
+ if Bake.options.consoleOutput_fullnames
47
+ @exe_name = File.expand_path(@exe_name, @projectDir)
48
+ end
49
+ return @exe_name
46
50
  end
47
51
 
48
52
  def calcCmdlineFile()
@@ -34,6 +34,10 @@ module Bake
34
34
  baseFilename += ".#{@config.artifactExtension.name}"
35
35
  end
36
36
  @archive_name ||= File.join([@block.output_dir, baseFilename])
37
+ if Bake.options.consoleOutput_fullnames
38
+ @archive_name = File.expand_path(@archive_name, @projectDir)
39
+ end
40
+ return @archive_name
37
41
  end
38
42
 
39
43
  def calcCmdlineFile()
@@ -17,14 +17,16 @@ module Bake
17
17
  @projectDir = config.get_project_dir
18
18
  @path_to = ""
19
19
  @flags = adjustFlags("",config.flags) if config.flags
20
- @makefile = config.name
20
+ @makefile = block.convPath(config.name)
21
21
  @target = config.target != "" ? config.target : "all"
22
22
  calcPathTo(referencedConfigs)
23
23
  calcCommandLine
24
24
  calcCleanLine
25
25
  calcEnv
26
26
 
27
- block.lib_elements << LibElement.new(LibElement::LIB_WITH_PATH, config.lib) if config.lib != ""
27
+ if config.lib != ""
28
+ block.lib_elements << LibElement.new(LibElement::LIB_WITH_PATH, block.convPath(config.lib))
29
+ end
28
30
  end
29
31
 
30
32
  def calcEnv
@@ -1,7 +1,7 @@
1
1
  module Bake
2
2
  class Version
3
3
  def self.number
4
- "2.65.0"
4
+ "2.68.0"
5
5
  end
6
6
 
7
7
  def self.printBakeVersion(ry = "")
@@ -29,26 +29,22 @@ module Bake
29
29
  end
30
30
  end
31
31
 
32
- expectedRGen = "0.8.2"
33
- expectedRText = "0.9.0"
34
- expectedConcurrent = "1.0.5"
35
-
36
- begin
37
- gem "rgen", "=#{expectedRGen}"
38
- rescue Exception => e
39
- puts "Warning: Failed to load rgen #{expectedRGen}, using latest version"
40
- end
41
-
42
- begin
43
- gem "rtext", "=#{expectedRText}"
44
- rescue Exception => e
45
- puts "Warning: Failed to load rtext #{expectedRText}, using latest version"
46
- end
47
-
48
- begin
49
- gem "concurrent-ruby", "=#{expectedConcurrent}"
50
- rescue Exception => e
51
- puts "Warning: Failed to load concurrent-ruby #{expectedConcurrent}, using latest version"
32
+ deps = [
33
+ ["rgen", "0.8.2"],
34
+ ["rtext", "0.9.0"],
35
+ ["concurrent-ruby", "1.0.5"],
36
+ ["highline", "1.7.8"],
37
+ ["colored", "1.2"],
38
+ ["thwait", "0.1.0"],
39
+ ["e2mmap", "0.1.0"]]
40
+
41
+ deps.each do |d|
42
+ begin
43
+ gem d[0], "=#{d[1]}"
44
+ rescue Exception => e
45
+ puts "Error: Failed to load gem #{d[0]} #{d[1]}, please reinstall bake-toolkit."
46
+ exit -1
47
+ end
52
48
  end
53
49
 
54
50
  end
data/lib/tocxx.rb CHANGED
@@ -652,8 +652,8 @@ module Bake
652
652
  al = AdaptConfig.new
653
653
  adaptConfigs = al.load()
654
654
 
655
- @loadedConfig = Config.new
656
- @referencedConfigs = @loadedConfig.load(adaptConfigs)
655
+ loadedConfig = Config.new
656
+ @referencedConfigs = loadedConfig.load(adaptConfigs)
657
657
 
658
658
  cache.write_cache(@referencedConfigs, adaptConfigs)
659
659
  end
@@ -894,10 +894,13 @@ module Bake
894
894
  o = b.object_files[s]
895
895
  dep_filename = b.calcDepFile(o, type)
896
896
  dep_filename_conv = b.calcDepFileConv(dep_filename)
897
- File.readlines(File.expand_path(dep_filename_conv, b.projectDir)).map{|line| line.strip}.each do |dep|
898
- header = File.expand_path(dep, b.projectDir)
899
- if File.exist?(header)
900
- inCompilation << header
897
+ fname = File.expand_path(dep_filename_conv, b.projectDir)
898
+ if File.exist?(fname)
899
+ File.readlines(fname).map{|line| line.strip}.each do |dep|
900
+ header = File.expand_path(dep, b.projectDir)
901
+ if File.exist?(header)
902
+ inCompilation << header
903
+ end
901
904
  end
902
905
  end
903
906
  end
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.65.0
4
+ version: 2.68.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: 2020-08-26 00:00:00.000000000 Z
11
+ date: 2021-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rtext
@@ -98,72 +98,58 @@ dependencies:
98
98
  name: e2mmap
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ">="
101
+ - - '='
102
102
  - !ruby/object:Gem::Version
103
- version: '0'
103
+ version: 0.1.0
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ">="
109
- - !ruby/object:Gem::Version
110
- version: '0'
111
- - !ruby/object:Gem::Dependency
112
- name: rake
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - ">="
116
- - !ruby/object:Gem::Version
117
- version: 12.3.3
118
- type: :development
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - ">="
108
+ - - '='
123
109
  - !ruby/object:Gem::Version
124
- version: 12.3.3
110
+ version: 0.1.0
125
111
  - !ruby/object:Gem::Dependency
126
112
  name: rspec
127
113
  requirement: !ruby/object:Gem::Requirement
128
114
  requirements:
129
- - - ">="
115
+ - - '='
130
116
  - !ruby/object:Gem::Version
131
- version: '0'
117
+ version: 3.10.0
132
118
  type: :development
133
119
  prerelease: false
134
120
  version_requirements: !ruby/object:Gem::Requirement
135
121
  requirements:
136
- - - ">="
122
+ - - '='
137
123
  - !ruby/object:Gem::Version
138
- version: '0'
124
+ version: 3.10.0
139
125
  - !ruby/object:Gem::Dependency
140
126
  name: simplecov
141
127
  requirement: !ruby/object:Gem::Requirement
142
128
  requirements:
143
- - - ">="
129
+ - - '='
144
130
  - !ruby/object:Gem::Version
145
- version: '0'
131
+ version: 0.16.1
146
132
  type: :development
147
133
  prerelease: false
148
134
  version_requirements: !ruby/object:Gem::Requirement
149
135
  requirements:
150
- - - ">="
136
+ - - '='
151
137
  - !ruby/object:Gem::Version
152
- version: '0'
138
+ version: 0.16.1
153
139
  - !ruby/object:Gem::Dependency
154
140
  name: coveralls
155
141
  requirement: !ruby/object:Gem::Requirement
156
142
  requirements:
157
- - - ">="
143
+ - - '='
158
144
  - !ruby/object:Gem::Version
159
- version: '0'
145
+ version: 0.8.23
160
146
  type: :development
161
147
  prerelease: false
162
148
  version_requirements: !ruby/object:Gem::Requirement
163
149
  requirements:
164
- - - ">="
150
+ - - '='
165
151
  - !ruby/object:Gem::Version
166
- version: '0'
152
+ version: 0.8.23
167
153
  description: See documentation for more details
168
154
  email: alexander.schaal@esrlabs.com
169
155
  executables:
@@ -279,7 +265,7 @@ files:
279
265
  - lib/rtext-service/options/options.rb
280
266
  - lib/tocxx.rb
281
267
  - license.txt
282
- homepage:
268
+ homepage: https://github.com/esrlabs/bake
283
269
  licenses:
284
270
  - MIT
285
271
  metadata: {}
@@ -300,8 +286,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
300
286
  - !ruby/object:Gem::Version
301
287
  version: '0'
302
288
  requirements: []
303
- rubyforge_project:
304
- rubygems_version: 2.7.7
289
+ rubygems_version: 3.1.4
305
290
  signing_key:
306
291
  specification_version: 4
307
292
  summary: Build tool to compile C/C++ projects fast and easy.