bake-toolkit 2.37.14 → 2.38.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
  SHA1:
3
- metadata.gz: b3aaec6d38662152abd693f17c8b44a47e483c15
4
- data.tar.gz: 44a27f6a3baf79d46599e827d03ce024595f9493
3
+ metadata.gz: 8fe8160f5c00bfbdb0b8f53dd51f34de03c113da
4
+ data.tar.gz: 19b60b81d616cb347710c196b0a35cfd49a843b1
5
5
  SHA512:
6
- metadata.gz: 73685aa42e576c8551e70b965a65059446b76e27f493233a2a55e8c20f48ffd154871a97b39ab00e00b47a60f60ac5bf65609933753cf6af7b2b71cb00f5cfe7
7
- data.tar.gz: c82d5f60e374ad58176d13a860aa3d1e23b0f71ce7835c27b9d7dcf1386537a06cc87717aed186547f8f3e15a3986f80aa24842e37acf1fc188ac1e2bb326a11
6
+ metadata.gz: a85cee46490cb6e671fd30d4b8f0d8eb25a5bede3ddd81b9de2fe7e4aff56f4cfd2538c4d52939d5a2b71ea7b4bc75682971a9c688e8ebd0866fe58a655036d5
7
+ data.tar.gz: eedd45fbd7f9adf294290ff7de81f830377cbeab8d464735f39e6291430321633d14462cb9a7e634eda91738d887d3a60547927312fe2b35cb5c0ae5fe292a61
data/bin/bakeqac CHANGED
@@ -123,7 +123,7 @@ end
123
123
  excludeParam = false
124
124
  wasMinus = false
125
125
  ARGV.each do |x|
126
- if ["--c++11", "--c++14", "--qacnofilter", "--qacnoformat", "--qacrawformat", "--qacunittest", "--qacdoc", "--qaccctpatch"].include?x
126
+ if ["--c++11", "--c++14", "--qacnofilefilter", "--qacnomsgfilter", "--qacnofilter", "--qacnoformat", "--qacrawformat", "--qacunittest", "--qacdoc", "--qaccctpatch"].include?x
127
127
  excludeParam = false
128
128
  next
129
129
  elsif ["--cct", "--rcf", "--acf", "--qacdata", "--qacstep", "--qacretry"].include?x
