gcc-to-clang-analyzer 0.0.8 → 0.0.9

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: c1f39f8ee53e037f850b152e1e248b270d10e40c
4
- data.tar.gz: 3a4dd8986ec3994261e2afe434b838bc9e772f67
3
+ metadata.gz: ea614ca2df802ab09462b14c9c49717e4226827f
4
+ data.tar.gz: e81b354ba5cae077c704fd82cf4ebab2017799b7
5
5
  SHA512:
6
- metadata.gz: f647028ce5da4e45e7aa49669fb5be0a29d5760aafb56df773479d9a4e18d930c398967a757ce4d2a0fc3e93d461b7485376be3cdb047e1a8cfeb5a7078bd9c2
7
- data.tar.gz: c91ba13b3661efd82a68d5188606d9c0cd56a46d8a83ce3f984cc127f9c21f59951a623e6bf12fb2fe66aa5189e0ac2b0087f423a98ad739dc86703a2f612226
6
+ metadata.gz: 783a5fed71820a8f0a8c47c0c97d0dd7cc6c2162b7841111578ca615754ed56c9f4cdf8ca484b9d164cf4229eda29a458d8ea31bba997aa7e33a2572f6a43aaa
7
+ data.tar.gz: 5591cc996ec00cabf42623405ae293519f79cc5c4f2d6fd22917a06d9dff416dd80ebd4fb235331bcfcbf70b7e463f2748d07f5173c73ed63c9b04dffcdfab84
data/bin/g++ CHANGED
@@ -1,20 +1,22 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
+ require 'logger'
4
+
5
+ LOG = Logger.new(STDOUT)
6
+ LOG.level = Logger::DEBUG
7
+ LOG.debug("original #{ARGV.join(' ')}")
8
+
3
9
  require 'gcc_to_clang_analyzer/prepare_compiler_commandline'
4
10
  require 'gcc_to_clang_analyzer/rewrite_plist_file'
5
- require 'logger'
6
- logger = Logger.new(STDOUT)
7
- logger.level = Logger::WARN
8
- logger.debug("original #{ARGV.join(' ')}")
9
11
 
10
12
  command_line, output = PrepareCompilerCommandline.transform(ARGV)
11
13
 
12
14
  cl = command_line.join(' ')
13
- logger.info("executing '#{cl}'")
15
+ LOG.info("executing '#{cl}'")
14
16
 
15
17
  res = system(cl)
16
18
  unless res
17
- logger.warn("problems while executing #{cl}")
19
+ LOG.warn("problems while executing #{cl}")
18
20
  exit res
19
21
  end
20
22
 
@@ -23,7 +25,8 @@ if output.length > 0
23
25
  prefix = File.absolute_path('.').gsub(workspace_path+'/', '')
24
26
  tmp_output = output + ".tmp"
25
27
  File.open(tmp_output, 'w') do |io|
26
- io << RewritePlistFile.with_prefix(prefix, output)
28
+ output_data = File.read(output)
29
+ io << RewritePlistFile.with_prefix(prefix, output_data, LOG)
27
30
  end
28
31
  File.delete(output)
29
32
  File.rename(tmp_output, output)
@@ -25,12 +25,20 @@ class RewritePlistFile
25
25
  # end
26
26
  # return original
27
27
  # end
28
- def self.with_prefix(prefix, original)
28
+ class NullLogger
29
+ def debug(s)
30
+ end
31
+ end
32
+ def self.with_prefix(prefix, original, log=NullLogger.new)
29
33
  doc = Nokogiri::XML(original)
34
+ log.debug("ORIGINAL") if log
35
+ log.debug(doc.to_xml) if log
30
36
  array_element = doc.xpath("//key[text()='files']/following-sibling::array/string")
31
37
  array_element.each do |e|
32
38
  e.content = File.join(prefix, e.content)
33
39
  end
40
+ log.debug("TRANSFORMED") if log
41
+ log.debug(doc.to_xml) if log
34
42
  return doc.to_xml()
35
43
  end
36
44
  end
@@ -1,3 +1,3 @@
1
1
  module GccToClangAnalyzer
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gcc-to-clang-analyzer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christian Köstlin