bake-toolkit 2.54.2 → 2.54.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b1f28f604eabf9369d88baeca22ca3197b795869d2e63abf5abad688e4bcd029
4
- data.tar.gz: 4013fa730dd7932df41e7b1600d9a6be5ca9532778371944d54490fbfa5b3249
3
+ metadata.gz: b660cd9c40c8aac3678294bc00bf7f797b2c4fdd024bcf329db5ea640da69223
4
+ data.tar.gz: 45c476b4b32fa4990f2502f6e5f4dedc0386a3177f870fee6b25ef72cff4a437
5
5
  SHA512:
6
- metadata.gz: a5714a0943746ec267597eb12de35b821a6fd57ca69be8d93c61a851706662f962ae2571a4d1f3a9414f6bcc9a4273943a45c52bac483ca0c86387b182824a7e
7
- data.tar.gz: 8eb1da4a19aab634a3576225594f4e4318be9bc7bf4b71f91c464fb3c7e8b4a3ba3cd8948a24fc9b0ed37b7079c381f82e669e339fef6bb3e0ceb9929e3b4705
6
+ metadata.gz: 36a9dbdae13d2985641b0d16a213c5daaa42279e41232dc6830aa3e07eac3df51ba8050c92a6f0febf2923f47f5e79dff3ccff748b2fd90b8e3a46501cc3db71
7
+ data.tar.gz: 368185045fe98fa0801f45fd268410adcf86651ac300f26015e51060196b7f7d784c17cb119219e7e6a3354ab870f36d82d66e0dfc8f5b2d8321686d030d255e
@@ -66,8 +66,8 @@ def self.executeQacli(cmd, adminStepAndImmediateOutput = false)
66
66
  processTimeout = false
67
67
 
68
68
  loop do
69
- FileUtils.rm_rf @options.qacdata if adminStepAndImmediateOutput
70
- FileUtils::mkdir_p @options.qacdata
69
+ FileUtils.rm_rf(@options.qacdata) if adminStepAndImmediateOutput
70
+ Utils.gitIgnore(@options.qacdata)
71
71
 
72
72
  cmdDupped = cmd.dup
73
73
  cmdDupped << @options.qacdata
