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/bake/options.rb
DELETED
@@ -1,421 +0,0 @@
|
|
1
|
-
require 'cxxproject/ext/rake'
|
2
|
-
require 'cxxproject/utils/printer'
|
3
|
-
require "cxxproject/toolchain/colorizing_formatter"
|
4
|
-
require "option/parser"
|
5
|
-
|
6
|
-
module Cxxproject
|
7
|
-
|
8
|
-
class Options < Parser
|
9
|
-
attr_reader :build_config, :main_dir, :project, :filename, :eclipse_version, :alias_filename # String
|
10
|
-
attr_reader :roots, :include_filter, :exclude_filter # String List
|
11
|
-
attr_reader :clean, :rebuild, :single, :verbose, :nocache, :color, :show_includes, :show_includes_and_defines, :linkOnly, :check_uninc, :printLess, :no_autodir, :clobber, :lint, :debug, :cmake # Boolean
|
12
|
-
attr_reader :threads, :socket, :lint_min, :lint_max # Fixnum
|
13
|
-
attr_reader :vars # map
|
14
|
-
|
15
|
-
def initialize(argv)
|
16
|
-
super(argv)
|
17
|
-
|
18
|
-
@vars = {}
|
19
|
-
@build_config = ""
|
20
|
-
@main_dir = nil
|
21
|
-
@project = nil
|
22
|
-
@filename = nil
|
23
|
-
@single = false
|
24
|
-
@clean = false
|
25
|
-
@clobber = false
|
26
|
-
@lint = false
|
27
|
-
@debug = false
|
28
|
-
@rebuild = false
|
29
|
-
@verbose = false
|
30
|
-
@nocache = false
|
31
|
-
@check_uninc = false
|
32
|
-
@color = false
|
33
|
-
@show_includes = false
|
34
|
-
@show_includes_and_defines = false
|
35
|
-
@linkOnly = false
|
36
|
-
@printLess = false
|
37
|
-
@no_autodir = false
|
38
|
-
@cmake = false
|
39
|
-
@threads = 8
|
40
|
-
@lint_min = -1
|
41
|
-
@lint_max = -1
|
42
|
-
@roots = []
|
43
|
-
@socket = 0
|
44
|
-
@include_filter = []
|
45
|
-
@exclude_filter = []
|
46
|
-
@def_roots = []
|
47
|
-
@eclipse_version = ""
|
48
|
-
@alias_filename = ""
|
49
|
-
|
50
|
-
add_default(Proc.new{ |x| set_build_config_default(x) })
|
51
|
-
|
52
|
-
add_option(Option.new("-m",true) { |x| set_main_dir(x) })
|
53
|
-
add_option(Option.new("-b",true) { |x| set_build_config(x) })
|
54
|
-
add_option(Option.new("-p",true) { |x| set_project(x); set_single })
|
55
|
-
add_option(Option.new("-f",true) { |x| set_filename(x) })
|
56
|
-
add_option(Option.new("-c",false) { set_clean })
|
57
|
-
add_option(Option.new("-a",true) { |x| set_color(x) })
|
58
|
-
add_option(Option.new("-w",true) { |x| set_root(x) })
|
59
|
-
add_option(Option.new("-r",false) { set_error })
|
60
|
-
add_option(Option.new("--depfileInfo",false) { set_depfileInfo })
|
61
|
-
add_option(Option.new("--rebuild",false) { set_rebuild })
|
62
|
-
add_option(Option.new("--prepro",false) { set_prepro })
|
63
|
-
add_option(Option.new("--link_only",false) { set_linkOnly })
|
64
|
-
add_option(Option.new("--no_autodir",false) { set_no_autodir })
|
65
|
-
add_option(Option.new("--lint",false) { set_lint })
|
66
|
-
add_option(Option.new("--lint_min",true) { |x| set_lint_min(x) })
|
67
|
-
add_option(Option.new("--lint_max",true) { |x| set_lint_max(x) })
|
68
|
-
|
69
|
-
add_option(Option.new("-v0",false) { set_v(0) })
|
70
|
-
add_option(Option.new("-v1",false) { set_v(1) })
|
71
|
-
add_option(Option.new("-v2",false) { set_v(2) })
|
72
|
-
|
73
|
-
add_option(Option.new("--debug",false) { set_debug })
|
74
|
-
add_option(Option.new("--set",true) { |x| set_set(x) })
|
75
|
-
|
76
|
-
add_option(Option.new("--clobber",false) { set_clobber })
|
77
|
-
add_option(Option.new("--ignore_cache",false) { set_nocache })
|
78
|
-
add_option(Option.new("--threads",true) { |x| set_threads(x) })
|
79
|
-
add_option(Option.new("--socket",true) { |x| set_socket(x) })
|
80
|
-
add_option(Option.new("--toolchain_info",true) { |x| print_toolchain(x) })
|
81
|
-
add_option(Option.new("--toolchain_names",false) { print_toolchains })
|
82
|
-
add_option(Option.new("--include_filter",true) { |x| set_include_filter(x) })
|
83
|
-
add_option(Option.new("--exclude_filter",true) { |x| set_exclude_filter(x) })
|
84
|
-
add_option(Option.new("--show_abs_paths",false) { set_show_fullnames })
|
85
|
-
add_option(Option.new("--visualStudio",false) { set_visualStudio })
|
86
|
-
add_option(Option.new("-h",false) { usage; ExitHelper.exit(0) })
|
87
|
-
add_option(Option.new("--help",false) { usage; ExitHelper.exit(0) })
|
88
|
-
add_option(Option.new("--show_include_paths",false) { set_show_inc })
|
89
|
-
add_option(Option.new("--show_incs_and_defs",false) { set_show_inc_def })
|
90
|
-
add_option(Option.new("--eclipse_version",true) { |x| set_eclipse_version(x) })
|
91
|
-
add_option(Option.new("--show_license",false) { show_license })
|
92
|
-
add_option(Option.new("--version",false) { ExitHelper.exit(0) })
|
93
|
-
add_option(Option.new("--check_uninc",false) { set_check_uninc })
|
94
|
-
add_option(Option.new("--cmake",false) { set_cmake })
|
95
|
-
add_option(Option.new("--alias",true) { |x| set_alias_filename(x) })
|
96
|
-
|
97
|
-
end
|
98
|
-
|
99
|
-
def usage
|
100
|
-
puts "\nUsage: bake [options]"
|
101
|
-
puts " [-b] <name> Config name of main project"
|
102
|
-
puts " -m <dir> Directory of main project (default is current directory)."
|
103
|
-
puts " -p <dir> Project to build/clean (default is main project)"
|
104
|
-
puts " -f <name> Build/Clean this file only."
|
105
|
-
puts " -c Clean the file/project."
|
106
|
-
puts " -a <scheme> Use ansi color sequences (console must support it). Possible values are 'white' and 'black'."
|
107
|
-
puts " -v<level> Verbose level from 0 to 2, whereas -v0 is less, -v1 is normal (default) and -v2 is more verbose."
|
108
|
-
puts " -r Stop on first error."
|
109
|
-
puts " -w <root> Add a workspace root (can be used multiple times)."
|
110
|
-
puts " If no root is specified, the parent directory of the main project is added automatically."
|
111
|
-
puts " --rebuild Clean before build."
|
112
|
-
puts " --clobber Clean the file/project (same as option -c) AND the bake cache files."
|
113
|
-
puts " --prepro Stop after preprocessor."
|
114
|
-
puts " --link_only Only link executable - doesn't update objects and archives or start PreSteps and PostSteps."
|
115
|
-
puts " --lint Performs Lint checks instead of compiling sources. Works currently only with"
|
116
|
-
puts " GCC toolchain in project and file scope."
|
117
|
-
puts " --lint_min <num> If number of files in a project is too large for lint to handle, it is possible"
|
118
|
-
puts " to specify only a part of the file list to lint (default -1)."
|
119
|
-
puts " --lint_max <num> See above (default -1)."
|
120
|
-
puts " --ignore_cache Rereads the original meta files - usefull if workspace structure has been changed."
|
121
|
-
puts " --check_uninc Checks for unnecessary includes (only done for successful project builds)."
|
122
|
-
puts " --threads <num> Set NUMBER of parallel compiled files (default is 8)."
|
123
|
-
puts " --socket <num> Set SOCKET for sending errors, receiving commands, etc. - used by e.g. Eclipse."
|
124
|
-
puts " --toolchain_info <name> Prints default values of a toolchain."
|
125
|
-
puts " --toolchain_names Prints available toolchains."
|
126
|
-
puts " --include_filter <name> Includes steps with this filter name (can be used multiple times)."
|
127
|
-
puts " 'PRE' or 'POST' includes all PreSteps respectively PostSteps."
|
128
|
-
puts " --exclude_filter <name> Excludes steps with this filter name (can be used multiple times)."
|
129
|
-
puts " 'PRE' or 'POST' excludes all PreSteps respectively PostSteps."
|
130
|
-
puts " --show_abs_paths Compiler prints absolute filename paths instead of relative paths."
|
131
|
-
puts " --no_autodir Disable auto completion of paths like in IncludeDir"
|
132
|
-
puts " --set <key>=<value> Sets a variable. Overwrites variables defined in Project.metas (can be used multiple times)."
|
133
|
-
puts ""
|
134
|
-
puts " --version Print version."
|
135
|
-
puts " -h, --help Print this help."
|
136
|
-
puts " --show_license Print the license."
|
137
|
-
puts ""
|
138
|
-
puts " --cmake Temporary switch for BSW."
|
139
|
-
|
140
|
-
end
|
141
|
-
|
142
|
-
def parse_options()
|
143
|
-
parse_internal(false)
|
144
|
-
set_main_dir(Dir.pwd) if @main_dir.nil?
|
145
|
-
set_project(File.basename(@main_dir)) if @project.nil?
|
146
|
-
@roots = @def_roots if @roots.length == 0
|
147
|
-
Rake::application.max_parallel_tasks = @threads
|
148
|
-
Rake::application.debug = @debug
|
149
|
-
Rake::application.lint = @lint
|
150
|
-
|
151
|
-
if @linkOnly
|
152
|
-
if @rebuild
|
153
|
-
Printer.printError "Error: --link_only and --rebuild not allowed at the same time"
|
154
|
-
ExitHelper.exit(1)
|
155
|
-
end
|
156
|
-
if @clean
|
157
|
-
Printer.printError "Error: --link_only and -c not allowed at the same time"
|
158
|
-
ExitHelper.exit(1)
|
159
|
-
end
|
160
|
-
end
|
161
|
-
|
162
|
-
if @lint and not @single
|
163
|
-
Printer.printError "Error: --lint must be used together with -p and optional with -f"
|
164
|
-
ExitHelper.exit(1)
|
165
|
-
end
|
166
|
-
|
167
|
-
if @lint and @clean
|
168
|
-
Printer.printError "Error: --lint and -c not allowed (yet)"
|
169
|
-
ExitHelper.exit(1)
|
170
|
-
end
|
171
|
-
|
172
|
-
if @lint_max >= 0 and @lint_min >= 0 and @lint_max < @lint_min
|
173
|
-
Printer.printError "Error: lint_max must be greater than lint_min"
|
174
|
-
ExitHelper.exit(1)
|
175
|
-
end
|
176
|
-
|
177
|
-
end
|
178
|
-
|
179
|
-
def check_valid_dir(dir)
|
180
|
-
if not File.exists?(dir)
|
181
|
-
Printer.printError "Error: Directory #{dir} does not exist"
|
182
|
-
ExitHelper.exit(1)
|
183
|
-
end
|
184
|
-
if not File.directory?(dir)
|
185
|
-
Printer.printError "Error: #{dir} is not a directory"
|
186
|
-
ExitHelper.exit(1)
|
187
|
-
end
|
188
|
-
end
|
189
|
-
|
190
|
-
def set_include_filter(x)
|
191
|
-
@include_filter << x
|
192
|
-
end
|
193
|
-
|
194
|
-
def set_exclude_filter(x)
|
195
|
-
@exclude_filter << x
|
196
|
-
end
|
197
|
-
|
198
|
-
def set_build_config_default(config)
|
199
|
-
index = config.index('-')
|
200
|
-
return false if (index != nil and index == 0)
|
201
|
-
set_build_config(config)
|
202
|
-
return true
|
203
|
-
end
|
204
|
-
|
205
|
-
def set_build_config(config)
|
206
|
-
if not @build_config.empty?
|
207
|
-
Printer.printError "Error: Cannot set build config '#{config}', because build config is already set to '#{@build_config}'"
|
208
|
-
ExitHelper.exit(1)
|
209
|
-
end
|
210
|
-
@build_config = config
|
211
|
-
end
|
212
|
-
|
213
|
-
def set_main_dir(dir)
|
214
|
-
check_valid_dir(dir)
|
215
|
-
@main_dir = File.expand_path(dir.gsub(/[\\]/,'/'))
|
216
|
-
@def_roots = calc_def_roots(@main_dir)
|
217
|
-
end
|
218
|
-
|
219
|
-
def set_project(name)
|
220
|
-
@project = name
|
221
|
-
end
|
222
|
-
|
223
|
-
def set_filename(filename)
|
224
|
-
@filename = filename.gsub(/[\\]/,'/')
|
225
|
-
end
|
226
|
-
|
227
|
-
def set_single()
|
228
|
-
@single = true
|
229
|
-
end
|
230
|
-
def set_clean()
|
231
|
-
@clean = true
|
232
|
-
end
|
233
|
-
def set_clobber()
|
234
|
-
@clobber = true
|
235
|
-
set_clean
|
236
|
-
end
|
237
|
-
def set_rebuild()
|
238
|
-
@clean = true
|
239
|
-
@rebuild = true
|
240
|
-
end
|
241
|
-
def set_nocache()
|
242
|
-
@nocache = true
|
243
|
-
end
|
244
|
-
def set_check_uninc()
|
245
|
-
@check_uninc = true
|
246
|
-
end
|
247
|
-
def set_cmake()
|
248
|
-
@cmake = true
|
249
|
-
end
|
250
|
-
def set_prepro()
|
251
|
-
Rake::application.preproFlags = true
|
252
|
-
end
|
253
|
-
def set_linkOnly()
|
254
|
-
@linkOnly = true
|
255
|
-
set_single()
|
256
|
-
end
|
257
|
-
|
258
|
-
def set_no_autodir()
|
259
|
-
@no_autodir = true
|
260
|
-
end
|
261
|
-
|
262
|
-
def set_lint()
|
263
|
-
@lint = true
|
264
|
-
end
|
265
|
-
|
266
|
-
def set_debug()
|
267
|
-
@debug = true
|
268
|
-
end
|
269
|
-
|
270
|
-
def set_v(num)
|
271
|
-
if num == 0
|
272
|
-
@printLess = true
|
273
|
-
@verbose = false
|
274
|
-
Rake::application.options.silent = true
|
275
|
-
elsif num == 1
|
276
|
-
Rake::application.options.silent = false
|
277
|
-
@printLess = false
|
278
|
-
@verbose = false
|
279
|
-
elsif num == 2
|
280
|
-
Rake::application.options.silent = false
|
281
|
-
@printLess = false
|
282
|
-
@verbose = true
|
283
|
-
end
|
284
|
-
end
|
285
|
-
|
286
|
-
def set_color(x)
|
287
|
-
if (x != "black" and x != "white" and x != "none")
|
288
|
-
Printer.printError "Error: color scheme must be 'black' or 'white'"
|
289
|
-
ExitHelper.exit(1)
|
290
|
-
end
|
291
|
-
begin
|
292
|
-
if (x == "none")
|
293
|
-
@color = false
|
294
|
-
ColorizingFormatter.enabled = false
|
295
|
-
else
|
296
|
-
ColorizingFormatter::setColorScheme(x.to_sym)
|
297
|
-
@color = true
|
298
|
-
ColorizingFormatter.enabled = true
|
299
|
-
end
|
300
|
-
rescue Exception => e
|
301
|
-
Printer.printError "Error: colored gem not installed (#{e.message})"
|
302
|
-
puts e.backtrace if @verbose
|
303
|
-
ExitHelper.exit(1)
|
304
|
-
end
|
305
|
-
end
|
306
|
-
|
307
|
-
def set_error()
|
308
|
-
Rake::Task.bail_on_first_error = true
|
309
|
-
end
|
310
|
-
|
311
|
-
def set_depfileInfo()
|
312
|
-
Cxxproject::HasSources.print_additional_depfile_info = true
|
313
|
-
end
|
314
|
-
|
315
|
-
def set_show_inc
|
316
|
-
@show_includes = true
|
317
|
-
end
|
318
|
-
|
319
|
-
def set_show_inc_def
|
320
|
-
@show_includes_and_defines = true
|
321
|
-
end
|
322
|
-
|
323
|
-
def set_show_fullnames
|
324
|
-
Rake::application.consoleOutput_fullnames = true
|
325
|
-
end
|
326
|
-
|
327
|
-
def set_visualStudio
|
328
|
-
Rake::application.consoleOutput_visualStudio = true
|
329
|
-
end
|
330
|
-
|
331
|
-
def set_root(dir)
|
332
|
-
check_valid_dir(dir)
|
333
|
-
r = File.expand_path(dir.gsub(/[\\]/,'/'))
|
334
|
-
@roots << r if not @roots.include?r
|
335
|
-
end
|
336
|
-
|
337
|
-
def set_threads(num)
|
338
|
-
@threads = String === num ? num.to_i : num
|
339
|
-
if @threads <= 0
|
340
|
-
Printer.printError "Error: number of threads must be > 0"
|
341
|
-
ExitHelper.exit(1)
|
342
|
-
end
|
343
|
-
end
|
344
|
-
|
345
|
-
def set_socket(num)
|
346
|
-
@socket = String === num ? num.to_i : num
|
347
|
-
end
|
348
|
-
|
349
|
-
def set_set(str)
|
350
|
-
ar = str.split("=")
|
351
|
-
if not str.include?"=" or ar[0].length == 0
|
352
|
-
Printer.printError "Error: --set must be followed by key=value"
|
353
|
-
ExitHelper.exit(1)
|
354
|
-
end
|
355
|
-
@vars[ar[0]] = ar[1..-1].join("=")
|
356
|
-
end
|
357
|
-
|
358
|
-
def set_lint_min(num)
|
359
|
-
@lint_min = String === num ? num.to_i : num
|
360
|
-
end
|
361
|
-
|
362
|
-
def set_lint_max(num)
|
363
|
-
@lint_max = String === num ? num.to_i : num
|
364
|
-
end
|
365
|
-
|
366
|
-
def printHash(x, level)
|
367
|
-
x.each do |k,v|
|
368
|
-
if Hash === v
|
369
|
-
if level > 0
|
370
|
-
level.times {print " "}
|
371
|
-
else
|
372
|
-
print "\n"
|
373
|
-
end
|
374
|
-
puts k
|
375
|
-
printHash(v,level+1)
|
376
|
-
elsif Array === v or String === v
|
377
|
-
level.times {print " "}
|
378
|
-
puts "#{k} = #{v}"
|
379
|
-
end
|
380
|
-
end
|
381
|
-
end
|
382
|
-
|
383
|
-
def print_toolchain(x)
|
384
|
-
tcs = Cxxproject::Toolchain::Provider[x]
|
385
|
-
if tcs.nil?
|
386
|
-
puts "Toolchain not available"
|
387
|
-
else
|
388
|
-
printHash(tcs, 0)
|
389
|
-
end
|
390
|
-
ExitHelper.exit(0)
|
391
|
-
end
|
392
|
-
|
393
|
-
def print_toolchains()
|
394
|
-
puts "Available toolchains:"
|
395
|
-
Cxxproject::Toolchain::Provider.list.keys.each { |c| puts "* #{c}" }
|
396
|
-
ExitHelper.exit(0)
|
397
|
-
end
|
398
|
-
|
399
|
-
def show_license()
|
400
|
-
licenseFile = File.join(File.dirname(File.dirname(File.dirname(__FILE__))), "license.txt")
|
401
|
-
file = File.new(licenseFile, "r")
|
402
|
-
while (line = file.gets)
|
403
|
-
puts "#{line}"
|
404
|
-
end
|
405
|
-
file.close
|
406
|
-
ExitHelper.exit(0)
|
407
|
-
end
|
408
|
-
|
409
|
-
def set_eclipse_version(x)
|
410
|
-
@eclipse_version = x
|
411
|
-
end
|
412
|
-
|
413
|
-
def set_alias_filename(x)
|
414
|
-
@alias_filename = x
|
415
|
-
end
|
416
|
-
|
417
|
-
end
|
418
|
-
|
419
|
-
end
|
420
|
-
|
421
|
-
|
data/lib/bakery/loader.rb
DELETED
@@ -1,57 +0,0 @@
|
|
1
|
-
require 'bakery/model/metamodel'
|
2
|
-
require 'bakery/model/language'
|
3
|
-
require 'bake/version'
|
4
|
-
|
5
|
-
require 'rgen/environment'
|
6
|
-
require 'rgen/fragment/fragmented_model'
|
7
|
-
|
8
|
-
require 'rtext/default_loader'
|
9
|
-
|
10
|
-
require 'cxxproject/utils/exit_helper'
|
11
|
-
require 'cxxproject/utils/printer'
|
12
|
-
|
13
|
-
module Cxxproject
|
14
|
-
|
15
|
-
class BakeryLoader
|
16
|
-
|
17
|
-
attr_reader :model
|
18
|
-
|
19
|
-
def initialize(options)
|
20
|
-
@env = RGen::Environment.new
|
21
|
-
@options = options
|
22
|
-
@model = RGen::Fragment::FragmentedModel.new(:env => @env)
|
23
|
-
end
|
24
|
-
|
25
|
-
def load(filename)
|
26
|
-
|
27
|
-
sumErrors = 0
|
28
|
-
|
29
|
-
if not File.exists?filename
|
30
|
-
Printer.printError "Error: #{filename} does not exist"
|
31
|
-
ExitHelper.exit(1)
|
32
|
-
end
|
33
|
-
|
34
|
-
loader = RText::DefaultLoader.new(
|
35
|
-
Cxxproject::BakeryLanguage,
|
36
|
-
@model,
|
37
|
-
:file_provider => proc { [filename] },
|
38
|
-
:cache => @DumpFileCache)
|
39
|
-
loader.load()
|
40
|
-
|
41
|
-
f = @model.fragments[0]
|
42
|
-
|
43
|
-
f.data[:problems].each do |p|
|
44
|
-
Printer.printError "Error: "+p.file+"("+p.line.to_s+"): "+p.message
|
45
|
-
end
|
46
|
-
|
47
|
-
if f.data[:problems].length > 0
|
48
|
-
ExitHelper.exit(1)
|
49
|
-
end
|
50
|
-
|
51
|
-
return @env
|
52
|
-
|
53
|
-
end
|
54
|
-
|
55
|
-
|
56
|
-
end
|
57
|
-
end
|