cxxproject 0.5.64 → 0.5.65

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,32 @@
1
+ require 'cxxproject/errorparser/error_parser'
2
+
3
+ module Cxxproject
4
+ class GreenHillsCompilerErrorParser < ErrorParser
5
+
6
+ def initialize()
7
+ # example:
8
+ # "test.c", line 1: warning #123-D: blah blub
9
+ @error_expression = /"([^"]+)", line ([0-9]+)[:0-9]* (catastrophic |fatal )*([A-Za-z\._]+) (.+)/
10
+ end
11
+
12
+ def scan_lines(consoleOutput, proj_dir)
13
+ res = []
14
+ consoleOutputFullnames = ""
15
+ consoleOutput.each_line do |l|
16
+ d = ErrorDesc.new
17
+ scan_res = l.gsub(/\r\n?/, "").scan(@error_expression)
18
+ if scan_res.length > 0
19
+ d.file_name = File.expand_path(scan_res[0][0])
20
+ d.line_number = scan_res[0][1].to_i
21
+ d.message = scan_res[0][4]
22
+ d.severity = get_severity(scan_res[0][3])
23
+ l.gsub!(scan_res[0][0],d.file_name)
24
+ end
25
+ res << d
26
+ consoleOutputFullnames << l
27
+ end
28
+ [res, consoleOutputFullnames]
29
+ end
30
+
31
+ end
32
+ end
@@ -0,0 +1,31 @@
1
+ require 'cxxproject/errorparser/error_parser'
2
+
3
+ module Cxxproject
4
+ class GreenHillsLinkerErrorParser < ErrorParser
5
+
6
+ def initialize()
7
+ # todo: is every line an error?
8
+ end
9
+
10
+ def scan_lines(consoleOutput, proj_dir)
11
+ res = []
12
+ consoleOutput.each_line do |l|
13
+ l.rstrip!
14
+ d = ErrorDesc.new
15
+ d.file_name = proj_dir
16
+ d.line_number = 0
17
+ d.message = l
18
+ if l.length == 0
19
+ d.severity = SEVERITY_OK
20
+ elsif l.include?" Warning:"
21
+ d.severity = SEVERITY_WARNING
22
+ else
23
+ d.severity = SEVERITY_ERROR
24
+ end
25
+ res << d
26
+ end
27
+ [res, consoleOutput]
28
+ end
29
+
30
+ end
31
+ end
@@ -0,0 +1,52 @@
1
+ require 'cxxproject/toolchain/provider'
2
+ require 'cxxproject/utils/utils'
3
+ require 'cxxproject/errorparser/GreenHills_compiler_error_parser'
4
+ require 'cxxproject/errorparser/GreenHills_linker_error_parser'
5
+
6
+ module Cxxproject
7
+ module Toolchain
8
+
9
+ GreenHillsChain = Provider.add("GreenHills")
10
+
11
+ GreenHillsChain[:COMPILER][:C].update({
12
+ :COMMAND => "ccppc",
13
+ :FLAGS => "",
14
+ :DEFINE_FLAG => "-D",
15
+ :OBJECT_FILE_FLAG => "-o ",
16
+ :INCLUDE_PATH_FLAG => "-I",
17
+ :COMPILE_FLAGS => "-c",
18
+ :DEP_FLAGS => "-Xmake-dependency=6 -Xmake-dependency-savefile=", # -MMD ok, -MF missing?
19
+ :DEP_FLAGS_SPACE => false,
20
+ :PREPRO_FLAGS => "-P" # -E (stdout, oder -o ...)? wahrscheinlich aber -P
21
+ })
22
+
23
+ GreenHillsChain[:COMPILER][:CPP] = Utils.deep_copy(GreenHillsChain[:COMPILER][:C])
24
+ GreenHillsChain[:COMPILER][:CPP][:SOURCE_FILE_ENDINGS] = Provider.default[:COMPILER][:CPP][:SOURCE_FILE_ENDINGS]
25
+
26
+ GreenHillsChain[:COMPILER][:ASM] = Utils.deep_copy(GreenHillsChain[:COMPILER][:C])
27
+ GreenHillsChain[:COMPILER][:ASM][:COMMAND] = "asppc" # ??
28
+ GreenHillsChain[:COMPILER][:ASM][:COMPILE_FLAGS] = ""
29
+ GreenHillsChain[:COMPILER][:ASM][:SOURCE_FILE_ENDINGS] = Provider.default[:COMPILER][:ASM][:SOURCE_FILE_ENDINGS]
30
+ GreenHillsChain[:COMPILER][:ASM][:PREPRO_FLAGS] = ""
31
+
32
+ GreenHillsChain[:ARCHIVER][:COMMAND] = "ccppc" # ??
33
+ GreenHillsChain[:ARCHIVER][:ARCHIVE_FLAGS] = "-rc" # -archive ??
34
+
35
+ GreenHillsChain[:LINKER][:COMMAND] = "ccppc" # ??
36
+ GreenHillsChain[:LINKER][:SCRIPT] = "-Wm" # -T file.ld , evtl. -Wl,-T file.ld ???
37
+ GreenHillsChain[:LINKER][:USER_LIB_FLAG] = "-l:" # ?? does that exist ?
38
+ GreenHillsChain[:LINKER][:EXE_FLAG] = "-o"
39
+ GreenHillsChain[:LINKER][:LIB_FLAG] = "-l"
40
+ GreenHillsChain[:LINKER][:LIB_PATH_FLAG] = "-L"
41
+ GreenHillsChain[:LINKER][:MAP_FILE_FLAG] = "-Wl,-m6" # -map=filename / -nomap (default)
42
+ GreenHillsChain[:LINKER][:OUTPUT_ENDING] = ".elf"
43
+
44
+ GreenHillsCompilerErrorParser = GreenHillsCompilerErrorParser.new
45
+ GreenHillsChain[:COMPILER][:C][:ERROR_PARSER] = GreenHillsCompilerErrorParser
46
+ GreenHillsChain[:COMPILER][:CPP][:ERROR_PARSER] = GreenHillsCompilerErrorParser
47
+ GreenHillsChain[:COMPILER][:ASM][:ERROR_PARSER] = GreenHillsCompilerErrorParser
48
+ GreenHillsChain[:ARCHIVER][:ERROR_PARSER] = GreenHillsCompilerErrorParser
49
+ GreenHillsChain[:LINKER][:ERROR_PARSER] = GreenHillsLinkerErrorParser.new
50
+
51
+ end
52
+ end
@@ -129,3 +129,4 @@ require 'cxxproject/toolchain/diab'
129
129
  require 'cxxproject/toolchain/gcc'
