bake-toolkit 2.48.3 → 2.49.0

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: 87b0a6156a9c1c4991df6c1186af0d5a9a079af28b8295f62a0d8491c79b8c48
4
- data.tar.gz: 4aa739dbe2fa50df789ce3c6555096469c23063423d3f01fcdd083712d091bb8
3
+ metadata.gz: 8844fa101183b5ecb09b0044a22a62114fd6c44b0159073b8dc3384aacd59998
4
+ data.tar.gz: 94959e16d1b765730b022c485b85653102d0c61abb33ff51cb4234354bb05555
5
5
  SHA512:
6
- metadata.gz: 8705e0c8fe13182e469f875455473496eb1c588eefa6079a158080942f6c9b1a5b81e83552992e92df5f273f0043b28400cdc7ab2d7a5f7cce7275a4de97a465
7
- data.tar.gz: 82520083ec69c0b837190c04a64996d0f2efd5e0a4b17f5e5bae239137da96c29bed7fb334a6bee1feb01aff31a7437f0d1905fffc48c42b9553921907d69e4a
6
+ metadata.gz: 6f778ac7fbed30cbf74b8899b82143f151975f9dd7a0d17fbf12142c379df6285e3a90420be10ddcfa2a97e1b175f9aef2f505fc9aa1a36a4b75c96859981c23
7
+ data.tar.gz: 452e34af50623a715ac25f417d37f00946a8abb7af1a55552f6c5f6e1cf3ad297e27f83992f3ba0c4279d43379ad602b028d62de6baf2892f94d1d8b938fb663
@@ -11,7 +11,7 @@ module Bake
11
11
  end
12
12
  puts k
13
13
  printHash(v,level+1)
14
- elsif Array === v or String === v
14
+ elsif Array === v or String === v or true == v or false == v or Symbol === v
15
15
  level.times {print " "}
16
16
  print "\n" if (level == 0)
17
17
  puts "#{k} = #{v}"
@@ -22,7 +22,7 @@ module Bake
22
22
  end
23
23
 
24
24
  def get_severity(str)
25
- if str.downcase == "info" || str.downcase == "note"
25
+ if str.downcase == "info" || str.downcase == "note" || str.downcase == "remark"
26
26
  SEVERITY_INFO
27
27
  elsif str.downcase == "warning"
28
28
  SEVERITY_WARNING