@@ -226,7 +226,7 @@ $cmdRemoveLocks = qaExe + ["admin", "--qaf-project", @options.qacdata, "--remove
226
226
  ###### STEP 2: BUILD ######
227
227
 
228
228
  if success and (@options.qacstep.nil? or @options.qacstep.include?"analyze")
229
- FileUtils::mkdir_p @options.qacdata
229
+ Utils.gitIgnore(@options.qacdata)
230
230
 
231
231
  cmd = qaExe + ["analyze", "-b"]
232
232
 
@@ -287,7 +287,7 @@ $cmdRemoveLocks = qaExe + ["admin", "--qaf-project", @options.qacdata, "--remove
287
287
  ###### STEP 3: RESULT ######
288
288
 
289
289
  if success and (@options.qacstep.nil? or @options.qacstep.include?"view")
290
- FileUtils::mkdir_p @options.qacdata
290
+ Utils.gitIgnore(@options.qacdata)
291
291
 
292
292
  puts "bakeqac: printing results..."
293
293
 
@@ -453,7 +453,7 @@ $cmdRemoveLocks = qaExe + ["admin", "--qaf-project", @options.qacdata, "--remove
453
453
  ###### STEP 4b: REPORT SUR (OPTIONAL) ######
454
454
 
455
455
  if success and !@options.qacstep.nil? and @options.qacstep.include?("report")
456
- FileUtils::mkdir_p @options.qacdata
456
+ Utils.gitIgnore(@options.qacdata)
457
457
 
458
458
  puts "bakeqac: generating SUR report..."
459
459
 
@@ -467,7 +467,7 @@ $cmdRemoveLocks = qaExe + ["admin", "--qaf-project", @options.qacdata, "--remove
467
467
  ###### STEP 4c: REPORT RCR (OPTIONAL) ######
468
468
 
469
469
  if success and !@options.qacstep.nil? and @options.qacstep.include?("report")
470
- FileUtils::mkdir_p @options.qacdata
470
+ Utils.gitIgnore(@options.qacdata)
471
471
 
472
472
  puts "bakeqac: generating RCR report..."
473
473
 
@@ -481,7 +481,7 @@ $cmdRemoveLocks = qaExe + ["admin", "--qaf-project", @options.qacdata, "--remove
481
481
  ###### STEP 5: REPORT MDR (OPTIONAL) ######
482
482
 
483
483
  if success and !@options.qacstep.nil? and @options.qacstep.include?("mdr")
484
- FileUtils::mkdir_p @options.qacdata
484
+ Utils.gitIgnore(@options.qacdata)
485
485
 
486
486
  puts "bakeqac: generating MDR report..."
487
487
 
@@ -30,7 +30,9 @@ module Bake
30
30
  else
31
31
  @cacheFilename = Bake.options.main_dir+"/.bake/Project.meta." + sanitize_filename(Bake.options.build_config) + qacStr + ".cache"
32
32
  end
33
- FileUtils.mkdir_p(File.dirname(@cacheFilename)) if !Bake.options.dry
33
+ if !Bake.options.dry
34
+ Utils.gitIgnore(File.dirname(@cacheFilename))
35
+ end
34
36
  end
35
37
 
36
38
  def load_cache
@@ -71,6 +71,10 @@ module Bake
71
71
  end
72
72
  })
73
73
 
74
+ if !Bake.options.dry
75
+ Utils.gitIgnore(File.dirname(filename)+"/.bake")
76
+ end
77
+
74
78
  frag = @model.fragments[0]
75
79
  @model.remove_fragment(frag)
76
80
  frag
@@ -18,7 +18,7 @@ module Bake
18
18
  puts " -p <dir> Project to build/clean (default is main project)"
19
19
  puts " -f <name> Build/Clean this file only."
20
20
  puts " -c Clean the file/project."
21
- puts " -a <scheme> Use ansi color sequences (console must-- support it). Possible values are 'white' and 'black'."
21
+ puts " -a <scheme> Use ansi color sequences (console must support it). Possible values are 'white', 'black' and 'none' (default)."
22
22
  puts " -v<level> Verbose level from 0 to 3, whereas -v0 is less, -v1 is normal (default) and -v2 and -v3 are more verbose."
23
23
  puts " -r Stop on first error."
24
24
  puts " -w <root>[,<depth>] Add a workspace root (can be used multiple times). Additionally the search depth can be specified (>=0)."
@@ -41,7 +41,7 @@ module Bake
41
41
 
42
42
  def self.resolveOutputDir()
43
43
  @@outputDirUnresolved.each do |elem|
44
- subst(elem)
44
+ subst(elem) if elem
45
45
  end
46
46
  end
47
47
 
@@ -156,7 +156,7 @@ module Bake
156
156
 
157
157
  end
158
158
 
159
- def self.substString(str, elem=nil)
159
+ def self.substString(str, elem=nil, attrName=nil)
160
160
  substStr = ""
161
161
  posSubst = 0
162
162
  while (true)
@@ -256,7 +256,7 @@ module Bake
256
256
  configs = @@referencedConfigs[out_proj_name]
257
257
  config = configs.select {|c| c.name == out_conf_name }.first
258
258
  if config
259
- out_dir = nil
259
+ out_dir = nil
260
260
  if (config.toolchain and config.toolchain.outputDir and config.toolchain.outputDir != "")
261
261
  out_dir = config.toolchain.outputDir
262
262
  else
@@ -272,6 +272,10 @@ module Bake
272
272
  end
273
273
 
274
274
  if (out_dir.include?"$(")
275
+ if !elem
276
+ Bake.formatter.printError("Variable OutputDir not used correctly in this config", @@config)
277
+ ExitHelper.exit(1)
278
+ end
275
279
  substStr << str[posStart..posEnd]
276
280
  @@outputDirUnresolved << elem
277
281
  else
@@ -368,7 +372,7 @@ module Bake
368
372
  return if Metamodel::DefaultToolchain === elem
369
373
  return if Metamodel::Toolchain === elem.class
370
374
  next if a.eType.name != "EString"
371
- substStr = substString(elem.getGeneric(a.name), elem)
375
+ substStr = substString(elem.getGeneric(a.name), elem, a.name)
372
376
  elem.setGeneric(a.name, substStr)
373
377
  end
374
378
 
@@ -12,7 +12,7 @@ module Bake
12
12
  def setColorScheme(scheme)
13
13
 
14
14
  if (scheme != :black and scheme != :white and scheme != :none)
15
- Bake.formatter.printError("Error: color scheme must be 'black' or 'white'")
15
+ Bake.formatter.printError("Error: color scheme must be 'black', 'white' or 'none'")
16
16
  ExitHelper.exit(1)
17
17
  end
18
18
  @scheme = scheme
@@ -4,7 +4,8 @@ module Bake
4
4
  class TaskingCompilerErrorParser < ErrorParser
5
5
 
6
6
  def initialize()
7
- @error_expression = /.* (.+): \[\"(.+)\" ([0-9]+)\] (.*)/
7
+ @error_expression = /.* (.+): \[\"(.+)\" ([0-9]+)\/*[0-9]*\] (.*)/
8
+ @error_expression2 = /.* (.+): (.+) “(.*)”/
8
9
  end
9
10
 
10
11
  def scan_lines(consoleOutput, proj_dir)
@@ -19,7 +20,15 @@ module Bake
19
20
  d.line_number = scan_res[0][2].to_i
20
21
  d.message = scan_res[0][3]
21
22
  d.severity = get_tasking_severity(scan_res[0][0])
22
- l.gsub!(scan_res[0][0],d.file_name)
23
+ l.gsub!(scan_res[0][1],d.file_name)
24
+ end
25
+ scan_res = lstripped.scan(@error_expression2)
26
+ if scan_res.length > 0
27
+ d.file_name = File.expand_path(scan_res[0][2], proj_dir)
28
+ d.line_number = 0
29
+ d.message = scan_res[0][1]
30
+ d.severity = get_tasking_severity(scan_res[0][0])
31
+ l.gsub!(scan_res[0][2],d.file_name)
23
32
  end
24
33
  res << d
25
34
  consoleOutputFullnames << l
@@ -35,7 +35,7 @@ module Bake
35
35
  puts " [-b] <name> Name of the collection to build."
36
36
  puts " -m <dir> Directory containing the collection file (default is current directory)."
37
37
  puts " -r Stop on first error."
38
- puts " -a <scheme> Use ansi color sequences (console must support it). Possible values are 'white' and 'black'."
38
+ puts " -a <scheme> Use ansi color sequences (console must support it). Possible values are 'white', 'black' and 'none' (default)."
39
39
  puts " -h, --help Print this help."
40
40
  puts " -w <root>[,<depth>] Add a workspace root (can be used multiple times). Additionally the search depth can be specified (>=0)."
41
41
  puts " If no root is specified, the parent directory of Collection.meta is added automatically."
@@ -26,15 +26,16 @@ module Bake
26
26
  end
27
27
  end
28
28
 
29
- def self.prepareOutput(filename)
29
+ def self.prepareOutput(filename, block = nil)
30
30
  return if Bake.options.dry
31
31
  filename = File.expand_path(filename, @projectDir)
32
32
  begin
33
33
  if File.exists?(filename)
34
34
  FileUtils.rm(filename)
35
35
  else
36
- FileUtils.mkdir_p(File.dirname(filename))
36
+ FileUtils::mkdir_p(File.dirname(filename))
37
37
  end
38
+ Utils.gitIgnore(File.expand_path(block.output_dir, @projectDir)) if block
38
39
  rescue Exception => e
39
40
  if Bake.options.debug
40
41
  puts e.message
@@ -217,7 +218,7 @@ module Bake
217
218
 
218
219
  cmdFile = orgOut + ".file" + postfix
219
220
  cmdFileLong = File.expand_path(cmdFile, @projectDir)
220
- FileUtils.mkdir_p(File.dirname(cmdFileLong))
221
+ Utils.gitIgnore(File.dirname(cmdFileLong))
221
222
  File.open(cmdFileLong, "w") { |f| f.puts argsFlat }
222
223
  return onlyCmd + ["#{tcs[:FILE_COMMAND]}#{cmdFile}"]
223
224
  end
@@ -419,6 +419,9 @@ module Bake
419
419
  puts "Profiling #{Time.now - $timeStart}: prepareIncludes (#{@projectName+","+@config.name}) stop..." if Bake.options.profiling
420
420
  end
421
421
 
422
+ odir = File.expand_path(@block.output_dir, @projectDir)
423
+ Utils.gitIgnore(odir) if !Bake.options.dry
424
+
422
425
  fileListBlock = Set.new if Bake.options.filelist
423
426
  compileJobs = Multithread::Jobs.new(@source_files) do |jobs|
424
427
  while source = jobs.get_next_or_nil do
@@ -460,8 +463,6 @@ module Bake
460
463
  if Bake.options.filelist && !Bake.options.dry
461
464
  Bake.options.filelist.merge(fileListBlock.merge(fileListBlock))
462
465
 
463
- odir = File.expand_path(@block.output_dir, @projectDir)
464
- FileUtils.mkdir_p(odir)
465
466
  File.open(odir + "/" + "file-list.txt", 'wb') do |f|
466
467
  fileListBlock.sort.each do |entry|
467
468
  f.puts(entry)
@@ -676,7 +677,7 @@ module Bake
676
677
  mergeCounter += 1
677
678
  mdir = File.expand_path(@block.output_dir+"/mergedIncludes#{mergeCounter}", @projectDir)
678
679
  FileUtils.rm_rf(mdir)
679
- FileUtils.mkdir_p(mdir)
680
+ Utils.gitIgnore(mdir)
680
681
  inmerge = true
681
682
  end
682
683
  if !merging
@@ -712,7 +713,7 @@ module Bake
712
713
  sum + si
713
714
  end
714
715
  puts "Profiling #{Time.now - $timeStart}: copy #{sum} byte in #{filesToCopy.length} files..." if Bake.options.profiling
715
- destDirs.each {|d| FileUtils.mkdir_p(d)}
716
+ destDirs.each {|d| Utils.gitIgnore(d) }
716
717
  filesToCopy.each do |t, dest|
717
718
  dest.each do |d|
718
719
  FileUtils.cp_r(t, d, :preserve => true)
@@ -17,7 +17,11 @@ module Bake
17
17
  end
18
18
 
19
19
  def calcLinkerScript
20
- @linker_script = @config.linkerScript.nil? ? nil : @block.convPath(@config.linkerScript)
20
+ if Metamodel::LibraryConfig === @config
21
+ @linker_script = nil
22
+ else
23
+ @linker_script = @config.linkerScript.nil? ? nil : @block.convPath(@config.linkerScript)
24
+ end
21
25
  end
22
26
 
23
27
  def calcArtifactName
@@ -43,6 +47,11 @@ module Bake
43
47
 
44
48
  def calcMapFile
45
49
  @mapfile = nil
50
+ if Metamodel::LibraryConfig === @config
51
+ def @config.mapFile
52
+ Metamodel::MapFile.new
53
+ end
54
+ end
46
55
  if (not Bake.options.docu) and (not @config.mapFile.nil?)
47
56
  if @config.mapFile.name == ""
48
57
  @mapfile = @exe_name.chomp(File.extname(@exe_name)) + ".map"
@@ -171,7 +180,7 @@ module Bake
171
180
  else
172
181
  ToCxx.linkBlock
173
182
 
174
- BlockBase.prepareOutput(@exe_name)
183
+ BlockBase.prepareOutput(@exe_name, @block)
175
184
 
176
185
  printCmd(cmdLinePrint, "Linking #{@projectName} (#{@config.name}): #{@exe_name}", reason, false)
177
186
  BlockBase.writeCmdLineFile(cmd, cmdLineFile)
@@ -121,7 +121,7 @@ module Bake
121
121
 
122
122
  begin
123
123
  success = true
124
- BlockBase.prepareOutput(File.expand_path(@archive_name, @projectDir))
124
+ BlockBase.prepareOutput(File.expand_path(@archive_name, @projectDir), @block)
125
125
  BlockBase.writeCmdLineFile(cmd, cmdLineFile)
126
126
  consoleOutput = ""
127
127
 
@@ -64,6 +64,7 @@ module Bake
64
64
  line = line.split("#")[0].strip.gsub(/[\\]/,'/')
65
65
  if line != ""
66
66
  root = Root.extract_depth(line)
67
+ root.dir = root.dir[0..-2] if root.dir.end_with?("/")
67
68
  if !File.is_absolute?(root.dir)
68
69
  root.dir = File.expand_path(File.dirname(rootsFile) + "/" + root.dir)
69
70
  end
@@ -3,6 +3,14 @@ require 'rbconfig'
3
3
  module Bake
4
4
 
5
5
  module Utils
6
+
7
+ def self.gitIgnore(folder)
8
+ FileUtils::mkdir_p(folder)
9
+ gitignore = folder + "/.gitignore"
10
+ if !File.exist?(gitignore)
11
+ File.write(gitignore, ".\n")
12
+ end
13
+ end
6
14
 
7
15
  def self.flagSplit(str, removeQuotes)
8
16
  return [] if str == ""
@@ -1,7 +1,7 @@
1
1
  module Bake
2
2
  class Version
3
3
  def self.number
4
- "2.54.2"
4
+ "2.54.3"
5
5
  end
6
6
 
7
7
  def self.printBakeVersion(ry = "")
@@ -505,16 +505,14 @@ module Bake
505
505
  block.mainSteps << compile
506
506
  end
507
507
  if not Bake.options.filename and not Bake.options.analyze
508
- if Metamodel::LibraryConfig === config
509
- block.mainSteps << Blocks::Library.new(block, config, @referencedConfigs, compile)
510
- else
508
+ if Metamodel::ExecutableConfig === config || (Bake.options.dev_features.include?("enforce-executable-config") && config == @mainConfig)
511
509
  block.mainSteps << Blocks::Executable.new(block, config, @referencedConfigs, compile) unless block.prebuild
510
+ else
511
+ block.mainSteps << Blocks::Library.new(block, config, @referencedConfigs, compile)
512
512
  end
513
513
  end
514
514
  end
515
515
 
516
-
517
-
518
516
  end
519
517
  end
520
518
  end
@@ -716,7 +714,12 @@ module Bake
716
714
  f.puts " \"module_path\": \"#{mainBlock.projectDir}\","
717
715
  f.puts " \"config_name\": \"#{@mainConfig.name}\","
718
716
  Dir.chdir(mainBlock.projectDir) do
719
- f.puts " \"artifact\": \"#{File.expand_path(mainBlock.mainSteps.last.calcArtifactName)}\","
717
+ if Blocks::Library === mainBlock.mainSteps.last || Blocks::Executable === mainBlock.mainSteps.last
718
+ aName = File.expand_path(mainBlock.mainSteps.last.calcArtifactName)
719
+ else
720
+ aName = ""
721
+ end
722
+ f.puts " \"artifact\": \"#{aName}\","
720
723
  end
721
724
  f.puts " \"compiler_c\": \"#{@defaultToolchain[:COMPILER][:C][:COMMAND]}\","
722
725
  f.puts " \"compiler_cxx\": \"#{@defaultToolchain[:COMPILER][:CPP][:COMMAND]}\","
@@ -789,7 +792,7 @@ module Bake
789
792
  if Bake.options.filelist && !Bake.options.dry
790
793
  mainBlock = Blocks::ALL_BLOCKS[Bake.options.main_project_name+","+Bake.options.build_config]
791
794
  Dir.chdir(mainBlock.projectDir) do
792
- FileUtils.mkdir_p(mainBlock.output_dir)
795
+ Utils.gitIgnore(mainBlock.output_dir)
793
796
  File.open(mainBlock.output_dir + "/" + "global-file-list.txt", 'wb') do |f|
794
797
  Bake.options.filelist.sort.each do |entry|
795
798
  f.puts(entry)
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.54.2
4
+ version: 2.54.3
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-10-16 00:00:00.000000000 Z
11
+ date: 2019-11-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rtext
@@ -267,7 +267,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
267
267
  version: '0'
268
268
  requirements: []
269
269
  rubyforge_project:
270
- rubygems_version: 2.7.7
270
+ rubygems_version: 2.7.6
271
271
  signing_key:
272
272
  specification_version: 4
273
273
  summary: Build tool to compile C/C++ projects fast and easy.