bake-toolkit 1.8.0.1 → 2.0.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. checksums.yaml +4 -4
  2. data/bin/bake +14 -53
  3. data/bin/bakery +50 -43
  4. data/bin/createVSProjects +3 -3
  5. data/doc/cmd/install.html +1 -5
  6. data/doc/cmd/usecmd.html +29 -5
  7. data/doc/dyk/lint.html +21 -4
  8. data/doc/dyk/tipps.html +0 -6
  9. data/doc/eclipse/import.html +3 -1
  10. data/doc/eclipse/import/Import.png +0 -0
  11. data/doc/eclipse/use.html +8 -5
  12. data/doc/further/change.html +134 -1
  13. data/doc/further/issues.html +1 -0
  14. data/doc/further/wish.html +24 -21
  15. data/doc/index.html +1 -1
  16. data/doc/syntax/subst.html +8 -1
  17. data/doc/syntax/syntax.html +42 -14
  18. data/lib/bake/cache.rb +51 -59
  19. data/lib/bake/config/loader.rb +289 -0
  20. data/lib/bake/libElement.rb +134 -0
  21. data/lib/bake/mergeConfig.rb +1 -1
  22. data/lib/bake/model/language.rb +1 -1
  23. data/lib/bake/model/loader.rb +88 -0
  24. data/lib/bake/model/metamodel.rb +24 -16
  25. data/lib/bake/model/metamodel_ext.rb +9 -4
  26. data/lib/bake/options/options.rb +222 -0
  27. data/lib/bake/options/showConfigNames.rb +44 -0
  28. data/lib/bake/options/showDoc.rb +19 -0
  29. data/lib/bake/options/showLicense.rb +9 -0
  30. data/lib/bake/options/showToolchains.rb +39 -0
  31. data/lib/bake/options/usage.rb +54 -0
  32. data/lib/bake/process_output.rb +10 -0
  33. data/lib/bake/subst.rb +105 -40
  34. data/lib/bake/toolchain/clang.rb +44 -0
  35. data/lib/bake/toolchain/colorizing_formatter.rb +125 -0
  36. data/lib/bake/toolchain/diab.rb +53 -0
  37. data/lib/bake/toolchain/errorparser/diab_compiler_error_parser.rb +40 -0
  38. data/lib/bake/toolchain/errorparser/diab_linker_error_parser.rb +41 -0
  39. data/lib/bake/toolchain/errorparser/error_parser.rb +71 -0
  40. data/lib/bake/toolchain/errorparser/gcc_compiler_error_parser.rb +35 -0
  41. data/lib/bake/toolchain/errorparser/gcc_linker_error_parser.rb +35 -0
  42. data/lib/bake/toolchain/errorparser/greenhills_compiler_error_parser.rb +32 -0
  43. data/lib/bake/toolchain/errorparser/greenhills_linker_error_parser.rb +44 -0
  44. data/lib/bake/toolchain/errorparser/keil_compiler_error_parser.rb +40 -0
  45. data/lib/bake/toolchain/errorparser/keil_linker_error_parser.rb +30 -0
  46. data/lib/bake/toolchain/errorparser/lint_error_parser.rb +34 -0
  47. data/lib/bake/toolchain/errorparser/process_output.rb +3 -0
  48. data/lib/bake/toolchain/errorparser/ti_compiler_error_parser.rb +30 -0
  49. data/lib/bake/toolchain/errorparser/ti_linker_error_parser.rb +30 -0
  50. data/lib/bake/toolchain/gcc.rb +49 -0
  51. data/lib/bake/toolchain/gcc_param.rb +7 -0
  52. data/lib/bake/toolchain/greenhills.rb +52 -0
  53. data/lib/bake/toolchain/keil.rb +55 -0
  54. data/lib/bake/toolchain/lint.rb +20 -0
  55. data/lib/bake/toolchain/provider.rb +136 -0
  56. data/lib/bake/toolchain/ti.rb +47 -0
  57. data/lib/bake/util.rb +27 -15
  58. data/lib/bakery/buildPattern.rb +1 -1
  59. data/lib/bakery/model/language.rb +1 -1
  60. data/lib/bakery/model/loader.rb +56 -0
  61. data/lib/bakery/model/metamodel.rb +1 -1
  62. data/lib/bakery/options/options.rb +87 -0
  63. data/lib/bakery/toBake.rb +10 -6
  64. data/lib/blocks/block.rb +225 -0
  65. data/lib/blocks/blockBase.rb +155 -0
  66. data/lib/blocks/commandLine.rb +25 -0
  67. data/lib/blocks/compile.rb +382 -0
  68. data/lib/blocks/docu.rb +28 -0
  69. data/lib/blocks/executable.rb +143 -0
  70. data/lib/blocks/has_execute_command.rb +31 -0
  71. data/lib/blocks/library.rb +78 -0
  72. data/lib/blocks/lint.rb +53 -0
  73. data/lib/blocks/makefile.rb +87 -0
  74. data/lib/blocks/showIncludes.rb +114 -0
  75. data/lib/common/abortException.rb +4 -0
  76. data/lib/common/cleanup.rb +9 -0
  77. data/lib/common/exit_helper.rb +28 -0
  78. data/lib/common/ext/file.rb +88 -0
  79. data/lib/common/ext/stdout.rb +45 -0
  80. data/lib/common/ide_interface.rb +194 -0
  81. data/lib/common/options/option.rb +13 -0
  82. data/lib/common/options/parser.rb +59 -0
  83. data/lib/common/process.rb +64 -0
  84. data/lib/common/utils.rb +52 -0
  85. data/lib/{bake → common}/version.rb +3 -10
  86. data/lib/multithread/job.rb +44 -0
  87. data/lib/tocxx.rb +201 -932
  88. data/lib/vs/options.rb +3 -2
  89. data/license.txt +47 -22
  90. metadata +90 -30
  91. data/bin/bake-doc +0 -12
  92. data/lib/alias/loader.rb +0 -56
  93. data/lib/alias/model/language.rb +0 -22
  94. data/lib/alias/model/metamodel.rb +0 -29
  95. data/lib/bake/loader.rb +0 -92
  96. data/lib/bake/options.rb +0 -421
  97. data/lib/bakery/loader.rb +0 -57
  98. data/lib/bakery/options.rb +0 -105
  99. data/lib/option/parser.rb +0 -73