@@ -235,10 +235,13 @@ $cmdRemoveLocks = qaExe + ["admin", "--qaf-project", @options.qacdata, "--remove
235
235
  end
236
236
  end
237
237
 
238
- if @options.qacfilter
238
+ if success
239
+ ProjectFilter.writeFilter(filter)
240
+ end
241
+
242
+ if @options.qacmsgfilter
239
243
  if success
240
244
  puts filterOutput
241
- ProjectFilter.writeFilter(filter)
242
245
  else
243
246
  puts consoleOutput # error
244
247
  end
@@ -277,11 +280,15 @@ $cmdRemoveLocks = qaExe + ["admin", "--qaf-project", @options.qacdata, "--remove
277
280
  converted_line = (scan_res[0][0].downcase + scan_res[0][1] + scan_res[0][2].gsub(/\\/,"/"))
278
281
  foundFile = ProjectFilter.localFile(converted_line)
279
282
  end
280
- if foundFile && !line.include?("QAC++ Deep Flow Static Analyser")
283
+ if foundFile && (!line.include?("QAC++ Deep Flow Static Analyser") || !@options.qacmsgfilter)
281
284
  filteredLines << line
282
- elsif !success # HACK, see above
283
- filteredLines << line if ["MSG: ", "trc: ", "// ======= Results for"].none? { |pattern| line.include?(pattern) }
285
+ else
286
+ misraLine = ["MSG: ", "trc: ", "// ======= Results for"].none? { |pattern| line.include?(pattern) }
287
+ if !success || (misraLine && !@options.qacmsgfilter) # HACK, see above
288
+ filteredLines << line
289
+ end
284
290
  end
291
+
285
292
  end
286
293
 
287
294
  # 2. sort
@@ -19,7 +19,7 @@ module Bake
19
19
  end
20
20
 
21
21
  def self.localFile(str)
22
- return true if not is_valid?
22
+ return true if (not is_valid?) || (not @@options.qacfilefilter)
23
23
  projects.any? { |fil| str.include?(fil+"/") and not str.include?(fil+"/test/") and not str.include?(fil+"/mock/") and not str.include?(fil+"/.qacdata/") }
24
24
  end
25
25
 
@@ -35,7 +35,7 @@ module Bake
35
35
  def self.calcFilter_internal
36
36
  @@filterList = []
37
37
  filter_filename = "#{@@options.qacdata}/filter.txt"
38
- @@valid = File.exist?(filter_filename) && @@options.qacfilter
38
+ @@valid = File.exist?(filter_filename)
39
39
  if @@valid
40
40
  File.open(filter_filename, "r") do |f|
41
41
  f.each_line { |line| @@filterList << line.strip }
@@ -7,7 +7,7 @@ module Bake
7
7
 
8
8
  class BakeqacOptions < Parser
9
9
  attr_reader :rcf, :acf, :qacstep, :qac_home, :cct_append # String
10
- attr_reader :c11, :c14, :qacfilter, :qacnoformat, :qacunittest, :qacdoc, :cct_patch # Boolean
10
+ attr_reader :c11, :c14, :qacmsgfilter, :qacfilefilter, :qacnoformat, :qacunittest, :qacdoc, :cct_patch # Boolean
11
11
  attr_reader :cct # Array
12
12
  attr_reader :qacretry # int
13
13
  attr_accessor :qacdata # String
@@ -26,7 +26,8 @@ module Bake
26
26
  @default = nil
27
27
  @qacdata = nil
28
28
  @qacstep = nil
29
- @qacfilter = true
29
+ @qacmsgfilter = true
30
+ @qacfilefilter = true
30
31
  @qacnoformat = false
31
32
  @qacunittest = false
32
33
  @qacretry = 0
@@ -45,7 +46,9 @@ module Bake
45
46
  add_option(["--qaccctpatch" ], lambda { @cct_patch = true })
46
47
  add_option(["--qacdata" ], lambda { |x| @qacdata = x.gsub(/\\/,"/") })
47
48
  add_option(["--qacstep" ], lambda { |x| @qacstep = x })
48
- add_option(["--qacnofilter" ], lambda { @qacfilter = false })
49
+ add_option(["--qacnofilter" ], lambda { @qacfilefilter = false; @qacmsgfilter = false }) # backward compatibility
50
+ add_option(["--qacnofilefilter" ], lambda { @qacfilefilter = false })
51
+ add_option(["--qacnomsgfilter" ], lambda { @qacmsgfilter = false })
49
52
  add_option(["--qacretry" ], lambda { |x| @qacretry = x.to_i })
50
53
  add_option(["--qacnoformat", "--qacrawformat"], lambda { @qacnoformat = true })
51
54
  add_option(["--qacunittest" ], lambda { @qacunittest = true })
@@ -67,7 +70,8 @@ module Bake
67
70
  puts " --qaccctpatch If specified, some adaptions to cct are made. Might improve the result - no guarantee."
68
71
  puts " --qacdata <dir> QAC writes data into this folder. Default is <working directory>/.qacdata."
69
72
  puts " --qacstep admin|analyze|view|report|mdr Steps can be ORed. Per default admin|analyze|view will be executed."
70
- puts " --qacnofilter Output will be printed immediately and unfiltered. Per default filters are used to reduce noise."
73
+ puts " --qacnofilefilter Some files will be filtered per default, like /test/."
74
+ puts " --qacnomsgfilter Some messages will be filter per default filters to reduce noise."
71
75
  puts " --qacrawformat Raw QAC output (with incomplete MISRA rules!)."
72
76
  puts " --qacretry <seconds> If build or result step fail due to refused license, the step will be retried until timeout."
73
77
  puts " --qacdoc Print link to HTML help page for every warning if found."
data/lib/bakery/toBake.rb CHANGED
@@ -55,12 +55,6 @@ module Bake
55
55
  end
56
56
  end
57
57
 
58
- toBuildPattern.each do |bp|
59
- if not bp.coll_p.isFound
60
- Bake.formatter.printInfo("No match for project #{bp.coll_p.name} with config #{bp.coll_p.config}", @options.collection_dir+"/Collection.meta", bp.coll_p.line_number)
61
- end
62
- end
63
-
64
58
  col.exclude.each do |p|
65
59
  p.name = "/"+p.name.gsub("*","(\\w*)")+"/Project.meta"
66
60
  p.config = "^"+p.config.gsub("*","(\\w*)")+"$"
@@ -159,8 +159,8 @@ module Bake
159
159
  raise SystemCommandFailed.new
160
160
  end
161
161
 
162
- cmd = Utils.flagSplit(compiler[:PREFIX], false)
163
- cmd += Utils.flagSplit(compiler[:COMMAND], false)
162
+ cmd = Utils.flagSplit(compiler[:PREFIX], true)
163
+ cmd += Utils.flagSplit(compiler[:COMMAND], true)
164
164
  cmd += compiler[:COMPILE_FLAGS].split(" ")
165
165
 
166
166
  if dep_filename
@@ -228,6 +228,11 @@ module Bake
228
228
  end if Bake.options.filelist
229
229
  end
230
230
  check_config_file
231
+ else
232
+ if Bake.options.filename and Bake.options.verbose >= 1
233
+ puts "Up-to-date #{source}"
234
+ SyncOut.flushOutput()
235
+ end
231
236
  end
232
237
 
233
238
 
@@ -286,8 +291,10 @@ module Bake
286
291
  def execute
287
292
  #Dir.chdir(@projectDir) do
288
293
 
289
- calcSources
290
- calcObjects
294
+ SyncOut.mutex.synchronize do
295
+ calcSources
296
+ calcObjects
297
+ end
291
298
 
292
299
  fileListBlock = Set.new if Bake.options.filelist
293
300
  compileJobs = Multithread::Jobs.new(@source_files) do |jobs|
@@ -439,7 +446,7 @@ module Bake
439
446
  @source_files.keep_if do |source|
440
447
  source.include?Bake.options.filename
441
448
  end
442
- if @source_files.length == 0 and cleaning == false and @config.files.length > 0
449
+ if @source_files.length == 0 and cleaning == false and @config.files.length > 0 and Bake.options.verbose >= 2
443
450
  Bake.formatter.printInfo("#{Bake.options.filename} does not match to any source", @config)
444
451
  end
445
452
  end
@@ -116,8 +116,8 @@ module Bake
116
116
 
117
117
  linker = @block.tcs[:LINKER]
118
118
 
119
- cmd = Utils.flagSplit(linker[:PREFIX], false)
120
- cmd += Utils.flagSplit(linker[:COMMAND], false) # g++
119
+ cmd = Utils.flagSplit(linker[:PREFIX], true)
120
+ cmd += Utils.flagSplit(linker[:COMMAND], true) # g++
121
121
  cmd += linker[:MUST_FLAGS].split(" ")
122
122
  cmd += Bake::Utils::flagSplit(linker[:FLAGS],true)
123
123
 
@@ -87,8 +87,8 @@ module Bake
87
87
  end
88
88
  archiver = @block.tcs[:ARCHIVER]
89
89
 
90
- cmd = Utils.flagSplit(archiver[:PREFIX], false)
91
- cmd += Utils.flagSplit(archiver[:COMMAND], false) # ar
90
+ cmd = Utils.flagSplit(archiver[:PREFIX], true)
91
+ cmd += Utils.flagSplit(archiver[:COMMAND], true) # ar
92
92
  cmd += Bake::Utils::flagSplit(archiver[:FLAGS],true) # --all_load
93
93
  cmd += archiver[:ARCHIVE_FLAGS].split(" ")
94
94
 
data/lib/common/root.rb CHANGED
@@ -79,6 +79,10 @@ module Bake
79
79
  end
80
80
 
81
81
  def self.search_to_depth(root, baseName, depth)
82
+ if not File.exist?(root)
83
+ Bake.formatter.printError("Root #{root} does not exist.")
84
+ ExitHelper.exit(1)
85
+ end
82
86
  if depth != nil
83
87
  array = Array.new(depth+1) {|i| root + '/*'*i + '/' + baseName}
84
88
  return Dir.glob(array).sort
data/lib/common/utils.rb CHANGED
@@ -15,12 +15,12 @@ module Bake
15
15
  s = ""
16
16
 
17
17
  str.split("").each do |i|
18
- hasDoubleQuote = !hasDoubleQuote if !hasQuote and i == '"'
19
- hasQuote = !hasQuote if !hasDoubleQuote and i == '\''
20
- hadQuote = true if hasDoubleQuote
18
+ hasDoubleQuote = !hasDoubleQuote if !hasQuote && i == '"'
19
+ hasQuote = !hasQuote if !hasDoubleQuote && i == '\''
20
+ hadQuote = true if hasDoubleQuote || hasQuote
21
21
  if i == ' '
22
- if not hasDoubleQuote and not hasQuote
23
- if hadQuote and removeQuotes
22
+ if !hasDoubleQuote && !hasQuote
23
+ if hadQuote && removeQuotes
24
24
  ar << s[1..-2] if s.length > 2
25
25
  hadQuote = false
26
26
  else
@@ -32,7 +32,11 @@ module Bake
32
32
  end
33
33
  s << i
34
34
  end
35
- ar << s if s.length > 0
35
+ if !hasDoubleQuote && !hasQuote && hadQuote && removeQuotes
36
+ ar << s[1..-2] if s.length > 2
37
+ elsif s.length > 0
38
+ ar << s
39
+ end
36
40
  ar
37
41
  end
38
42
 
@@ -1,7 +1,7 @@
1
1
  module Bake
2
2
  class Version
3
3
  def self.number
4
- "2.37.14"
4
+ "2.38.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.37.14
4
+ version: 2.38.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: 2017-07-18 00:00:00.000000000 Z
11
+ date: 2017-07-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rtext
@@ -80,6 +80,20 @@ dependencies:
80
80
  - - '='
81
81
  - !ruby/object:Gem::Version
82
82
  version: '1.2'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rake
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
83
97
  - !ruby/object:Gem::Dependency
84
98
  name: rspec
85
99
  requirement: !ruby/object:Gem::Requirement