bake-toolkit 2.0.10 → 2.1.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/doc/dyk/lint.html +11 -0
- data/doc/further/change.html +16 -1
- data/doc/index.html +1 -1
- data/doc/syntax/syntax.html +4 -1
- data/lib/bake/cache.rb +1 -1
- data/lib/bake/config/loader.rb +24 -10
- data/lib/bake/model/loader.rb +2 -2
- data/lib/bake/options/options.rb +9 -9
- data/lib/bake/options/usage.rb +2 -1
- data/lib/bake/subst.rb +3 -2
- data/lib/bake/toolchain/lint.rb +1 -1
- data/lib/blocks/block.rb +6 -5
- data/lib/blocks/blockBase.rb +8 -8
- data/lib/blocks/compile.rb +21 -6
- data/lib/blocks/executable.rb +2 -2
- data/lib/blocks/has_execute_command.rb +3 -3
- data/lib/blocks/library.rb +2 -2
- data/lib/common/cleanup.rb +1 -0
- data/lib/common/version.rb +1 -1
- data/lib/tocxx.rb +15 -0
- metadata +2 -3
- data/lib/bake/process_output.rb +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 55fd9b69d1c25ad937a08eaec9f8d12d055a1fbc
|
4
|
+
data.tar.gz: 269feb7487d2f484ce31f3fa6be8ca629b5c3de8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 75783f20ffd0d0e08b453a2e3dc1394c32c2bb609c9c2873f49d6c18285541f1667e1ce6b9e0e0709562b66c404530e9873bc5b3a30501a98466f00499798f33
|
7
|
+
data.tar.gz: fdd3a74eace9ba8618e611306997846cf63d2c8aeb84d7fb2c0a0e504c58daafe3b689825043884d32a4a0f3e5918f2269be3884c4b921e3a92ce16497486f44
|
data/doc/dyk/lint.html
CHANGED
@@ -53,6 +53,17 @@ To use in bake, add a LintPolicy in Project.meta:
|
|
53
53
|
<pre id="rundrum"><code>LintPolicy ".../your.lnt"</code></pre>
|
54
54
|
|
55
55
|
|
56
|
+
<h3>Output to xml</h3>
|
57
|
+
This is an example how to redirect the output to single xml files placed into the main project folder.
|
58
|
+
<pre id="rundrum"><code>DefaultToolchain GCC {
|
59
|
+
LintPolicy "-os($(MainProjectDir)/$(ProjectName)_$(ConfigName)_lintout.xml)"
|
60
|
+
LintPolicy "-v"
|
61
|
+
LintPolicy "+xml(doc)"
|
62
|
+
LintPolicy "-format=<message><file>%f</file> <line>%l</line> <type>%t</type> <code>%n</code> <desc>%m</desc></message>"
|
63
|
+
LintPolicy "-format_specific= "
|
64
|
+
LintPolicy "-pragma(message)"</code></pre>
|
65
|
+
|
66
|
+
|
56
67
|
<h3>Notes</h3>
|
57
68
|
In rare cases lint has problems if it has to open too many (include) files. If that is the case, use --lint_min and --lint_max command line option of bake. Example:
|
58
69
|
<pre id="rundrum"><code>bake Debug -p MyLibraryProject --lint --lint_max 50 (lints the first 51 files)
|
data/doc/further/change.html
CHANGED
@@ -7,13 +7,28 @@
|
|
7
7
|
<body>
|
8
8
|
<h1>Changelog</h1>
|
9
9
|
|
10
|
+
January 23, 2015 - bake-toolkit 2.1.0<br>
|
11
|
+
<ul>
|
12
|
+
<li><b>Bugfix: fixed crash in warning output if setting variable via cmd did not work</b>
|
13
|
+
<li><b>Workaround: dependent header files are now ignored on Windows if path starts with "/" and file cannot be found</b>
|
14
|
+
<li><b>Changed: output of lint is now ignored, linting will only fails if it cannot be executed</b>
|
15
|
+
<li><b>Changed: introduced new verbose mode <i>-v3</i>, shifted some output to this level</b>
|
16
|
+
<li><b>Added: a dependency project can be specified with parent folders if it is ambiguous, e.g. <i>Dependency "my/folder/proj", config: lib</i></b>
|
17
|
+
<li><b>Added: experimental CC2J output</b>
|
18
|
+
</ul>
|
19
|
+
|
20
|
+
January 23, 2015 - Eclipse plugin 1.2.1<br>
|
21
|
+
<ul>
|
22
|
+
<li><b>Bugfix: importing projects with existing .(c)project files may be placed in wrong folder</b>
|
23
|
+
</ul>
|
24
|
+
|
10
25
|
January 15, 2015 - bake-toolkit 2.0.10<br>
|
11
26
|
<ul>
|
12
27
|
<li><b>Bugfix: spaces in paths were not handled correctly in all cases</b>
|
13
28
|
<li><b>Bugfix: dependency files of Keil compiler not treated correctly</b>
|
14
29
|
<li><b>Added: showing why files are built in verbose mode <i>-v2</i></b>
|
15
30
|
<li><b>Added: whole workspace can be linted now (projects will be linted separately)</b>
|
16
|
-
<li><b>Changed: removed <i>bake-doc</i> command, use <i>bake --doc
|
31
|
+
<li><b>Changed: removed <i>bake-doc</i> command, use <i>bake --doc</i> instead</b>
|
17
32
|
<li><b>Changed: if no default project is specified, possible build configs are shown on command line again like in bake 1.x</b>
|
18
33
|
</ul>
|
19
34
|
|
data/doc/index.html
CHANGED
@@ -72,7 +72,7 @@ bake is used to build software <font color="#009900"><b>fast</b></font> and <fon
|
|
72
72
|
|
73
73
|
<p>
|
74
74
|
<hr>
|
75
|
-
<table width="100%" border="0"><tr><td align="left">Described bake-toolkit version: 2.0
|
75
|
+
<table width="100%" border="0"><tr><td align="left">Described bake-toolkit version: 2.1.0</td><td align="right">January 23, 2015</td></tr></table>
|
76
76
|
|
77
77
|
</body>
|
78
78
|
|
data/doc/syntax/syntax.html
CHANGED
@@ -435,7 +435,10 @@ function showDependency() {
|
|
435
435
|
str = 'Specifies another project to be built before this project.<br>'+
|
436
436
|
'The archive, linker libs and search paths are imported from this project to the this project automatically.<br>'+
|
437
437
|
'If you omit the project, the current project will be used.<br>'+
|
438
|
-
'If you omit the config name, the default config will be used
|
438
|
+
'If you omit the config name, the default config will be used.<br>'+
|
439
|
+
'<b>Examples:</b><br>'+
|
440
|
+
' <i>Dependency gtest, config: lib<br>'+
|
441
|
+
' Dependency "my/folder/proj"</i>'
|
439
442
|
ddrivetip("Dependency", "No","0..n","-",str)
|
440
443
|
}
|
441
444
|
|
data/lib/bake/cache.rb
CHANGED
@@ -130,7 +130,7 @@ module Bake
|
|
130
130
|
end
|
131
131
|
|
132
132
|
if cache != nil
|
133
|
-
Bake.formatter.printInfo("Info: cache is up-to-date, loading cached meta information") if Bake.options.
|
133
|
+
Bake.formatter.printInfo("Info: cache is up-to-date, loading cached meta information") if Bake.options.verbose >= 3
|
134
134
|
Bake.options.build_config = cache.build_config if Bake.options.build_config == ""
|
135
135
|
return cache.referencedConfigs
|
136
136
|
end
|
data/lib/bake/config/loader.rb
CHANGED
@@ -111,14 +111,20 @@ module Bake
|
|
111
111
|
end
|
112
112
|
|
113
113
|
def loadMeta(dep)
|
114
|
-
|
114
|
+
dep_subbed = dep.name.gsub(/\\/,"/")
|
115
|
+
if dep_subbed.include?":" or dep_subbed.include?"../" or dep_subbed.start_with?"/" or dep_subbed.end_with?"/"
|
116
|
+
Bake.formatter.printError("#{dep.name} is invalid", dep)
|
117
|
+
ExitHelper.exit(1)
|
118
|
+
end
|
119
|
+
dep_path, dismiss, dep_name = dep_subbed.rpartition("/")
|
120
|
+
|
115
121
|
# file not loaded yet
|
116
|
-
if not @loadedConfigs.include?
|
122
|
+
if not @loadedConfigs.include?dep_name
|
117
123
|
|
118
124
|
pmeta_filenames = []
|
119
125
|
|
120
126
|
@potentialProjs.each do |pp|
|
121
|
-
if pp.include?("/" +
|
127
|
+
if pp.include?("/" + dep_subbed + "/Project.meta") or pp == (dep_subbed + "/Project.meta")
|
122
128
|
pmeta_filenames << pp
|
123
129
|
end
|
124
130
|
end
|
@@ -137,17 +143,25 @@ module Bake
|
|
137
143
|
end
|
138
144
|
end
|
139
145
|
|
140
|
-
@loadedConfigs[
|
146
|
+
@loadedConfigs[dep_name] = loadProjMeta(pmeta_filenames[0])
|
147
|
+
else
|
148
|
+
folder = @loadedConfigs[dep_name][0].get_project_dir
|
149
|
+
if not folder.include?dep_subbed
|
150
|
+
Bake.formatter.printError("Cannot load #{dep.name}, because #{folder} already loaded", dep)
|
151
|
+
ExitHelper.exit(1)
|
152
|
+
end
|
153
|
+
|
141
154
|
end
|
142
|
-
|
155
|
+
|
143
156
|
# get config
|
144
|
-
config, dep.config = getFullProject(@loadedConfigs[
|
157
|
+
config, dep.config = getFullProject(@loadedConfigs[dep_name], dep.config)
|
158
|
+
dep.name = dep_name
|
145
159
|
|
146
160
|
# config not referenced yet
|
147
|
-
if not @referencedConfigs.include?
|
148
|
-
@referencedConfigs[
|
149
|
-
elsif @referencedConfigs[
|
150
|
-
@referencedConfigs[
|
161
|
+
if not @referencedConfigs.include?dep_name
|
162
|
+
@referencedConfigs[dep_name] = [config]
|
163
|
+
elsif @referencedConfigs[dep_name].index { |c| c.name == dep.config } == nil
|
164
|
+
@referencedConfigs[dep_name] << config
|
151
165
|
else
|
152
166
|
return
|
153
167
|
end
|
data/lib/bake/model/loader.rb
CHANGED
@@ -50,13 +50,13 @@ module Bake
|
|
50
50
|
loader.load(:before_load => proc {|fragment, kind|
|
51
51
|
case kind
|
52
52
|
when :load_update_cache
|
53
|
-
if Bake.options.
|
53
|
+
if Bake.options.verbose >= 3
|
54
54
|
puts "Loading and caching #{fragment.location}"
|
55
55
|
else
|
56
56
|
puts "Loading #{fragment.location}"
|
57
57
|
end
|
58
58
|
when :load_cached
|
59
|
-
if Bake.options.
|
59
|
+
if Bake.options.verbose >= 3
|
60
60
|
puts "Loading cached #{fragment.location}"
|
61
61
|
else
|
62
62
|
puts "Loading #{fragment.location}"
|
data/lib/bake/options/options.rb
CHANGED
@@ -18,13 +18,12 @@ module Bake
|
|
18
18
|
|
19
19
|
class Options < Parser
|
20
20
|
attr_accessor :build_config, :nocache
|
21
|
-
attr_reader :main_dir, :project, :filename, :main_project_name # String
|
21
|
+
attr_reader :main_dir, :project, :filename, :main_project_name, :cc2j_filename # String
|
22
22
|
attr_reader :roots, :include_filter, :exclude_filter # String List
|
23
23
|
attr_reader :stopOnFirstError, :clean, :rebuild, :show_includes, :show_includes_and_defines, :linkOnly, :no_autodir, :clobber, :lint, :docu, :debug, :prepro # Boolean
|
24
24
|
attr_reader :threads, :socket, :lint_min, :lint_max # Fixnum
|
25
25
|
attr_reader :vars # map
|
26
|
-
attr_reader :
|
27
|
-
attr_reader :verboseHigh
|
26
|
+
attr_reader :verbose
|
28
27
|
attr_reader :consoleOutput_fullnames, :consoleOutput_visualStudio
|
29
28
|
|
30
29
|
|
@@ -36,13 +35,13 @@ module Bake
|
|
36
35
|
@consoleOutput_visualStudio = false
|
37
36
|
@prepro = false
|
38
37
|
@stopOnFirstError = false
|
39
|
-
@
|
40
|
-
@verboseHigh = false
|
38
|
+
@verbose = 1
|
41
39
|
@vars = {}
|
42
40
|
@build_config = ""
|
43
41
|
@main_dir = nil
|
44
42
|
@project = nil
|
45
43
|
@filename = nil
|
44
|
+
@cc2j_filename = nil
|
46
45
|
@clean = false
|
47
46
|
@clobber = false
|
48
47
|
@lint = false
|
@@ -84,9 +83,10 @@ module Bake
|
|
84
83
|
|
85
84
|
add_option(Option.new("--docu",false) { @docu = true })
|
86
85
|
|
87
|
-
|
88
|
-
add_option(Option.new("-v1",false) { @
|
89
|
-
add_option(Option.new("-v2",false) { @
|
86
|
+
add_option(Option.new("-v0",false) { @verbose = 0 })
|
87
|
+
add_option(Option.new("-v1",false) { @verbose = 1 })
|
88
|
+
add_option(Option.new("-v2",false) { @verbose = 2 })
|
89
|
+
add_option(Option.new("-v3",false) { @verbose = 3 })
|
90
90
|
|
91
91
|
add_option(Option.new("--debug",false) { @debug = true })
|
92
92
|
add_option(Option.new("--set",true) { |x| set_set(x) })
|
@@ -109,7 +109,7 @@ module Bake
|
|
109
109
|
add_option(Option.new("--doc",false) { Doc.show })
|
110
110
|
add_option(Option.new("--version",false) { ExitHelper.exit(0) })
|
111
111
|
add_option(Option.new("--show_configs",false) { @showConfigs = true })
|
112
|
-
|
112
|
+
add_option(Option.new("--writeCC2J",true) { |x| @cc2j_filename = x.gsub(/[\\]/,'/') })
|
113
113
|
|
114
114
|
end
|
115
115
|
|
data/lib/bake/options/usage.rb
CHANGED
@@ -10,7 +10,7 @@ module Bake
|
|
10
10
|
puts " -f <name> Build/Clean this file only."
|
11
11
|
puts " -c Clean the file/project."
|
12
12
|
puts " -a <scheme> Use ansi color sequences (console must support it). Possible values are 'white' and 'black'."
|
13
|
-
puts " -v<level> Verbose level from 0 to
|
13
|
+
puts " -v<level> Verbose level from 0 to 3, whereas -v0 is less, -v1 is normal (default) and -v2 and -v3 are more verbose."
|
14
14
|
puts " -r Stop on first error."
|
15
15
|
puts " -w <root> Add a workspace root (can be used multiple times)."
|
16
16
|
puts " If no root is specified, the parent directory of the main project is added automatically."
|
@@ -39,6 +39,7 @@ module Bake
|
|
39
39
|
puts " --set <key>=<value> Sets a variable. Overwrites variables defined in Project.metas (can be used multiple times)."
|
40
40
|
puts " --show_include_paths Used by IDEs plugins"
|
41
41
|
puts " --show_incs_and_defs Used by IDEs plugins"
|
42
|
+
puts " --writeCC2J <name> Writes compiler command into a json file (experimental!)"
|
42
43
|
puts ""
|
43
44
|
puts " --version Print version."
|
44
45
|
puts " --doc Open documentation in browser"
|
data/lib/bake/subst.rb
CHANGED
@@ -80,6 +80,7 @@ module Bake
|
|
80
80
|
end
|
81
81
|
else
|
82
82
|
cmd_result = false
|
83
|
+
consoleOutput = ""
|
83
84
|
begin
|
84
85
|
Dir.chdir(@@projDir) do
|
85
86
|
cmd = [substString(s.cmd, s)]
|
@@ -90,7 +91,7 @@ module Bake
|
|
90
91
|
consoleOutput = e.message
|
91
92
|
end
|
92
93
|
if (cmd_result == false)
|
93
|
-
Bake.formatter.printWarning("Command not successful, variable #{s.name}
|
94
|
+
Bake.formatter.printWarning("Command not successful, variable #{s.name} will be set to \"\" (#{consoleOutput.chomp}).", s)
|
94
95
|
@@userVarMap[s.name] = ""
|
95
96
|
end
|
96
97
|
end
|
@@ -187,7 +188,7 @@ module Bake
|
|
187
188
|
elsif ENV[var]
|
188
189
|
substStr << ENV[var]
|
189
190
|
else
|
190
|
-
if Bake.options.
|
191
|
+
if Bake.options.verbose >= 2
|
191
192
|
msg = "Substitute variable '$(#{var})' with empty string"
|
192
193
|
if elem
|
193
194
|
Bake.formatter.printInfo(msg, elem)
|
data/lib/bake/toolchain/lint.rb
CHANGED
@@ -11,7 +11,7 @@ module Bake
|
|
11
11
|
:COMMAND => "lint-nt.exe",
|
12
12
|
:DEFINE_FLAG => "-D",
|
13
13
|
:INCLUDE_PATH_FLAG => "-I",
|
14
|
-
:COMPILE_FLAGS => ["-b","-\"format=%f%(:%l:%) %t %n: %m\"", "-width(0)", "-hF1"], # array, not string!
|
14
|
+
:COMPILE_FLAGS => ["-b","-\"format=%f%(:%l:%) %t %n: %m\"", "-width(0)", "-hF1", "-zero"], # array, not string!
|
15
15
|
})
|
16
16
|
|
17
17
|
LintChain[:COMPILER][:CPP][:ERROR_PARSER] = LintErrorParser.new
|
data/lib/blocks/block.rb
CHANGED
@@ -9,6 +9,7 @@ module Bake
|
|
9
9
|
|
10
10
|
module Blocks
|
11
11
|
|
12
|
+
CC2J = []
|
12
13
|
ALL_BLOCKS = {}
|
13
14
|
ALL_COMPILE_BLOCKS = {}
|
14
15
|
|
@@ -90,7 +91,7 @@ module Bake
|
|
90
91
|
end
|
91
92
|
end
|
92
93
|
else
|
93
|
-
if elem and Bake.options.
|
94
|
+
if elem and Bake.options.verbose >= 2
|
94
95
|
Bake.formatter.printInfo("\"..\" in path name found", elem)
|
95
96
|
end
|
96
97
|
end
|
@@ -166,7 +167,7 @@ module Bake
|
|
166
167
|
|
167
168
|
def execute
|
168
169
|
if (@inDeps)
|
169
|
-
if
|
170
|
+
if Bake.options.verbose >= 1
|
170
171
|
Bake.formatter.printWarning("Circular dependency found including project #{@projectName} with config #{@configName}", @config)
|
171
172
|
end
|
172
173
|
return true
|
@@ -182,7 +183,7 @@ module Bake
|
|
182
183
|
|
183
184
|
Bake::IDEInterface.instance.set_build_info(@projectName, @configName)
|
184
185
|
|
185
|
-
if
|
186
|
+
if Bake.options.verbose >= 1
|
186
187
|
Bake.formatter.printAdditionalInfo "**** Building #{Block.block_counter} of #{@@num_projects}: #{@projectName} (#{@configName}) ****"
|
187
188
|
end
|
188
189
|
|
@@ -197,7 +198,7 @@ module Bake
|
|
197
198
|
depResult = callDeps(:clean)
|
198
199
|
return false if not depResult and Bake.options.stopOnFirstError
|
199
200
|
|
200
|
-
if Bake.options.
|
201
|
+
if Bake.options.verbose >= 2
|
201
202
|
Bake.formatter.printAdditionalInfo "**** Cleaning #{Block.block_counter} of #{@@num_projects}: #{@projectName} (#{@configName}) ****"
|
202
203
|
end
|
203
204
|
|
@@ -206,7 +207,7 @@ module Bake
|
|
206
207
|
if Bake.options.clobber
|
207
208
|
Dir.chdir(@projectDir) do
|
208
209
|
if File.exist?".bake"
|
209
|
-
puts "Deleting folder .bake" if Bake.options.
|
210
|
+
puts "Deleting folder .bake" if Bake.options.verbose >= 2
|
210
211
|
FileUtils.rm_rf(".bake")
|
211
212
|
end
|
212
213
|
end
|
data/lib/blocks/blockBase.rb
CHANGED
@@ -25,14 +25,14 @@ module Bake
|
|
25
25
|
begin
|
26
26
|
FileUtils.touch(@config.file_name)
|
27
27
|
rescue Exception=>e
|
28
|
-
if Bake.options.
|
28
|
+
if Bake.options.verbose >= 2
|
29
29
|
Bake.formatter.printWarning("Could not touch #{@config.file_name}: #{e.message}", @config.file_name)
|
30
30
|
end
|
31
31
|
end
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
|
-
def prepareOutput(filename)
|
35
|
+
def self.prepareOutput(filename)
|
36
36
|
begin
|
37
37
|
if File.exists?(filename)
|
38
38
|
FileUtils.rm(filename)
|
@@ -61,19 +61,19 @@ module Bake
|
|
61
61
|
def printCmd(cmd, alternate, reason, forceVerbose)
|
62
62
|
|
63
63
|
if (cmd == @lastCommand)
|
64
|
-
if (Bake.options.
|
64
|
+
if (Bake.options.verbose >= 2 or (@printedCmdAlternate and not forceVerbose))
|
65
65
|
return
|
66
66
|
end
|
67
67
|
end
|
68
68
|
|
69
69
|
@lastCommand = cmd
|
70
70
|
|
71
|
-
return if Bake.options.
|
71
|
+
return if Bake.options.verbose == 0 and not forceVerbose
|
72
72
|
|
73
|
-
if forceVerbose or Bake.options.
|
73
|
+
if forceVerbose or Bake.options.verbose >= 2 or not alternate
|
74
74
|
@printedCmdAlternate = false
|
75
|
-
if Bake.options.
|
76
|
-
|
75
|
+
puts "" if Bake.options.verbose >= 2 # for A.K. :-)
|
76
|
+
if Bake.options.verbose >= 3
|
77
77
|
exedIn = "\n(executed in '#{@projectDir}')"
|
78
78
|
because = reason ? "\n(#{reason})" : ""
|
79
79
|
else
|
@@ -114,7 +114,7 @@ module Bake
|
|
114
114
|
end
|
115
115
|
|
116
116
|
if Bake.options.lint
|
117
|
-
|
117
|
+
# ignore error output
|
118
118
|
else
|
119
119
|
ret = error_descs.any? { |e| e.severity == ErrorParser::SEVERITY_ERROR }
|
120
120
|
end
|
data/lib/blocks/compile.rb
CHANGED
@@ -47,8 +47,19 @@ module Bake
|
|
47
47
|
|
48
48
|
begin
|
49
49
|
File.readlines(dep_filename_conv).map{|line| line.strip}.each do |dep|
|
50
|
-
|
51
|
-
|
50
|
+
dep = "/usr/bla"
|
51
|
+
if not File.exist?(dep)
|
52
|
+
# we need a hack here. with some windows configurations the compiler prints unix paths
|
53
|
+
# into the dep file which cannot be found easily. this will be true for system includes,
|
54
|
+
# e.g. /usr/lib/...xy.h
|
55
|
+
if Bake::Utils::OS.windows? and dep.start_with?"/"
|
56
|
+
puts "Dependency header file #{dep} ignored!" if Bake.options.debug
|
57
|
+
else
|
58
|
+
return "because dependent header #{dep} does not exist"
|
59
|
+
end
|
60
|
+
else
|
61
|
+
return "because dependent header #{dep} is newer than object" if oTime < File.mtime(dep)
|
62
|
+
end
|
52
63
|
end
|
53
64
|
rescue Exception => ex
|
54
65
|
if Bake.options.debug
|
@@ -112,7 +123,7 @@ module Bake
|
|
112
123
|
raise SystemCommandFailed.new
|
113
124
|
end
|
114
125
|
|
115
|
-
prepareOutput(object)
|
126
|
+
BlockBase.prepareOutput(object)
|
116
127
|
|
117
128
|
cmd = Utils.flagSplit(compiler[:COMMAND], false)
|
118
129
|
cmd += compiler[:COMPILE_FLAGS].split(" ")
|
@@ -150,6 +161,10 @@ module Bake
|
|
150
161
|
end
|
151
162
|
cmd << source
|
152
163
|
|
164
|
+
if Bake.options.cc2j_filename
|
165
|
+
Blocks::CC2J << { :directory => @projectDir, :command => cmd, :file => source }
|
166
|
+
end
|
167
|
+
|
153
168
|
success, consoleOutput = ProcessHelper.run(cmd, false, false)
|
154
169
|
outputType = Bake.options.prepro ? "Preprocessing" : "Compiling"
|
155
170
|
process_result(cmd, consoleOutput, compiler[:ERROR_PARSER], "#{outputType} #{source}", reason, success)
|
@@ -270,11 +285,11 @@ module Bake
|
|
270
285
|
object = get_object_file(source)
|
271
286
|
dep_filename = calcDepFile(object, type)
|
272
287
|
if File.exist?object
|
273
|
-
puts "Deleting file #{object}" if Bake.options.
|
288
|
+
puts "Deleting file #{object}" if Bake.options.verbose >= 2
|
274
289
|
FileUtils.rm_rf(object)
|
275
290
|
end
|
276
291
|
if File.exist?dep_filename
|
277
|
-
puts "Deleting file #{dep_filename}" if Bake.options.
|
292
|
+
puts "Deleting file #{dep_filename}" if Bake.options.verbose >= 2
|
278
293
|
FileUtils.rm_rf(dep_filename)
|
279
294
|
end
|
280
295
|
end
|
@@ -298,7 +313,7 @@ module Bake
|
|
298
313
|
if not p.include?"*" and not p.include?"?"
|
299
314
|
Bake.formatter.printError("Source file '#{p}' not found", sources)
|
300
315
|
raise SystemCommandFailed.new
|
301
|
-
elsif
|
316
|
+
elsif Bake.options.verbose >= 1
|
302
317
|
Bake.formatter.printInfo("Source file pattern '#{p}' does not match to any file", sources)
|
303
318
|
end
|
304
319
|
end
|
data/lib/blocks/executable.rb
CHANGED
@@ -92,7 +92,7 @@ module Bake
|
|
92
92
|
reason = needed?(libs)
|
93
93
|
return unless reason
|
94
94
|
|
95
|
-
prepareOutput(@exe_name)
|
95
|
+
BlockBase.prepareOutput(@exe_name)
|
96
96
|
|
97
97
|
linker = @tcs[:LINKER]
|
98
98
|
|
@@ -131,7 +131,7 @@ module Bake
|
|
131
131
|
def clean
|
132
132
|
Dir.chdir(@projectDir) do
|
133
133
|
if File.exist?@output_dir
|
134
|
-
puts "Deleting folder #{@output_dir}" if Bake.options.
|
134
|
+
puts "Deleting folder #{@output_dir}" if Bake.options.verbose >= 2
|
135
135
|
FileUtils.rm_rf(@output_dir)
|
136
136
|
end
|
137
137
|
end unless Bake.options.filename
|
@@ -5,8 +5,8 @@ module Bake
|
|
5
5
|
module HasExecuteCommand
|
6
6
|
|
7
7
|
def executeCommand(commandLine, ignoreStr=nil)
|
8
|
-
puts commandLine if
|
9
|
-
puts "(executed in '#{@projectDir}')" if Bake.options.
|
8
|
+
puts commandLine if Bake.options.verbose >= 1
|
9
|
+
puts "(executed in '#{@projectDir}')" if Bake.options.verbose >= 3
|
10
10
|
cmd_result = false
|
11
11
|
output = ""
|
12
12
|
begin
|
@@ -20,7 +20,7 @@ module Bake
|
|
20
20
|
|
21
21
|
if (cmd_result == false and (not ignoreStr or not output.include?ignoreStr))
|
22
22
|
Bake.formatter.printError("Command \"#{commandLine}\" failed", @config)
|
23
|
-
puts "(executed in '#{@projectDir}')" if
|
23
|
+
puts "(executed in '#{@projectDir}')" if Bake.options.verbose >= 3
|
24
24
|
raise SystemCommandFailed.new
|
25
25
|
end
|
26
26
|
end
|
data/lib/blocks/library.rb
CHANGED
@@ -45,7 +45,7 @@ module Bake
|
|
45
45
|
reason = needed?
|
46
46
|
return unless reason
|
47
47
|
|
48
|
-
prepareOutput(archive_name)
|
48
|
+
BlockBase.prepareOutput(archive_name)
|
49
49
|
|
50
50
|
archiver = @tcs[:ARCHIVER]
|
51
51
|
|
@@ -65,7 +65,7 @@ module Bake
|
|
65
65
|
def clean
|
66
66
|
Dir.chdir(@projectDir) do
|
67
67
|
if File.exist?@output_dir
|
68
|
-
puts "Deleting folder #{@output_dir}" if Bake.options.
|
68
|
+
puts "Deleting folder #{@output_dir}" if Bake.options.verbose >= 2
|
69
69
|
FileUtils.rm_rf(@output_dir)
|
70
70
|
end
|
71
71
|
end unless Bake.options.filename
|
data/lib/common/cleanup.rb
CHANGED
data/lib/common/version.rb
CHANGED
data/lib/tocxx.rb
CHANGED
@@ -254,6 +254,21 @@ module Bake
|
|
254
254
|
ExitHelper.set_exit_code(1)
|
255
255
|
return
|
256
256
|
end
|
257
|
+
|
258
|
+
if Bake.options.cc2j_filename
|
259
|
+
Blocks::BlockBase.prepareOutput(Bake.options.cc2j_filename)
|
260
|
+
File.open(Bake.options.cc2j_filename, 'w') do |f|
|
261
|
+
f.puts "["
|
262
|
+
noComma = Blocks::CC2J.length - 1
|
263
|
+
Blocks::CC2J.each_with_index do |c, index|
|
264
|
+
cmd = c[:command].is_a?(Array) ? c[:command].join(' ') : c[:command]
|
265
|
+
f.puts " { \"directory\": \"" + c[:directory] + "\","
|
266
|
+
f.puts " \"command\": \"" + cmd + "\","
|
267
|
+
f.puts " \"file\": \"" + c[:file] + "\" }#{index == noComma ? "" : ","}"
|
268
|
+
end
|
269
|
+
f.puts "]"
|
270
|
+
end
|
271
|
+
end
|
257
272
|
|
258
273
|
if result == false
|
259
274
|
Bake.formatter.printError("\n#{taskType} failed.")
|
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.0
|
4
|
+
version: 2.1.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: 2015-01-
|
11
|
+
date: 2015-01-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rtext
|
@@ -89,7 +89,6 @@ files:
|
|
89
89
|
- lib/bake/options/showLicense.rb
|
90
90
|
- lib/bake/options/showToolchains.rb
|
91
91
|
- lib/bake/options/usage.rb
|
92
|
-
- lib/bake/process_output.rb
|
93
92
|
- lib/bake/subst.rb
|
94
93
|
- lib/bake/toolchain/clang.rb
|
95
94
|
- lib/bake/toolchain/colorizing_formatter.rb
|