bake-toolkit 2.68.1 → 2.71.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: aedaaf58ee97493bdcc5a0002b571de20295c8ea013f3a45be44755931da8a2f
4
- data.tar.gz: 66f7876ca45bf0955be3dbaa58bc522f5e5fb848c15bdf527f71d9c159a4f89a
3
+ metadata.gz: 97f124f36bbd221636166d8e01a9854b4c680f235643dab7154d3d6e50df0c4c
4
+ data.tar.gz: 664f60e7f0fec1089b08f55a7662c1d3f5c3e6ad81c7f5332b206e10ca28fc47
5
5
  SHA512:
6
- metadata.gz: 7cc330fc24ae6454869a1dff273461784f10c4d92af7c6b144251be2606595eda7976a04772f62059963dff1ec2db4f8697eaf2e7e4a164c351e85d83e0d5b73
7
- data.tar.gz: ee9003412d36a81cff6606b19783637da7379940b241a77188c48522f569b7afd01d110384827e4956397f698ea6d74654046484214e69e60f42ed4653014045
6
+ metadata.gz: 655d3a58f54e604245af4a38feb61e099ae8ea9af58ec135a181a312cca39ed1cb18461ca4733c8d2754090cf782e0e2ca918b490ddce55f071add4ce09d9824
7
+ data.tar.gz: 14034133ac3b08bcfc0c3b54483bf0f1cc98138a2a04e452d0860ca91fb9914f37115b822a068cdbc42caf8d584ca8c0e96268f82cf601992e6403a4209625fe
data/Rakefile.rb CHANGED
@@ -1,7 +1,3 @@
1
- gem "coveralls", "=0.8.23"
2
- gem "simplecov", "=0.16.1"
3
- gem "rspec", "=3.10.0"
4
-
5
1
  require 'rake'
6
2
 
7
3
  require './rake_helper/spec.rb'
data/bin/bakery CHANGED
@@ -112,7 +112,7 @@ module Bake
112
112
  p = File.dirname(bp.proj)
113
113
  pRel = File.rel_from_to_project(Dir.pwd, p, false)
114
114
  pRel = "." if pRel.empty?
115
- cmd = (["-m", pRel, "-b", bp.conf] + bp.args.split + passedParams)
115
+ cmd = (["-m", pRel, "-b", bp.conf] + bp.args.split + passedParams + bp.args_end.split)
116
116
  cmdWithNum = "bakery #{currentRun} of #{maxRuns}: bake " + cmd.join(" ")
117
117
  puts "\n#{$stars}"
118
118
  Bake.formatter.printInfo(cmdWithNum)
@@ -143,6 +143,9 @@ module Bake
143
143
  if !configHash.has_key?(name)
144
144
  return adaptHash[name].any?{|ah| ah.match("")}
145
145
  end
146
+ if name == "toolchain" && configHash[name] == [""]
147
+ Bake.formatter.printWarning("Trying to adapt '#{config.name}' with 'toolchain == #{c.parent.toolchain}', but toolchain is not defined yet", c)
148
+ end
146
149
  adaptHash[name].any? { |ah| configHash[name].any?{|ch| ah.match(ch)}}
147
150
  }
148
151
 
@@ -56,7 +56,7 @@ module Bake
56
56
  cb = block.library.compileBlock
57
57
  if (block.prebuild and File.exist?adaptedPath) or
58
58
  (!cb.nil? and !(cb.calcSources(true, true) - cb.source_files_ignored_in_lib).empty?)
59
- if Bake.options.consoleOutput_fullnames
59
+ if Bake.options.abs_path_in
60
60
  adaptedPath = File.expand_path(adaptedPath, @projectDir)
61
61
  end
62
62
  @@linker_libs_array << adaptedPath
@@ -70,7 +70,7 @@ module Bake
70
70
  cb.object_files_ignored_in_lib.each do |ldirect|
71
71
  adaptedPath, prefix = adaptPath(ldirect, block, prefix)
72
72
  if (!block.prebuild or File.exist?adaptedPath)
73
- if Bake.options.consoleOutput_fullnames
73
+ if Bake.options.abs_path_in
74
74
  adaptedPath = File.expand_path(adaptedPath, @projectDir)
75
75
  end
76
76
  @@linker_libs_array << adaptedPath
@@ -22,7 +22,7 @@ module Bake
22
22
  attr_reader :vars, :include_filter_args # map
23
23
  attr_reader :verbose
24
24
  attr_reader :filelist # set
25
- attr_reader :consoleOutput_fullnames
25
+ attr_reader :abs_path_in, :abs_path_out
26
26
  attr_reader :roots # Root array