130
130
  require 'cxxproject/toolchain/clang'
131
131
  require 'cxxproject/toolchain/ti'
132
+ require 'cxxproject/toolchain/greenhills'
@@ -50,7 +50,7 @@ module Cxxproject
50
50
  def self.safeExecute
51
51
  begin
52
52
  consoleOutput = yield
53
- [$?.success?, consoleOutput, false]
53
+ [($?.to_i >> 8) == 0, consoleOutput, false]
54
54
  rescue Exception => e
55
55
  [false, e.message, true]
56
56
  end
@@ -1,7 +1,7 @@
1
1
  module Cxxproject
2
2
  class Version
3
3
  def self.cxxproject
4
- "0.5.64"
4
+ "0.5.65"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: cxxproject
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.5.64
5
+ version: 0.5.65
6
6
  platform: ruby
7
7
  authors:
8
8
  - oliver mueller
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2013-04-17 00:00:00 Z
13
+ date: 2013-05-28 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: highline
@@ -61,6 +61,8 @@ files:
61
61
  - lib/cxxproject/errorparser/error_parser.rb
62
62
  - lib/cxxproject/errorparser/gcc_compiler_error_parser.rb
63
63
  - lib/cxxproject/errorparser/gcc_linker_error_parser.rb
64
+ - lib/cxxproject/errorparser/greenhills_compiler_error_parser.rb
65
+ - lib/cxxproject/errorparser/greenhills_linker_error_parser.rb
64
66
  - lib/cxxproject/errorparser/ti_compiler_error_parser.rb
65
67
  - lib/cxxproject/errorparser/ti_linker_error_parser.rb
66
68
  - lib/cxxproject/eval_context.rb
@@ -76,6 +78,7 @@ files:
76
78
  - lib/cxxproject/toolchain/colorizing_formatter.rb
77
79
  - lib/cxxproject/toolchain/diab.rb
78
80
  - lib/cxxproject/toolchain/gcc.rb
81
+ - lib/cxxproject/toolchain/greenhills.rb
79
82
  - lib/cxxproject/toolchain/provider.rb
80
83
  - lib/cxxproject/toolchain/ti.rb
81
84
  - lib/cxxproject/toolchain/toolchain.rb