bake-toolkit 2.51.2 → 2.52.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8697a5a661d397ab0b18922825cbec08120b390511ca0a57aaa45d9a7c92005f
4
- data.tar.gz: 5f30afd19285987fa95a39e5ba0fbf51dfd3cc3c5d352a8d86a95ce168c85829
3
+ metadata.gz: 652c942772e53a8e02aacd190d4b5c6b7d15c5966727447cc4df221f2cf24843
4
+ data.tar.gz: 27952eb4784061168c8125bd0825a409e3ea681e9a8d6d4e8288c5f268021ebd
5
5
  SHA512:
6
- metadata.gz: 177e19aa83ad0525fde24d4e5ae6fb032cb082bb24cbaffb51d24024a6196f725b6be47be1951a86270ad8034573e28c19576e319b2e4218962534527197c6f2
7
- data.tar.gz: 1b14989c0d2d91a27bfd1f2dab31268978e35c519f9755c4785df8a33612d13cdd26ef22fe79b55542fecdd50ba157be5de8f644e9b75b627efbf5acbdad4598
6
+ metadata.gz: 2257e2a91fda80533af002515c7bbfe4e6e8f44ecc719f2ad99ca3ca5d56b3dd4dc2c9e162737da30db73c8c3fa0b99ce36541d1af6e39dd071063305100c501
7
+ data.tar.gz: 9af48c70d00d6869c9bf59c16e5da761bf29b49b94b9f08ce4a269cc6a32387816ec3a131adc05790badaa176e96ca192e29f73b1051c9b7ce3104ebc66accbb
@@ -87,13 +87,7 @@ module Bake
87
87
 
88
88
  # check if config has to be manipulated
89
89
  @adaptConfigs.each do |c|
90
-
91
- if isMain
92
- @defaultToolchainName = config.defaultToolchain.basedOn unless config.defaultToolchain.nil?
93
- @mainProjectName = config.parent.name
94
- @mainConfigName = config.name
95
- end
96
-
90
+
97
91
  projSplitted = c.project.split(";")
98
92
  confSplitted = c.name.split(";")