27
27
  attr_reader :diabCaseCheck
28
28
  attr_reader :defines
@@ -50,7 +50,8 @@ module Bake
50
50
  @analyze = false
51
51
  @eclipseOrder = false
52
52
  @showConfigs = false
53
- @consoleOutput_fullnames = false
53
+ @abs_path_in = false
54
+ @abs_path_out = false
54
55
  @prepro = false
55
56
  @stopOnFirstError = false
56
57
  @verbose = 1
@@ -141,7 +142,9 @@ module Bake
141
142
  add_option(["--dot-project-level", ], lambda { @dot = true; @dotShowProjOnly = true })
142
143
  add_option(["--do", "--include_filter" ], lambda { |x| set_filter(x) })
143
144
  add_option(["--omit", "--exclude_filter" ], lambda { |x| @exclude_filter << x })
144
- add_option(["--abs-paths", "--show_abs_paths" ], lambda { @consoleOutput_fullnames = true })
145
+ add_option(["--abs-paths", "--show_abs_paths" ], lambda { @abs_path_in = @abs_path_out = true })
146
+ add_option(["--abs-paths-in", "--show_abs_paths" ], lambda { @abs_path_in = true })
147
+ add_option(["--abs-paths-out", "--show_abs_paths" ], lambda { @abs_path_out = true })
145
148
  add_option(["--prebuild" ], lambda { @prebuild = true })
146
149
  add_option(["--Wparse" ], lambda { @wparse = true })
147
150
 
@@ -48,7 +48,10 @@ module Bake
48
48
  puts " 'PRE', 'POST', 'STARTUP', 'EXIT' or 'CLEAN' includes all according steps."
49
49
  puts " --omit <name> Excludes elements with this filter name (can be used multiple times)."
50
50
  puts " 'PRE', 'POST', 'STARTUP', 'EXIT' or 'CLEAN' excludes all according steps."
51
- puts " --abs-paths Compiler prints absolute filename paths instead of relative paths."
51
+ puts " --abs-paths Relative filename paths are converted to absolute paths for compiler commands and output."
52
+ puts " --abs-paths-in Relative filename paths are converted to absolute paths for compiler commands."
53
+ puts " Depending on the compiler this might have also effects on the raw output of the compiler."
54
+ puts " --abs-paths-out Relative filename paths are converted to absolute paths for compiler output."
52
55
  puts " --Wparse The error parser result is also taken into account, not only the return value of compiler, archiver and linker."
53
56
  puts " --no-autodir Disable auto completion of paths like in IncludeDir"
54
57
  puts " --set <key>=<value> Sets a variable. Overwrites variables defined in Project.metas (can be used multiple times)."
@@ -1,11 +1,12 @@
1
1
  module Bake
2
2
 
3
3
  class BuildPattern
4
- attr_reader :proj, :conf, :args, :coll_p
5
- def initialize(proj, conf, args, coll_p)
4
+ attr_reader :proj, :conf, :args, :args_end, :coll_p
5
+ def initialize(proj, conf, args, args_end, coll_p)
6
6
  @proj = proj
7
7
  @conf = conf
8
8
  @args = args
9
+ @args_end = args_end
9
10
  @coll_p = coll_p
10
11
  end
11
12
  def getId
@@ -20,6 +20,7 @@ module Bake
20
20
  has_attr 'name', String, :defaultValueLiteral => ""
21
21
  has_attr 'config', String, :defaultValueLiteral => ""
22
22
  has_attr 'args', String, :defaultValueLiteral => ""
23
+ has_attr 'args_end', String, :defaultValueLiteral => ""
23
24
  end
24
25
  class Exclude < ModelElement
25
26
  has_attr 'name', String, :defaultValueLiteral => ""
data/lib/bakery/toBake.rb CHANGED
@@ -30,7 +30,7 @@ module Bake
30
30
  toBuildPattern = []
31
31
  @options.roots.each do |root|
32
32
  col.project.each do |p|
33
- projs = Root.search_to_depth(root.dir,p.name + "/Project.meta", root.depth)
33
+ projs = Root.search_to_depth(root.dir,p.name + "/Project.meta", root.depth).map { |p| Pathname.new(p).cleanpath.to_s }
34
34
  if File.basename(root.dir) == p.name && File.exist?(root.dir + "/Project.meta")
35
35
  projs << root.dir + "/Project.meta"
36
36
  end
@@ -38,7 +38,7 @@ module Bake
38
38
  Bake.formatter.printWarning("pattern does not match any project: #{p.name}", p)
39
39
  end
40
40
  projs.each do |f|
