bake-toolkit 2.24.0 → 2.24.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/documentation/_build/html/_sources/changelog.txt +527 -521
- data/documentation/_build/html/_sources/index.txt +33 -33
- data/documentation/_build/html/_static/syntax.html +1 -1
- data/documentation/_build/html/changelog.html +9 -1
- data/documentation/_build/html/index.html +4 -4
- data/documentation/_build/html/searchindex.js +1 -1
- data/documentation/_build/html/syntax/project_meta_syntax.html +2 -2
- data/documentation/_build/html/syntax/syntax.html +1 -1
- data/lib/bake/libElement.rb +177 -176
- data/lib/bake/toolchain/gcc.rb +59 -55
- data/lib/bakeqac/options/options.rb +19 -7
- data/lib/blocks/block.rb +333 -323
- data/lib/blocks/compile.rb +520 -530
- data/lib/common/version.rb +1 -1
- metadata +2 -2
data/lib/bake/toolchain/gcc.rb
CHANGED
@@ -1,55 +1,59 @@
|
|
1
|
-
require 'common/utils'
|
2
|
-
require 'bake/toolchain/provider'
|
3
|
-
require 'bake/toolchain/errorparser/error_parser'
|
4
|
-
require 'bake/toolchain/errorparser/gcc_compiler_error_parser'
|
5
|
-
require 'bake/toolchain/errorparser/gcc_linker_error_parser'
|
6
|
-
|
7
|
-
module Bake
|
8
|
-
module Toolchain
|
9
|
-
|
10
|
-
def self.getGccVersion
|
11
|
-
gccVersionStr = `g++ --version`
|
12
|
-
splitted = gccVersionStr.split("\n")[0].split(" ")
|
13
|
-
return splitted[splitted.length-1].split(".").map { |v| v.to_i }
|
14
|
-
end
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
:
|
24
|
-
:
|
25
|
-
:
|
26
|
-
:
|
27
|
-
:
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
GCCChain[:COMPILER][:
|
35
|
-
GCCChain[:COMPILER][:
|
36
|
-
|
37
|
-
|
38
|
-
GCCChain[:
|
39
|
-
|
40
|
-
|
41
|
-
GCCChain[:
|
42
|
-
GCCChain[:
|
43
|
-
|
44
|
-
GCCChain[:LINKER][:
|
45
|
-
GCCChain[:LINKER][:
|
46
|
-
|
47
|
-
|
48
|
-
GCCChain[:
|
49
|
-
GCCChain[:
|
50
|
-
|
51
|
-
|
52
|
-
GCCChain[:
|
53
|
-
|
54
|
-
|
55
|
-
|
1
|
+
require 'common/utils'
|
2
|
+
require 'bake/toolchain/provider'
|
3
|
+
require 'bake/toolchain/errorparser/error_parser'
|
4
|
+
require 'bake/toolchain/errorparser/gcc_compiler_error_parser'
|
5
|
+
require 'bake/toolchain/errorparser/gcc_linker_error_parser'
|
6
|
+
|
7
|
+
module Bake
|
8
|
+
module Toolchain
|
9
|
+
|
10
|
+
def self.getGccVersion
|
11
|
+
gccVersionStr = `g++ --version`
|
12
|
+
splitted = gccVersionStr.split("\n")[0].split(" ")
|
13
|
+
return splitted[splitted.length-1].split(".").map { |v| v.to_i }
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.getGccPlatform
|
17
|
+
`g++ -dumpmachine`
|
18
|
+
end
|
19
|
+
|
20
|
+
GCCChain = Provider.add("GCC")
|
21
|
+
|
22
|
+
GCCChain[:COMPILER][:CPP].update({
|
23
|
+
:COMMAND => "g++",
|
24
|
+
:DEFINE_FLAG => "-D",
|
25
|
+
:OBJECT_FILE_FLAG => "-o",
|
26
|
+
:OBJ_FLAG_SPACE => true,
|
27
|
+
:INCLUDE_PATH_FLAG => "-I",
|
28
|
+
:COMPILE_FLAGS => "-c ",
|
29
|
+
:DEP_FLAGS => "-MD -MF",
|
30
|
+
:DEP_FLAGS_SPACE => true,
|
31
|
+
:PREPRO_FLAGS => "-E -P"
|
32
|
+
})
|
33
|
+
|
34
|
+
GCCChain[:COMPILER][:C] = Utils.deep_copy(GCCChain[:COMPILER][:CPP])
|
35
|
+
GCCChain[:COMPILER][:C][:SOURCE_FILE_ENDINGS] = Provider.default[:COMPILER][:C][:SOURCE_FILE_ENDINGS]
|
36
|
+
GCCChain[:COMPILER][:C][:COMMAND] = "gcc"
|
37
|
+
|
38
|
+
GCCChain[:COMPILER][:ASM] = Utils.deep_copy(GCCChain[:COMPILER][:C])
|
39
|
+
GCCChain[:COMPILER][:ASM][:SOURCE_FILE_ENDINGS] = Provider.default[:COMPILER][:ASM][:SOURCE_FILE_ENDINGS]
|
40
|
+
|
41
|
+
GCCChain[:ARCHIVER][:COMMAND] = "ar"
|
42
|
+
GCCChain[:ARCHIVER][:ARCHIVE_FLAGS] = "-rc"
|
43
|
+
|
44
|
+
GCCChain[:LINKER][:COMMAND] = "g++"
|
45
|
+
GCCChain[:LINKER][:SCRIPT] = "-T"
|
46
|
+
GCCChain[:LINKER][:USER_LIB_FLAG] = "-l:"
|
47
|
+
GCCChain[:LINKER][:EXE_FLAG] = "-o"
|
48
|
+
GCCChain[:LINKER][:LIB_FLAG] = "-l"
|
49
|
+
GCCChain[:LINKER][:LIB_PATH_FLAG] = "-L"
|
50
|
+
|
51
|
+
gccCompilerErrorParser = GCCCompilerErrorParser.new
|
52
|
+
GCCChain[:COMPILER][:C][:ERROR_PARSER] = gccCompilerErrorParser
|
53
|
+
GCCChain[:COMPILER][:CPP][:ERROR_PARSER] = gccCompilerErrorParser
|
54
|
+
GCCChain[:COMPILER][:ASM][:ERROR_PARSER] = gccCompilerErrorParser
|
55
|
+
GCCChain[:ARCHIVER][:ERROR_PARSER] = gccCompilerErrorParser
|
56
|
+
GCCChain[:LINKER][:ERROR_PARSER] = GCCLinkerErrorParser.new
|
57
|
+
|
58
|
+
end
|
59
|
+
end
|
@@ -111,7 +111,7 @@ module Bake
|
|
111
111
|
parse_internal(true, bakeOptions)
|
112
112
|
set_main_dir(Dir.pwd) if @main_dir.nil?
|
113
113
|
|
114
|
-
if
|
114
|
+
if !ENV["QAC_HOME"] || ENV["QAC_HOME"].empty?
|
115
115
|
Bake.formatter.printError("Error: specify the environment variable QAC_HOME.")
|
116
116
|
ExitHelper.exit(1)
|
117
117
|
end
|
@@ -135,14 +135,26 @@ module Bake
|
|
135
135
|
ExitHelper.exit(1)
|
136
136
|
end
|
137
137
|
|
138
|
-
|
138
|
+
plStr = nil
|
139
|
+
gccPlatform = Bake::Toolchain::getGccPlatform
|
140
|
+
if gccPlatform.include?"mingw"
|
139
141
|
plStr = "w64-mingw32"
|
140
|
-
elsif
|
142
|
+
elsif gccPlatform.include?"cygwin"
|
141
143
|
plStr = "pc-cygwin"
|
142
|
-
|
144
|
+
elsif gccPlatform.include?"linux"
|
143
145
|
plStr = "generic-linux"
|
144
146
|
end
|
145
147
|
|
148
|
+
if plStr.nil? # fallback
|
149
|
+
if RUBY_PLATFORM =~ /mingw/
|
150
|
+
plStr = "w64-mingw32"
|
151
|
+
elsif RUBY_PLATFORM =~ /cygwin/
|
152
|
+
plStr = "pc-cygwin"
|
153
|
+
else
|
154
|
+
plStr = "generic-linux"
|
155
|
+
end
|
156
|
+
end
|
157
|
+
|
146
158
|
while (@cct.empty? or gccVersion[0]>=5)
|
147
159
|
@cct = [qac_home + "/config/cct/GNU_GCC-g++_#{gccVersion[0]}.#{gccVersion[1]}-i686-#{plStr}-C++#{@cVersion}.cct"]
|
148
160
|
break if File.exist?@cct[0]
|
@@ -155,11 +167,11 @@ module Bake
|
|
155
167
|
gccVersion[1] = 20
|
156
168
|
end
|
157
169
|
end
|
158
|
-
|
159
|
-
cctInDir = searchCctFile(@main_dir)
|
160
|
-
@cct_append = cctInDir.gsub(/[\\]/,'/') if cctInDir
|
161
170
|
end
|
162
171
|
|
172
|
+
cctInDir = searchCctFile(@main_dir)
|
173
|
+
@cct_append = cctInDir.gsub(/[\\]/,'/') if cctInDir
|
174
|
+
|
163
175
|
if @acf.nil?
|
164
176
|
@acf = qac_home + "/config/acf/default.acf"
|
165
177
|
end
|
data/lib/blocks/block.rb
CHANGED
@@ -1,324 +1,334 @@
|
|
1
|
-
require 'bake/libElement'
|
2
|
-
require 'common/abortException'
|
3
|
-
|
4
|
-
module Bake
|
5
|
-
|
6
|
-
BUILD_PASSED = 0
|
7
|
-
BUILD_FAILED = 1
|
8
|
-
BUILD_ABORTED = 2
|
9
|
-
|
10
|
-
module Blocks
|
11
|
-
|
12
|
-
CC2J = []
|
13
|
-
ALL_BLOCKS = {}
|
14
|
-
ALL_COMPILE_BLOCKS = {}
|
15
|
-
|
16
|
-
class Block
|
17
|
-
|
18
|
-
attr_reader :lib_elements, :projectDir, :library, :config, :projectName, :
|
19
|
-
attr_accessor :visited, :inDeps, :result
|
20
|
-
|
21
|
-
def startupSteps
|
22
|
-
@startupSteps ||= []
|
23
|
-
end
|
24
|
-
|
25
|
-
def preSteps
|
26
|
-
@preSteps ||= []
|
27
|
-
end
|
28
|
-
|
29
|
-
def mainSteps
|
30
|
-
@mainSteps ||= []
|
31
|
-
end
|
32
|
-
|
33
|
-
def postSteps
|
34
|
-
@postSteps ||= []
|
35
|
-
end
|
36
|
-
|
37
|
-
def exitSteps
|
38
|
-
@exitSteps ||= []
|
39
|
-
end
|
40
|
-
|
41
|
-
def dependencies
|
42
|
-
@dependencies ||= []
|
43
|
-
end
|
44
|
-
|
45
|
-
def childs
|
46
|
-
@childs ||= []
|
47
|
-
end
|
48
|
-
|
49
|
-
def parents
|
50
|
-
@parents ||= []
|
51
|
-
end
|
52
|
-
|
53
|
-
def set_library(library)
|
54
|
-
@library = library
|
55
|
-
end
|
56
|
-
|
57
|
-
def initialize(config, referencedConfigs, prebuild)
|
58
|
-
@inDeps = false
|
59
|
-
@prebuild = prebuild
|
60
|
-
@visited = false
|
61
|
-
@library = nil
|
62
|
-
@config = config
|
63
|
-
@referencedConfigs = referencedConfigs
|
64
|
-
@projectName = config.parent.name
|
65
|
-
@configName = config.name
|
66
|
-
@projectDir = config.get_project_dir
|
67
|
-
@@block_counter = 0
|
68
|
-
@result = true
|
69
|
-
|
70
|
-
@lib_elements = Bake::LibElements.calcLibElements(self)
|
71
|
-
end
|
72
|
-
|
73
|
-
def getCompileBlocks()
|
74
|
-
mainSteps.select { |m| Compile === m }
|
75
|
-
end
|
76
|
-
|
77
|
-
def convPath(dir, elem=nil, warnIfLocal=false)
|
78
|
-
if dir.respond_to?("name")
|
79
|
-
d = dir.name
|
80
|
-
elem = dir
|
81
|
-
else
|
82
|
-
d = dir
|
83
|
-
end
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
res
|
118
|
-
end
|
119
|
-
end
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
res
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
@inDeps
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
@
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
1
|
+
require 'bake/libElement'
|
2
|
+
require 'common/abortException'
|
3
|
+
|
4
|
+
module Bake
|
5
|
+
|
6
|
+
BUILD_PASSED = 0
|
7
|
+
BUILD_FAILED = 1
|
8
|
+
BUILD_ABORTED = 2
|
9
|
+
|
10
|
+
module Blocks
|
11
|
+
|
12
|
+
CC2J = []
|
13
|
+
ALL_BLOCKS = {}
|
14
|
+
ALL_COMPILE_BLOCKS = {}
|
15
|
+
|
16
|
+
class Block
|
17
|
+
|
18
|
+
attr_reader :lib_elements, :projectDir, :library, :config, :projectName, :prebuild
|
19
|
+
attr_accessor :visited, :inDeps, :result
|
20
|
+
|
21
|
+
def startupSteps
|
22
|
+
@startupSteps ||= []
|
23
|
+
end
|
24
|
+
|
25
|
+
def preSteps
|
26
|
+
@preSteps ||= []
|
27
|
+
end
|
28
|
+
|
29
|
+
def mainSteps
|
30
|
+
@mainSteps ||= []
|
31
|
+
end
|
32
|
+
|
33
|
+
def postSteps
|
34
|
+
@postSteps ||= []
|
35
|
+
end
|
36
|
+
|
37
|
+
def exitSteps
|
38
|
+
@exitSteps ||= []
|
39
|
+
end
|
40
|
+
|
41
|
+
def dependencies
|
42
|
+
@dependencies ||= []
|
43
|
+
end
|
44
|
+
|
45
|
+
def childs
|
46
|
+
@childs ||= []
|
47
|
+
end
|
48
|
+
|
49
|
+
def parents
|
50
|
+
@parents ||= []
|
51
|
+
end
|
52
|
+
|
53
|
+
def set_library(library)
|
54
|
+
@library = library
|
55
|
+
end
|
56
|
+
|
57
|
+
def initialize(config, referencedConfigs, prebuild)
|
58
|
+
@inDeps = false
|
59
|
+
@prebuild = prebuild
|
60
|
+
@visited = false
|
61
|
+
@library = nil
|
62
|
+
@config = config
|
63
|
+
@referencedConfigs = referencedConfigs
|
64
|
+
@projectName = config.parent.name
|
65
|
+
@configName = config.name
|
66
|
+
@projectDir = config.get_project_dir
|
67
|
+
@@block_counter = 0
|
68
|
+
@result = true
|
69
|
+
|
70
|
+
@lib_elements = Bake::LibElements.calcLibElements(self)
|
71
|
+
end
|
72
|
+
|
73
|
+
def getCompileBlocks()
|
74
|
+
mainSteps.select { |m| Compile === m }
|
75
|
+
end
|
76
|
+
|
77
|
+
def convPath(dir, elem=nil, warnIfLocal=false)
|
78
|
+
if dir.respond_to?("name")
|
79
|
+
d = dir.name
|
80
|
+
elem = dir
|
81
|
+
else
|
82
|
+
d = dir
|
83
|
+
end
|
84
|
+
|
85
|
+
return d if Bake.options.no_autodir
|
86
|
+
|
87
|
+
inc = d.split("/")
|
88
|
+
if (inc[0] == "..") # very simple check, but should be okay for 99.9 % of the cases
|
89
|
+
if elem and Bake.options.verbose >= 2
|
90
|
+
Bake.formatter.printInfo("path starts with \"..\"", elem)
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
res = []
|
95
|
+
|
96
|
+
if (inc[0] == @projectName) # prio 1: the real path magic
|
97
|
+
resPathMagic = inc[1..-1].join("/") # within self
|
98
|
+
resPathMagic = "." if resPathMagic == ""
|
99
|
+
res << resPathMagic
|
100
|
+
elsif @referencedConfigs.include?(inc[0])
|
101
|
+
dirOther = @referencedConfigs[inc[0]].first.parent.get_project_dir
|
102
|
+
resPathMagic = File.rel_from_to_project(@projectDir, dirOther, false)
|
103
|
+
postfix = inc[1..-1].join("/")
|
104
|
+
resPathMagic = resPathMagic + "/" + postfix if postfix != ""
|
105
|
+
resPathMagic = "." if resPathMagic == ""
|
106
|
+
res << resPathMagic
|
107
|
+
end
|
108
|
+
|
109
|
+
if File.exists?(@projectDir + "/" + d) # prio 2: local, e.g. "include"
|
110
|
+
res << d
|
111
|
+
end
|
112
|
+
|
113
|
+
# prioo 3: check if dir exists without Project.meta entry
|
114
|
+
Bake.options.roots.each do |r|
|
115
|
+
absIncDir = r+"/"+d
|
116
|
+
if File.exists?(absIncDir)
|
117
|
+
res << File.rel_from_to_project(@projectDir,absIncDir,false)
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
121
|
+
return d if res.empty? # prio 4: fallback, no path found
|
122
|
+
|
123
|
+
res = res.map{ |r| Pathname.new(r).cleanpath.to_s }.uniq
|
124
|
+
|
125
|
+
if warnIfLocal && res.length > 1
|
126
|
+
if elem and Bake.options.verbose >= 2
|
127
|
+
Bake.formatter.printInfo("#{d} matches several paths:", elem)
|
128
|
+
puts " #{res[0]} (chosen)"
|
129
|
+
res[1..-1].each { |r| puts " #{r}" }
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
133
|
+
res[0]
|
134
|
+
end
|
135
|
+
|
136
|
+
|
137
|
+
def self.block_counter
|
138
|
+
@@block_counter += 1
|
139
|
+
end
|
140
|
+
|
141
|
+
def self.reset_block_counter
|
142
|
+
@@block_counter = 0
|
143
|
+
end
|
144
|
+
|
145
|
+
def self.set_num_projects(num)
|
146
|
+
@@num_projects = num
|
147
|
+
end
|
148
|
+
|
149
|
+
def executeStep(step, method)
|
150
|
+
begin
|
151
|
+
@result = step.send(method) && @result
|
152
|
+
rescue Bake::SystemCommandFailed => scf
|
153
|
+
@result = false
|
154
|
+
ProcessHelper.killProcess(true)
|
155
|
+
rescue SystemExit => exSys
|
156
|
+
@result = false
|
157
|
+
ProcessHelper.killProcess(true)
|
158
|
+
rescue Exception => ex1
|
159
|
+
@result = false
|
160
|
+
if not Bake::IDEInterface.instance.get_abort
|
161
|
+
Bake.formatter.printError("Error: #{ex1.message}")
|
162
|
+
puts ex1.backtrace if Bake.options.debug
|
163
|
+
end
|
164
|
+
end
|
165
|
+
|
166
|
+
if Bake::IDEInterface.instance.get_abort
|
167
|
+
raise AbortException.new
|
168
|
+
end
|
169
|
+
|
170
|
+
# needed for ctrl-c in Cygwin console
|
171
|
+
#####################################
|
172
|
+
# additionally, the user has to enable raw mode of Cygwin console: "stty raw".
|
173
|
+
# raw mode changes the signals into raw characters.
|
174
|
+
# original problem: Cygwin is compiled with broken control handler config,
|
175
|
+
# which might not be changed due to backward compatibility.
|
176
|
+
# the control handler works only with programs compiled under Cygwin, which is
|
177
|
+
# not true for Windows RubyInstaller packages.
|
178
|
+
ctrl_c_found = false
|
179
|
+
begin
|
180
|
+
while IO.select([$stdin],nil,nil,0) do
|
181
|
+
nextChar = $stdin.sysread(1)
|
182
|
+
if nextChar == "\x03"
|
183
|
+
ctrl_c_found = true
|
184
|
+
end
|
185
|
+
end
|
186
|
+
rescue Exception => e
|
187
|
+
end
|
188
|
+
raise AbortException.new if ctrl_c_found
|
189
|
+
|
190
|
+
return @result
|
191
|
+
end
|
192
|
+
|
193
|
+
def callDeps(method)
|
194
|
+
depResult = true
|
195
|
+
dependencies.each do |dep|
|
196
|
+
depResult = (ALL_BLOCKS[dep].send(method) and depResult)
|
197
|
+
break if not depResult and Bake.options.stopOnFirstError
|
198
|
+
end
|
199
|
+
return depResult
|
200
|
+
end
|
201
|
+
|
202
|
+
def callSteps(method)
|
203
|
+
|
204
|
+
preSteps.each do |step|
|
205
|
+
@result = executeStep(step, method) if @result
|
206
|
+
return false if not @result and Bake.options.stopOnFirstError
|
207
|
+
end unless @prebuild
|
208
|
+
|
209
|
+
mainSteps.each do |step|
|
210
|
+
if !@prebuild || (Library === step)
|
211
|
+
@result = executeStep(step, method) if @result
|
212
|
+
end
|
213
|
+
return false if not @result and Bake.options.stopOnFirstError
|
214
|
+
end
|
215
|
+
|
216
|
+
postSteps.each do |step|
|
217
|
+
@result = executeStep(step, method) if @result
|
218
|
+
return false if not @result and Bake.options.stopOnFirstError
|
219
|
+
end unless @prebuild
|
220
|
+
|
221
|
+
return @result
|
222
|
+
end
|
223
|
+
|
224
|
+
def execute
|
225
|
+
if (@inDeps)
|
226
|
+
if Bake.options.verbose >= 3
|
227
|
+
Bake.formatter.printWarning("While calculating next config, a circular dependency was found including project #{@projectName} with config #{@configName}", @config)
|
228
|
+
end
|
229
|
+
return true
|
230
|
+
end
|
231
|
+
|
232
|
+
return true if (@visited)
|
233
|
+
@visited = true
|
234
|
+
|
235
|
+
@inDeps = true
|
236
|
+
depResult = callDeps(:execute)
|
237
|
+
@inDeps = false
|
238
|
+
return false if not depResult and Bake.options.stopOnFirstError
|
239
|
+
|
240
|
+
Bake::IDEInterface.instance.set_build_info(@projectName, @configName)
|
241
|
+
|
242
|
+
if Bake.options.verbose >= 1
|
243
|
+
typeStr = @prebuild ? "Using" : "Building"
|
244
|
+
Bake.formatter.printAdditionalInfo "**** #{typeStr} #{Block.block_counter} of #{@@num_projects}: #{@projectName} (#{@configName}) ****"
|
245
|
+
end
|
246
|
+
puts "Project path: #{@projectDir}" if Bake.options.projectPaths
|
247
|
+
|
248
|
+
@result = callSteps(:execute)
|
249
|
+
return (depResult && @result)
|
250
|
+
end
|
251
|
+
|
252
|
+
def clean
|
253
|
+
return true if (@visited)
|
254
|
+
@visited = true
|
255
|
+
|
256
|
+
depResult = callDeps(:clean)
|
257
|
+
return false if not depResult and Bake.options.stopOnFirstError
|
258
|
+
|
259
|
+
if Bake.options.verbose >= 2
|
260
|
+
typeStr = @prebuild ? "Checking" : "Cleaning"
|
261
|
+
Bake.formatter.printAdditionalInfo "**** #{typeStr} #{Block.block_counter} of #{@@num_projects}: #{@projectName} (#{@configName}) ****"
|
262
|
+
end
|
263
|
+
|
264
|
+
@result = callSteps(:clean)
|
265
|
+
|
266
|
+
if Bake.options.clobber
|
267
|
+
Dir.chdir(@projectDir) do
|
268
|
+
if File.exist?".bake"
|
269
|
+
puts "Deleting folder .bake" if Bake.options.verbose >= 2
|
270
|
+
FileUtils.rm_rf(".bake")
|
271
|
+
end
|
272
|
+
end
|
273
|
+
end
|
274
|
+
|
275
|
+
return (depResult && @result)
|
276
|
+
end
|
277
|
+
|
278
|
+
def startup
|
279
|
+
return true if (@visited)
|
280
|
+
@visited = true
|
281
|
+
|
282
|
+
depResult = callDeps(:startup)
|
283
|
+
|
284
|
+
if Bake.options.verbose >= 1 and not startupSteps.empty?
|
285
|
+
Bake.formatter.printAdditionalInfo "**** Starting up #{@projectName} (#{@configName}) ****"
|
286
|
+
end
|
287
|
+
|
288
|
+
startupSteps.each do |step|
|
289
|
+
@result = executeStep(step, :startupStep) && @result
|
290
|
+
end
|
291
|
+
|
292
|
+
return (depResult && @result)
|
293
|
+
end
|
294
|
+
|
295
|
+
def exits
|
296
|
+
return true if (@visited)
|
297
|
+
@visited = true
|
298
|
+
|
299
|
+
depResult = callDeps(:exits)
|
300
|
+
|
301
|
+
if Bake.options.verbose >= 1 and not exitSteps.empty?
|
302
|
+
Bake.formatter.printAdditionalInfo "**** Exiting #{@projectName} (#{@configName}) ****"
|
303
|
+
end
|
304
|
+
|
305
|
+
exitSteps.each do |step|
|
306
|
+
@result = executeStep(step, :exitStep) && @result
|
307
|
+
end
|
308
|
+
|
309
|
+
return (depResult && @result)
|
310
|
+
end
|
311
|
+
|
312
|
+
def getSubBlocks(b, method)
|
313
|
+
b.send(method).each do |child_b|
|
314
|
+
if not @otherBlocks.include?child_b and not child_b == self
|
315
|
+
@otherBlocks << child_b
|
316
|
+
getSubBlocks(child_b, method)
|
317
|
+
end
|
318
|
+
end
|
319
|
+
end
|
320
|
+
|
321
|
+
def getBlocks(method)
|
322
|
+
@otherBlocks = []
|
323
|
+
getSubBlocks(self, method)
|
324
|
+
return @otherBlocks
|
325
|
+
end
|
326
|
+
|
327
|
+
end
|
328
|
+
|
329
|
+
|
330
|
+
|
331
|
+
end
|
332
|
+
|
333
|
+
|
324
334
|
end
|