bake-toolkit 2.23.12 → 2.24.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/bakeclean +32 -0
- data/bin/bakeqac +13 -6
- data/documentation/_build/html/_sources/changelog.txt +9 -0
- data/documentation/_build/html/_sources/concepts/prebuild.txt +1 -0
- data/documentation/_build/html/_sources/index.txt +1 -1
- data/documentation/_build/html/_sources/tips_and_tricks/bakeclean.txt +11 -0
- data/documentation/_build/html/_sources/tips_and_tricks/tips_and_tricks.txt +1 -0
- data/documentation/_build/html/changelog.html +11 -0
- data/documentation/_build/html/concepts/concepts.html +1 -1
- data/documentation/_build/html/concepts/prebuild.html +2 -1
- data/documentation/_build/html/index.html +5 -4
- data/documentation/_build/html/searchindex.js +1 -1
- data/documentation/_build/html/tips_and_tricks/bakeclean.html +170 -0
- data/documentation/_build/html/tips_and_tricks/tips_and_tricks.html +1 -0
- data/lib/bake/options/options.rb +322 -320
- data/lib/bake/options/usage.rb +77 -77
- data/lib/bake/subst.rb +4 -3
- data/lib/bake/toolchain/provider.rb +154 -147
- data/lib/bakeclean/options/options.rb +32 -0
- data/lib/bakeqac/options/options.rb +4 -1
- data/lib/blocks/block.rb +7 -9
- data/lib/blocks/blockBase.rb +26 -3
- data/lib/blocks/executable.rb +2 -8
- data/lib/blocks/library.rb +27 -13
- data/lib/common/version.rb +5 -1
- metadata +7 -2
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'common/options/parser'
|
2
|
+
require 'common/version'
|
3
|
+
|
4
|
+
module Bake
|
5
|
+
|
6
|
+
class BakecleanOptions < Parser
|
7
|
+
attr_reader :preview # Boolean
|
8
|
+
|
9
|
+
def initialize(argv)
|
10
|
+
super(argv)
|
11
|
+
|
12
|
+
@preview = false
|
13
|
+
|
14
|
+
add_option(["--preview" ], lambda { @preview = true })
|
15
|
+
add_option(["-h", "--help" ], lambda { usage; ExitHelper.exit(0) })
|
16
|
+
add_option(["--version" ], lambda { Bake::Version.printBakecleanVersion; ExitHelper.exit(0) })
|
17
|
+
end
|
18
|
+
|
19
|
+
def usage
|
20
|
+
puts "\nUsage: bakeclean [options]"
|
21
|
+
puts " --preview Only shows the folder which would be deleted."
|
22
|
+
puts " --version Print version."
|
23
|
+
puts " -h, --help Print this help."
|
24
|
+
end
|
25
|
+
|
26
|
+
def parse_options()
|
27
|
+
parse_internal(false)
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
@@ -6,13 +6,14 @@ module Bake
|
|
6
6
|
|
7
7
|
class BakeqacOptions < Parser
|
8
8
|
attr_reader :rcf, :acf, :qacdata, :qacstep, :qac_home, :cct_append # String
|
9
|
-
attr_reader :c11, :c14, :qacfilter, :qacnoformat, :qacunittest, :qacdoc # Boolean
|
9
|
+
attr_reader :c11, :c14, :qacfilter, :qacnoformat, :qacunittest, :qacdoc, :cct_patch # Boolean
|
10
10
|
attr_reader :cct # Array
|
11
11
|
attr_reader :qacretry # int
|
12
12
|
|
13
13
|
def initialize(argv)
|
14
14
|
super(argv)
|
15
15
|
|
16
|
+
@cct_patch = false
|
16
17
|
@cct_append = nil
|
17
18
|
@main_dir = nil
|
18
19
|
@cVersion = ""
|
@@ -37,6 +38,7 @@ module Bake
|
|
37
38
|
add_option(["--cct" ], lambda { |x| @cct << x.gsub(/\\/,"/") })
|
38
39
|
add_option(["--rcf" ], lambda { |x| @rcf = x.gsub(/\\/,"/") })
|
39
40
|
add_option(["--acf" ], lambda { |x| @acf = x.gsub(/\\/,"/") })
|
41
|
+
add_option(["--qaccctpatch" ], lambda { @cct_patch = true })
|
40
42
|
add_option(["--qacdata" ], lambda { |x| @qacdata = x.gsub(/\\/,"/") })
|
41
43
|
add_option(["--qacstep" ], lambda { |x| @qacstep = x })
|
42
44
|
add_option(["--qacnofilter" ], lambda { @qacfilter = false })
|
@@ -58,6 +60,7 @@ module Bake
|
|
58
60
|
puts " a file named qac.cct will be searched up to root and also used if found."
|
59
61
|
puts " --rcf <file> Set a specific rule config file. If not specified, $(QAC_HOME)/config/rcf/mcpp-1_5_1-en_US.rcf will be used."
|
60
62
|
puts " --acf <file> Set a specific analysis config file, otherwise $(QAC_HOME)/config/acf/default.acf will be used."
|
63
|
+
puts " --qaccctpatch If specified, some adaptions to cct are made. Might improve the result - no guarantee."
|
61
64
|
puts " --qacdata <dir> QAC writes data into this folder. Default is <working directory>/.qacdata."
|
62
65
|
puts " --qacstep admin|analyze|view Steps can be ORed. Per default all steps will be executed."
|
63
66
|
puts " --qacnofilter Output will be printed immediately and unfiltered. Per default filters are used to reduce noise."
|
data/lib/blocks/block.rb
CHANGED
@@ -194,17 +194,19 @@ module Bake
|
|
194
194
|
preSteps.each do |step|
|
195
195
|
@result = executeStep(step, method) if @result
|
196
196
|
return false if not @result and Bake.options.stopOnFirstError
|
197
|
-
end
|
197
|
+
end unless @prebuild
|
198
198
|
|
199
199
|
mainSteps.each do |step|
|
200
|
-
|
200
|
+
if !@prebuild || (Library === step)
|
201
|
+
@result = executeStep(step, method) if @result
|
202
|
+
end
|
201
203
|
return false if not @result and Bake.options.stopOnFirstError
|
202
204
|
end
|
203
205
|
|
204
206
|
postSteps.each do |step|
|
205
207
|
@result = executeStep(step, method) if @result
|
206
208
|
return false if not @result and Bake.options.stopOnFirstError
|
207
|
-
end
|
209
|
+
end unless @prebuild
|
208
210
|
|
209
211
|
return @result
|
210
212
|
end
|
@@ -228,13 +230,11 @@ module Bake
|
|
228
230
|
Bake::IDEInterface.instance.set_build_info(@projectName, @configName)
|
229
231
|
|
230
232
|
if Bake.options.verbose >= 1
|
231
|
-
typeStr = @prebuild ? "
|
233
|
+
typeStr = @prebuild ? "Using" : "Building"
|
232
234
|
Bake.formatter.printAdditionalInfo "**** #{typeStr} #{Block.block_counter} of #{@@num_projects}: #{@projectName} (#{@configName}) ****"
|
233
235
|
end
|
234
236
|
puts "Project path: #{@projectDir}" if Bake.options.projectPaths
|
235
237
|
|
236
|
-
return depResult if @prebuild
|
237
|
-
|
238
238
|
@result = callSteps(:execute)
|
239
239
|
return (depResult && @result)
|
240
240
|
end
|
@@ -247,12 +247,10 @@ module Bake
|
|
247
247
|
return false if not depResult and Bake.options.stopOnFirstError
|
248
248
|
|
249
249
|
if Bake.options.verbose >= 2
|
250
|
-
typeStr = @prebuild ? "
|
250
|
+
typeStr = @prebuild ? "Checking" : "Cleaning"
|
251
251
|
Bake.formatter.printAdditionalInfo "**** #{typeStr} #{Block.block_counter} of #{@@num_projects}: #{@projectName} (#{@configName}) ****"
|
252
252
|
end
|
253
253
|
|
254
|
-
return depResult if @prebuild
|
255
|
-
|
256
254
|
@result = callSteps(:clean)
|
257
255
|
|
258
256
|
if Bake.options.clobber
|
data/lib/blocks/blockBase.rb
CHANGED
@@ -99,10 +99,13 @@ module Bake
|
|
99
99
|
if @tcs[:OUTPUT_DIR] != nil
|
100
100
|
p = @block.convPath(@tcs[:OUTPUT_DIR])
|
101
101
|
@output_dir = p
|
102
|
-
elsif isMainProject?
|
103
|
-
@output_dir = "build" + Bake.options.buildDirDelimiter + Bake.options.build_config
|
104
102
|
else
|
105
|
-
|
103
|
+
qacPart = Bake.options.qac ? (".qac" + Bake.options.buildDirDelimiter) : ""
|
104
|
+
if isMainProject?
|
105
|
+
@output_dir = "build" + Bake.options.buildDirDelimiter + qacPart + Bake.options.build_config
|
106
|
+
else
|
107
|
+
@output_dir = "build" + Bake.options.buildDirDelimiter + qacPart + @config.name + "_" + Bake.options.main_project_name + "_" + Bake.options.build_config
|
108
|
+
end
|
106
109
|
end
|
107
110
|
end
|
108
111
|
|
@@ -199,6 +202,26 @@ module Bake
|
|
199
202
|
incList
|
200
203
|
end
|
201
204
|
|
205
|
+
|
206
|
+
def cleanProjectDir
|
207
|
+
Dir.chdir(@projectDir) do
|
208
|
+
if File.exist?@output_dir
|
209
|
+
puts "Deleting folder #{@output_dir}" if Bake.options.verbose >= 2
|
210
|
+
FileUtils.rm_rf(@output_dir)
|
211
|
+
|
212
|
+
if (@tcs[:OUTPUT_DIR] == nil) && (Bake.options.buildDirDelimiter == "/") # in this case all builds are placed in a "build" folder
|
213
|
+
buildDir = File.dirname(@output_dir)
|
214
|
+
if (File.basename(buildDir) == "build") && (Dir.entries(buildDir).size == 2)# double check if it's really "build" and check if it's empty (except "." and "..")
|
215
|
+
puts "Deleting folder #{buildDir}" if Bake.options.verbose >= 2
|
216
|
+
FileUtils.rm_rf(buildDir)
|
217
|
+
end
|
218
|
+
end
|
219
|
+
|
220
|
+
end
|
221
|
+
end unless Bake.options.filename
|
222
|
+
return true
|
223
|
+
end
|
224
|
+
|
202
225
|
end
|
203
226
|
end
|
204
227
|
end
|
data/lib/blocks/executable.rb
CHANGED
@@ -24,7 +24,7 @@ module Bake
|
|
24
24
|
if not @config.artifactName.nil? and @config.artifactName.name != ""
|
25
25
|
baseFilename = @config.artifactName.name
|
26
26
|
else
|
27
|
-
baseFilename = "#{@projectName}#{@tcs
|
27
|
+
baseFilename = "#{@projectName}#{Bake::Toolchain.outputEnding(@tcs)}"
|
28
28
|
end
|
29
29
|
@exe_name ||= File.join([@output_dir, baseFilename])
|
30
30
|
end
|
@@ -160,13 +160,7 @@ module Bake
|
|
160
160
|
end
|
161
161
|
|
162
162
|
def clean
|
163
|
-
|
164
|
-
if File.exist?@output_dir
|
165
|
-
puts "Deleting folder #{@output_dir}" if Bake.options.verbose >= 2
|
166
|
-
FileUtils.rm_rf(@output_dir)
|
167
|
-
end
|
168
|
-
end unless Bake.options.filename
|
169
|
-
return true
|
163
|
+
return cleanProjectDir()
|
170
164
|
end
|
171
165
|
|
172
166
|
end
|
data/lib/blocks/library.rb
CHANGED
@@ -41,7 +41,7 @@ module Bake
|
|
41
41
|
aTime = File.mtime(@archive_name)
|
42
42
|
|
43
43
|
# sources
|
44
|
-
@
|
44
|
+
@objects.each do |obj|
|
45
45
|
return "because object #{obj} does not exist" if not File.exists?(obj)
|
46
46
|
return "because object #{obj} is newer than executable" if aTime < File.mtime(obj)
|
47
47
|
end
|
@@ -52,9 +52,21 @@ module Bake
|
|
52
52
|
def execute
|
53
53
|
|
54
54
|
Dir.chdir(@projectDir) do
|
55
|
-
|
56
|
-
|
57
|
-
|
55
|
+
|
56
|
+
@objects = @compileBlock.objects
|
57
|
+
if !@block.prebuild
|
58
|
+
if @objects.empty?
|
59
|
+
puts "No source files, library won't be created" if Bake.options.verbose >= 2
|
60
|
+
return true
|
61
|
+
end
|
62
|
+
else
|
63
|
+
@objects = Dir.glob("#{@output_dir}/**/*.o")
|
64
|
+
if @objects.empty?
|
65
|
+
if !File.exists?(@archive_name)
|
66
|
+
puts "No object files, library won't be created" if Bake.options.verbose >= 2
|
67
|
+
end
|
68
|
+
return true
|
69
|
+
end
|
58
70
|
end
|
59
71
|
|
60
72
|
cmdLineCheck = false
|
@@ -78,7 +90,7 @@ module Bake
|
|
78
90
|
cmd[cmd.length-1] += @archive_name
|
79
91
|
end
|
80
92
|
|
81
|
-
cmd += @
|
93
|
+
cmd += @objects
|
82
94
|
|
83
95
|
if cmdLineCheck and BlockBase.isCmdLineEqual?(cmd, cmdLineFile)
|
84
96
|
success = true
|
@@ -99,17 +111,19 @@ module Bake
|
|
99
111
|
end
|
100
112
|
|
101
113
|
def clean
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
114
|
+
if @block.prebuild
|
115
|
+
Dir.chdir(@projectDir) do
|
116
|
+
@objects = Dir.glob("#{@output_dir}/**/*.o")
|
117
|
+
if !@objects.empty? && File.exist?(@archive_name)
|
118
|
+
puts "Deleting file #{@archive_name}" if Bake.options.verbose >= 2
|
119
|
+
FileUtils.rm_rf(@archive_name)
|
120
|
+
end
|
106
121
|
end
|
107
|
-
|
108
|
-
|
122
|
+
else
|
123
|
+
return cleanProjectDir()
|
124
|
+
end
|
109
125
|
end
|
110
126
|
|
111
|
-
|
112
127
|
end
|
113
|
-
|
114
128
|
end
|
115
129
|
end
|
data/lib/common/version.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module Bake
|
2
2
|
class Version
|
3
3
|
def self.number
|
4
|
-
"2.
|
4
|
+
"2.24.0"
|
5
5
|
end
|
6
6
|
|
7
7
|
def self.printBakeVersion(ry = "")
|
@@ -15,6 +15,10 @@ module Bake
|
|
15
15
|
def self.printBakeqacVersion()
|
16
16
|
printBakeVersion("qac")
|
17
17
|
end
|
18
|
+
|
19
|
+
def self.printBakecleanVersion()
|
20
|
+
printBakeVersion("clean")
|
21
|
+
end
|
18
22
|
end
|
19
23
|
|
20
24
|
expectedRGen = "0.8.2"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bake-toolkit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.24.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Schaal
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rtext
|
@@ -102,12 +102,14 @@ executables:
|
|
102
102
|
- createVSProjects
|
103
103
|
- bake-doc
|
104
104
|
- bakeqac
|
105
|
+
- bakeclean
|
105
106
|
extensions: []
|
106
107
|
extra_rdoc_files: []
|
107
108
|
files:
|
108
109
|
- Rakefile.rb
|
109
110
|
- bin/bake
|
110
111
|
- bin/bake-doc
|
112
|
+
- bin/bakeclean
|
111
113
|
- bin/bakeqac
|
112
114
|
- bin/bakery
|
113
115
|
- bin/createVSProjects
|
@@ -193,6 +195,7 @@ files:
|
|
193
195
|
- documentation/_build/html/_sources/syntax/project_meta_syntax.txt
|
194
196
|
- documentation/_build/html/_sources/syntax/syntax.txt
|
195
197
|
- documentation/_build/html/_sources/syntax/variable_substitutions.txt
|
198
|
+
- documentation/_build/html/_sources/tips_and_tricks/bakeclean.txt
|
196
199
|
- documentation/_build/html/_sources/tips_and_tricks/dot.txt
|
197
200
|
- documentation/_build/html/_sources/tips_and_tricks/how_to_use_bake_with_cygwin.txt
|
198
201
|
- documentation/_build/html/_sources/tips_and_tricks/qac.txt
|
@@ -380,6 +383,7 @@ files:
|
|
380
383
|
- documentation/_build/html/syntax/project_meta_syntax.html
|
381
384
|
- documentation/_build/html/syntax/syntax.html
|
382
385
|
- documentation/_build/html/syntax/variable_substitutions.html
|
386
|
+
- documentation/_build/html/tips_and_tricks/bakeclean.html
|
383
387
|
- documentation/_build/html/tips_and_tricks/dot.html
|
384
388
|
- documentation/_build/html/tips_and_tricks/how_to_use_bake_with_cygwin.html
|
385
389
|
- documentation/_build/html/tips_and_tricks/qac.html
|
@@ -434,6 +438,7 @@ files:
|
|
434
438
|
- lib/bake/toolchain/provider.rb
|
435
439
|
- lib/bake/toolchain/ti.rb
|
436
440
|
- lib/bake/util.rb
|
441
|
+
- lib/bakeclean/options/options.rb
|
437
442
|
- lib/bakeqac/options/options.rb
|
438
443
|
- lib/bakery/buildPattern.rb
|
439
444
|
- lib/bakery/model/language.rb
|