41
- toBuildPattern << BuildPattern.new(f, "^"+p.config.gsub("*","(\\w*)")+"$", p.args, p)
41
+ toBuildPattern << BuildPattern.new(f, "^"+p.config.gsub("*","(\\w*)")+"$", p.args, p.args_end, p)
42
42
  end
43
43
  end
44
44
  end
@@ -51,7 +51,7 @@ module Bake
51
51
  res = c.gsub(/#.*/,"").match("\\s*(Library|Executable|Custom){1}Config\\s*\"?([\\w:-]*)\"?")
52
52
  if res
53
53
  if res[2].match(bp.conf) != nil
54
- toBuild << BuildPattern.new(bp.proj, res[2], bp.args, nil)
54
+ toBuild << BuildPattern.new(bp.proj, res[2], bp.args, bp.args_end, nil)
55
55
  bp.coll_p.found
56
56
  end
57
57
  end
data/lib/blocks/block.rb CHANGED
@@ -601,7 +601,7 @@ module Bake
601
601
  if @tcs[:OUTPUT_DIR_POSTFIX] != nil
602
602
  @output_dir = @output_dir + @tcs[:OUTPUT_DIR_POSTFIX]
603
603
  end
604
- if Bake.options.consoleOutput_fullnames
604
+ if Bake.options.abs_path_in
605
605
  @output_dir = File.expand_path(@output_dir, @projectDir)
606
606
  end
607
607
  end
@@ -136,7 +136,7 @@ module Bake
136
136
  end
137
137
 
138
138
  console_output = x[0]
139
- console_output = console_output_full if Bake.options.consoleOutput_fullnames
139
+ console_output = console_output_full if Bake.options.abs_path_out
140
140
 
141
141
  ret = error_descs.any? { |e| e.severity == ErrorParser::SEVERITY_ERROR }
142
142
 
@@ -254,7 +254,7 @@ module Bake
254
254
  if Bake.options.cc2j_filename
255
255
  cmdJson = cmd.is_a?(Array) ? cmd.join(' ') : cmd
256
256
  srcFilePath = source
257
- if Bake.options.consoleOutput_fullnames
257
+ if Bake.options.abs_path_in
258
258
  srcFilePath = File.join(@projectDir, srcFilePath) if !File.is_absolute?(srcFilePath)
259
259
  cmdJson[source] = srcFilePath
260
260
  end
@@ -529,7 +529,7 @@ module Bake
529
529
  if not type.nil?
530
530
  object = get_object_file(source)
531
531
 
532
- if Bake.options.consoleOutput_fullnames
532
+ if Bake.options.abs_path_in
533
533
  object = File.expand_path(object, @projectDir)
534
534
  source = File.expand_path(source, @projectDir)
535
535
  end
@@ -586,8 +586,9 @@ module Bake
586
586
  end
587
587
  res.each do |f|
588
588
  singleFile = res.length == 1 && res[0] == pr
589
- if ((!@fileTcs.has_key?(f)) || singleFile)
590
- @fileTcs[f] = icf
589
+ fTcs = (Bake.options.abs_path_in ? File.expand_path(f, @projectDir) : f)
590
+ if ((!@fileTcs.has_key?(fTcs)) || singleFile)
591
+ @fileTcs[fTcs] = icf
591
592
  end
592
593
  if source_files.include?(f) || exclude_files.include?(f)
593
594
  if (singleFile)
@@ -641,7 +642,7 @@ module Bake
641
642
  block.bes.each do |be|
642
643
  if Metamodel::IncludeDir === be
643
644
  if be.inherit == true || block == @block
644
- if Bake.options.consoleOutput_fullnames
645
+ if Bake.options.abs_path_in
645
646
  mappedInc = be.name
646
647
  else
647
648
  mappedInc = File.rel_from_to_project(@projectDir,be.name,false)
@@ -781,11 +782,6 @@ module Bake
781
782
  end
782
783
  end
783
784
 
784
- def tcs4source(source)
785
- @fileTcs[source] || @block.tcs
786
- end
787
-
788
-
789
785
  end
790
786
 
791
787
  end
@@ -43,7 +43,7 @@ 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
46
+ if Bake.options.abs_path_in
47
47
  @exe_name = File.expand_path(@exe_name, @projectDir)
48
48
  end
49
49
  return @exe_name
@@ -11,6 +11,13 @@ module Bake
11
11
  @type = type
12
12
  @projectDir = projectDir
13
13
  @echo = (config.echo != "off")
14
+ if !@arg1 || @arg1.empty?
15
+ Bake.formatter.printError("Error: source of file-step must not be empty")
16
+ ExitHelper.exit(1)
17
+ elsif [:copy, :move].include?(@type) && (!@arg2 || @arg2.empty?)
18
+ Bake.formatter.printError("Error: target of file-step must not be empty")
19
+ ExitHelper.exit(1)
20
+ end
14
21
  end
15
22
 
16
23
  def run
@@ -20,13 +27,13 @@ module Bake
20
27
  FileUtils.touch(@arg1)
21
28
  elsif @type == :move
22
29
  puts "Moving #{@arg1} to #{@arg2}" if @echo
23
- FileUtils.mv(@arg1, @arg2)
30
+ Dir.glob(@arg1).each {|f| FileUtils.mv(f, @arg2)}
24
31
  elsif @type == :copy
25
32
  puts "Copying #{@arg1} to #{@arg2}" if @echo
26
- FileUtils.cp_r(@arg1, @arg2)
33
+ Dir.glob(@arg1).each {|f| FileUtils.cp_r(f, @arg2)}
27
34
  elsif @type == :remove
28
35
  puts "Removing #{@arg1}" if @echo
29
- FileUtils.rm_rf(@arg1)
36
+ Dir.glob(@arg1).each {|f| FileUtils.rm_rf(f)}
30
37
  elsif @type == :makedir
31
38
  puts "Making #{@arg1}" if @echo
32
39
  FileUtils.mkdir_p(@arg1)
@@ -34,7 +34,7 @@ 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
37
+ if Bake.options.abs_path_in
38
38
  @archive_name = File.expand_path(@archive_name, @projectDir)
39
39
  end
40
40
  return @archive_name
@@ -22,7 +22,7 @@ module Bake
22
22
  print projName
23
23
  incs = []
24
24
  blocks.each do |block|
25
- if Bake.options.consoleOutput_fullnames
25
+ if Bake.options.abs_path_in
26
26
  incs += block.include_list.map { |i| File.expand_path(i, block.projectDir) }
27
27
  else
28
28
  incs += block.include_list
@@ -103,7 +103,7 @@ module Bake
103
103
  block.calcIncludes
104
104
  block.calcDefines
105
105
  block.calcFlags
106
- if Bake.options.consoleOutput_fullnames
106
+ if Bake.options.abs_path_in
107
107
  blockIncs += block.include_list.map { |i| File.expand_path(i, block.projectDir) }
108
108
  else
109
109
  blockIncs += block.include_list
data/lib/common/root.rb CHANGED
@@ -80,6 +80,7 @@ module Bake
80
80
  end
81
81
 
82
82
  def self.search_to_depth(root, baseName, depth)
83
+ return Dir.glob(baseName) if File.is_absolute?(baseName)
83
84
  if not File.exist?(root)
84
85
  Bake.formatter.printError("Root #{root} does not exist.")
85
86
  ExitHelper.exit(1)
@@ -1,7 +1,7 @@
1
1
  module Bake
2
2
  class Version
3
3
  def self.number
4
- "2.68.1"
4
+ "2.71.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.68.1
4
+ version: 2.71.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Schaal
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-08 00:00:00.000000000 Z
11
+ date: 2021-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rtext
@@ -128,28 +128,28 @@ dependencies:
128
128
  requirements:
129
129
  - - '='
130
130
  - !ruby/object:Gem::Version
131
- version: 0.16.1
131
+ version: 0.21.2
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - '='
137
137
  - !ruby/object:Gem::Version
138
- version: 0.16.1
138
+ version: 0.21.2
139
139
  - !ruby/object:Gem::Dependency
140
- name: coveralls
140
+ name: simplecov-lcov
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
143
  - - '='
144
144
  - !ruby/object:Gem::Version
145
- version: 0.8.23
145
+ version: 0.8.0
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - '='
151
151
  - !ruby/object:Gem::Version
152
- version: 0.8.23
152
+ version: 0.8.0
153
153
  description: See documentation for more details
154
154
  email: alexander.schaal@esrlabs.com
155
155
  executables:
@@ -269,7 +269,7 @@ homepage: https://github.com/esrlabs/bake
269
269
  licenses:
270
270
  - MIT
271
271
  metadata: {}
272
- post_install_message:
272
+ post_install_message:
273
273
  rdoc_options:
274
274
  - "-x"
275
275
  - doc
@@ -286,8 +286,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
286
286
  - !ruby/object:Gem::Version
287
287
  version: '0'
288
288
  requirements: []
289
- rubygems_version: 3.1.4
290
- signing_key:
289
+ rubygems_version: 3.2.22
290
+ signing_key:
291
291
  specification_version: 4
292
292
  summary: Build tool to compile C/C++ projects fast and easy.
293
293
  test_files: []