99
93
  projPatterns = projSplitted.map { |p| /\A#{p.gsub("*", "(\\w*)")}\z/ }
@@ -107,13 +101,28 @@ module Bake
107
101
  || (isMain and confSplitted.any? {|p| p == "__MAIN__"}) \
108
102
  || confSplitted.any? {|p| p == "__ALL__"}
109
103
 
110
- conditionProjPattern = c.parent.mainProject.split(";").map { |p| /\A#{p.gsub("*", "(\\w*)")}\z/ }
111
- conditionConfPattern = c.parent.mainConfig.split(";").map { |p| /\A#{p.gsub("*", "(\\w*)")}\z/ }
112
-
113
- adaptCondition = (c.parent.toolchain == "" || c.parent.toolchain == @defaultToolchainName) &&
114
- (c.parent.os == "" || c.parent.os == Utils::OS.name) &&
115
- (c.parent.mainProject == "" || conditionProjPattern.any? {|p| p.match(@mainProjectName)}) &&
116
- (c.parent.mainConfig == "" || conditionConfPattern.any? {|p| p.match(@mainConfigName)})
104
+ adaptHash = c.parent.getHash
105
+
106
+ configHash = {
107
+ "toolchain" => [@defaultToolchainName],
108
+ "os" => [Utils::OS.name],
109
+ "mainProject" => [@mainProjectName],
110
+ "mainConfig" => [@mainConfigName]
111
+ }
112
+ config.scopes.each do |s|
113
+ configHash[s.name] = [] unless configHash.has_key?(s.name)
114
+ configHash[s.name] += s.value.split(";")
115
+ end
116
+
117
+ checkCondition = lambda {|name,value|
118
+ return true if adaptHash[name].empty?
119
+ if !configHash.has_key?(name)
120
+ return adaptHash[name].any?{|ah| ah.empty?}
121
+ end
122
+ adaptHash[name].any? { |ah| configHash[name].any?{|ch| ah.match(ch)}}
123
+ }
124
+
125
+ adaptCondition = adaptHash.all? {|name,value| checkCondition.call(name, value)}
117
126
 
118
127
  invertLogic = (Bake::Metamodel::Unless === c.parent)
119
128
  next if (adaptCondition && invertLogic) || (!adaptCondition && !invertLogic)
@@ -53,9 +53,9 @@ module Bake
53
53
  def self.addOwnLib(block)
54
54
  if block.library
55
55
  adaptedPath, prefix = adaptPath(block.library.archive_name, block, prefix)
56
+ cb = block.library.compileBlock
56
57
  if (block.prebuild and File.exist?adaptedPath) or
57
- (!block.library.compileBlock.nil? and !block.library.compileBlock.objects.empty?) or
58
- (!block.library.compileBlock.nil? and !block.library.compileBlock.calcSources(true, true).empty?)
58
+ (!cb.nil? and !(cb.calcSources(true, true) - cb.source_files_ignored_in_lib).empty?)
59
59
  @@linker_libs_array << adaptedPath
60
60
  @@source_libraries << adaptedPath
61
61
  end
@@ -30,6 +30,11 @@ module Bake
30
30
 
31
31
  CompilerType = RGen::MetamodelBuilder::DataTypes::Enum.new( :name => "CompilerType", :literals => [:CPP, :C, :ASM])
32
32
 
33
+ class Scope < ModelElement
34
+ has_attr 'name', String, :defaultValueLiteral => ""
35
+ has_attr 'value', String, :defaultValueLiteral => ""
36
+ end
37
+
33
38
  class Flags < ModelElement
34
39
  has_attr 'overwrite', String, :defaultValueLiteral => ""
35
40
  has_attr 'add', String, :defaultValueLiteral => ""
@@ -137,6 +142,7 @@ module Bake
137
142
 
138
143
  class Files < ModelElement
139
144
  has_attr 'name', String, :defaultValueLiteral => ""
145
+ has_attr 'compileOnly', Boolean, :defaultValueLiteral => "false"
140
146
  contains_many 'define', Define, 'parent'
141
147
  contains_many 'flags', Flags, 'parent'
142
148
  end
@@ -276,6 +282,7 @@ module Bake
276
282
  has_attr 'project', String, :defaultValueLiteral => ""
277
283
  has_attr 'private', Boolean, :defaultValueLiteral => "false"
278
284
  has_attr 'mergeInc', String, :defaultValueLiteral => ""
285
+ contains_many 'scopes', Scope, 'parent'
279
286
  contains_one 'description', Description, 'parent'
280
287
  contains_one 'startupSteps', StartupSteps, 'parent'
281
288
  contains_one 'preSteps', PreSteps, 'parent'
@@ -336,6 +343,7 @@ module Bake
336
343
  has_attr 'mainProject', String, :defaultValueLiteral => ""
337
344
  has_attr 'mainConfig', String, :defaultValueLiteral => ""
338
345
  contains_many 'config', BaseConfig_INTERNAL, 'parent'
346
+ contains_many 'scopes', Scope, 'parent'
339
347
  end
340
348
 
341
349
  class If < Adapt
@@ -32,6 +32,27 @@ module Bake
32
32
  end
33
33
  end
34
34
 
35
+ module Adapt::ClassModule
36
+ def mapValue(str)
37
+ str.split(";").map { |p| /\A#{p.gsub("*", "(\\w*)")}\z/ }
38
+ end
39
+ def calcHash()
40
+ @hash = {}
41
+ deprecated = ["toolchain", "mainConfig", "mainProject", "os"]
42
+ deprecated.each do |d|
43
+ @hash[d] = self.send(d).empty? ? [] : mapValue(self.send(d))
44
+ end
45
+ self.scopes.each do |s|
46
+ @hash[s.name] = [] unless @hash.has_key?(s.name)
47
+ @hash[s.name] += mapValue(s.value)
48
+ end
49
+ @hash
50
+ end
51
+ def getHash
52
+ @hash ||= calcHash()
53
+ end
54
+ end
55
+
35
56
  module BaseConfig_INTERNAL::ClassModule
36
57
  def qname
37
58
  @qname ||= parent.name + "," + name
@@ -24,7 +24,7 @@ module Bake
24
24
  attr_reader :include_filter, :exclude_filter, :adapt # String List
25
25
  attr_reader :conversion_info, :stopOnFirstError, :clean, :rebuild, :show_includes, :show_includes_and_defines, :projectPaths, :qac, :dry, :syncedOutput, :debug_threads, :skipBuildingLine # Boolean
26
26
  attr_reader :linkOnly, :compileOnly, :no_autodir, :clobber, :docu, :debug, :prepro, :prebuild, :printTime, :json, :wparse, :caseSensitivityCheck, :fileCmd, :profiling # Boolean
27
- attr_reader :dotAndCompile
27
+ attr_reader :dotAndCompile, :show_roots
28
28
  attr_reader :threads, :socket # Fixnum
29
29
  attr_reader :vars, :include_filter_args # map
30
30
  attr_reader :verbose
@@ -91,6 +91,7 @@ module Bake
91
91
  @defines = []
92
92
  @fileCmd = false
93
93
  @dotAndCompile = false
94
+ @show_roots = false
94
95
 
95
96
  add_option(["-b", "" ], lambda { |x| set_build_config(x) })
96
97
  add_option(["-m" ], lambda { |x| @main_dir = x })
@@ -109,7 +110,7 @@ module Bake
109
110
  add_option(["--no-autodir", "--no_autodir" ], lambda { @no_autodir = true })
110
111
 
111
112
  add_option(["--create" ], lambda { |x| Bake::Create.proj(x) })
112
- add_option(["--conversion-info", "--conversion_info" ], lambda { @conversion_info = true })
113
+ add_option(["--conversion-info", "--conversion_info" ], lambda { @conversion_info = true; @syncedOutput = true })
113
114
  add_option(["--file-list", "--file_list" ], lambda { @filelist = Set.new })
114
115
  add_option(["--filter-paths" ], lambda { @projectPaths = true })
115
116
  add_option(["--qac" ], lambda { @qac = true })
@@ -165,6 +166,8 @@ module Bake
165
166
 
166
167
  # deprecated and not replaced by new command
167
168
  add_option(["--show_include_paths" ], lambda { @show_includes = true })
169
+
170
+ add_option(["--roots" ], lambda { @show_roots = true })
168
171
 
169
172
  end
170
173
 
@@ -189,6 +192,11 @@ module Bake
189
192
  end
190
193
 
191
194
  @roots = Root.uniq(@roots)
195
+
196
+ if @show_roots
197
+ puts @roots.map {|r| r.dir }
198
+ ExitHelper.exit(0)
199
+ end
192
200
 
193
201
  @adapt.uniq!
194
202
 
@@ -54,6 +54,7 @@ module Bake
54
54
  puts " --incs-and-defs=json Prints includes and defines of all projects in json format"
55
55
  puts " --incs-and-defs=bake Used by IDEs plugins"
56
56
  puts " --conversion-info Prints infos for an external tool which converts bake configs for other build systems"
57
+ puts " --roots Prints all workspace roots"
57
58
  puts " --file-list Writes all sources and headers used by a SINGLE config into '<config output folder>/file-list.txt'."
58
59
  puts " Writes all sources and headers used by ALL configs into '<main config output folder/global-file-list.txt'."
59
60
  puts " --prebuild Does not build configs which are marked as 'prebuild', this feature is used for distributions."
@@ -4,7 +4,8 @@ module Bake
4
4
  class GCCCompilerErrorParser < ErrorParser
5
5
 
6
6
  def initialize()
7
- @error_expression = /([^:]+):([0-9]+)[:0-9]* (catastrophic |fatal )*([A-Za-z\._]+): (.+)/
7
+ @error_expression = /([^:]+):([0-9]+)[:0-9]* (catastrophic |fatal )*([A-Za-z\._]+): (.+)/
8
+ @error_expression2 = /([^:]+)\(([0-9]+)\): (catastrophic |fatal )*([A-Za-z\._]+): (.+)/
8
9
  end
9
10
 
10
11
  def scan_lines(consoleOutput, proj_dir)
@@ -13,6 +14,7 @@ module Bake
13
14
  consoleOutput[0].each_line do |l|
14
15
  d = ErrorDesc.new
15
16
  scan_res = l.gsub(/\r\n?/, "").scan(@error_expression)
17
+ scan_res = l.gsub(/\r\n?/, "").scan(@error_expression2) if !(scan_res.length > 0)
16
18
  if scan_res.length > 0
17
19
  d.file_name = File.expand_path(scan_res[0][0], proj_dir)
18
20
  d.line_number = scan_res[0][1].to_i
@@ -64,6 +64,10 @@ module Bake
64
64
  def set_library(library)
65
65
  @library = library
66
66
  end
67
+
68
+ def qname()
69
+ @projectName + "," + @configName
70
+ end
67
71
 
68
72
  def initialize(config, referencedConfigs, prebuild, tcs)
69
73
  @inDeps = false
@@ -210,6 +214,7 @@ module Bake
210
214
  end
211
215
 
212
216
  def isBuildBlock?
217
+ return true if Bake.options.conversion_info
213
218
  @isBuildBlock ||= calcIsBuildBlock
214
219
  end
215
220
 
@@ -548,6 +553,7 @@ module Bake
548
553
  def calcOutputDir
549
554
  if @tcs[:OUTPUT_DIR] != nil
550
555
  p = convPath(@tcs[:OUTPUT_DIR])
556
+ p = p[2..-1] if p.start_with?("./")
551
557
  @output_dir = p
552
558
  else
553
559
  qacPart = Bake.options.qac ? (".qac" + Bake.options.buildDirDelimiter) : ""
@@ -47,7 +47,7 @@ module Bake
47
47
 
48
48
  class Compile < BlockBase
49
49
 
50
- attr_reader :objects, :include_list
50
+ attr_reader :objects, :include_list, :source_files_ignored_in_lib
51
51
 
52
52
  def mutex
53
53
  @mutex ||= Mutex.new
@@ -526,7 +526,7 @@ module Bake
526
526
  end
527
527
  end
528
528
  @object_files[source] = object
529
- @objects << object
529
+ @objects << object unless @source_files_ignored_in_lib.include?(source)
530
530
  end
531
531
  end
532
532
  end
@@ -534,6 +534,7 @@ module Bake
534
534
  def calcSources(cleaning = false, keep = false)
535
535
  return @source_files if @source_files and not @source_files.empty?
536
536
  @source_files = []
537
+ @source_files_ignored_in_lib = []
537
538
 
538
539
  exclude_files = Set.new
539
540
  @config.excludeFiles.each do |pr|
@@ -559,6 +560,7 @@ module Bake
559
560
  next if source_files.include?(f)
560
561
  source_files << f
561
562
  @source_files << f
563
+ @source_files_ignored_in_lib << f if sources.compileOnly
562
564
  end
563
565
  end
564
566
 
@@ -591,7 +593,7 @@ module Bake
591
593
  end
592
594
  end
593
595
 
594
- @source_files
596
+ return @source_files
595
597
  end
596
598
 
597
599
  def calcIncludesInternal(block)
@@ -12,6 +12,10 @@ module Bake
12
12
 
13
13
  def execute
14
14
  Dir.chdir(@projectDir) do
15
+ calcFileTcs
16
+ calcIncludes
17
+ calcDefines
18
+ calcFlags
15
19
  calcSources
16
20
 
17
21
  puts "START_INFO"
@@ -24,9 +28,9 @@ module Bake
24
28
  puts " BAKE_DEFINES"
25
29
  (@block.tcs[:COMPILER][:CPP][:DEFINES] + @block.tcs[:COMPILER][:C][:DEFINES] + @block.tcs[:COMPILER][:ASM][:DEFINES]).uniq.each { |s| puts " #{s}" }
26
30
  puts " BAKE_DEPENDENCIES"
27
- @block.dependencies.each { |dep| puts " #{dep.projectName}" }
31
+ @block.dependencies.each { |dep| puts " #{ALL_BLOCKS[dep].qname}" }
28
32
  puts " BAKE_DEPENDENCIES_FILTERED"
29
- @block.dependencies.each { |dep| puts " #{dep.projectName}" unless @projectName == dep.projectName or dep.projectName == "gmock" or dep.projectName == "gtest" }
33
+ @block.dependencies.each { |dep| pn = ALL_BLOCKS[dep].projectName; puts " #{ALL_BLOCKS[dep].qname}" unless @projectName == pn || pn == "gmock" || pn == "gtest" }
30
34
  puts "END_INFO"
31
35
  end
32
36
  return true
@@ -1,7 +1,7 @@
1
1
  module Bake
2
2
  class Version
3
3
  def self.number
4
- "2.51.2"
4
+ "2.52.0"
5
5
  end
6
6
 
7
7
  def self.printBakeVersion(ry = "")
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.51.2
4
+ version: 2.52.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-03-26 00:00:00.000000000 Z
11
+ date: 2019-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rtext