@@ -0,0 +1,47 @@
1
+ require_relative 'error_parser'
2
+
3
+ module Bake
4
+ class IARCompilerErrorParser < ErrorParser
5
+
6
+ def initialize()
7
+ @error_expression_start = /\"(.+)\",([0-9]+)\s+(internal |fatal )*([A-Za-z]+)([^:]*):\s*(.*)/
8
+ end
9
+
10
+ def scan_lines(consoleOutput, proj_dir)
11
+ res = []
12
+ error_severity = 255
13
+ consoleOutputFullnames = ""
14
+ lastValidErrorDesc = nil
15
+
16
+ consoleOutput[0].each_line do |l|
17
+ d = ErrorDesc.new
18
+ lstripped = l.rstrip
19
+ scan_res = lstripped.scan(@error_expression_start)
20
+ if scan_res.length == 0
21
+ if lastValidErrorDesc
22
+ lastValidErrorDesc.message += l
23
+ d.severity = lastValidErrorDesc.severity
24
+ else
25
+ d.severity = SEVERITY_OK
26
+ d.message = lstripped
27
+ end
28
+ if lstripped == ""
29
+ lastValidErrorDesc = nil
30
+ end
31
+ else
32
+ d.file_name = File.expand_path(scan_res[0][0], proj_dir)
33
+ d.line_number = scan_res[0][1].to_i
34
+ d.message = scan_res[0][5]
35
+ d.severity = get_severity(scan_res[0][3])
36
+ error_severity = d.severity
37
+ l.gsub!(scan_res[0][0],d.file_name)
38
+ lastValidErrorDesc = d
39
+ end
40
+ res << d
41
+ consoleOutputFullnames << l
42
+ end
43
+ [res, consoleOutputFullnames]
44
+ end
45
+
46
+ end
47
+ end
@@ -0,0 +1,38 @@
1
+ require_relative 'error_parser'
2
+
3
+ module Bake
4
+ class IARLinkerErrorParser < ErrorParser
5
+
6
+ def initialize()
7
+ @error_expression = /([A-Za-z]+)\[\w+\]:\s*(.+)/
8
+ end
9
+
10
+ def scan_lines(consoleOutput, proj_dir)
11
+ res = []
12
+ lastValidErrorDesc = nil
13
+ consoleOutput[0].each_line do |l|
14
+ l.rstrip!
15
+ d = ErrorDesc.new
16
+ scan_res = l.scan(@error_expression)
17
+ if scan_res.length > 0
18
+ d.file_name = proj_dir
19
+ d.line_number = 0
20
+ d.message = scan_res[0][1]
21
+ d.severity = get_severity(scan_res[0][0])
22
+ error_severity = d.severity
23
+ lastValidErrorDesc = d
24
+ else
25
+ if lastValidErrorDesc
26
+ lastValidErrorDesc.message += l.lstrip
27
+ d.severity = lastValidErrorDesc.severity
28
+ else
29
+ d.severity = SEVERITY_ERROR
30
+ end
31
+ end
32
+ res << d
33
+ end
34
+ [res, consoleOutput[0]]
35
+ end
36
+
37
+ end
38
+ end
@@ -0,0 +1,56 @@
1
+ require_relative '../../common/utils'
2
+ require_relative '../toolchain/provider'
3
+ require_relative '../toolchain/errorparser/error_parser'
4
+ require_relative '../toolchain/errorparser/iar_compiler_error_parser'
5
+ require_relative '../toolchain/errorparser/iar_linker_error_parser'
6
+
7
+ module Bake
8
+ module Toolchain
9
+
10
+ IARChain = Provider.add("IAR")
11
+
12
+ IARChain[:COMPILER][:CPP].update({
13
+ :COMMAND => "iccarm",
14
+ :DEFINE_FLAG => "-D",
15
+ :OBJECT_FILE_FLAG => "-o",
16
+ :OBJ_FLAG_SPACE => true,
17
+ :COMPILE_FLAGS => "--c++",
18
+ :DEP_FLAGS => "--dependencies",
19
+ :DEP_FLAGS_SPACE => true,
20
+ :PREPRO_FLAGS => ""
21
+ })
22
+
23
+ IARChain[:COMPILER][:C] = Utils.deep_copy(IARChain[:COMPILER][:CPP])
24
+ IARChain[:COMPILER][:C][:SOURCE_FILE_ENDINGS] = Provider.default[:COMPILER][:C][:SOURCE_FILE_ENDINGS]
25
+ IARChain[:COMPILER][:C][:COMPILE_FLAGS] = ""
26
+
27
+ IARChain[:COMPILER][:ASM] = Utils.deep_copy(IARChain[:COMPILER][:C])
28
+ IARChain[:COMPILER][:ASM][:SOURCE_FILE_ENDINGS] = Provider.default[:COMPILER][:ASM][:SOURCE_FILE_ENDINGS]
29
+ IARChain[:COMPILER][:ASM][:COMMAND] = "iasmarm"
30
+ IARChain[:COMPILER][:ASM][:COMPILE_FLAGS] = ""
31
+ IARChain[:COMPILER][:ASM][:PREFIX] = Provider.default[:COMPILER][:ASM][:PREFIX]
32
+
33
+ IARChain[:COMPILER][:DEP_FILE_SINGLE_LINE] = :plain
34
+
35
+ IARChain[:ARCHIVER][:COMMAND] = "iarchive"
36
+ IARChain[:ARCHIVER][:ARCHIVE_FLAGS] = "--create"
37
+
38
+ IARChain[:LINKER][:COMMAND] = "ilinkarm"
39
+ IARChain[:LINKER][:SCRIPT] = "--config"
40
+ IARChain[:LINKER][:USER_LIB_FLAG] = ""
41
+ IARChain[:LINKER][:EXE_FLAG] = "-o"
42
+ IARChain[:LINKER][:LIB_FLAG] = ""
43
+ IARChain[:LINKER][:LIB_PATH_FLAG] = "-L"
44
+ IARChain[:LINKER][:MAP_FILE_FLAG] = "--map"
45
+ IARChain[:LINKER][:MAP_FILE_PIPE] = false
46
+ IARChain[:LINKER][:LIST_MODE] = true
47
+
48
+ iarCompilerErrorParser = IARCompilerErrorParser.new
49
+ IARChain[:COMPILER][:C][:ERROR_PARSER] = iarCompilerErrorParser
50
+ IARChain[:COMPILER][:CPP][:ERROR_PARSER] = iarCompilerErrorParser
51
+ IARChain[:COMPILER][:ASM][:ERROR_PARSER] = iarCompilerErrorParser
52
+ IARChain[:ARCHIVER][:ERROR_PARSER] = iarCompilerErrorParser
53
+ IARChain[:LINKER][:ERROR_PARSER] = IARLinkerErrorParser.new
54
+
55
+ end
56
+ end
@@ -29,7 +29,7 @@ module Bake
29
29
  KeilChain[:COMPILER][:ASM][:COMPILE_FLAGS] = ""
30
30
  KeilChain[:COMPILER][:ASM][:PREFIX] = Provider.default[:COMPILER][:ASM][:PREFIX]
31
31
 
32
- KeilChain[:COMPILER][:DEP_FILE_SINGLE_LINE] = true
32
+ KeilChain[:COMPILER][:DEP_FILE_SINGLE_LINE] = :single
33
33
 
34
34
  KeilChain[:ARCHIVER][:COMMAND] = "armar"
35
35
  KeilChain[:ARCHIVER][:ARCHIVE_FLAGS] = "--create"
@@ -72,7 +72,8 @@ module Bake
72
72
  :ERROR_PARSER => nil,
73
73
  :PREPRO_FLAGS => "",
74
74
  :PREPRO_FILE_FLAG => nil
75
- }
75
+ },
76
+ :DEP_FILE_SINGLE_LINE => :multi
76
77
  },
