bake-toolkit 2.8.0 → 2.9.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/further/change.html +15 -0
- data/doc/index.html +1 -1
- data/lib/bake/options/create.rb +96 -0
- data/lib/bake/options/options.rb +37 -1
- data/lib/bake/options/usage.rb +2 -0
- data/lib/blocks/convert.rb +35 -0
- data/lib/blocks/executable.rb +2 -0
- data/lib/common/version.rb +1 -1
- data/lib/tocxx.rb +22 -3
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d7b3127c8cc5671a807254d3493ff59b326fb80
|
4
|
+
data.tar.gz: 2f073076a3c207ea02eb37b22f503753acd0ad40
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2316ef390f25fa482f317bd173ef8ac992046b15afc920b8c2a24116faeb856ef898f895f2fc35762b656c4965bb3af461398a2e2a9e34a1ec87084f316bcee1
|
7
|
+
data.tar.gz: 6bd20579645b276b447fb6810be9d9676dab6561818033597439d576f01f1b9f7b47b671803edf30edfcd0013cb7367800f3794db2530af3cad9d7817d12fc5f
|
data/doc/further/change.html
CHANGED
@@ -7,6 +7,21 @@
|
|
7
7
|
<body>
|
8
8
|
<h1>Changelog</h1>
|
9
9
|
|
10
|
+
June 5, 2015 - bake-toolkit 2.9.0<br>
|
11
|
+
<ul>
|
12
|
+
<li><b>Added: "--create" command line option to create project templates</b>
|
13
|
+
<li><b>Added: "--conversion_info" command line option for bake conversion tool</b>
|
14
|
+
<li><b>Cosmetic: made output clearer if "--link_only" is used for non ExecutableConfigs</b>
|
15
|
+
</ul>
|
16
|
+
|
17
|
+
June 5, 2015 - Eclipse plugin 1.4.5<br>
|
18
|
+
<ul>
|
19
|
+
<li><b>Bugfix: input streams from bake were closed too early under Linux - console window output and AdjustCDT feature should work correctly now</b>
|
20
|
+
<li><b>Added: "Link This Project Only" shortcut added</b>
|
21
|
+
<li><b>Added: Files under "build_*" and ".bake" are now automatically marked as derived (not shown in "Open Resource" dialog)</b>
|
22
|
+
<li><b>Changed: error message dialog of AdjustCDT now displays the end instead of the beginning of very long error messages</b>
|
23
|
+
</ul>
|
24
|
+
|
10
25
|
May 19, 2015 - bake-toolkit 2.8.0<br>
|
11
26
|
<ul>
|
12
27
|
<li><b>Bugfix: when building a project with <i>-p name</i>, not only <i>name</i> was built, but all projects which start with the string <i>name</i></b>
|
data/doc/index.html
CHANGED
@@ -74,7 +74,7 @@ bake is used to build software <font color="#009900"><b>fast</b></font> and <fon
|
|
74
74
|
|
75
75
|
<p>
|
76
76
|
<hr>
|
77
|
-
<table width="100%" border="0"><tr><td align="left">Described bake-toolkit version: 2.
|
77
|
+
<table width="100%" border="0"><tr><td align="left">Described bake-toolkit version: 2.9.0</td><td align="right">June 5, 2015</td></tr></table>
|
78
78
|
|
79
79
|
</body>
|
80
80
|
|
@@ -0,0 +1,96 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
|
3
|
+
module Bake
|
4
|
+
|
5
|
+
class Create
|
6
|
+
|
7
|
+
def self.exeTemplate
|
8
|
+
"Project default: main {\n"+
|
9
|
+
"\n"+
|
10
|
+
" Responsible {\n"+
|
11
|
+
" Person \"#{ENV["USER"]}\"\n"+
|
12
|
+
" }\n"+
|
13
|
+
"\n"+
|
14
|
+
" ExecutableConfig main {\n"+
|
15
|
+
" # Dependency ...\n"+
|
16
|
+
" Files \"src/**/*.cpp\"\n"+
|
17
|
+
" IncludeDir \"include\"\n"+
|
18
|
+
" DefaultToolchain GCC\n"+
|
19
|
+
" }\n"+
|
20
|
+
"}\n"
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.libTemplate
|
24
|
+
"Project default: lib {\n"+
|
25
|
+
"\n"+
|
26
|
+
" Responsible {\n"+
|
27
|
+
" Person \"#{ENV["USER"]}\"\n"+
|
28
|
+
" }\n"+
|
29
|
+
"\n"+
|
30
|
+
" LibraryConfig lib {\n"+
|
31
|
+
" Files \"src/**/*.cpp\"\n"+
|
32
|
+
" IncludeDir \"include\"\n"+
|
33
|
+
" }\n"+
|
34
|
+
"\n"+
|
35
|
+
" ExecutableConfig UnitTest {\n"+
|
36
|
+
" Dependency config: lib\n"+
|
37
|
+
" Files \"test/src/**/*.cpp\"\n"+
|
38
|
+
" IncludeDir \"include\"\n"+
|
39
|
+
" DefaultToolchain GCC\n"+
|
40
|
+
" }\n"+
|
41
|
+
"}\n"
|
42
|
+
end
|
43
|
+
|
44
|
+
def self.customTemplate
|
45
|
+
"Project default: lib {\n"+
|
46
|
+
"\n"+
|
47
|
+
" Responsible {\n"+
|
48
|
+
" Person \"#{ENV["USER"]}\"\n"+
|
49
|
+
" }\n"+
|
50
|
+
"\n"+
|
51
|
+
" CustomConfig lib {\n"+
|
52
|
+
" Files \"src/**/*.cpp\"\n"+
|
53
|
+
" IncludeDir \"include\"\n"+
|
54
|
+
" }\n"+
|
55
|
+
"}\n"
|
56
|
+
end
|
57
|
+
|
58
|
+
def self.mainTemplate
|
59
|
+
"int main()\n"+
|
60
|
+
"{\n"+
|
61
|
+
" return 0;\n"+
|
62
|
+
"}\n"
|
63
|
+
end
|
64
|
+
|
65
|
+
def self.checkFile(name)
|
66
|
+
if File.exists?(name)
|
67
|
+
puts "#{name} already exists"
|
68
|
+
ExitHelper.exit(1)
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
def self.proj(type)
|
73
|
+
checkFile("Project.meta")
|
74
|
+
checkFile("src/main.cpp") if (type == "exe")
|
75
|
+
FileUtils::mkdir_p "src"
|
76
|
+
FileUtils::mkdir_p "include"
|
77
|
+
|
78
|
+
if (type == "lib")
|
79
|
+
File.write("Project.meta", libTemplate);
|
80
|
+
elsif (type == "exe")
|
81
|
+
File.write("Project.meta", exeTemplate);
|
82
|
+
File.write("src/main.cpp", mainTemplate);
|
83
|
+
elsif (type == "custom")
|
84
|
+
File.write("Project.meta", customTemplate);
|
85
|
+
else
|
86
|
+
puts "'--create' must be followed by 'lib', 'exe' or 'custom'"
|
87
|
+
ExitHelper.exit(1)
|
88
|
+
end
|
89
|
+
|
90
|
+
puts "Project created."
|
91
|
+
ExitHelper.exit(1)
|
92
|
+
end
|
93
|
+
|
94
|
+
end
|
95
|
+
|
96
|
+
end
|
data/lib/bake/options/options.rb
CHANGED
@@ -5,6 +5,7 @@ require 'bake/options/showConfigNames'
|
|
5
5
|
require 'bake/options/showLicense'
|
6
6
|
require 'bake/options/showDoc'
|
7
7
|
require 'bake/options/usage'
|
8
|
+
require 'bake/options/create'
|
8
9
|
require 'common/options/option'
|
9
10
|
|
10
11
|
module Bake
|
@@ -20,7 +21,7 @@ module Bake
|
|
20
21
|
attr_accessor :build_config, :nocache, :analyze, :eclipseOrder, :envToolchain
|
21
22
|
attr_reader :main_dir, :project, :filename, :main_project_name, :cc2j_filename # String
|
22
23
|
attr_reader :roots, :include_filter, :exclude_filter # String List
|
23
|
-
attr_reader :stopOnFirstError, :clean, :rebuild, :show_includes, :show_includes_and_defines, :linkOnly, :no_autodir, :clobber, :lint, :docu, :debug, :prepro # Boolean
|
24
|
+
attr_reader :conversion_info, :stopOnFirstError, :clean, :rebuild, :show_includes, :show_includes_and_defines, :linkOnly, :no_autodir, :clobber, :lint, :docu, :debug, :prepro # Boolean
|
24
25
|
attr_reader :threads, :socket, :lint_min, :lint_max # Fixnum
|
25
26
|
attr_reader :vars # map
|
26
27
|
attr_reader :verbose
|
@@ -30,6 +31,7 @@ module Bake
|
|
30
31
|
def initialize(argv)
|
31
32
|
super(argv)
|
32
33
|
|
34
|
+
@conversion_info = false
|
33
35
|
@envToolchain = false
|
34
36
|
@analyze = false
|
35
37
|
@eclipseOrder = false
|
@@ -84,6 +86,9 @@ module Bake
|
|
84
86
|
add_option(Option.new("--lint_min",true) { |x| @lint_min = String === x ? x.to_i : x })
|
85
87
|
add_option(Option.new("--lint_max",true) { |x| @lint_max = String === x ? x.to_i : x })
|
86
88
|
|
89
|
+
add_option(Option.new("--create",true) { |x| Bake::Create.proj(x) })
|
90
|
+
add_option(Option.new("--conversion_info",false) { @conversion_info = true })
|
91
|
+
|
87
92
|
add_option(Option.new("--docu",false) { @docu = true })
|
88
93
|
|
89
94
|
add_option(Option.new("-v0",false) { @verbose = 0 })
|
@@ -128,6 +133,37 @@ module Bake
|
|
128
133
|
end
|
129
134
|
end
|
130
135
|
|
136
|
+
if @conversion_info
|
137
|
+
if @rebuild
|
138
|
+
Bake.formatter.printError("Error: --conversion_info and --rebuild not allowed at the same time")
|
139
|
+
ExitHelper.exit(1)
|
140
|
+
end
|
141
|
+
if @clean
|
142
|
+
Bake.formatter.printError("Error: --conversion_info and -c not allowed at the same time")
|
143
|
+
ExitHelper.exit(1)
|
144
|
+
end
|
145
|
+
if @prepro
|
146
|
+
Bake.formatter.printError("Error: --conversion_info and --prepro not allowed at the same time")
|
147
|
+
ExitHelper.exit(1)
|
148
|
+
end
|
149
|
+
if @linkOnly
|
150
|
+
Bake.formatter.printError("Error: --conversion_info and --linkOnly not allowed at the same time")
|
151
|
+
ExitHelper.exit(1)
|
152
|
+
end
|
153
|
+
if @lint
|
154
|
+
Bake.formatter.printError("Error: --conversion_info and --lint not allowed at the same time")
|
155
|
+
ExitHelper.exit(1)
|
156
|
+
end
|
157
|
+
if @docu
|
158
|
+
Bake.formatter.printError("Error: --conversion_info and --docu not allowed at the same time")
|
159
|
+
ExitHelper.exit(1)
|
160
|
+
end
|
161
|
+
if not @project
|
162
|
+
Bake.formatter.printError("Error: --conversion_info must be used with -p")
|
163
|
+
ExitHelper.exit(1)
|
164
|
+
end
|
165
|
+
end
|
166
|
+
|
131
167
|
if @linkOnly
|
132
168
|
if @rebuild
|
133
169
|
Bake.formatter.printError("Error: --link_only and --rebuild not allowed at the same time")
|
data/lib/bake/options/usage.rb
CHANGED
@@ -39,7 +39,9 @@ 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 " --conversion_info Prints infos for an external tool which converts bake configs for other build systems"
|
42
43
|
puts " --writeCC2J <name> Writes compiler command into a json file (experimental!)"
|
44
|
+
puts " --create exe|lib|custom Creates a project with exe, lib or custom template"
|
43
45
|
puts ""
|
44
46
|
puts " --version Print version."
|
45
47
|
puts " --doc Open documentation in browser"
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'blocks/compile'
|
2
|
+
|
3
|
+
module Bake
|
4
|
+
|
5
|
+
module Blocks
|
6
|
+
|
7
|
+
class Convert < Compile
|
8
|
+
|
9
|
+
def initialize(block, config, referencedConfigs, tcs)
|
10
|
+
super(block, config, referencedConfigs, tcs)
|
11
|
+
end
|
12
|
+
|
13
|
+
def execute
|
14
|
+
Dir.chdir(@projectDir) do
|
15
|
+
calcSources
|
16
|
+
|
17
|
+
puts "START_INFO"
|
18
|
+
puts " BAKE_SOURCES"
|
19
|
+
@source_files.each { |s| puts " #{s}" }
|
20
|
+
puts " BAKE_INCLUDES"
|
21
|
+
@include_list.each { |s| puts " #{s}" }
|
22
|
+
puts " BAKE_DEFINES"
|
23
|
+
(@tcs[:COMPILER][:CPP][:DEFINES] + @tcs[:COMPILER][:C][:DEFINES] + @tcs[:COMPILER][:ASM][:DEFINES]).uniq.each { |s| puts " #{s}" }
|
24
|
+
puts "END_INFO"
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def clean
|
29
|
+
# nothing to do here
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
end
|
data/lib/blocks/executable.rb
CHANGED
data/lib/common/version.rb
CHANGED
data/lib/tocxx.rb
CHANGED
@@ -21,9 +21,11 @@ require 'blocks/block'
|
|
21
21
|
require 'blocks/commandLine'
|
22
22
|
require 'blocks/makefile'
|
23
23
|
require 'blocks/compile'
|
24
|
+
require 'blocks/convert'
|
24
25
|
require 'blocks/library'
|
25
26
|
require 'blocks/executable'
|
26
27
|
require 'blocks/lint'
|
28
|
+
require 'blocks/convert'
|
27
29
|
require 'blocks/docu'
|
28
30
|
|
29
31
|
require 'set'
|
@@ -38,7 +40,13 @@ module Bake
|
|
38
40
|
end
|
39
41
|
|
40
42
|
class ToCxx
|
43
|
+
|
44
|
+
@@linkBlock = 0
|
41
45
|
|
46
|
+
def self.linkBlock
|
47
|
+
@@linkBlock = 1
|
48
|
+
end
|
49
|
+
|
42
50
|
def initialize
|
43
51
|
@configTcMap = {}
|
44
52
|
end
|
@@ -105,7 +113,7 @@ module Bake
|
|
105
113
|
addSteps(block, block.startupSteps, config.startupSteps)
|
106
114
|
addSteps(block, block.exitSteps, config.exitSteps)
|
107
115
|
|
108
|
-
if not Bake.options.linkOnly and not Bake.options.prepro and not Bake.options.lint and not Bake.options.docu and not Bake.options.filename and not Bake.options.analyze
|
116
|
+
if not Bake.options.linkOnly and not Bake.options.prepro and not Bake.options.lint and not Bake.options.conversion_info and not Bake.options.docu and not Bake.options.filename and not Bake.options.analyze
|
109
117
|
addSteps(block, block.preSteps, config.preSteps)
|
110
118
|
addSteps(block, block.postSteps, config.postSteps)
|
111
119
|
end
|
@@ -113,9 +121,11 @@ module Bake
|
|
113
121
|
if Bake.options.docu
|
114
122
|
block.mainSteps << Blocks::Docu.new(config, @configTcMap[config])
|
115
123
|
elsif Metamodel::CustomConfig === config
|
116
|
-
if not Bake.options.linkOnly and not Bake.options.prepro and not Bake.options.lint and not Bake.options.docu and not Bake.options.filename and not Bake.options.analyze
|
124
|
+
if not Bake.options.linkOnly and not Bake.options.prepro and not Bake.options.lint and not Bake.options.conversion_info and not Bake.options.docu and not Bake.options.filename and not Bake.options.analyze
|
117
125
|
addSteps(block, block.mainSteps, config) if config.step
|
118
126
|
end
|
127
|
+
elsif Bake.options.conversion_info
|
128
|
+
block.mainSteps << Blocks::Convert.new(block, config, @loadedConfig.referencedConfigs, @configTcMap[config])
|
119
129
|
elsif Bake.options.lint
|
120
130
|
block.mainSteps << Blocks::Lint.new(block, config, @loadedConfig.referencedConfigs, @configTcMap[config])
|
121
131
|
else
|
@@ -206,6 +216,8 @@ module Bake
|
|
206
216
|
taskType = "Building"
|
207
217
|
if Bake.options.lint
|
208
218
|
taskType = "Linting"
|
219
|
+
elsif Bake.options.conversion_info
|
220
|
+
taskType = "Showing conversion infos"
|
209
221
|
elsif Bake.options.docu
|
210
222
|
taskType = "Generating documentation"
|
211
223
|
elsif Bake.options.prepro
|
@@ -269,6 +281,9 @@ module Bake
|
|
269
281
|
createBaseTcsForConfig
|
270
282
|
substVars
|
271
283
|
createTcsForConfig
|
284
|
+
|
285
|
+
@@linkBlock = 0
|
286
|
+
|
272
287
|
convert2bb
|
273
288
|
|
274
289
|
Blocks::Show.includes if Bake.options.show_includes
|
@@ -324,7 +339,11 @@ module Bake
|
|
324
339
|
ExitHelper.set_exit_code(1)
|
325
340
|
return
|
326
341
|
else
|
327
|
-
Bake.
|
342
|
+
if Bake.options.linkOnly and @@linkBlock == 0
|
343
|
+
Bake.formatter.printSuccess("\nNothing to link.")
|
344
|
+
else
|
345
|
+
Bake.formatter.printSuccess("\n#{taskType} done.")
|
346
|
+
end
|
328
347
|
end
|
329
348
|
rescue SystemExit
|
330
349
|
Bake.formatter.printError("\n#{taskType} failed.") if ExitHelper.exit_code != 0
|
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.9.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-05
|
11
|
+
date: 2015-06-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rtext
|
@@ -83,6 +83,7 @@ files:
|
|
83
83
|
- lib/bake/model/loader.rb
|
84
84
|
- lib/bake/model/metamodel.rb
|
85
85
|
- lib/bake/model/metamodel_ext.rb
|
86
|
+
- lib/bake/options/create.rb
|
86
87
|
- lib/bake/options/options.rb
|
87
88
|
- lib/bake/options/showConfigNames.rb
|
88
89
|
- lib/bake/options/showDoc.rb
|
@@ -128,6 +129,7 @@ files:
|
|
128
129
|
- lib/blocks/blockBase.rb
|
129
130
|
- lib/blocks/commandLine.rb
|
130
131
|
- lib/blocks/compile.rb
|
132
|
+
- lib/blocks/convert.rb
|
131
133
|
- lib/blocks/docu.rb
|
132
134
|
- lib/blocks/executable.rb
|
133
135
|
- lib/blocks/has_execute_command.rb
|