bake-toolkit 2.19.2 → 2.20.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/_images/dot.png +0 -0
- data/documentation/_build/html/_images/dotP.png +0 -0
- data/documentation/_build/html/_images/dotPC.png +0 -0
- data/documentation/_build/html/_sources/changelog.txt +12 -0
- data/documentation/_build/html/_sources/concepts/concepts.txt +2 -0
- data/documentation/_build/html/_sources/concepts/inject.txt +65 -0
- data/documentation/_build/html/_sources/concepts/prebuild.txt +56 -0
- data/documentation/_build/html/_sources/index.txt +1 -1
- data/documentation/_build/html/_sources/syntax/auto_adjustment.txt +43 -0
- data/documentation/_build/html/_sources/syntax/syntax.txt +1 -1
- data/documentation/_build/html/_sources/syntax/variable_substitutions.txt +41 -68
- data/documentation/_build/html/_sources/tips_and_tricks/dot.txt +34 -0
- data/documentation/_build/html/_sources/tips_and_tricks/tips_and_tricks.txt +1 -1
- data/documentation/_build/html/_static/dot.png +0 -0
- data/documentation/_build/html/_static/dotP.png +0 -0
- data/documentation/_build/html/_static/dotPC.png +0 -0
- data/documentation/_build/html/_static/syntax.html +20 -0
- data/documentation/_build/html/changelog.html +17 -3
- data/documentation/_build/html/commandline/commandline.html +3 -3
- data/documentation/_build/html/concepts/build_hierarchy.html +3 -3
- data/documentation/_build/html/concepts/concepts.html +13 -3
- data/documentation/_build/html/concepts/inject.html +217 -0
- data/documentation/_build/html/concepts/link_order.html +3 -3
- data/documentation/_build/html/concepts/prebuild.html +205 -0
- data/documentation/_build/html/concepts/the_main_project.html +3 -3
- data/documentation/_build/html/concepts/the_project_meta_file.html +3 -3
- data/documentation/_build/html/genindex.html +3 -3
- data/documentation/_build/html/ide/eclipse/eclipse.html +3 -3
- data/documentation/_build/html/ide/eclipse/how_to_convert_existing_cdt_workspace.html +3 -3
- data/documentation/_build/html/ide/eclipse/how_to_create_a_new_project_in_eclipse.html +3 -3
- data/documentation/_build/html/ide/eclipse/how_to_create_a_workspace_in_eclipse.html +3 -3
- data/documentation/_build/html/ide/eclipse/how_to_debug_in_eclipse.html +3 -3
- data/documentation/_build/html/ide/eclipse/how_to_install_eclipse_plugin.html +3 -3
- data/documentation/_build/html/ide/eclipse/how_to_use_bake_in_eclipse.html +3 -3
- data/documentation/_build/html/ide/ide_integrations.html +3 -3
- data/documentation/_build/html/ide/vs/how_to_create_vs_projects.html +3 -3
- data/documentation/_build/html/ide/vs/how_to_debug_in_vs.html +3 -3
- data/documentation/_build/html/ide/vs/how_to_used_bake_in_vs.html +3 -3
- data/documentation/_build/html/ide/vs/vs.html +3 -3
- data/documentation/_build/html/ide/vs/vs_install.html +3 -3
- data/documentation/_build/html/index.html +10 -7
- data/documentation/_build/html/install/install_bake.html +3 -3
- data/documentation/_build/html/internal.html +3 -3
- data/documentation/_build/html/known_issues.html +3 -3
- data/documentation/_build/html/license.html +3 -3
- data/documentation/_build/html/performance/performance.html +5 -5
- data/documentation/_build/html/quickstart/quickstart.html +3 -3
- data/documentation/_build/html/search.html +3 -3
- data/documentation/_build/html/searchindex.js +1 -1
- data/documentation/_build/html/syntax/adapt_configs.html +3 -3
- data/documentation/_build/html/syntax/auto_adjustment.html +190 -0
- data/documentation/_build/html/syntax/derive_configs.html +3 -3
- data/documentation/_build/html/syntax/project_meta_syntax.html +23 -3
- data/documentation/_build/html/syntax/syntax.html +11 -7
- data/documentation/_build/html/syntax/variable_substitutions.html +54 -67
- data/documentation/_build/html/tips_and_tricks/{bundle.html → dot.html} +25 -19
- data/documentation/_build/html/tips_and_tricks/how_to_use_bake_with_cygwin.html +3 -3
- data/documentation/_build/html/tips_and_tricks/static_code_analysis.html +3 -3
- data/documentation/_build/html/tips_and_tricks/the_bakery.html +3 -3
- data/documentation/_build/html/tips_and_tricks/the_clang.html +5 -5
- data/documentation/_build/html/tips_and_tricks/tips_and_tricks.html +4 -4
- data/documentation/_build/html/why_bake/why_bake.html +5 -5
- data/lib/adapt/config/loader.rb +37 -35
- data/lib/bake/config/checks.rb +19 -11
- data/lib/bake/config/loader.rb +67 -60
- data/lib/bake/model/metamodel.rb +56 -30
- data/lib/bake/options/options.rb +37 -3
- data/lib/bake/options/usage.rb +12 -3
- data/lib/bake/subst.rb +5 -2
- data/lib/blocks/block.rb +27 -6
- data/lib/blocks/blockBase.rb +2 -17
- data/lib/blocks/compile.rb +91 -91
- data/lib/blocks/executable.rb +41 -41
- data/lib/common/version.rb +1 -1
- data/lib/tocxx.rb +212 -55
- metadata +16 -4
- data/documentation/_build/html/_sources/tips_and_tricks/bundle.txt +0 -24
@@ -5,7 +5,7 @@
|
|
5
5
|
<head>
|
6
6
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
7
7
|
|
8
|
-
<title>Tips and Tricks — bake
|
8
|
+
<title>Tips and Tricks — bake documentation</title>
|
9
9
|
|
10
10
|
<link rel="stylesheet" href="../_static/basic.css" type="text/css" />
|
11
11
|
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
|
@@ -15,7 +15,7 @@
|
|
15
15
|
<script type="text/javascript">
|
16
16
|
var DOCUMENTATION_OPTIONS = {
|
17
17
|
URL_ROOT: '../',
|
18
|
-
VERSION: '
|
18
|
+
VERSION: '',
|
19
19
|
COLLAPSE_INDEX: false,
|
20
20
|
FILE_SUFFIX: '.html',
|
21
21
|
HAS_SOURCE: true
|
@@ -29,7 +29,7 @@
|
|
29
29
|
<script type="text/javascript" src="../_static/bootstrap-3.3.4/js/bootstrap.min.js"></script>
|
30
30
|
<script type="text/javascript" src="../_static/bootstrap-sphinx.js"></script>
|
31
31
|
<link rel="shortcut icon" href="../_static/logo_tiny_32.ico"/>
|
32
|
-
<link rel="top" title="bake
|
32
|
+
<link rel="top" title="bake documentation" href="../index.html" />
|
33
33
|
<link rel="next" title="The Bakery" href="the_bakery.html" />
|
34
34
|
<link rel="prev" title="How to Debug in Visual Studio" href="../ide/vs/how_to_debug_in_vs.html" />
|
35
35
|
<meta charset='utf-8'>
|
@@ -149,7 +149,7 @@
|
|
149
149
|
<li class="toctree-l1"><a class="reference internal" href="static_code_analysis.html">Static Code Analysis</a></li>
|
150
150
|
<li class="toctree-l1"><a class="reference internal" href="how_to_use_bake_with_cygwin.html">How to use bake with cygwin</a></li>
|
151
151
|
<li class="toctree-l1"><a class="reference internal" href="the_clang.html">Clang Analyze</a></li>
|
152
|
-
<li class="toctree-l1"><a class="reference internal" href="
|
152
|
+
<li class="toctree-l1"><a class="reference internal" href="dot.html">Generating dot graphs</a></li>
|
153
153
|
</ul>
|
154
154
|
</div>
|
155
155
|
<div class="section" id="unnecessary-includes">
|
@@ -5,7 +5,7 @@
|
|
5
5
|
<head>
|
6
6
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
7
7
|
|
8
|
-
<title>Why you should use bake — bake
|
8
|
+
<title>Why you should use bake — bake documentation</title>
|
9
9
|
|
10
10
|
<link rel="stylesheet" href="../_static/basic.css" type="text/css" />
|
11
11
|
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
|
@@ -15,7 +15,7 @@
|
|
15
15
|
<script type="text/javascript">
|
16
16
|
var DOCUMENTATION_OPTIONS = {
|
17
17
|
URL_ROOT: '../',
|
18
|
-
VERSION: '
|
18
|
+
VERSION: '',
|
19
19
|
COLLAPSE_INDEX: false,
|
20
20
|
FILE_SUFFIX: '.html',
|
21
21
|
HAS_SOURCE: true
|
@@ -29,9 +29,9 @@
|
|
29
29
|
<script type="text/javascript" src="../_static/bootstrap-3.3.4/js/bootstrap.min.js"></script>
|
30
30
|
<script type="text/javascript" src="../_static/bootstrap-sphinx.js"></script>
|
31
31
|
<link rel="shortcut icon" href="../_static/logo_tiny_32.ico"/>
|
32
|
-
<link rel="top" title="bake
|
32
|
+
<link rel="top" title="bake documentation" href="../index.html" />
|
33
33
|
<link rel="next" title="Install bake" href="../install/install_bake.html" />
|
34
|
-
<link rel="prev" title="bake 2.
|
34
|
+
<link rel="prev" title="bake 2.20.0" href="../index.html" />
|
35
35
|
<meta charset='utf-8'>
|
36
36
|
<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
|
37
37
|
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
|
@@ -108,7 +108,7 @@
|
|
108
108
|
|
109
109
|
|
110
110
|
<li>
|
111
|
-
<a href="../index.html" title="Previous Chapter: bake 2.
|
111
|
+
<a href="../index.html" title="Previous Chapter: bake 2.20.0"><span class="glyphicon glyphicon-chevron-left visible-sm"></span><span class="hidden-sm hidden-tablet">« bake 2.20.0</span>
|
112
112
|
</a>
|
113
113
|
</li>
|
114
114
|
<li>
|
data/lib/adapt/config/loader.rb
CHANGED
@@ -5,71 +5,73 @@ module Bake
|
|
5
5
|
|
6
6
|
class AdaptConfig
|
7
7
|
attr_reader :referencedConfigs
|
8
|
-
|
8
|
+
|
9
9
|
@@filenames = []
|
10
|
-
|
10
|
+
|
11
11
|
def self.filenames
|
12
12
|
@@filenames
|
13
|
-
end
|
14
|
-
|
13
|
+
end
|
14
|
+
|
15
15
|
def loadProjMeta(filename, filenum)
|
16
|
-
|
16
|
+
|
17
17
|
Bake::Configs::Checks.symlinkCheck(filename)
|
18
|
-
|
18
|
+
|
19
19
|
f = @loader.load(filename)
|
20
|
-
|
20
|
+
|
21
21
|
if f.root_elements.length != 1 or not Metamodel::Adapt === f.root_elements[0]
|
22
22
|
Bake.formatter.printError("Config file must have exactly one 'Adapt' element as root element", filename)
|
23
23
|
ExitHelper.exit(1)
|
24
24
|
end
|
25
|
-
|
25
|
+
|
26
26
|
adapt = f.root_elements[0]
|
27
27
|
configs = adapt.getConfig
|
28
|
-
|
28
|
+
|
29
29
|
Bake::Configs::Checks::commonMetamodelCheck(configs, filename)
|
30
|
-
|
30
|
+
|
31
31
|
configs.each do |c|
|
32
32
|
if not c.extends.empty?
|
33
|
-
Bake.formatter.printError("Attribute 'extends' must not be used in adapt config.",c)
|
33
|
+
Bake.formatter.printError("Attribute 'extends' must not be used in adapt config.",c)
|
34
34
|
ExitHelper.exit(1)
|
35
35
|
end
|
36
36
|
if c.name.empty?
|
37
|
-
Bake.formatter.printError("Configs must be named.",c)
|
37
|
+
Bake.formatter.printError("Configs must be named.",c)
|
38
38
|
ExitHelper.exit(1)
|
39
39
|
end
|
40
40
|
if c.project.empty?
|
41
|
-
Bake.formatter.printError("The corresponding project must be specified.",c)
|
41
|
+
Bake.formatter.printError("The corresponding project must be specified.",c)
|
42
42
|
ExitHelper.exit(1)
|
43
43
|
end
|
44
44
|
if not ["replace", "remove", "extend"].include?c.type
|
45
|
-
Bake.formatter.printError("Allowed types are 'replace', 'remove' and 'extend'.",c)
|
45
|
+
Bake.formatter.printError("Allowed types are 'replace', 'remove' and 'extend'.",c)
|
46
46
|
ExitHelper.exit(1)
|
47
47
|
end
|
48
48
|
end
|
49
|
-
|
49
|
+
|
50
50
|
configs
|
51
|
-
end
|
52
|
-
|
51
|
+
end
|
52
|
+
|
53
53
|
def getPotentialAdaptionProjects()
|
54
54
|
potentialAdapts = []
|
55
55
|
Bake.options.roots.each do |r|
|
56
56
|
if (r.length == 3 && r.include?(":/"))
|
57
57
|
r = r + Bake.options.main_project_name # glob would not work otherwise on windows (ruby bug?)
|
58
|
-
end
|
58
|
+
end
|
59
59
|
Bake.options.adapt.each do |a|
|
60
|
-
|
60
|
+
adaptBaseName = a + "/Adapt.meta"
|
61
|
+
potentialAdapts << adaptBaseName if File.exists?adaptBaseName
|
62
|
+
fn = r+"/**{,/*/**}/#{adaptBaseName}"
|
61
63
|
potentialAdapts.concat(Dir.glob(fn).sort)
|
62
64
|
end
|
63
65
|
end
|
64
|
-
|
66
|
+
|
65
67
|
potentialAdapts.uniq
|
66
|
-
end
|
67
|
-
|
68
|
-
def chooseProjectFilenames(potentialAdapts)
|
68
|
+
end
|
69
|
+
|
70
|
+
def chooseProjectFilenames(potentialAdapts)
|
69
71
|
@@filenames = []
|
70
|
-
|
71
|
-
Bake.options.adapt.each do |a|
|
72
|
-
adapts = potentialAdapts.find_all { |p| p.include?(a+"/Adapt.meta") }
|
72
|
+
p potentialAdapts
|
73
|
+
Bake.options.adapt.each do |a|
|
74
|
+
adapts = potentialAdapts.find_all { |p| p.include?(a+"/Adapt.meta") }
|
73
75
|
if adapts.empty?
|
74
76
|
Bake.formatter.printError("Adaption project #{a} not found")
|
75
77
|
ExitHelper.exit(1)
|
@@ -85,27 +87,27 @@ module Bake
|
|
85
87
|
end
|
86
88
|
end
|
87
89
|
end
|
88
|
-
|
90
|
+
|
89
91
|
end
|
90
|
-
|
92
|
+
|
91
93
|
def load()
|
92
94
|
@@filenames = []
|
93
95
|
return [] if Bake.options.adapt.empty?
|
94
|
-
|
96
|
+
|
95
97
|
@loader = Loader.new
|
96
|
-
|
98
|
+
|
97
99
|
potentialProjects = getPotentialAdaptionProjects()
|
98
100
|
chooseProjectFilenames(potentialProjects)
|
99
|
-
|
101
|
+
|
100
102
|
configs = []
|
101
103
|
@@filenames.each_with_index do |f,i|
|
102
104
|
configs.concat(loadProjMeta(f, i+1))
|
103
105
|
end
|
104
|
-
|
105
|
-
return configs
|
106
|
+
|
107
|
+
return configs
|
106
108
|
end
|
107
|
-
|
108
|
-
|
109
|
+
|
110
|
+
|
109
111
|
end
|
110
112
|
|
111
113
|
end
|
data/lib/bake/config/checks.rb
CHANGED
@@ -2,7 +2,7 @@ module Bake
|
|
2
2
|
module Configs
|
3
3
|
|
4
4
|
class Checks
|
5
|
-
|
5
|
+
|
6
6
|
def self.symlinkCheck(filename)
|
7
7
|
dirOfProjMeta = File.dirname(filename)
|
8
8
|
Dir.chdir(dirOfProjMeta) do
|
@@ -19,14 +19,14 @@ module Bake
|
|
19
19
|
end
|
20
20
|
end
|
21
21
|
end
|
22
|
-
|
22
|
+
|
23
23
|
def self.commonMetamodelCheck(configs, filename)
|
24
|
-
|
24
|
+
|
25
25
|
if configs.length == 0
|
26
26
|
Bake.formatter.printError("No config found", filename)
|
27
27
|
ExitHelper.exit(1)
|
28
28
|
end
|
29
|
-
|
29
|
+
|
30
30
|
configs.each do |config|
|
31
31
|
if config.respond_to?("toolchain") and config.toolchain
|
32
32
|
config.toolchain.compiler.each do |c|
|
@@ -36,26 +36,34 @@ module Bake
|
|
36
36
|
end
|
37
37
|
end
|
38
38
|
end
|
39
|
-
|
39
|
+
|
40
40
|
config.includeDir.each do |inc|
|
41
41
|
if not ["front", "back", ""].include?inc.inject
|
42
|
-
Bake.formatter.printError("inject of IncludeDir must be 'front' or 'back'", inc)
|
42
|
+
Bake.formatter.printError("inject of IncludeDir must be 'front' or 'back'", inc)
|
43
43
|
ExitHelper.exit(1)
|
44
44
|
end
|
45
45
|
if not ["front", "back", ""].include?inc.infix
|
46
|
-
Bake.formatter.printError("infix of IncludeDir must be 'front' or 'back'", inc)
|
46
|
+
Bake.formatter.printError("infix of IncludeDir must be 'front' or 'back'", inc)
|
47
47
|
ExitHelper.exit(1)
|
48
48
|
end
|
49
49
|
if (inc.infix != "" and inc.inject != "")
|
50
|
-
Bake.formatter.printError("IncludeDir must have inject OR infix (deprecated)", inc)
|
50
|
+
Bake.formatter.printError("IncludeDir must have inject OR infix (deprecated)", inc)
|
51
51
|
ExitHelper.exit(1)
|
52
52
|
end
|
53
53
|
end if config.respond_to?("includeDir")
|
54
|
+
|
55
|
+
config.dependency.each do |d|
|
56
|
+
if not ["front", "back", ""].include?d.inject
|
57
|
+
Bake.formatter.printError("inject of Dependency must be 'front' or 'back'", d)
|
58
|
+
ExitHelper.exit(1)
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
54
62
|
end
|
55
|
-
|
63
|
+
|
56
64
|
end
|
57
|
-
|
65
|
+
|
58
66
|
end
|
59
|
-
|
67
|
+
|
60
68
|
end
|
61
69
|
end
|
data/lib/bake/config/loader.rb
CHANGED
@@ -5,18 +5,18 @@ module Bake
|
|
5
5
|
|
6
6
|
class Config
|
7
7
|
attr_reader :referencedConfigs
|
8
|
-
|
8
|
+
|
9
9
|
def getFullProjectInternal(configs, configname, isMain) # note: configs is never empty
|
10
|
-
|
10
|
+
|
11
11
|
if (configname == "")
|
12
12
|
if configs[0].parent.default != ""
|
13
13
|
configname = configs[0].parent.default
|
14
14
|
else
|
15
|
-
Bake.formatter.printError("No default config specified", configs[0].file_name)
|
15
|
+
Bake.formatter.printError("No default config specified", configs[0].file_name)
|
16
16
|
ExitHelper.exit(1)
|
17
17
|
end
|
18
18
|
end
|
19
|
-
|
19
|
+
|
20
20
|
config = nil
|
21
21
|
configs.each do |c|
|
22
22
|
if c.name == configname
|
@@ -26,13 +26,13 @@ module Bake
|
|
26
26
|
end
|
27
27
|
config = c
|
28
28
|
end
|
29
|
-
end
|
30
|
-
|
29
|
+
end
|
30
|
+
|
31
31
|
if not config
|
32
32
|
Bake.formatter.printError("Config '#{configname}' not found", configs[0].file_name)
|
33
33
|
ExitHelper.exit(1)
|
34
34
|
end
|
35
|
-
|
35
|
+
|
36
36
|
if config.extends != ""
|
37
37
|
config.extends.split(",").map {|ex| ex.strip}.reverse.each do |ex|
|
38
38
|
if (ex != "")
|
@@ -41,10 +41,10 @@ module Bake
|
|
41
41
|
end
|
42
42
|
end
|
43
43
|
end
|
44
|
-
|
44
|
+
|
45
45
|
[config, configname]
|
46
46
|
end
|
47
|
-
|
47
|
+
|
48
48
|
def getFullProject(configs, configname, isMain)
|
49
49
|
config, configname = getFullProjectInternal(configs, configname, isMain)
|
50
50
|
|
@@ -57,7 +57,7 @@ module Bake
|
|
57
57
|
end
|
58
58
|
end
|
59
59
|
end
|
60
|
-
|
60
|
+
|
61
61
|
[config, configname]
|
62
62
|
end
|
63
63
|
|
@@ -77,7 +77,7 @@ module Bake
|
|
77
77
|
end
|
78
78
|
end
|
79
79
|
end
|
80
|
-
|
80
|
+
|
81
81
|
def checkVerFormat(ver)
|
82
82
|
return true if ver.empty?
|
83
83
|
return false if ver.length > 3
|
@@ -94,18 +94,18 @@ module Bake
|
|
94
94
|
Bake.formatter.printError("Not compatible with installed bake version: #{text1 + text2 + text3}", reqVersion)
|
95
95
|
ExitHelper.exit(1)
|
96
96
|
end
|
97
|
-
|
97
|
+
|
98
98
|
def checkVer(reqVersion)
|
99
99
|
return if reqVersion.nil?
|
100
100
|
min = reqVersion.minimum.split(".")
|
101
101
|
max = reqVersion.maximum.split(".")
|
102
102
|
cur = Bake::Version.number.split(".")
|
103
|
-
|
103
|
+
|
104
104
|
if !checkVerFormat(min) or !checkVerFormat(max)
|
105
105
|
Bake.formatter.printError("Version must be <major>.<minor>.<patch> whereas minor and patch are optional and all numbers >= 0.", reqVersion)
|
106
106
|
ExitHelper.exit(1)
|
107
107
|
end
|
108
|
-
|
108
|
+
|
109
109
|
[min,max,cur].each { |arr| arr.map! {|x| x.to_i} }
|
110
110
|
min.each_with_index do |v,i|
|
111
111
|
break if v < cur[i]
|
@@ -116,16 +116,16 @@ module Bake
|
|
116
116
|
bailOutVer(reqVersion) if v < cur[i]
|
117
117
|
end
|
118
118
|
end
|
119
|
-
|
119
|
+
|
120
120
|
def loadProjMeta(filename)
|
121
|
-
|
121
|
+
|
122
122
|
Bake::Configs::Checks.symlinkCheck(filename)
|
123
|
-
|
123
|
+
|
124
124
|
@project_files << filename
|
125
125
|
f = @loader.load(filename)
|
126
126
|
|
127
127
|
config = nil
|
128
|
-
|
128
|
+
|
129
129
|
if f.root_elements.length != 1 or not Metamodel::Project === f.root_elements[0]
|
130
130
|
Bake.formatter.printError("Config file must have exactly one 'Project' element as root element", filename)
|
131
131
|
ExitHelper.exit(1)
|
@@ -134,25 +134,25 @@ module Bake
|
|
134
134
|
|
135
135
|
reqVersion = proj.getRequiredBakeVersion
|
136
136
|
checkVer(reqVersion)
|
137
|
-
|
137
|
+
|
138
138
|
configs = proj.getConfig
|
139
139
|
Bake::Configs::Checks::commonMetamodelCheck(configs, filename)
|
140
|
-
|
140
|
+
|
141
141
|
configs.each do |c|
|
142
142
|
if not c.project.empty?
|
143
|
-
Bake.formatter.printError("Attribute 'project' must only be used in adapt config.",c)
|
143
|
+
Bake.formatter.printError("Attribute 'project' must only be used in adapt config.",c)
|
144
144
|
ExitHelper.exit(1)
|
145
145
|
end
|
146
146
|
if not c.type.empty?
|
147
|
-
Bake.formatter.printError("Attribute 'type' must only be used in adapt config.",c)
|
147
|
+
Bake.formatter.printError("Attribute 'type' must only be used in adapt config.",c)
|
148
148
|
ExitHelper.exit(1)
|
149
149
|
end
|
150
150
|
end
|
151
|
-
|
151
|
+
|
152
152
|
configs
|
153
153
|
end
|
154
|
-
|
155
|
-
|
154
|
+
|
155
|
+
|
156
156
|
def validateDependencies(config)
|
157
157
|
config.dependency.each do |dep|
|
158
158
|
if dep.name.include?"$" or dep.config.include?"$"
|
@@ -170,23 +170,27 @@ module Bake
|
|
170
170
|
ExitHelper.exit(1)
|
171
171
|
end
|
172
172
|
dep_path, dismiss, dep_name = dep_subbed.rpartition("/")
|
173
|
-
|
173
|
+
|
174
174
|
# file not loaded yet
|
175
175
|
if not @loadedConfigs.include?dep_name
|
176
|
-
|
176
|
+
|
177
|
+
if Bake.options.verbose >= 3
|
178
|
+
puts "First referenced by #{dep.parent.parent.name} (#{dep.parent.name}):"
|
179
|
+
end
|
180
|
+
|
177
181
|
pmeta_filenames = []
|
178
|
-
|
182
|
+
|
179
183
|
@potentialProjs.each do |pp|
|
180
|
-
if pp.include?("/" + dep_subbed + "/Project.meta") or pp == (dep_subbed + "/Project.meta")
|
184
|
+
if pp.include?("/" + dep_subbed + "/Project.meta") or pp == (dep_subbed + "/Project.meta")
|
181
185
|
pmeta_filenames << pp
|
182
186
|
end
|
183
187
|
end
|
184
|
-
|
188
|
+
|
185
189
|
if pmeta_filenames.empty?
|
186
190
|
Bake.formatter.printError("#{dep.name}/Project.meta not found", dep)
|
187
191
|
ExitHelper.exit(1)
|
188
192
|
end
|
189
|
-
|
193
|
+
|
190
194
|
if pmeta_filenames.length > 1
|
191
195
|
Bake.formatter.printWarning("Project #{dep.name} exists more than once", dep)
|
192
196
|
chosen = " (chosen)"
|
@@ -195,7 +199,7 @@ module Bake
|
|
195
199
|
chosen = ""
|
196
200
|
end
|
197
201
|
end
|
198
|
-
|
202
|
+
|
199
203
|
@loadedConfigs[dep_name] = loadProjMeta(pmeta_filenames[0])
|
200
204
|
else
|
201
205
|
folder = @loadedConfigs[dep_name][0].get_project_dir
|
@@ -203,54 +207,57 @@ module Bake
|
|
203
207
|
Bake.formatter.printError("Cannot load #{dep.name}, because #{folder} already loaded", dep)
|
204
208
|
ExitHelper.exit(1)
|
205
209
|
end
|
206
|
-
|
210
|
+
|
207
211
|
end
|
208
|
-
|
212
|
+
|
209
213
|
# get config
|
214
|
+
if Bake.options.verbose >= 3
|
215
|
+
puts " #{dep_name} #{dep.config.empty? ? "<default>" : "("+dep.config+")"} referenced by #{dep.parent.parent.name} (#{dep.parent.name})"
|
216
|
+
end
|
210
217
|
config, dep.config = getFullProject(@loadedConfigs[dep_name], dep.config, false)
|
211
218
|
dep.name = dep_name
|
212
|
-
|
219
|
+
|
213
220
|
# config not referenced yet
|
214
221
|
if not @referencedConfigs.include?dep_name
|
215
|
-
@referencedConfigs[dep_name] = [config]
|
222
|
+
@referencedConfigs[dep_name] = [config]
|
216
223
|
elsif @referencedConfigs[dep_name].index { |c| c.name == dep.config } == nil
|
217
224
|
@referencedConfigs[dep_name] << config
|
218
225
|
else
|
219
226
|
return
|
220
227
|
end
|
221
|
-
|
228
|
+
|
222
229
|
validateDependencies(config)
|
223
230
|
@depsPending += config.dependency
|
224
231
|
end
|
225
|
-
|
232
|
+
|
226
233
|
def loadMainMeta()
|
227
234
|
mainMeta = Bake.options.main_dir+"/Project.meta"
|
228
235
|
if not File.exist?(mainMeta)
|
229
236
|
Bake.formatter.printError("Error: #{mainMeta} not found")
|
230
237
|
ExitHelper.exit(1)
|
231
238
|
end
|
232
|
-
|
239
|
+
|
233
240
|
@project_files = []
|
234
241
|
configs = loadProjMeta(mainMeta)
|
235
242
|
@loadedConfigs = {}
|
236
243
|
@loadedConfigs[Bake.options.main_project_name] = configs
|
237
244
|
|
238
|
-
if not showConfigNames?
|
245
|
+
if not showConfigNames?
|
239
246
|
config, Bake.options.build_config = getFullProject(configs,Bake.options.build_config, true)
|
240
247
|
@referencedConfigs = {}
|
241
248
|
@referencedConfigs[Bake.options.main_project_name] = [config]
|
242
|
-
|
249
|
+
|
243
250
|
validateDependencies(config)
|
244
251
|
@depsPending = config.dependency
|
245
|
-
|
252
|
+
|
246
253
|
if Bake.options.build_config != "" and config.defaultToolchain == nil
|
247
254
|
Bake.formatter.printError("Main project configuration must contain DefaultToolchain", config)
|
248
255
|
ExitHelper.exit(1)
|
249
|
-
end
|
256
|
+
end
|
250
257
|
end
|
251
|
-
|
258
|
+
|
252
259
|
end
|
253
|
-
|
260
|
+
|
254
261
|
def checkRoots()
|
255
262
|
@potentialProjs = []
|
256
263
|
Bake.options.roots.each do |r|
|
@@ -260,30 +267,30 @@ module Bake
|
|
260
267
|
r = r+"/**{,/*/**}/Project.meta"
|
261
268
|
@potentialProjs.concat(Dir.glob(r).sort)
|
262
269
|
end
|
263
|
-
|
270
|
+
|
264
271
|
@potentialProjs = @potentialProjs.uniq
|
265
272
|
end
|
266
|
-
|
267
|
-
|
273
|
+
|
274
|
+
|
268
275
|
def filterStep(step, globalFilterStr)
|
269
|
-
|
276
|
+
|
270
277
|
# 1st prio: explicit single filter
|
271
|
-
if step.filter != ""
|
278
|
+
if step.filter != ""
|
272
279
|
return true if Bake.options.exclude_filter.include?step.filter
|
273
280
|
return false if Bake.options.include_filter.include?step.filter
|
274
|
-
end
|
281
|
+
end
|
275
282
|
|
276
283
|
# 2nd prio: explicit global filter
|
277
284
|
if globalFilterStr != nil
|
278
285
|
return true if Bake.options.exclude_filter.include?globalFilterStr
|
279
286
|
return false if Bake.options.include_filter.include?globalFilterStr
|
280
|
-
end
|
287
|
+
end
|
281
288
|
|
282
289
|
# 3nd prio: default
|
283
290
|
return true if step.default == "off"
|
284
|
-
false
|
291
|
+
false
|
285
292
|
end
|
286
|
-
|
293
|
+
|
287
294
|
def filterSteps
|
288
295
|
@referencedConfigs.each do |projName, configs|
|
289
296
|
configs.each do |config|
|
@@ -301,13 +308,13 @@ module Bake
|
|
301
308
|
def defaultConfigName
|
302
309
|
@loadedConfigs[Bake.options.main_project_name].first.parent.default
|
303
310
|
end
|
304
|
-
|
311
|
+
|
305
312
|
def showConfigNames?
|
306
313
|
Bake.options.showConfigs or (Bake.options.build_config == "" and defaultConfigName == "")
|
307
314
|
end
|
308
315
|
|
309
316
|
def printConfigNames
|
310
|
-
mainConfigName = Bake.options.build_config != "" ? Bake.options.build_config : defaultConfigName
|
317
|
+
mainConfigName = Bake.options.build_config != "" ? Bake.options.build_config : defaultConfigName
|
311
318
|
configs = @loadedConfigs[Bake.options.main_project_name]
|
312
319
|
foundValidConfig = false
|
313
320
|
configs.each do |c|
|
@@ -319,11 +326,11 @@ module Bake
|
|
319
326
|
Kernel.print "\n"
|
320
327
|
foundValidConfig = true
|
321
328
|
end
|
322
|
-
|
329
|
+
|
323
330
|
Bake.formatter.printWarning("No configuration with a DefaultToolchain found", Bake.options.main_dir+"/Project.meta") unless foundValidConfig
|
324
331
|
ExitHelper.exit(0)
|
325
332
|
end
|
326
|
-
|
333
|
+
|
327
334
|
def load(adaptConfigs)
|
328
335
|
@adaptConfigs = adaptConfigs
|
329
336
|
@loader = Loader.new
|
@@ -349,8 +356,8 @@ module Bake
|
|
349
356
|
else
|
350
357
|
loadMainMeta # "--list" specified
|
351
358
|
printConfigNames
|
352
|
-
end
|
359
|
+
end
|
353
360
|
end
|
354
|
-
|
361
|
+
|
355
362
|
end
|
356
363
|
end
|