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.
- checksums.yaml +4 -4
- data/bin/bake +14 -53
- data/bin/bakery +50 -43
- data/bin/createVSProjects +3 -3
- data/doc/cmd/install.html +1 -5
- data/doc/cmd/usecmd.html +29 -5
- data/doc/dyk/lint.html +21 -4
- data/doc/dyk/tipps.html +0 -6
- data/doc/eclipse/import.html +3 -1
- data/doc/eclipse/import/Import.png +0 -0
- data/doc/eclipse/use.html +8 -5
- data/doc/further/change.html +134 -1
- data/doc/further/issues.html +1 -0
- data/doc/further/wish.html +24 -21
- data/doc/index.html +1 -1
- data/doc/syntax/subst.html +8 -1
- data/doc/syntax/syntax.html +42 -14
- data/lib/bake/cache.rb +51 -59
- data/lib/bake/config/loader.rb +289 -0
- data/lib/bake/libElement.rb +134 -0
- data/lib/bake/mergeConfig.rb +1 -1
- data/lib/bake/model/language.rb +1 -1
- data/lib/bake/model/loader.rb +88 -0
- data/lib/bake/model/metamodel.rb +24 -16
- data/lib/bake/model/metamodel_ext.rb +9 -4
- data/lib/bake/options/options.rb +222 -0
- data/lib/bake/options/showConfigNames.rb +44 -0
- data/lib/bake/options/showDoc.rb +19 -0
- data/lib/bake/options/showLicense.rb +9 -0
- data/lib/bake/options/showToolchains.rb +39 -0
- data/lib/bake/options/usage.rb +54 -0
- data/lib/bake/process_output.rb +10 -0
- data/lib/bake/subst.rb +105 -40
- data/lib/bake/toolchain/clang.rb +44 -0
- data/lib/bake/toolchain/colorizing_formatter.rb +125 -0
- data/lib/bake/toolchain/diab.rb +53 -0
- data/lib/bake/toolchain/errorparser/diab_compiler_error_parser.rb +40 -0
- data/lib/bake/toolchain/errorparser/diab_linker_error_parser.rb +41 -0
- data/lib/bake/toolchain/errorparser/error_parser.rb +71 -0
- data/lib/bake/toolchain/errorparser/gcc_compiler_error_parser.rb +35 -0
- data/lib/bake/toolchain/errorparser/gcc_linker_error_parser.rb +35 -0
- data/lib/bake/toolchain/errorparser/greenhills_compiler_error_parser.rb +32 -0
- data/lib/bake/toolchain/errorparser/greenhills_linker_error_parser.rb +44 -0
- data/lib/bake/toolchain/errorparser/keil_compiler_error_parser.rb +40 -0
- data/lib/bake/toolchain/errorparser/keil_linker_error_parser.rb +30 -0
- data/lib/bake/toolchain/errorparser/lint_error_parser.rb +34 -0
- data/lib/bake/toolchain/errorparser/process_output.rb +3 -0
- data/lib/bake/toolchain/errorparser/ti_compiler_error_parser.rb +30 -0
- data/lib/bake/toolchain/errorparser/ti_linker_error_parser.rb +30 -0
- data/lib/bake/toolchain/gcc.rb +49 -0
- data/lib/bake/toolchain/gcc_param.rb +7 -0
- data/lib/bake/toolchain/greenhills.rb +52 -0
- data/lib/bake/toolchain/keil.rb +55 -0
- data/lib/bake/toolchain/lint.rb +20 -0
- data/lib/bake/toolchain/provider.rb +136 -0
- data/lib/bake/toolchain/ti.rb +47 -0
- data/lib/bake/util.rb +27 -15
- data/lib/bakery/buildPattern.rb +1 -1
- data/lib/bakery/model/language.rb +1 -1
- data/lib/bakery/model/loader.rb +56 -0
- data/lib/bakery/model/metamodel.rb +1 -1
- data/lib/bakery/options/options.rb +87 -0
- data/lib/bakery/toBake.rb +10 -6
- data/lib/blocks/block.rb +225 -0
- data/lib/blocks/blockBase.rb +155 -0
- data/lib/blocks/commandLine.rb +25 -0
- data/lib/blocks/compile.rb +382 -0
- data/lib/blocks/docu.rb +28 -0
- data/lib/blocks/executable.rb +143 -0
- data/lib/blocks/has_execute_command.rb +31 -0
- data/lib/blocks/library.rb +78 -0
- data/lib/blocks/lint.rb +53 -0
- data/lib/blocks/makefile.rb +87 -0
- data/lib/blocks/showIncludes.rb +114 -0
- data/lib/common/abortException.rb +4 -0
- data/lib/common/cleanup.rb +9 -0
- data/lib/common/exit_helper.rb +28 -0
- data/lib/common/ext/file.rb +88 -0
- data/lib/common/ext/stdout.rb +45 -0
- data/lib/common/ide_interface.rb +194 -0
- data/lib/common/options/option.rb +13 -0
- data/lib/common/options/parser.rb +59 -0
- data/lib/common/process.rb +64 -0
- data/lib/common/utils.rb +52 -0
- data/lib/{bake → common}/version.rb +3 -10
- data/lib/multithread/job.rb +44 -0
- data/lib/tocxx.rb +201 -932
- data/lib/vs/options.rb +3 -2
- data/license.txt +47 -22
- metadata +90 -30
- data/bin/bake-doc +0 -12
- data/lib/alias/loader.rb +0 -56
- data/lib/alias/model/language.rb +0 -22
- data/lib/alias/model/metamodel.rb +0 -29
- data/lib/bake/loader.rb +0 -92
- data/lib/bake/options.rb +0 -421
- data/lib/bakery/loader.rb +0 -57
- data/lib/bakery/options.rb +0 -105
- data/lib/option/parser.rb +0 -73
data/lib/bakery/options.rb
DELETED
@@ -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
|