77
78
 
78
79
  :ARCHIVER =>
@@ -116,7 +117,6 @@ module Bake
116
117
  :CLEAN => "clean"
117
118
  },
118
119
 
119
- :DEP_FILE_SINGLE_LINE => false,
120
120
  :DOCU => "",
121
121
  :KEEP_FILE_ENDINGS => false
122
122
  }
@@ -158,6 +158,7 @@ require_relative '../toolchain/clang_analyze'
158
158
  require_relative '../toolchain/ti'
159
159
  require_relative '../toolchain/greenhills'
160
160
  require_relative '../toolchain/keil'
161
+ require_relative '../toolchain/iar'
161
162
  require_relative '../toolchain/msvc'
162
163
  require_relative '../toolchain/gcc_env'
163
164
  require_relative '../toolchain/tasking'
@@ -51,6 +51,6 @@ module Bake
51
51
  TaskingChain[:ARCHIVER][:ERROR_PARSER] = taskingCompilerErrorParser
52
52
  TaskingChain[:LINKER][:ERROR_PARSER] = TaskingLinkerErrorParser.new
53
53
 
54
- TaskingChain[:COMPILER][:DEP_FILE_SINGLE_LINE] = true
54
+ TaskingChain[:COMPILER][:DEP_FILE_SINGLE_LINE] = :single
55
55
  end
56
56
  end
@@ -28,7 +28,7 @@ module Bake
28
28
  TiChain[:COMPILER][:ASM][:SOURCE_FILE_ENDINGS] = Provider.default[:COMPILER][:ASM][:SOURCE_FILE_ENDINGS]
29
29
  TiChain[:COMPILER][:ASM][:PREFIX] = Provider.default[:COMPILER][:ASM][:PREFIX]
30
30
 
31
- TiChain[:COMPILER][:DEP_FILE_SINGLE_LINE] = true
31
+ TiChain[:COMPILER][:DEP_FILE_SINGLE_LINE] = :single
32
32
 
33
33
  TiChain[:ARCHIVER][:COMMAND] = "ti_ar"
34
34
  TiChain[:ARCHIVER][:ARCHIVE_FLAGS] = "r"
@@ -336,10 +336,10 @@ module Bake
336
336
 
337
337
  end
338
338
 
339
- def self.read_depfile(dep_filename, projDir, singleLine)
339
+ def self.read_depfile(dep_filename, projDir, lineType)
340
340
  deps = []
341
341
  begin
342
- if singleLine
342
+ if lineType == :single
343
343
  File.readlines(dep_filename).each do |line|
344
344
  splitted = line.split(": ")
345
345
  if splitted.length > 1
@@ -353,11 +353,20 @@ module Bake
353
353
  end
354
354
  end
355
355
  end
356
- else
356
+ elsif lineType == :multi
357
357
  deps_string = File.read(dep_filename)
358
358
  deps_string = deps_string.gsub(/\\\n/,'')
359
359
  dep_splitted = deps_string.split(/([^\\]) /).each_slice(2).map(&:join)[2..-1]
360
360
  deps = dep_splitted.map { |d| d.gsub(/[\\] /,' ').gsub(/[\\]/,'/').strip }.delete_if {|d| d == "" }
361
+ elsif lineType == :plain
362
+ firstLine = true
363
+ File.readlines(dep_filename).each do |line|
364
+ if firstLine
365
+ firstLine = false
366
+ else
367
+ deps << line
368
+ end
369
+ end
361
370
  end
362
371
  rescue Exception => ex1
363
372
  if !Bake.options.dry
@@ -1,7 +1,7 @@
1
1
  module Bake
2
2
  class Version
3
3
  def self.number
4
- "2.48.3"
4
+ "2.49.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.48.3
4
+ version: 2.49.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: 2018-11-28 00:00:00.000000000 Z
11
+ date: 2019-01-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rtext
@@ -183,6 +183,8 @@ files:
183
183
  - lib/bake/toolchain/errorparser/gcc_linker_error_parser.rb
184
184
  - lib/bake/toolchain/errorparser/greenhills_compiler_error_parser.rb
185
185
  - lib/bake/toolchain/errorparser/greenhills_linker_error_parser.rb
186
+ - lib/bake/toolchain/errorparser/iar_compiler_error_parser.rb
187
+ - lib/bake/toolchain/errorparser/iar_linker_error_parser.rb
186
188
  - lib/bake/toolchain/errorparser/keil_compiler_error_parser.rb
187
189
  - lib/bake/toolchain/errorparser/keil_linker_error_parser.rb
188
190
  - lib/bake/toolchain/errorparser/msvc_compiler_error_parser.rb
@@ -195,6 +197,7 @@ files:
195
197
  - lib/bake/toolchain/gcc.rb
196
198
  - lib/bake/toolchain/gcc_env.rb
197
199
  - lib/bake/toolchain/greenhills.rb
200
+ - lib/bake/toolchain/iar.rb
198
201
  - lib/bake/toolchain/keil.rb
199
202
  - lib/bake/toolchain/msvc.rb
200
203
  - lib/bake/toolchain/provider.rb