@@ -1,105 +0,0 @@
1
- require 'cxxproject/utils/printer'
2
- require "cxxproject/toolchain/colorizing_formatter"
3
- require "option/parser"
4
-
5
- module Cxxproject
6
-
7
- class BakeryOptions < Parser
8
- attr_reader :collection_name, :collection_dir # String
9
- attr_reader :roots # String List
10
- attr_reader :color, :error # Boolean
11
- attr_reader :socket # Fixnum
12
-
13
- def initialize(argv)
14
- super(argv)
15
-
16
- @collection_name = ""
17
- @collection_dir = nil
18
- @color = nil
19
- @error = false
20
- @roots = []
21
- @socket = 0
22
- @def_root = []
23
-
24
- add_option(Option.new("-b",true) { |x| set_collection_name(x) })
25
- add_option(Option.new("-m",true) { |x| set_collection_dir(x) })
26
- add_option(Option.new("-r",false) { set_error })
27
- add_option(Option.new("-a",true) { |x| set_color(x) })
28
- add_option(Option.new("-w",true) { |x| set_root(x) })
29
- add_option(Option.new("--socket",true) { |x| set_socket(x) })
30
- add_option(Option.new("-h",false) { usage; ExitHelper.exit(0) })
31
- end
32
-
33
- def usage
34
- puts "\nUsage: bake <name> [options]"
35
- puts " -b <name> Name of the collection to build."
36
- puts " -m <dir> Directory containing the collection file (default is current directory)."
37
- puts " -r Stop on first error."
38
- puts " -a <scheme> Use ansi color sequences (console must support it). Possible values are 'white' and 'black'."
39
- puts " -h Print this help."
40
- puts " -w <root> Add a workspace root (can be used multiple times)."
41
- puts " If no root is specified, the parent directory of Collection.meta is added automatically."
42
- puts " --socket <num> Set socket for sending errors, receiving commands, etc. - used by e.g. Eclipse."
43
- puts "Note: all parameters except -b, -p and -h will be passed to bake - see bake help for more options."
44
- end
45
-
46
- def parse_options()
47
- parse_internal(true)
48
- set_collection_dir(Dir.pwd) if @collection_dir.nil?
49
- if @roots.length == 0
50
- @roots = @def_root
51
- @roots << @collection_dir unless @def_root.include?@collection_dir
52
- end
53
- end
54
-
55
- def check_valid_dir(dir)
56
- if not File.exists?(dir)
57
- Printer.printError "Error: Directory #{dir} does not exist"
58
- ExitHelper.exit(1)
59
- end
60
- if not File.directory?(dir)
61
- Printer.printError "Error: #{dir} is not a directory"
62
- ExitHelper.exit(1)
63
- end
64
- end
65
-
66
- def set_collection_name(collection_name)
67
- if not @collection_name.empty?
68
- Printer.printError "Error: Cannot set collection name '#{collection_name}', because collection name is already set to '#{@collection_name}'"
69
- ExitHelper.exit(1)
70
- end
71
- @collection_name = collection_name
72
- end
73
-
74
- def set_collection_dir(dir)
75
- check_valid_dir(dir)
76
- @collection_dir = File.expand_path(dir.gsub(/[\\]/,'/'))
77
- @def_roots = calc_def_roots(@collection_dir)
78
- end
79
-
80
- def set_color(x)
81
- if (x != "black" and x != "white")
82
- Printer.printError "Error: color scheme must be 'black' or 'white'"
83
- ExitHelper.exit(1)
84
- end
85
- @color = x
86
- ColorizingFormatter.enabled = true
87
- ColorizingFormatter::setColorScheme(x.to_sym)
88
- end
89
- def set_error()
90
- @error = true
91
- end
92
-
93
- def set_root(dir)
94
- check_valid_dir(dir)
95
- r = File.expand_path(dir.gsub(/[\\]/,'/'))
96
- @roots << r if not @roots.include?r
97
- end
98
-
99
- def set_socket(num)
100
- @socket = String === num ? num.to_i : num
101
- end
102
-
103
- end
104
-
105
- end
data/lib/option/parser.rb DELETED
@@ -1,73 +0,0 @@
1
- require 'cxxproject/utils/printer'
2
- require 'cxxproject/utils/exit_helper'
3
-
4
- module Cxxproject
5
-
6
-
7
- class Option
8
- attr_reader :param, :arg, :block
9
- def initialize(param, arg, &f)
10
- @param = param
11
- @arg = arg # true / false
12
- @block = f
13
- f
14
-
15
- end
16
- end
17
-
18
-
19
- class Parser
20
-
21
- def initialize(argv)
22
- @options = {}
23
- @argv = argv
24
- @default = nil
25
- end
26
-
27
- def add_option(opt)
28
- @options[opt.param] = opt
29
- end
30
-
31
- def add_default(opt)
32
- @default = opt
33
- end
34
-
35
- def parse_internal(ignoreInvalid = true)
36
- pos = 0
37
- begin
38
- while pos < @argv.length do
39
- if not @options.include?@argv[pos]
40
- if @default
41
- res = @default.call(@argv[pos])
42
- if (not res and not ignoreInvalid)
43
- raise "Option #{@argv[pos]} unknown"
44
- end
45
- end
46
- else
47
- option = @options[@argv[pos]]
48
- if option.arg
49
- if pos+1 < @argv.length and @argv[pos+1][0] != "-"
50
- option.block.call(@argv[pos+1])
51
- pos = pos + 1
52
- else
53
- raise "Argument for option #{@argv[pos]} missing"
54
- end
55
- else
56
- option.block.call()
57
- end
58
- end
59
- pos = pos + 1
60
- end
61
- rescue SystemExit => e
62
- raise
63
- rescue Exception => e
64
- Printer.printError e.message unless e.message.include?("Cxxproject::ExitHelperException")
65
- ExitHelper.exit(1)
66
- end
67
-
68
- end
69
-
70
- end
71
-
72
-
73
- end