bake-toolkit 2.30.0 → 2.31.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/lib/adapt/config/loader.rb +2 -3
- data/lib/bake/cache.rb +4 -1
- data/lib/bake/config/loader.rb +9 -6
- data/lib/bake/model/loader.rb +7 -1
- data/lib/bake/model/metamodel.rb +9 -0
- data/lib/bake/options/options.rb +4 -1
- data/lib/bake/options/usage.rb +2 -0
- data/lib/bake/subst.rb +1 -1
- data/lib/bake/toolchain/provider.rb +5 -0
- data/lib/bake/util.rb +6 -0
- data/lib/blocks/block.rb +5 -1
- data/lib/blocks/blockBase.rb +24 -15
- data/lib/blocks/compile.rb +23 -10
- data/lib/blocks/executable.rb +5 -2
- data/lib/blocks/has_execute_command.rb +5 -0
- data/lib/blocks/library.rb +8 -3
- data/lib/common/version.rb +1 -1
- data/lib/tocxx.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 591b37562b34be1359a7a53a148d7e1742ea500f
|
4
|
+
data.tar.gz: 78bf6242de07bb51e91a4d910ed65ef606683b29
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fac870359cbe3ba177abb4052466de49c2b314f476b20b3e6aa76305bf11026946421c4b97e6addc16ff3bc581f9648b077e71f827b38bbd3dd92a70e00f7147
|
7
|
+
data.tar.gz: 750652d03d56a383209e6db4110c737e0119d38f7d1f53ab0cfa0beaf6759f173520ee19dad901384ac664da010f47a5131092e8f4a1ab345b653ae39d2a6459
|
data/lib/adapt/config/loader.rb
CHANGED
@@ -29,9 +29,8 @@ module Bake
|
|
29
29
|
configs
|
30
30
|
end
|
31
31
|
|
32
|
-
def self.checkSyntax(configs, filename)
|
32
|
+
def self.checkSyntax(configs, filename, isLocalAdapt = false)
|
33
33
|
Bake::Configs::Checks::commonMetamodelCheck(configs, filename, true)
|
34
|
-
|
35
34
|
configs.each do |c|
|
36
35
|
if not c.extends.empty?
|
37
36
|
Bake.formatter.printError("Attribute 'extends' must not be used in adapt config.",c)
|
@@ -44,7 +43,7 @@ module Bake
|
|
44
43
|
if c.project.empty?
|
45
44
|
Bake.formatter.printError("The corresponding project must be specified.",c)
|
46
45
|
ExitHelper.exit(1)
|
47
|
-
end
|
46
|
+
end if !isLocalAdapt
|
48
47
|
if not ["replace", "remove", "extend", "push_front"].include?c.type
|
49
48
|
Bake.formatter.printError("Allowed types are 'replace', 'remove', 'extend' and 'push_front'.",c)
|
50
49
|
ExitHelper.exit(1)
|
data/lib/bake/cache.rb
CHANGED
@@ -30,7 +30,7 @@ module Bake
|
|
30
30
|
else
|
31
31
|
@cacheFilename = Bake.options.main_dir+"/.bake/Project.meta." + sanitize_filename(Bake.options.build_config) + qacStr + ".cache"
|
32
32
|
end
|
33
|
-
FileUtils.mkdir_p(File.dirname(@cacheFilename))
|
33
|
+
FileUtils.mkdir_p(File.dirname(@cacheFilename)) if !Bake.options.dry
|
34
34
|
end
|
35
35
|
|
36
36
|
def load_cache
|
@@ -78,6 +78,7 @@ module Bake
|
|
78
78
|
break
|
79
79
|
end
|
80
80
|
end
|
81
|
+
break if cache == nil
|
81
82
|
end
|
82
83
|
end
|
83
84
|
|
@@ -170,6 +171,8 @@ module Bake
|
|
170
171
|
end
|
171
172
|
|
172
173
|
def write_cache(referencedConfigs, adaptConfigs)
|
174
|
+
return if Bake.options.dry
|
175
|
+
|
173
176
|
cache = Cache.new
|
174
177
|
cache.referencedConfigs = referencedConfigs
|
175
178
|
cache.adaptStrings = Bake.options.adapt
|
data/lib/bake/config/loader.rb
CHANGED
@@ -103,10 +103,13 @@ module Bake
|
|
103
103
|
conditionProjPattern = /\A#{c.parent.mainProject.gsub("*", "(\\w*)")}\z/
|
104
104
|
conditionConfPattern = /\A#{c.parent.mainConfig.gsub("*", "(\\w*)")}\z/
|
105
105
|
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
106
|
+
adaptCondition = (c.parent.toolchain == "" || c.parent.toolchain == @defaultToolchainName) &&
|
107
|
+
(c.parent.os == "" || c.parent.os == Utils::OS.name) &&
|
108
|
+
(c.parent.mainProject == "" || !conditionProjPattern.match(@mainProjectName).nil?) &&
|
109
|
+
(c.parent.mainConfig == "" || !conditionConfPattern.match(@mainConfigName).nil?)
|
110
|
+
|
111
|
+
invertLogic = (Bake::Metamodel::Unless === c.parent)
|
112
|
+
next if (adaptCondition && invertLogic) || (!adaptCondition && !invertLogic)
|
110
113
|
|
111
114
|
MergeConfig.new(c, config).merge(c.type.to_sym)
|
112
115
|
|
@@ -215,9 +218,9 @@ module Bake
|
|
215
218
|
adaptRoots.each do |adapt|
|
216
219
|
adapt.mainProject = @mainProjectName if adapt.mainProject == "__THIS__"
|
217
220
|
adaptConfigs = adapt.getConfig
|
218
|
-
AdaptConfig.checkSyntax(adaptConfigs, filename)
|
221
|
+
AdaptConfig.checkSyntax(adaptConfigs, filename, true)
|
219
222
|
adaptConfigs.each do |ac|
|
220
|
-
ac.project = proj.name if ac.project == "__THIS__"
|
223
|
+
ac.project = proj.name if ac.project == "__THIS__" || ac.project == ""
|
221
224
|
end
|
222
225
|
@adaptConfigs.concat(adaptConfigs)
|
223
226
|
end
|
data/lib/bake/model/loader.rb
CHANGED
@@ -24,7 +24,13 @@ module Bake
|
|
24
24
|
|
25
25
|
fcm = RGen::Util::FileCacheMap.new(".bake", ".cache")
|
26
26
|
fcm.version_info = Version.number
|
27
|
-
|
27
|
+
|
28
|
+
if !Bake.options.dry
|
29
|
+
@DumpFileCache = RGen::Fragment::DumpFileCache.new(fcm)
|
30
|
+
else
|
31
|
+
@DumpFileCache = nil
|
32
|
+
end
|
33
|
+
|
28
34
|
@model = RGen::Fragment::FragmentedModel.new(:env => @env)
|
29
35
|
end
|
30
36
|
|
data/lib/bake/model/metamodel.rb
CHANGED
@@ -57,11 +57,13 @@ module Bake
|
|
57
57
|
|
58
58
|
class Archiver < ModelElement
|
59
59
|
has_attr 'command', String, :defaultValueLiteral => ""
|
60
|
+
has_attr 'prefix', String, :defaultValueLiteral => "$(ArchiverPrefix)"
|
60
61
|
contains_many 'flags', Flags, 'parent'
|
61
62
|
end
|
62
63
|
|
63
64
|
class Linker < ModelElement
|
64
65
|
has_attr 'command', String, :defaultValueLiteral => ""
|
66
|
+
has_attr 'prefix', String, :defaultValueLiteral => "$(LinkerPrefix)"
|
65
67
|
contains_many 'flags', Flags, 'parent'
|
66
68
|
contains_many 'libprefixflags', LibPrefixFlags, 'parent'
|
67
69
|
contains_many 'libpostfixflags', LibPostfixFlags, 'parent'
|
@@ -70,6 +72,7 @@ module Bake
|
|
70
72
|
class Compiler < ModelElement
|
71
73
|
has_attr 'ctype', CompilerType
|
72
74
|
has_attr 'command', String, :defaultValueLiteral => ""
|
75
|
+
has_attr 'prefix', String, :defaultValueLiteral => "$(CompilerPrefix)"
|
73
76
|
contains_many 'define', Define, 'parent'
|
74
77
|
contains_many 'flags', Flags, 'parent'
|
75
78
|
contains_one 'internalDefines', InternalDefines, 'parent'
|
@@ -300,6 +303,12 @@ module Bake
|
|
300
303
|
contains_many 'config', BaseConfig_INTERNAL, 'parent'
|
301
304
|
end
|
302
305
|
|
306
|
+
class If < Adapt
|
307
|
+
end
|
308
|
+
|
309
|
+
class Unless < Adapt
|
310
|
+
end
|
311
|
+
|
303
312
|
class Project < ModelElement
|
304
313
|
has_attr 'default', String, :defaultValueLiteral => ""
|
305
314
|
contains_one 'description', Description, 'parent'
|
data/lib/bake/options/options.rb
CHANGED
@@ -20,7 +20,7 @@ module Bake
|
|
20
20
|
attr_accessor :build_config, :nocache, :analyze, :eclipseOrder, :envToolchain, :showConfigs
|
21
21
|
attr_reader :main_dir, :project, :filename, :main_project_name, :buildDirDelimiter, :dot, :cc2j_filename # String
|
22
22
|
attr_reader :roots, :include_filter, :exclude_filter, :adapt # String List
|
23
|
-
attr_reader :conversion_info, :stopOnFirstError, :clean, :rebuild, :show_includes, :show_includes_and_defines, :projectPaths, :qac # Boolean
|
23
|
+
attr_reader :conversion_info, :stopOnFirstError, :clean, :rebuild, :show_includes, :show_includes_and_defines, :projectPaths, :qac, :dry # Boolean
|
24
24
|
attr_reader :linkOnly, :compileOnly, :no_autodir, :clobber, :docu, :debug, :prepro, :oldLinkOrder, :prebuild, :printTime, :json, :wparse # Boolean
|
25
25
|
attr_reader :threads, :socket # Fixnum
|
26
26
|
attr_reader :vars # map
|
@@ -32,6 +32,7 @@ module Bake
|
|
32
32
|
def initialize(argv)
|
33
33
|
super(argv)
|
34
34
|
|
35
|
+
@dry = false
|
35
36
|
@filelist = nil
|
36
37
|
@qac = false
|
37
38
|
@projectPaths = false
|
@@ -133,6 +134,8 @@ module Bake
|
|
133
134
|
add_option(["--doc", "--show_doc" ], lambda { Doc.show })
|
134
135
|
add_option(["--install-doc", "--install_doc" ], lambda { Doc.install })
|
135
136
|
|
137
|
+
add_option(["--dry" ], lambda { @dry = true })
|
138
|
+
|
136
139
|
add_option(["--version" ], lambda { Bake::Usage.version })
|
137
140
|
add_option(["--list", "--show_configs" ], lambda { @showConfigs = true })
|
138
141
|
add_option(["--compilation-db" ], lambda { |x,dummy| @cc2j_filename = (x ? x : "compilation-db.json" )})
|
data/lib/bake/options/usage.rb
CHANGED
@@ -59,6 +59,8 @@ module Bake
|
|
59
59
|
puts " --version Print version."
|
60
60
|
puts " --time Print elapsed time at the end."
|
61
61
|
puts " --doc Open documentation in browser"
|
62
|
+
puts " --dry No changes to the file system, no external processes like the compiler are called."
|
63
|
+
puts " Exceptions: some special command line options like --create or --dot and 'cmd's of 'Set's."
|
62
64
|
puts " --install-doc If installed, --doc opens the offline docu, otherwise it's online. You may need super user rights to enhance the bake-toolkit installation."
|
63
65
|
puts " -h, --help Print this help."
|
64
66
|
puts " --license Print the license."
|
data/lib/bake/subst.rb
CHANGED
@@ -264,7 +264,7 @@ module Bake
|
|
264
264
|
elsif ENV[var]
|
265
265
|
substStr << ENV[var]
|
266
266
|
else
|
267
|
-
if Bake.options.verbose >= 2
|
267
|
+
if Bake.options.verbose >= 2 && !(["CompilerPrefix", "ArchiverPrefix", "LinkerPrefix"].include?(var))
|
268
268
|
msg = "Substitute variable '$(#{var})' with empty string"
|
269
269
|
if elem
|
270
270
|
Bake.formatter.printInfo(msg, elem)
|
@@ -15,6 +15,7 @@ module Bake
|
|
15
15
|
{
|
16
16
|
:CPP => {
|
17
17
|
:COMMAND => "",
|
18
|
+
:PREFIX => "$(CompilerPrefix)",
|
18
19
|
:DEFINE_FLAG => "",
|
19
20
|
:OBJECT_FILE_FLAG => "",
|
20
21
|
:OBJECT_FILE_ENDING => ".o",
|
@@ -34,6 +35,7 @@ module Bake
|
|
34
35
|
},
|
35
36
|
:C => {
|
36
37
|
:COMMAND => "",
|
38
|
+
:PREFIX => "$(CompilerPrefix)",
|
37
39
|
:DEFINE_FLAG => "",
|
38
40
|
:OBJECT_FILE_FLAG => "",
|
39
41
|
:OBJECT_FILE_ENDING => ".o",
|
@@ -53,6 +55,7 @@ module Bake
|
|
53
55
|
},
|
54
56
|
:ASM => {
|
55
57
|
:COMMAND => "",
|
58
|
+
:PREFIX => "$(CompilerPrefix)",
|
56
59
|
:DEFINE_FLAG => "",
|
57
60
|
:OBJECT_FILE_FLAG => "",
|
58
61
|
:OBJECT_FILE_ENDING => ".o",
|
@@ -75,6 +78,7 @@ module Bake
|
|
75
78
|
:ARCHIVER =>
|
76
79
|
{
|
77
80
|
:COMMAND => "",
|
81
|
+
:PREFIX => "$(ArchiverPrefix)",
|
78
82
|
:ARCHIVE_FLAGS => "",
|
79
83
|
:ARCHIVE_FLAGS_SPACE => true,
|
80
84
|
:FLAGS => "",
|
@@ -84,6 +88,7 @@ module Bake
|
|
84
88
|
:LINKER =>
|
85
89
|
{
|
86
90
|
:COMMAND => "",
|
91
|
+
:PREFIX => "$(LinkerPrefix)",
|
87
92
|
:MUST_FLAGS => "",
|
88
93
|
:SCRIPT => "",
|
89
94
|
:USER_LIB_FLAG => "",
|
data/lib/bake/util.rb
CHANGED
@@ -60,6 +60,7 @@ end
|
|
60
60
|
def integrateLinker(tcs, linker)
|
61
61
|
return tcs unless linker
|
62
62
|
tcs[:LINKER][:COMMAND] = linker.command if linker.command != ""
|
63
|
+
tcs[:LINKER][:PREFIX] = linker.prefix if linker.prefix != ""
|
63
64
|
tcs[:LINKER][:FLAGS] = adjustFlags(tcs[:LINKER][:FLAGS], linker.flags)
|
64
65
|
tcs[:LINKER][:LIB_PREFIX_FLAGS] = adjustFlags(tcs[:LINKER][:LIB_PREFIX_FLAGS], linker.libprefixflags)
|
65
66
|
tcs[:LINKER][:LIB_POSTFIX_FLAGS] = adjustFlags(tcs[:LINKER][:LIB_POSTFIX_FLAGS], linker.libpostfixflags)
|
@@ -68,6 +69,7 @@ end
|
|
68
69
|
def integrateArchiver(tcs, archiver)
|
69
70
|
return tcs unless archiver
|
70
71
|
tcs[:ARCHIVER][:COMMAND] = archiver.command if archiver.command != ""
|
72
|
+
tcs[:ARCHIVER][:PREFIX] = archiver.prefix if archiver.prefix != ""
|
71
73
|
tcs[:ARCHIVER][:FLAGS] = adjustFlags(tcs[:ARCHIVER][:FLAGS], archiver.flags)
|
72
74
|
end
|
73
75
|
|
@@ -76,6 +78,10 @@ def integrateCompiler(tcs, compiler, type)
|
|
76
78
|
if compiler.respond_to?"command"
|
77
79
|
tcs[:COMPILER][type][:COMMAND] = compiler.command if compiler.command != ""
|
78
80
|
end
|
81
|
+
if compiler.respond_to?"prefix"
|
82
|
+
tcs[:COMPILER][type][:PREFIX] = compiler.prefix if compiler.prefix != ""
|
83
|
+
end
|
84
|
+
|
79
85
|
tcs[:COMPILER][type][:FLAGS] = adjustFlags(tcs[:COMPILER][type][:FLAGS], compiler.flags)
|
80
86
|
compiler.define.each do |d|
|
81
87
|
tcs[:COMPILER][type][:DEFINES] << d.str unless tcs[:COMPILER][type][:DEFINES].include? d.str
|
data/lib/blocks/block.rb
CHANGED
@@ -104,6 +104,8 @@ module Bake
|
|
104
104
|
|
105
105
|
res = []
|
106
106
|
|
107
|
+
return d if (inc[0] == "." || inc[0] == "..") # prio 0: force local
|
108
|
+
|
107
109
|
if (inc[0] == @projectName) # prio 1: the real path magic
|
108
110
|
resPathMagic = inc[1..-1].join("/") # within self
|
109
111
|
resPathMagic = "." if resPathMagic == ""
|
@@ -280,7 +282,9 @@ module Bake
|
|
280
282
|
Dir.chdir(@projectDir) do
|
281
283
|
if File.exist?".bake"
|
282
284
|
puts "Deleting folder .bake" if Bake.options.verbose >= 2
|
283
|
-
|
285
|
+
if !Bake.options.dry
|
286
|
+
FileUtils.rm_rf(".bake")
|
287
|
+
end
|
284
288
|
end
|
285
289
|
end
|
286
290
|
end
|
data/lib/blocks/blockBase.rb
CHANGED
@@ -20,7 +20,7 @@ module Bake
|
|
20
20
|
def check_config_file()
|
21
21
|
if File.exists?(@config.file_name) and File.mtime(@config.file_name) > @config_date
|
22
22
|
begin
|
23
|
-
FileUtils.touch(@config.file_name)
|
23
|
+
FileUtils.touch(@config.file_name) if !Bake.options.dry
|
24
24
|
rescue Exception=>e
|
25
25
|
if Bake.options.verbose >= 2
|
26
26
|
Bake.formatter.printWarning("Could not touch #{@config.file_name}: #{e.message}", @config.file_name)
|
@@ -30,6 +30,7 @@ module Bake
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def self.prepareOutput(filename)
|
33
|
+
return if Bake.options.dry
|
33
34
|
begin
|
34
35
|
if File.exists?(filename)
|
35
36
|
FileUtils.rm(filename)
|
@@ -61,7 +62,7 @@ module Bake
|
|
61
62
|
if File.exist?cmdLineFile
|
62
63
|
lastCmdLineArray = File.readlines(cmdLineFile)[0];
|
63
64
|
if lastCmdLineArray == cmd.join(" ")
|
64
|
-
FileUtils.touch(cmdLineFile)
|
65
|
+
FileUtils.touch(cmdLineFile) if !Bake.options.dry
|
65
66
|
return true
|
66
67
|
end
|
67
68
|
end
|
@@ -76,7 +77,9 @@ module Bake
|
|
76
77
|
|
77
78
|
def self.writeCmdLineFile(cmd, cmdLineFile)
|
78
79
|
begin
|
79
|
-
|
80
|
+
if !Bake.options.dry
|
81
|
+
File.open(cmdLineFile, 'w') { |f| f.write(cmd.join(" ")) }
|
82
|
+
end
|
80
83
|
rescue Exception => e
|
81
84
|
if Bake.options.debug
|
82
85
|
puts e.message
|
@@ -176,21 +179,27 @@ module Bake
|
|
176
179
|
|
177
180
|
|
178
181
|
def cleanProjectDir
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
buildDir = File.dirname(@block.output_dir)
|
186
|
-
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 "..")
|
187
|
-
puts "Deleting folder #{buildDir}" if Bake.options.verbose >= 2
|
188
|
-
FileUtils.rm_rf(buildDir)
|
182
|
+
if !Bake.options.filename
|
183
|
+
Dir.chdir(@projectDir) do
|
184
|
+
if File.exist?@block.output_dir
|
185
|
+
puts "Deleting folder #{@block.output_dir}" if Bake.options.verbose >= 2
|
186
|
+
if !Bake.options.dry
|
187
|
+
FileUtils.rm_rf(@block.output_dir)
|
189
188
|
end
|
190
|
-
end
|
191
189
|
|
190
|
+
if (@block.tcs[:OUTPUT_DIR] == nil) && (Bake.options.buildDirDelimiter == "/") # in this case all builds are placed in a "build" folder
|
191
|
+
buildDir = File.dirname(@block.output_dir)
|
192
|
+
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 "..")
|
193
|
+
puts "Deleting folder #{buildDir}" if Bake.options.verbose >= 2
|
194
|
+
if !Bake.options.dry
|
195
|
+
FileUtils.rm_rf(buildDir)
|
196
|
+
end
|
197
|
+
end
|
198
|
+
end
|
199
|
+
|
200
|
+
end
|
192
201
|
end
|
193
|
-
end
|
202
|
+
end
|
194
203
|
return true
|
195
204
|
end
|
196
205
|
|
data/lib/blocks/compile.rb
CHANGED
@@ -143,7 +143,8 @@ module Bake
|
|
143
143
|
raise SystemCommandFailed.new
|
144
144
|
end
|
145
145
|
|
146
|
-
cmd = Utils.flagSplit(compiler[:
|
146
|
+
cmd = Utils.flagSplit(compiler[:PREFIX], false)
|
147
|
+
cmd += Utils.flagSplit(compiler[:COMMAND], false)
|
147
148
|
cmd += compiler[:COMPILE_FLAGS].split(" ")
|
148
149
|
|
149
150
|
if dep_filename
|
@@ -190,7 +191,9 @@ module Bake
|
|
190
191
|
if not (cmdLineCheck and BlockBase.isCmdLineEqual?(cmd, cmdLineFile))
|
191
192
|
BlockBase.prepareOutput(object)
|
192
193
|
BlockBase.writeCmdLineFile(cmd, cmdLineFile)
|
193
|
-
success
|
194
|
+
success = true
|
195
|
+
consoleOutput = ""
|
196
|
+
success, consoleOutput = ProcessHelper.run(cmd, false, false) if !Bake.options.dry
|
194
197
|
|
195
198
|
outputType = Bake.options.analyze ? "Analyzing" : (Bake.options.prepro ? "Preprocessing" : "Compiling")
|
196
199
|
incList = process_result(cmd, consoleOutput, compiler[:ERROR_PARSER], "#{outputType} #{source}", reason, success)
|
@@ -225,8 +228,10 @@ module Bake
|
|
225
228
|
deps = dep_splitted.map { |d| d.gsub(/[\\] /,' ').gsub(/[\\]/,'/').strip }.delete_if {|d| d == "" }
|
226
229
|
end
|
227
230
|
rescue Exception => ex1
|
228
|
-
Bake.
|
229
|
-
|
231
|
+
if !Bake.options.dry
|
232
|
+
Bake.formatter.printWarning("Could not read '#{dep_filename}'", projDir)
|
233
|
+
puts ex1.message if Bake.options.debug
|
234
|
+
end
|
230
235
|
return nil
|
231
236
|
end
|
232
237
|
deps
|
@@ -234,7 +239,7 @@ module Bake
|
|
234
239
|
|
235
240
|
# todo: move to toolchain util file
|
236
241
|
def self.write_depfile(deps, dep_filename_conv)
|
237
|
-
if deps
|
242
|
+
if deps && !Bake.options.dry
|
238
243
|
begin
|
239
244
|
File.open(dep_filename_conv, 'wb') do |f|
|
240
245
|
deps.each do |dep|
|
@@ -307,7 +312,7 @@ module Bake
|
|
307
312
|
end
|
308
313
|
compileJobs.join
|
309
314
|
|
310
|
-
if Bake.options.filelist
|
315
|
+
if Bake.options.filelist && !Bake.options.dry
|
311
316
|
Bake.options.filelist.merge(fileListBlock.merge(fileListBlock))
|
312
317
|
|
313
318
|
FileUtils.mkdir_p(@block.output_dir)
|
@@ -333,7 +338,7 @@ module Bake
|
|
333
338
|
end
|
334
339
|
|
335
340
|
def clean
|
336
|
-
if Bake.options.filename or Bake.options.analyze
|
341
|
+
if (Bake.options.filename or Bake.options.analyze)
|
337
342
|
Dir.chdir(@projectDir) do
|
338
343
|
calcSources(true)
|
339
344
|
@source_files.each do |source|
|
@@ -343,18 +348,24 @@ module Bake
|
|
343
348
|
object = get_object_file(source)
|
344
349
|
if File.exist?object
|
345
350
|
puts "Deleting file #{object}" if Bake.options.verbose >= 2
|
346
|
-
|
351
|
+
if !Bake.options.dry
|
352
|
+
FileUtils.rm_rf(object)
|
353
|
+
end
|
347
354
|
end
|
348
355
|
if not Bake.options.analyze
|
349
356
|
dep_filename = calcDepFile(object, type)
|
350
357
|
if dep_filename and File.exist?dep_filename
|
351
358
|
puts "Deleting file #{dep_filename}" if Bake.options.verbose >= 2
|
352
|
-
|
359
|
+
if !Bake.options.dry
|
360
|
+
FileUtils.rm_rf(dep_filename)
|
361
|
+
end
|
353
362
|
end
|
354
363
|
cmdLineFile = calcCmdlineFile(object)
|
355
364
|
if File.exist?cmdLineFile
|
356
365
|
puts "Deleting file #{cmdLineFile}" if Bake.options.verbose >= 2
|
357
|
-
|
366
|
+
if !Bake.options.dry
|
367
|
+
FileUtils.rm_rf(cmdLineFile)
|
368
|
+
end
|
358
369
|
end
|
359
370
|
end
|
360
371
|
end
|
@@ -395,6 +406,8 @@ module Bake
|
|
395
406
|
source_files = Set.new
|
396
407
|
@config.files.each do |sources|
|
397
408
|
p = sources.name
|
409
|
+
p = p[2..-1] if p.start_with?"./"
|
410
|
+
|
398
411
|
res = Dir.glob(p).sort
|
399
412
|
if res.length == 0 and cleaning == false
|
400
413
|
if not p.include?"*" and not p.include?"?"
|
data/lib/blocks/executable.rb
CHANGED
@@ -108,7 +108,8 @@ module Bake
|
|
108
108
|
|
109
109
|
linker = @block.tcs[:LINKER]
|
110
110
|
|
111
|
-
cmd = Utils.flagSplit(linker[:
|
111
|
+
cmd = Utils.flagSplit(linker[:PREFIX], false)
|
112
|
+
cmd += Utils.flagSplit(linker[:COMMAND], false) # g++
|
112
113
|
cmd += linker[:MUST_FLAGS].split(" ")
|
113
114
|
cmd += Bake::Utils::flagSplit(linker[:FLAGS],true)
|
114
115
|
|
@@ -147,7 +148,9 @@ module Bake
|
|
147
148
|
|
148
149
|
printCmd(cmdLinePrint, "Linking #{@exe_name}", reason, false)
|
149
150
|
BlockBase.writeCmdLineFile(cmd, cmdLineFile)
|
150
|
-
success
|
151
|
+
success = true
|
152
|
+
consoleOutput = ""
|
153
|
+
success, consoleOutput = ProcessHelper.run(cmd, false, false, outPipe) if !Bake.options.dry
|
151
154
|
process_result(cmdLinePrint, consoleOutput, linker[:ERROR_PARSER], nil, reason, success)
|
152
155
|
|
153
156
|
check_config_file()
|
@@ -5,6 +5,11 @@ module Bake
|
|
5
5
|
module HasExecuteCommand
|
6
6
|
|
7
7
|
def executeCommand(commandLine, ignoreStr=nil, exitCodeArray = [0], echo = "on")
|
8
|
+
if Bake.options.dry
|
9
|
+
puts commandLine
|
10
|
+
return true
|
11
|
+
end
|
12
|
+
|
8
13
|
puts commandLine if (Bake.options.verbose >= 1 && echo != "off") || Bake.options.verbose >= 3
|
9
14
|
puts "(executed in '#{@projectDir}')" if Bake.options.verbose >= 3
|
10
15
|
cmd_result = false
|
data/lib/blocks/library.rb
CHANGED
@@ -80,7 +80,8 @@ module Bake
|
|
80
80
|
end
|
81
81
|
archiver = @block.tcs[:ARCHIVER]
|
82
82
|
|
83
|
-
cmd = Utils.flagSplit(archiver[:
|
83
|
+
cmd = Utils.flagSplit(archiver[:PREFIX], false)
|
84
|
+
cmd += Utils.flagSplit(archiver[:COMMAND], false) # ar
|
84
85
|
cmd += Bake::Utils::flagSplit(archiver[:FLAGS],true) # --all_load
|
85
86
|
cmd += archiver[:ARCHIVE_FLAGS].split(" ")
|
86
87
|
|
@@ -98,7 +99,9 @@ module Bake
|
|
98
99
|
BlockBase.prepareOutput(@archive_name)
|
99
100
|
|
100
101
|
BlockBase.writeCmdLineFile(cmd, cmdLineFile)
|
101
|
-
success
|
102
|
+
success = true
|
103
|
+
consoleOutput = ""
|
104
|
+
success, consoleOutput = ProcessHelper.run(cmd, false, false) if !Bake.options.dry
|
102
105
|
process_result(cmd, consoleOutput, archiver[:ERROR_PARSER], "Creating #{@archive_name}", reason, success)
|
103
106
|
|
104
107
|
check_config_file()
|
@@ -114,7 +117,9 @@ module Bake
|
|
114
117
|
@objects = Dir.glob("#{@block.output_dir}/**/*.o")
|
115
118
|
if !@objects.empty? && File.exist?(@archive_name)
|
116
119
|
puts "Deleting file #{@archive_name}" if Bake.options.verbose >= 2
|
117
|
-
|
120
|
+
if !Bake.options.dry
|
121
|
+
FileUtils.rm_rf(@archive_name)
|
122
|
+
end
|
118
123
|
end
|
119
124
|
end
|
120
125
|
else
|
data/lib/common/version.rb
CHANGED
data/lib/tocxx.rb
CHANGED
@@ -538,7 +538,7 @@ module Bake
|
|
538
538
|
File.write(Bake.options.cc2j_filename, JSON.pretty_generate(Blocks::CC2J))
|
539
539
|
end
|
540
540
|
|
541
|
-
if Bake.options.filelist
|
541
|
+
if Bake.options.filelist && !Bake.options.dry
|
542
542
|
mainBlock = Blocks::ALL_BLOCKS[Bake.options.main_project_name+","+Bake.options.build_config]
|
543
543
|
Dir.chdir(mainBlock.projectDir) do
|
544
544
|
FileUtils.mkdir_p(mainBlock.output_dir)
|
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.31.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: 2017-
|
11
|
+
date: 2017-02-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rtext
|