bake-toolkit 2.20.4 → 2.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Rakefile.rb +3 -3
- data/bin/bake +46 -46
- data/bin/bake-doc +11 -11
- data/bin/bakery +179 -179
- data/bin/createVSProjects +213 -213
- data/documentation/_build/html/_sources/changelog.txt +456 -451
- data/documentation/_build/html/_sources/commandline/commandline.txt +107 -107
- data/documentation/_build/html/_sources/concepts/build_hierarchy.txt +34 -34
- data/documentation/_build/html/_sources/concepts/concepts.txt +14 -14
- data/documentation/_build/html/_sources/concepts/inject.txt +65 -65
- data/documentation/_build/html/_sources/concepts/link_order.txt +91 -91
- data/documentation/_build/html/_sources/concepts/prebuild.txt +56 -56
- data/documentation/_build/html/_sources/concepts/the_main_project.txt +45 -45
- data/documentation/_build/html/_sources/concepts/the_project_meta_file.txt +72 -72
- data/documentation/_build/html/_sources/ide/eclipse/eclipse.txt +25 -25
- data/documentation/_build/html/_sources/ide/eclipse/how_to_convert_existing_cdt_workspace.txt +31 -31
- data/documentation/_build/html/_sources/ide/eclipse/how_to_create_a_new_project_in_eclipse.txt +18 -18
- data/documentation/_build/html/_sources/ide/eclipse/how_to_create_a_workspace_in_eclipse.txt +27 -27
- data/documentation/_build/html/_sources/ide/eclipse/how_to_debug_in_eclipse.txt +38 -38
- data/documentation/_build/html/_sources/ide/eclipse/how_to_install_eclipse_plugin.txt +44 -44
- data/documentation/_build/html/_sources/ide/eclipse/how_to_use_bake_in_eclipse.txt +86 -86
- data/documentation/_build/html/_sources/ide/ide_integrations.txt +8 -8
- data/documentation/_build/html/_sources/ide/vs/how_to_create_vs_projects.txt +15 -15
- data/documentation/_build/html/_sources/ide/vs/how_to_debug_in_vs.txt +35 -35
- data/documentation/_build/html/_sources/ide/vs/how_to_used_bake_in_vs.txt +35 -35
- data/documentation/_build/html/_sources/ide/vs/vs.txt +10 -10
- data/documentation/_build/html/_sources/ide/vs/vs_install.txt +43 -43
- data/documentation/_build/html/_sources/index.txt +33 -33
- data/documentation/_build/html/_sources/install/install_bake.txt +112 -112
- data/documentation/_build/html/_sources/internal.txt +50 -50
- data/documentation/_build/html/_sources/known_issues.txt +9 -9
- data/documentation/_build/html/_sources/license.txt +4 -4
- data/documentation/_build/html/_sources/performance/performance.txt +104 -104
- data/documentation/_build/html/_sources/quickstart/quickstart.txt +70 -70
- data/documentation/_build/html/_sources/syntax/adapt_configs.txt +143 -143
- data/documentation/_build/html/_sources/syntax/auto_adjustment.txt +43 -43
- data/documentation/_build/html/_sources/syntax/derive_configs.txt +93 -94
- data/documentation/_build/html/_sources/syntax/project_meta_syntax.txt +19 -19
- data/documentation/_build/html/_sources/syntax/syntax.txt +11 -11
- data/documentation/_build/html/_sources/syntax/variable_substitutions.txt +147 -147
- data/documentation/_build/html/_sources/tips_and_tricks/dot.txt +34 -34
- data/documentation/_build/html/_sources/tips_and_tricks/how_to_use_bake_with_cygwin.txt +62 -62
- data/documentation/_build/html/_sources/tips_and_tricks/static_code_analysis.txt +122 -122
- data/documentation/_build/html/_sources/tips_and_tricks/the_bakery.txt +72 -72
- data/documentation/_build/html/_sources/tips_and_tricks/the_clang.txt +43 -43
- data/documentation/_build/html/_sources/tips_and_tricks/tips_and_tricks.txt +34 -34
- data/documentation/_build/html/_sources/why_bake/why_bake.txt +40 -40
- data/documentation/_build/html/changelog.html +7 -0
- data/documentation/_build/html/commandline/commandline.html +2 -2
- data/documentation/_build/html/concepts/link_order.html +2 -2
- data/documentation/_build/html/concepts/prebuild.html +2 -2
- data/documentation/_build/html/index.html +4 -4
- data/documentation/_build/html/performance/performance.html +2 -2
- data/documentation/_build/html/searchindex.js +1 -1
- data/documentation/_build/html/syntax/adapt_configs.html +2 -2
- data/documentation/_build/html/syntax/syntax.html +2 -2
- data/documentation/_build/html/tips_and_tricks/the_clang.html +2 -2
- data/documentation/_build/html/why_bake/why_bake.html +2 -2
- data/lib/adapt/config/loader.rb +112 -112
- data/lib/bake/bundle.rb +158 -158
- data/lib/bake/cache.rb +179 -180
- data/lib/bake/config/checks.rb +68 -68
- data/lib/bake/config/loader.rb +363 -363
- data/lib/bake/libElement.rb +176 -176
- data/lib/bake/mergeConfig.rb +208 -208
- data/lib/bake/model/language.rb +45 -45
- data/lib/bake/model/loader.rb +99 -99
- data/lib/bake/model/metamodel.rb +307 -307
- data/lib/bake/model/metamodel_ext.rb +27 -27
- data/lib/bake/options/create.rb +95 -95
- data/lib/bake/options/options.rb +315 -310
- data/lib/bake/options/showDoc.rb +20 -20
- data/lib/bake/options/showLicense.rb +9 -9
- data/lib/bake/options/showToolchains.rb +38 -38
- data/lib/bake/options/usage.rb +79 -68
- data/lib/bake/subst.rb +313 -313
- data/lib/bake/toolchain/clang.rb +44 -44
- data/lib/bake/toolchain/clang_analyze.rb +31 -31
- data/lib/bake/toolchain/colorizing_formatter.rb +125 -125
- data/lib/bake/toolchain/diab.rb +53 -53
- data/lib/bake/toolchain/errorparser/diab_compiler_error_parser.rb +40 -40
- data/lib/bake/toolchain/errorparser/diab_linker_error_parser.rb +41 -41
- data/lib/bake/toolchain/errorparser/error_parser.rb +71 -71
- data/lib/bake/toolchain/errorparser/gcc_compiler_error_parser.rb +35 -35
- data/lib/bake/toolchain/errorparser/gcc_linker_error_parser.rb +35 -35
- data/lib/bake/toolchain/errorparser/greenhills_compiler_error_parser.rb +32 -32
- data/lib/bake/toolchain/errorparser/greenhills_linker_error_parser.rb +44 -44
- data/lib/bake/toolchain/errorparser/keil_compiler_error_parser.rb +40 -40
- data/lib/bake/toolchain/errorparser/keil_linker_error_parser.rb +30 -30
- data/lib/bake/toolchain/errorparser/lint_error_parser.rb +34 -34
- data/lib/bake/toolchain/errorparser/msvc_compiler_error_parser.rb +63 -63
- data/lib/bake/toolchain/errorparser/msvc_linker_error_parser.rb +42 -42
- data/lib/bake/toolchain/errorparser/process_output.rb +2 -2
- data/lib/bake/toolchain/errorparser/ti_compiler_error_parser.rb +30 -30
- data/lib/bake/toolchain/errorparser/ti_linker_error_parser.rb +30 -30
- data/lib/bake/toolchain/gcc.rb +49 -49
- data/lib/bake/toolchain/gcc_env.rb +55 -55
- data/lib/bake/toolchain/greenhills.rb +52 -52
- data/lib/bake/toolchain/keil.rb +53 -53
- data/lib/bake/toolchain/lint.rb +20 -20
- data/lib/bake/toolchain/msvc.rb +58 -58
- data/lib/bake/toolchain/provider.rb +146 -146
- data/lib/bake/toolchain/ti.rb +47 -47
- data/lib/bake/util.rb +149 -149
- data/lib/bakery/buildPattern.rb +24 -24
- data/lib/bakery/model/language.rb +22 -22
- data/lib/bakery/model/loader.rb +55 -55
- data/lib/bakery/model/metamodel.rb +48 -48
- data/lib/bakery/options/options.rb +87 -87
- data/lib/bakery/toBake.rb +81 -81
- data/lib/blocks/block.rb +324 -324
- data/lib/blocks/blockBase.rb +204 -204
- data/lib/blocks/commandLine.rb +38 -38
- data/lib/blocks/compile.rb +529 -528
- data/lib/blocks/convert.rb +41 -41
- data/lib/blocks/docu.rb +30 -30
- data/lib/blocks/executable.rb +174 -174
- data/lib/blocks/has_execute_command.rb +31 -31
- data/lib/blocks/library.rb +114 -114
- data/lib/blocks/lint.rb +56 -56
- data/lib/blocks/makefile.rb +100 -100
- data/lib/blocks/showIncludes.rb +140 -125
- data/lib/common/abortException.rb +4 -4
- data/lib/common/cleanup.rb +10 -10
- data/lib/common/exit_helper.rb +38 -38
- data/lib/common/ext/file.rb +88 -88
- data/lib/common/ext/rtext.rb +11 -11
- data/lib/common/ext/stdout.rb +45 -45
- data/lib/common/ide_interface.rb +194 -194
- data/lib/common/options/parser.rb +95 -85
- data/lib/common/process.rb +64 -64
- data/lib/common/utils.rb +52 -52
- data/lib/common/version.rb +31 -23
- data/lib/multithread/job.rb +44 -44
- data/lib/tocxx.rb +558 -555
- data/lib/vs/options.rb +69 -69
- data/license.txt +90 -90
- metadata +2 -2
data/lib/blocks/blockBase.rb
CHANGED
|
@@ -1,204 +1,204 @@
|
|
|
1
|
-
require 'bake/bundle'
|
|
2
|
-
|
|
3
|
-
module Bake
|
|
4
|
-
module Blocks
|
|
5
|
-
|
|
6
|
-
class BlockBase
|
|
7
|
-
|
|
8
|
-
attr_reader :tcs
|
|
9
|
-
attr_reader :projectDir
|
|
10
|
-
|
|
11
|
-
def initialize(block, config, referencedConfigs, tcs)
|
|
12
|
-
@block = block
|
|
13
|
-
@config = config
|
|
14
|
-
@referencedConfigs = referencedConfigs
|
|
15
|
-
@projectName = config.parent.name
|
|
16
|
-
@projectDir = config.get_project_dir
|
|
17
|
-
@tcs = tcs
|
|
18
|
-
@config_date = Time.now
|
|
19
|
-
|
|
20
|
-
@printedCmdAlternate = false
|
|
21
|
-
@lastCommand = nil
|
|
22
|
-
|
|
23
|
-
calcOutputDir
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
def check_config_file()
|
|
27
|
-
if File.exists?(@config.file_name) and File.mtime(@config.file_name) > @config_date
|
|
28
|
-
begin
|
|
29
|
-
FileUtils.touch(@config.file_name)
|
|
30
|
-
rescue Exception=>e
|
|
31
|
-
if Bake.options.verbose >= 2
|
|
32
|
-
Bake.formatter.printWarning("Could not touch #{@config.file_name}: #{e.message}", @config.file_name)
|
|
33
|
-
end
|
|
34
|
-
end
|
|
35
|
-
end
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
def self.prepareOutput(filename)
|
|
39
|
-
begin
|
|
40
|
-
if File.exists?(filename)
|
|
41
|
-
FileUtils.rm(filename)
|
|
42
|
-
else
|
|
43
|
-
FileUtils.mkdir_p(File.dirname(filename))
|
|
44
|
-
end
|
|
45
|
-
rescue Exception => e
|
|
46
|
-
if Bake.options.debug
|
|
47
|
-
puts e.message
|
|
48
|
-
puts e.backtrace
|
|
49
|
-
end
|
|
50
|
-
end
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
def defaultToolchainTime
|
|
54
|
-
@defaultToolchainTime ||= File.mtime(Bake.options.main_dir+"/Project.meta")
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
def config_changed?(cmdLineFile)
|
|
58
|
-
return "because command line file does not exist" if not File.exist?(cmdLineFile)
|
|
59
|
-
cmdTime = File.mtime(cmdLineFile)
|
|
60
|
-
return "because config file has been changed" if cmdTime < File.mtime(@config.file_name)
|
|
61
|
-
return "because DefaultToolchain has been changed" if cmdTime < defaultToolchainTime
|
|
62
|
-
return "because command line has been changed"
|
|
63
|
-
end
|
|
64
|
-
|
|
65
|
-
def self.isCmdLineEqual?(cmd, cmdLineFile)
|
|
66
|
-
begin
|
|
67
|
-
if File.exist?cmdLineFile
|
|
68
|
-
lastCmdLineArray = File.readlines(cmdLineFile)[0];
|
|
69
|
-
if lastCmdLineArray == cmd.join(" ")
|
|
70
|
-
FileUtils.touch(cmdLineFile)
|
|
71
|
-
return true
|
|
72
|
-
end
|
|
73
|
-
end
|
|
74
|
-
rescue Exception => e
|
|
75
|
-
if Bake.options.debug
|
|
76
|
-
puts e.message
|
|
77
|
-
puts e.backtrace
|
|
78
|
-
end
|
|
79
|
-
end
|
|
80
|
-
return false
|
|
81
|
-
end
|
|
82
|
-
|
|
83
|
-
def self.writeCmdLineFile(cmd, cmdLineFile)
|
|
84
|
-
begin
|
|
85
|
-
File.open(cmdLineFile, 'w') { |f| f.write(cmd.join(" ")) }
|
|
86
|
-
rescue Exception => e
|
|
87
|
-
if Bake.options.debug
|
|
88
|
-
puts e.message
|
|
89
|
-
puts e.backtrace
|
|
90
|
-
end
|
|
91
|
-
end
|
|
92
|
-
end
|
|
93
|
-
|
|
94
|
-
def isMainProject?
|
|
95
|
-
@projectName == Bake.options.main_project_name and @config.name == Bake.options.build_config
|
|
96
|
-
end
|
|
97
|
-
|
|
98
|
-
def calcOutputDir
|
|
99
|
-
if @tcs[:OUTPUT_DIR] != nil
|
|
100
|
-
p = @block.convPath(@tcs[:OUTPUT_DIR])
|
|
101
|
-
@output_dir = p
|
|
102
|
-
elsif isMainProject?
|
|
103
|
-
@output_dir = "build" + Bake.options.buildDirDelimiter + Bake.options.build_config
|
|
104
|
-
else
|
|
105
|
-
@output_dir = "build" + Bake.options.buildDirDelimiter + @config.name + "_" + Bake.options.main_project_name + "_" + Bake.options.build_config
|
|
106
|
-
end
|
|
107
|
-
end
|
|
108
|
-
|
|
109
|
-
def printCmd(cmd, alternate, reason, forceVerbose)
|
|
110
|
-
if (cmd == @lastCommand)
|
|
111
|
-
if (Bake.options.verbose >= 2 or (@printedCmdAlternate and not forceVerbose))
|
|
112
|
-
return
|
|
113
|
-
end
|
|
114
|
-
end
|
|
115
|
-
|
|
116
|
-
@lastCommand = cmd
|
|
117
|
-
|
|
118
|
-
return if Bake.options.verbose == 0 and not forceVerbose
|
|
119
|
-
|
|
120
|
-
if forceVerbose or Bake.options.verbose >= 2 or not alternate
|
|
121
|
-
@printedCmdAlternate = false
|
|
122
|
-
puts "" if Bake.options.verbose >= 2 # for A.K. :-)
|
|
123
|
-
if Bake.options.verbose >= 3
|
|
124
|
-
exedIn = "\n(executed in '#{@projectDir}')"
|
|
125
|
-
because = reason ? "\n(#{reason})" : ""
|
|
126
|
-
else
|
|
127
|
-
exedIn = ""
|
|
128
|
-
because = ""
|
|
129
|
-
end
|
|
130
|
-
|
|
131
|
-
if cmd.is_a?(Array)
|
|
132
|
-
puts cmd.join(' ') + exedIn + because
|
|
133
|
-
else
|
|
134
|
-
puts cmd + exedIn + because
|
|
135
|
-
end
|
|
136
|
-
else
|
|
137
|
-
@printedCmdAlternate = true
|
|
138
|
-
puts alternate
|
|
139
|
-
end
|
|
140
|
-
|
|
141
|
-
end
|
|
142
|
-
|
|
143
|
-
def process_console_output(console_output, error_parser)
|
|
144
|
-
ret = false
|
|
145
|
-
incList = nil
|
|
146
|
-
#if not console_output.empty?
|
|
147
|
-
if error_parser
|
|
148
|
-
begin
|
|
149
|
-
x = [console_output]
|
|
150
|
-
error_descs, console_output_full, incList = error_parser.scan_lines(x, @projectDir)
|
|
151
|
-
|
|
152
|
-
console_output = x[0]
|
|
153
|
-
console_output = console_output_full if Bake.options.consoleOutput_fullnames
|
|
154
|
-
|
|
155
|
-
if Bake.options.consoleOutput_visualStudio
|
|
156
|
-
console_output_VS = ""
|
|
157
|
-
descCounter = 0
|
|
158
|
-
console_output.each_line do |l|
|
|
159
|
-
d = error_descs[descCounter]
|
|
160
|
-
console_output_VS << error_parser.makeVsError(l.rstrip, d) << "\n"
|
|
161
|
-
descCounter = descCounter + 1
|
|
162
|
-
end
|
|
163
|
-
console_output = console_output_VS
|
|
164
|
-
end
|
|
165
|
-
|
|
166
|
-
if Bake.options.lint
|
|
167
|
-
# ignore error output
|
|
168
|
-
else
|
|
169
|
-
ret = error_descs.any? { |e| e.severity == ErrorParser::SEVERITY_ERROR }
|
|
170
|
-
end
|
|
171
|
-
|
|
172
|
-
console_output.gsub!(/[\r]/, "")
|
|
173
|
-
Bake.formatter.format(console_output, error_descs, error_parser) unless console_output.empty?
|
|
174
|
-
|
|
175
|
-
Bake::IDEInterface.instance.set_errors(error_descs)
|
|
176
|
-
rescue Exception => e
|
|
177
|
-
Bake.formatter.printWarning("Parsing output failed (maybe language not set to English?): " + e.message)
|
|
178
|
-
Bake.formatter.printWarning("Original output:")
|
|
179
|
-
Bake.formatter.printWarning(console_output)
|
|
180
|
-
raise e
|
|
181
|
-
end
|
|
182
|
-
else
|
|
183
|
-
puts console_output # fallback
|
|
184
|
-
end
|
|
185
|
-
#end
|
|
186
|
-
[ret, incList]
|
|
187
|
-
end
|
|
188
|
-
|
|
189
|
-
def process_result(cmd, console_output, error_parser, alternate, reason, success)
|
|
190
|
-
hasError = (success == false)
|
|
191
|
-
printCmd(cmd, alternate, reason, (hasError and not Bake.options.lint))
|
|
192
|
-
errorPrinted, incList = process_console_output(console_output, error_parser)
|
|
193
|
-
if hasError and not errorPrinted
|
|
194
|
-
Bake.formatter.printError("System command failed", @projectDir)
|
|
195
|
-
end
|
|
196
|
-
if hasError or errorPrinted
|
|
197
|
-
raise SystemCommandFailed.new
|
|
198
|
-
end
|
|
199
|
-
incList
|
|
200
|
-
end
|
|
201
|
-
|
|
202
|
-
end
|
|
203
|
-
end
|
|
204
|
-
end
|
|
1
|
+
require 'bake/bundle'
|
|
2
|
+
|
|
3
|
+
module Bake
|
|
4
|
+
module Blocks
|
|
5
|
+
|
|
6
|
+
class BlockBase
|
|
7
|
+
|
|
8
|
+
attr_reader :tcs
|
|
9
|
+
attr_reader :projectDir
|
|
10
|
+
|
|
11
|
+
def initialize(block, config, referencedConfigs, tcs)
|
|
12
|
+
@block = block
|
|
13
|
+
@config = config
|
|
14
|
+
@referencedConfigs = referencedConfigs
|
|
15
|
+
@projectName = config.parent.name
|
|
16
|
+
@projectDir = config.get_project_dir
|
|
17
|
+
@tcs = tcs
|
|
18
|
+
@config_date = Time.now
|
|
19
|
+
|
|
20
|
+
@printedCmdAlternate = false
|
|
21
|
+
@lastCommand = nil
|
|
22
|
+
|
|
23
|
+
calcOutputDir
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def check_config_file()
|
|
27
|
+
if File.exists?(@config.file_name) and File.mtime(@config.file_name) > @config_date
|
|
28
|
+
begin
|
|
29
|
+
FileUtils.touch(@config.file_name)
|
|
30
|
+
rescue Exception=>e
|
|
31
|
+
if Bake.options.verbose >= 2
|
|
32
|
+
Bake.formatter.printWarning("Could not touch #{@config.file_name}: #{e.message}", @config.file_name)
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def self.prepareOutput(filename)
|
|
39
|
+
begin
|
|
40
|
+
if File.exists?(filename)
|
|
41
|
+
FileUtils.rm(filename)
|
|
42
|
+
else
|
|
43
|
+
FileUtils.mkdir_p(File.dirname(filename))
|
|
44
|
+
end
|
|
45
|
+
rescue Exception => e
|
|
46
|
+
if Bake.options.debug
|
|
47
|
+
puts e.message
|
|
48
|
+
puts e.backtrace
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def defaultToolchainTime
|
|
54
|
+
@defaultToolchainTime ||= File.mtime(Bake.options.main_dir+"/Project.meta")
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def config_changed?(cmdLineFile)
|
|
58
|
+
return "because command line file does not exist" if not File.exist?(cmdLineFile)
|
|
59
|
+
cmdTime = File.mtime(cmdLineFile)
|
|
60
|
+
return "because config file has been changed" if cmdTime < File.mtime(@config.file_name)
|
|
61
|
+
return "because DefaultToolchain has been changed" if cmdTime < defaultToolchainTime
|
|
62
|
+
return "because command line has been changed"
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
def self.isCmdLineEqual?(cmd, cmdLineFile)
|
|
66
|
+
begin
|
|
67
|
+
if File.exist?cmdLineFile
|
|
68
|
+
lastCmdLineArray = File.readlines(cmdLineFile)[0];
|
|
69
|
+
if lastCmdLineArray == cmd.join(" ")
|
|
70
|
+
FileUtils.touch(cmdLineFile)
|
|
71
|
+
return true
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
rescue Exception => e
|
|
75
|
+
if Bake.options.debug
|
|
76
|
+
puts e.message
|
|
77
|
+
puts e.backtrace
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
return false
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
def self.writeCmdLineFile(cmd, cmdLineFile)
|
|
84
|
+
begin
|
|
85
|
+
File.open(cmdLineFile, 'w') { |f| f.write(cmd.join(" ")) }
|
|
86
|
+
rescue Exception => e
|
|
87
|
+
if Bake.options.debug
|
|
88
|
+
puts e.message
|
|
89
|
+
puts e.backtrace
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
def isMainProject?
|
|
95
|
+
@projectName == Bake.options.main_project_name and @config.name == Bake.options.build_config
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
def calcOutputDir
|
|
99
|
+
if @tcs[:OUTPUT_DIR] != nil
|
|
100
|
+
p = @block.convPath(@tcs[:OUTPUT_DIR])
|
|
101
|
+
@output_dir = p
|
|
102
|
+
elsif isMainProject?
|
|
103
|
+
@output_dir = "build" + Bake.options.buildDirDelimiter + Bake.options.build_config
|
|
104
|
+
else
|
|
105
|
+
@output_dir = "build" + Bake.options.buildDirDelimiter + @config.name + "_" + Bake.options.main_project_name + "_" + Bake.options.build_config
|
|
106
|
+
end
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
def printCmd(cmd, alternate, reason, forceVerbose)
|
|
110
|
+
if (cmd == @lastCommand)
|
|
111
|
+
if (Bake.options.verbose >= 2 or (@printedCmdAlternate and not forceVerbose))
|
|
112
|
+
return
|
|
113
|
+
end
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
@lastCommand = cmd
|
|
117
|
+
|
|
118
|
+
return if Bake.options.verbose == 0 and not forceVerbose
|
|
119
|
+
|
|
120
|
+
if forceVerbose or Bake.options.verbose >= 2 or not alternate
|
|
121
|
+
@printedCmdAlternate = false
|
|
122
|
+
puts "" if Bake.options.verbose >= 2 # for A.K. :-)
|
|
123
|
+
if Bake.options.verbose >= 3
|
|
124
|
+
exedIn = "\n(executed in '#{@projectDir}')"
|
|
125
|
+
because = reason ? "\n(#{reason})" : ""
|
|
126
|
+
else
|
|
127
|
+
exedIn = ""
|
|
128
|
+
because = ""
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
if cmd.is_a?(Array)
|
|
132
|
+
puts cmd.join(' ') + exedIn + because
|
|
133
|
+
else
|
|
134
|
+
puts cmd + exedIn + because
|
|
135
|
+
end
|
|
136
|
+
else
|
|
137
|
+
@printedCmdAlternate = true
|
|
138
|
+
puts alternate
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
def process_console_output(console_output, error_parser)
|
|
144
|
+
ret = false
|
|
145
|
+
incList = nil
|
|
146
|
+
#if not console_output.empty?
|
|
147
|
+
if error_parser
|
|
148
|
+
begin
|
|
149
|
+
x = [console_output]
|
|
150
|
+
error_descs, console_output_full, incList = error_parser.scan_lines(x, @projectDir)
|
|
151
|
+
|
|
152
|
+
console_output = x[0]
|
|
153
|
+
console_output = console_output_full if Bake.options.consoleOutput_fullnames
|
|
154
|
+
|
|
155
|
+
if Bake.options.consoleOutput_visualStudio
|
|
156
|
+
console_output_VS = ""
|
|
157
|
+
descCounter = 0
|
|
158
|
+
console_output.each_line do |l|
|
|
159
|
+
d = error_descs[descCounter]
|
|
160
|
+
console_output_VS << error_parser.makeVsError(l.rstrip, d) << "\n"
|
|
161
|
+
descCounter = descCounter + 1
|
|
162
|
+
end
|
|
163
|
+
console_output = console_output_VS
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
if Bake.options.lint
|
|
167
|
+
# ignore error output
|
|
168
|
+
else
|
|
169
|
+
ret = error_descs.any? { |e| e.severity == ErrorParser::SEVERITY_ERROR }
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
console_output.gsub!(/[\r]/, "")
|
|
173
|
+
Bake.formatter.format(console_output, error_descs, error_parser) unless console_output.empty?
|
|
174
|
+
|
|
175
|
+
Bake::IDEInterface.instance.set_errors(error_descs)
|
|
176
|
+
rescue Exception => e
|
|
177
|
+
Bake.formatter.printWarning("Parsing output failed (maybe language not set to English?): " + e.message)
|
|
178
|
+
Bake.formatter.printWarning("Original output:")
|
|
179
|
+
Bake.formatter.printWarning(console_output)
|
|
180
|
+
raise e
|
|
181
|
+
end
|
|
182
|
+
else
|
|
183
|
+
puts console_output # fallback
|
|
184
|
+
end
|
|
185
|
+
#end
|
|
186
|
+
[ret, incList]
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
def process_result(cmd, console_output, error_parser, alternate, reason, success)
|
|
190
|
+
hasError = (success == false)
|
|
191
|
+
printCmd(cmd, alternate, reason, (hasError and not Bake.options.lint))
|
|
192
|
+
errorPrinted, incList = process_console_output(console_output, error_parser)
|
|
193
|
+
if hasError and not errorPrinted
|
|
194
|
+
Bake.formatter.printError("System command failed", @projectDir)
|
|
195
|
+
end
|
|
196
|
+
if hasError or errorPrinted
|
|
197
|
+
raise SystemCommandFailed.new
|
|
198
|
+
end
|
|
199
|
+
incList
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
end
|
|
203
|
+
end
|
|
204
|
+
end
|
data/lib/blocks/commandLine.rb
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
require 'blocks/has_execute_command'
|
|
2
|
-
|
|
3
|
-
module Bake
|
|
4
|
-
module Blocks
|
|
5
|
-
|
|
6
|
-
class CommandLine
|
|
7
|
-
include HasExecuteCommand
|
|
8
|
-
|
|
9
|
-
def initialize(config, referencedConfigs)
|
|
10
|
-
@config = config # Bake::Metamodel::CommandLine
|
|
11
|
-
@commandLine = config.name
|
|
12
|
-
@projectDir = config.get_project_dir
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
def execute
|
|
16
|
-
return true if Bake.options.linkOnly
|
|
17
|
-
return executeCommand(@commandLine, nil, @config.validExitCodes)
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
def startupStep
|
|
21
|
-
return true if Bake.options.linkOnly
|
|
22
|
-
return executeCommand(@commandLine, nil, @config.validExitCodes)
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
def exitStep
|
|
26
|
-
return true if Bake.options.linkOnly
|
|
27
|
-
return executeCommand(@commandLine, nil, @config.validExitCodes)
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
def clean
|
|
31
|
-
# nothing to do here
|
|
32
|
-
return true
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
end
|
|
38
|
-
end
|
|
1
|
+
require 'blocks/has_execute_command'
|
|
2
|
+
|
|
3
|
+
module Bake
|
|
4
|
+
module Blocks
|
|
5
|
+
|
|
6
|
+
class CommandLine
|
|
7
|
+
include HasExecuteCommand
|
|
8
|
+
|
|
9
|
+
def initialize(config, referencedConfigs)
|
|
10
|
+
@config = config # Bake::Metamodel::CommandLine
|
|
11
|
+
@commandLine = config.name
|
|
12
|
+
@projectDir = config.get_project_dir
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def execute
|
|
16
|
+
return true if Bake.options.linkOnly
|
|
17
|
+
return executeCommand(@commandLine, nil, @config.validExitCodes)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def startupStep
|
|
21
|
+
return true if Bake.options.linkOnly
|
|
22
|
+
return executeCommand(@commandLine, nil, @config.validExitCodes)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def exitStep
|
|
26
|
+
return true if Bake.options.linkOnly
|
|
27
|
+
return executeCommand(@commandLine, nil, @config.validExitCodes)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def clean
|
|
31
|
+
# nothing to do here
|
|
32
|
+
return true
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
end
|
|
38
|
+
end
|