bake-toolkit 2.17.4 → 2.18.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/documentation/_build/html/_sources/changelog.txt +14 -0
- data/documentation/_build/html/_sources/concepts/build_hierarchy.txt +1 -1
- data/documentation/_build/html/_sources/concepts/concepts.txt +1 -0
- data/documentation/_build/html/_sources/concepts/link_order.txt +91 -0
- data/documentation/_build/html/_sources/index.txt +1 -1
- data/documentation/_build/html/changelog.html +31 -3
- data/documentation/_build/html/commandline/commandline.html +3 -3
- data/documentation/_build/html/concepts/build_hierarchy.html +6 -6
- data/documentation/_build/html/concepts/concepts.html +8 -3
- data/documentation/_build/html/concepts/link_order.html +246 -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 +7 -6
- 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 +3 -3
- 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/derive_configs.html +3 -3
- data/documentation/_build/html/syntax/project_meta_syntax.html +3 -3
- data/documentation/_build/html/syntax/syntax.html +5 -5
- data/documentation/_build/html/syntax/variable_substitutions.html +3 -3
- data/documentation/_build/html/tips_and_tricks/bundle.html +3 -3
- 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 +3 -3
- data/documentation/_build/html/tips_and_tricks/tips_and_tricks.html +3 -3
- data/documentation/_build/html/why_bake/why_bake.html +5 -5
- data/lib/bake/libElement.rb +77 -38
- data/lib/bake/mergeConfig.rb +31 -27
- data/lib/bake/options/options.rb +36 -33
- data/lib/bake/options/usage.rb +5 -3
- data/lib/common/version.rb +1 -1
- metadata +4 -2
|
@@ -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 2.
|
|
8
|
+
<title>Tips and Tricks — bake 2.18.0 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: '2.
|
|
18
|
+
VERSION: '2.18.0',
|
|
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 2.
|
|
32
|
+
<link rel="top" title="bake 2.18.0 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'>
|
|
@@ -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 2.
|
|
8
|
+
<title>Why you should use bake — bake 2.18.0 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: '2.
|
|
18
|
+
VERSION: '2.18.0',
|
|
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 2.
|
|
32
|
+
<link rel="top" title="bake 2.18.0 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.18.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.18.0"><span class="glyphicon glyphicon-chevron-left visible-sm"></span><span class="hidden-sm hidden-tablet">« bake 2.18.0</span>
|
|
112
112
|
</a>
|
|
113
113
|
</li>
|
|
114
114
|
<li>
|
data/lib/bake/libElement.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module Bake
|
|
2
|
-
|
|
2
|
+
|
|
3
3
|
class LibElement
|
|
4
|
-
|
|
4
|
+
|
|
5
5
|
LIB = 1
|
|
6
6
|
USERLIB = 2
|
|
7
7
|
LIB_WITH_PATH = 3
|
|
@@ -9,15 +9,15 @@ module Bake
|
|
|
9
9
|
DEPENDENCY = 5
|
|
10
10
|
|
|
11
11
|
attr_reader :type, :value
|
|
12
|
-
|
|
12
|
+
|
|
13
13
|
def initialize(type, value)
|
|
14
14
|
@type = type
|
|
15
15
|
@value = value
|
|
16
16
|
end
|
|
17
17
|
end
|
|
18
|
-
|
|
19
|
-
class LibElements
|
|
20
|
-
|
|
18
|
+
|
|
19
|
+
class LibElements
|
|
20
|
+
|
|
21
21
|
def self.calc_linker_lib_string(block, tcs)
|
|
22
22
|
@@lib_path_set = []
|
|
23
23
|
@@dep_set = Set.new
|
|
@@ -25,16 +25,25 @@ module Bake
|
|
|
25
25
|
@@projectDir = block.projectDir
|
|
26
26
|
@@source_libraries = []
|
|
27
27
|
@@linker_libs_array = []
|
|
28
|
-
|
|
28
|
+
|
|
29
29
|
collect_recursive(block)
|
|
30
|
-
|
|
31
|
-
if
|
|
32
|
-
|
|
30
|
+
|
|
31
|
+
if Bake.options.oldLinkOrder
|
|
32
|
+
if @@linker[:LIST_MODE] and not @@lib_path_set.empty?
|
|
33
|
+
@@linker_libs_array << (@@linker[:LIB_PATH_FLAG] + @@lib_path_set.join(","));
|
|
34
|
+
end
|
|
35
|
+
else
|
|
36
|
+
@@source_libraries.reverse!
|
|
37
|
+
@@lib_path_set.reverse!
|
|
38
|
+
if @@linker[:LIST_MODE] and not @@lib_path_set.empty?
|
|
39
|
+
@@linker_libs_array.unshift (@@linker[:LIB_PATH_FLAG] + @@lib_path_set.join(","));
|
|
40
|
+
end
|
|
41
|
+
@@linker_libs_array.reverse!
|
|
33
42
|
end
|
|
34
|
-
|
|
35
|
-
return [@@source_libraries, @@linker_libs_array]
|
|
43
|
+
|
|
44
|
+
return [@@source_libraries, @@linker_libs_array]
|
|
36
45
|
end
|
|
37
|
-
|
|
46
|
+
|
|
38
47
|
def self.adaptPath(path, block, prefix)
|
|
39
48
|
adaptedPath = path
|
|
40
49
|
if not File.is_absolute?(path)
|
|
@@ -44,23 +53,31 @@ module Bake
|
|
|
44
53
|
#adaptedPath = "\"" + adaptedPath + "\"" if adaptedPath.include?(" ")
|
|
45
54
|
[adaptedPath, prefix]
|
|
46
55
|
end
|
|
47
|
-
|
|
48
|
-
def self.collect_recursive(block)
|
|
49
|
-
return if @@dep_set.include?block
|
|
50
|
-
@@dep_set << block
|
|
51
|
-
|
|
52
|
-
prefix = nil
|
|
53
56
|
|
|
54
|
-
|
|
57
|
+
def self.addOwnLib(block)
|
|
58
|
+
if block.library
|
|
55
59
|
if (not block.library.compileBlock.objects.empty?) or not block.library.compileBlock.calcSources(true, true).empty?
|
|
56
60
|
adaptedPath, prefix = adaptPath(block.library.archive_name, block, prefix)
|
|
57
61
|
@@linker_libs_array << adaptedPath
|
|
58
62
|
@@source_libraries << adaptedPath
|
|
59
63
|
end
|
|
60
64
|
end
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
def self.collect_recursive(block)
|
|
68
|
+
return if @@dep_set.include?block
|
|
69
|
+
@@dep_set << block
|
|
70
|
+
|
|
71
|
+
prefix = nil
|
|
72
|
+
|
|
73
|
+
if Bake.options.oldLinkOrder
|
|
74
|
+
addOwnLib(block)
|
|
75
|
+
elems = block.lib_elements
|
|
76
|
+
else
|
|
77
|
+
elems = block.lib_elements.reverse
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
elems.each do |elem|
|
|
64
81
|
case elem.type
|
|
65
82
|
when LibElement::LIB
|
|
66
83
|
@@linker_libs_array << "#{@@linker[:LIB_FLAG]}#{elem.value}"
|
|
@@ -71,10 +88,29 @@ module Bake
|
|
|
71
88
|
@@linker_libs_array << adaptedPath
|
|
72
89
|
when LibElement::SEARCH_PATH
|
|
73
90
|
adaptedPath, prefix = adaptPath(elem.value, block, prefix)
|
|
74
|
-
|
|
91
|
+
lpf = "#{@@linker[:LIB_PATH_FLAG]}#{adaptedPath}"
|
|
92
|
+
|
|
93
|
+
if not Bake.options.oldLinkOrder
|
|
94
|
+
if not @@lib_path_set.include?adaptedPath
|
|
95
|
+
@@lib_path_set << adaptedPath
|
|
96
|
+
@@linker_libs_array << lpf if @@linker[:LIST_MODE] == false
|
|
97
|
+
end
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
if not Bake.options.oldLinkOrder
|
|
101
|
+
# must be moved to the end, so delete it...
|
|
102
|
+
ind1 = @@lib_path_set.index(adaptedPath)
|
|
103
|
+
ind2 = @@linker_libs_array.index(lpf)
|
|
104
|
+
@@lib_path_set.delete_at(ind1) if not ind1.nil?
|
|
105
|
+
@@linker_libs_array.delete_at(ind2) if not ind2.nil?
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
if (not Bake.options.oldLinkOrder) or (not @@lib_path_set.include?adaptedPath)
|
|
109
|
+
# end place it at the end again
|
|
75
110
|
@@lib_path_set << adaptedPath
|
|
76
|
-
@@linker_libs_array <<
|
|
111
|
+
@@linker_libs_array << lpf if @@linker[:LIST_MODE] == false
|
|
77
112
|
end
|
|
113
|
+
|
|
78
114
|
when LibElement::DEPENDENCY
|
|
79
115
|
if Blocks::ALL_BLOCKS.include?elem.value
|
|
80
116
|
bb = Blocks::ALL_BLOCKS[elem.value]
|
|
@@ -84,16 +120,19 @@ module Bake
|
|
|
84
120
|
end
|
|
85
121
|
end
|
|
86
122
|
end
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
123
|
+
|
|
124
|
+
addOwnLib(block) if not Bake.options.oldLinkOrder
|
|
125
|
+
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
92
131
|
def self.calcLibElements(block)
|
|
93
132
|
lib_elements = [] # value = array pairs [type, name/path string]
|
|
94
|
-
|
|
133
|
+
|
|
95
134
|
block.config.libStuff.each do |l|
|
|
96
|
-
|
|
135
|
+
|
|
97
136
|
if (Metamodel::UserLibrary === l)
|
|
98
137
|
ln = l.name
|
|
99
138
|
ls = nil
|
|
@@ -120,16 +159,16 @@ module Bake
|
|
|
120
159
|
else
|
|
121
160
|
ln = ls + "/" + ln unless ls.nil?
|
|
122
161
|
lib_elements << LibElement.new(LibElement::LIB_WITH_PATH, ln)
|
|
123
|
-
end
|
|
162
|
+
end
|
|
124
163
|
elsif (Metamodel::Dependency === l)
|
|
125
164
|
lib_elements << LibElement.new(LibElement::DEPENDENCY, l.name+","+l.config)
|
|
126
165
|
end
|
|
127
|
-
|
|
166
|
+
|
|
128
167
|
end
|
|
129
|
-
|
|
168
|
+
|
|
130
169
|
return lib_elements
|
|
131
|
-
end
|
|
132
|
-
|
|
170
|
+
end
|
|
171
|
+
|
|
133
172
|
end
|
|
134
|
-
|
|
173
|
+
|
|
135
174
|
end
|
data/lib/bake/mergeConfig.rb
CHANGED
|
@@ -3,12 +3,12 @@ require 'common/ext/rtext'
|
|
|
3
3
|
module Bake
|
|
4
4
|
|
|
5
5
|
class MergeConfig
|
|
6
|
-
|
|
6
|
+
|
|
7
7
|
def initialize(child, parent)
|
|
8
8
|
@child = child
|
|
9
9
|
@parent = parent
|
|
10
10
|
end
|
|
11
|
-
|
|
11
|
+
|
|
12
12
|
def self.clone(obj)
|
|
13
13
|
if obj.is_a?(Metamodel::ModelElement)
|
|
14
14
|
cloneModelElement(obj)
|
|
@@ -18,7 +18,7 @@ module Bake
|
|
|
18
18
|
obj # no clone, should not happen
|
|
19
19
|
end
|
|
20
20
|
end
|
|
21
|
-
|
|
21
|
+
|
|
22
22
|
def self.cloneModelElement(obj)
|
|
23
23
|
cpy = obj.class.new
|
|
24
24
|
cpy.file_name = obj.file_name
|
|
@@ -36,14 +36,14 @@ module Bake
|
|
|
36
36
|
end
|
|
37
37
|
cpy
|
|
38
38
|
end
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
|
|
40
|
+
|
|
41
41
|
def replace()
|
|
42
42
|
@child.class.ecore.eAllReferences.each do |f|
|
|
43
43
|
next unless @parent.class.ecore.eAllReferences.include?f
|
|
44
44
|
next unless f.containment
|
|
45
45
|
childData = @child.getGeneric(f.name)
|
|
46
|
-
if Metamodel::ModelElement === childData
|
|
46
|
+
if Metamodel::ModelElement === childData
|
|
47
47
|
@parent.setGeneric(f.name,childData) if !childData.nil?
|
|
48
48
|
elsif Array === childData
|
|
49
49
|
if !childData.empty?
|
|
@@ -56,7 +56,7 @@ module Bake
|
|
|
56
56
|
end
|
|
57
57
|
end
|
|
58
58
|
end
|
|
59
|
-
|
|
59
|
+
|
|
60
60
|
def hasSubNodes(elem)
|
|
61
61
|
elem.class.ecore.eAllReferences.each do |f|
|
|
62
62
|
next unless f.containment
|
|
@@ -68,31 +68,35 @@ module Bake
|
|
|
68
68
|
end
|
|
69
69
|
|
|
70
70
|
def sameAttr(childData, parentData)
|
|
71
|
-
childData.class.ecore.eAllAttributes.all? { |a|
|
|
71
|
+
childData.class.ecore.eAllAttributes.all? { |a|
|
|
72
72
|
a.eAnnotations.each do |x| x.details.each do |y|
|
|
73
73
|
return true if (y.key == :internal and y.value == true)
|
|
74
74
|
end; end
|
|
75
75
|
a.name == "line_number" || (not childData.eIsSet(a.name)) || (childData.getGeneric(a.name) == parentData.getGeneric(a.name))
|
|
76
76
|
}
|
|
77
77
|
end
|
|
78
|
-
|
|
78
|
+
|
|
79
79
|
def removeChilds(childElem, parentElem)
|
|
80
80
|
return if childElem.nil? or parentElem.nil?
|
|
81
|
-
|
|
81
|
+
|
|
82
82
|
childElem.class.ecore.eAllReferences.each do |f|
|
|
83
83
|
next unless f.containment
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
begin
|
|
85
|
+
childData = childElem.getGeneric(f.name)
|
|
86
|
+
parentData = parentElem.getGeneric(f.name)
|
|
87
|
+
rescue Exception => ex
|
|
88
|
+
next # how to check fast if f.name is valid?
|
|
89
|
+
end
|
|
86
90
|
next if childData.nil? or parentData.nil?
|
|
87
91
|
if (Array === childData)
|
|
88
92
|
if !parentData.empty? && !childData.empty?
|
|
89
93
|
childData.each do |c|
|
|
90
|
-
cN = hasSubNodes(c)
|
|
94
|
+
cN = hasSubNodes(c)
|
|
91
95
|
toRemove = []
|
|
92
96
|
parentData.each do |p|
|
|
93
97
|
next if p.class != c.class
|
|
94
98
|
if (not cN)
|
|
95
|
-
if sameAttr(c, p)
|
|
99
|
+
if sameAttr(c, p)
|
|
96
100
|
toRemove << p
|
|
97
101
|
end
|
|
98
102
|
else
|
|
@@ -116,24 +120,24 @@ module Bake
|
|
|
116
120
|
end
|
|
117
121
|
end
|
|
118
122
|
end
|
|
119
|
-
|
|
123
|
+
|
|
120
124
|
def extendAttributes(childData, parentData)
|
|
121
|
-
parentData.class.ecore.eAllAttributes.each do |a|
|
|
125
|
+
parentData.class.ecore.eAllAttributes.each do |a|
|
|
122
126
|
childData.setGeneric(a.name, parentData.getGeneric(a.name)) if !childData.eIsSet(a.name) && parentData.eIsSet(a.name)
|
|
123
127
|
end
|
|
124
128
|
end
|
|
125
|
-
|
|
129
|
+
|
|
126
130
|
def extend(child, parent)
|
|
127
131
|
(parent.class.ecore.eAllReferences & child.class.ecore.eAllReferences).each do |f|
|
|
128
132
|
next unless f.containment
|
|
129
133
|
parentData = parent.getGeneric(f.name)
|
|
130
134
|
next if parentData.nil? or (Array === parentData && parentData.empty?)
|
|
131
135
|
childData = child.getGeneric(f.name)
|
|
132
|
-
|
|
136
|
+
|
|
133
137
|
if Array === parentData
|
|
134
138
|
if f.name == "compiler"
|
|
135
139
|
extendedParentData = []
|
|
136
|
-
parentData.each do |p|
|
|
140
|
+
parentData.each do |p|
|
|
137
141
|
c = childData.find { |c| p.ctype == c.ctype }
|
|
138
142
|
if c
|
|
139
143
|
extendAttributes(c, p)
|
|
@@ -144,7 +148,7 @@ module Bake
|
|
|
144
148
|
end
|
|
145
149
|
end
|
|
146
150
|
restOfChildData = childData.find_all { |c| parentData.find {|p| p.ctype != c.ctype } }
|
|
147
|
-
child.setGeneric(f.name, extendedParentData + restOfChildData)
|
|
151
|
+
child.setGeneric(f.name, extendedParentData + restOfChildData)
|
|
148
152
|
else
|
|
149
153
|
child.setGeneric(f.name, parentData + childData)
|
|
150
154
|
end
|
|
@@ -157,17 +161,17 @@ module Bake
|
|
|
157
161
|
end
|
|
158
162
|
end
|
|
159
163
|
end
|
|
160
|
-
end
|
|
161
|
-
|
|
164
|
+
end
|
|
165
|
+
|
|
162
166
|
def copyChildToParent(c, p)
|
|
163
167
|
(p.class.ecore.eAllReferences & c.class.ecore.eAllReferences).each do |f|
|
|
164
168
|
next unless f.containment
|
|
165
169
|
childData = c.getGeneric(f.name)
|
|
166
170
|
next if childData.nil? || (Array === childData && childData.empty?)
|
|
167
171
|
p.setGeneric(f.name, childData)
|
|
168
|
-
end
|
|
172
|
+
end
|
|
169
173
|
end
|
|
170
|
-
|
|
174
|
+
|
|
171
175
|
def merge(type)
|
|
172
176
|
s = StringIO.new
|
|
173
177
|
ser = RText::Serializer.new(Language)
|
|
@@ -178,7 +182,7 @@ module Bake
|
|
|
178
182
|
s.puts "\n>>>> parent <<<<"
|
|
179
183
|
ser.serialize(@parent, s)
|
|
180
184
|
end
|
|
181
|
-
|
|
185
|
+
|
|
182
186
|
if (type == :remove)
|
|
183
187
|
removeChilds(@child, @parent)
|
|
184
188
|
elsif (type == :replace)
|
|
@@ -197,9 +201,9 @@ module Bake
|
|
|
197
201
|
puts "#{s.string}"
|
|
198
202
|
end
|
|
199
203
|
|
|
200
|
-
|
|
204
|
+
|
|
201
205
|
end
|
|
202
|
-
|
|
206
|
+
|
|
203
207
|
end
|
|
204
208
|
|
|
205
209
|
end
|
data/lib/bake/options/options.rb
CHANGED
|
@@ -15,35 +15,36 @@ module Bake
|
|
|
15
15
|
def self.options=(options)
|
|
16
16
|
@@options = options
|
|
17
17
|
end
|
|
18
|
-
|
|
18
|
+
|
|
19
19
|
class Options < Parser
|
|
20
20
|
attr_accessor :build_config, :nocache, :analyze, :eclipseOrder, :envToolchain, :showConfigs
|
|
21
21
|
attr_reader :main_dir, :project, :filename, :main_project_name, :cc2j_filename, :bundleDir # 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, :linkOnly, :no_autodir, :clobber, :lint, :docu, :debug, :prepro # Boolean
|
|
23
|
+
attr_reader :conversion_info, :stopOnFirstError, :clean, :rebuild, :show_includes, :show_includes_and_defines, :linkOnly, :no_autodir, :clobber, :lint, :docu, :debug, :prepro, :oldLinkOrder # Boolean
|
|
24
24
|
attr_reader :threads, :socket, :lint_min, :lint_max # Fixnum
|
|
25
25
|
attr_reader :vars # map
|
|
26
26
|
attr_reader :verbose
|
|
27
27
|
attr_reader :consoleOutput_fullnames, :consoleOutput_visualStudio
|
|
28
|
-
|
|
28
|
+
|
|
29
29
|
|
|
30
30
|
def initialize(argv)
|
|
31
31
|
super(argv)
|
|
32
32
|
|
|
33
|
+
@oldLinkOrder = false
|
|
33
34
|
@conversion_info = false
|
|
34
35
|
@envToolchain = false
|
|
35
36
|
@analyze = false
|
|
36
37
|
@eclipseOrder = false
|
|
37
38
|
@showConfigs = false
|
|
38
39
|
@consoleOutput_fullnames = false
|
|
39
|
-
@consoleOutput_visualStudio = false
|
|
40
|
+
@consoleOutput_visualStudio = false
|
|
40
41
|
@prepro = false
|
|
41
42
|
@stopOnFirstError = false
|
|
42
43
|
@verbose = 1
|
|
43
44
|
@vars = {}
|
|
44
45
|
@build_config = ""
|
|
45
46
|
@main_dir = nil
|
|
46
|
-
@project = nil
|
|
47
|
+
@project = nil
|
|
47
48
|
@filename = nil
|
|
48
49
|
@cc2j_filename = nil
|
|
49
50
|
@clean = false
|
|
@@ -68,7 +69,7 @@ module Bake
|
|
|
68
69
|
@main_project_name = ""
|
|
69
70
|
@adapt = []
|
|
70
71
|
@bundleDir = nil
|
|
71
|
-
|
|
72
|
+
|
|
72
73
|
add_option(["-b", "" ], lambda { |x| set_build_config(x) })
|
|
73
74
|
add_option(["-m" ], lambda { |x| set_main_dir(x) })
|
|
74
75
|
add_option(["-p" ], lambda { |x| @project = x })
|
|
@@ -84,22 +85,22 @@ module Bake
|
|
|
84
85
|
add_option(["--lint" ], lambda { @lint = true })
|
|
85
86
|
add_option(["--lint-min", "--lint_min" ], lambda { |x| @lint_min = String === x ? x.to_i : x })
|
|
86
87
|
add_option(["--lint-max", "--lint_max" ], lambda { |x| @lint_max = String === x ? x.to_i : x })
|
|
87
|
-
|
|
88
|
-
add_option(["--create" ], lambda { |x| Bake::Create.proj(x) })
|
|
89
|
-
add_option(["--conversion-info", "--conversion_info" ], lambda { @conversion_info = true })
|
|
90
|
-
|
|
88
|
+
|
|
89
|
+
add_option(["--create" ], lambda { |x| Bake::Create.proj(x) })
|
|
90
|
+
add_option(["--conversion-info", "--conversion_info" ], lambda { @conversion_info = true })
|
|
91
|
+
|
|
91
92
|
add_option(["--generate-doc", "--docu" ], lambda { @docu = true })
|
|
92
|
-
|
|
93
|
-
add_option(["--adapt" ], lambda { |x| set_adapt(x) })
|
|
94
|
-
|
|
93
|
+
|
|
94
|
+
add_option(["--adapt" ], lambda { |x| set_adapt(x) })
|
|
95
|
+
|
|
95
96
|
add_option(["-v0" ], lambda { @verbose = 0 })
|
|
96
97
|
add_option(["-v1" ], lambda { @verbose = 1 })
|
|
97
98
|
add_option(["-v2" ], lambda { @verbose = 2 })
|
|
98
99
|
add_option(["-v3" ], lambda { @verbose = 3 })
|
|
99
|
-
|
|
100
|
+
|
|
100
101
|
add_option(["--debug" ], lambda { @debug = true })
|
|
101
102
|
add_option(["--set" ], lambda { |x| set_set(x) })
|
|
102
|
-
|
|
103
|
+
|
|
103
104
|
add_option(["--clobber" ], lambda { @clobber = true; @clean = true })
|
|
104
105
|
add_option(["--ignore-cache", "--ignore_cache" ], lambda { @nocache = true })
|
|
105
106
|
add_option(["-j", "--threads" ], lambda { |x| set_threads(x) })
|
|
@@ -110,7 +111,7 @@ module Bake
|
|
|
110
111
|
add_option(["--omit", "--exclude_filter" ], lambda { |x| @exclude_filter << x })
|
|
111
112
|
add_option(["--abs-paths", "--show_abs_paths" ], lambda { @consoleOutput_fullnames = true })
|
|
112
113
|
add_option(["--bundle" ], lambda { |x| set_bundle_dir(x) })
|
|
113
|
-
|
|
114
|
+
|
|
114
115
|
add_option(["-h", "--help" ], lambda { Bake::Usage.show })
|
|
115
116
|
|
|
116
117
|
add_option(["--incs-and-defs", "--show_incs_and_defs" ], lambda { @show_includes_and_defines = true })
|
|
@@ -120,10 +121,12 @@ module Bake
|
|
|
120
121
|
add_option(["--version" ], lambda { ExitHelper.exit(0) })
|
|
121
122
|
add_option(["--list", "--show_configs" ], lambda { @showConfigs = true })
|
|
122
123
|
add_option(["--writeCC2J" ], lambda { |x| @cc2j_filename = x.gsub(/[\\]/,'/') })
|
|
124
|
+
add_option(["--link-2-17", "--link_2_17" ], lambda { @oldLinkOrder = true })
|
|
125
|
+
|
|
123
126
|
|
|
124
127
|
# hidden
|
|
125
128
|
add_option(["--visualStudio" ], lambda { @consoleOutput_visualStudio = true })
|
|
126
|
-
|
|
129
|
+
|
|
127
130
|
# deprecated and not replaced by new command
|
|
128
131
|
add_option(["--show_include_paths" ], lambda { @show_includes = true })
|
|
129
132
|
|
|
@@ -136,19 +139,19 @@ module Bake
|
|
|
136
139
|
@roots = @def_roots if @roots.length == 0
|
|
137
140
|
@roots.uniq!
|
|
138
141
|
@adapt.uniq!
|
|
139
|
-
|
|
142
|
+
|
|
140
143
|
if @project
|
|
141
144
|
if @project.split(',').length > 2
|
|
142
145
|
Bake.formatter.printError("Error: only one comma allowed for -p")
|
|
143
146
|
ExitHelper.exit(1)
|
|
144
147
|
end
|
|
145
148
|
end
|
|
146
|
-
|
|
149
|
+
|
|
147
150
|
if @conversion_info
|
|
148
151
|
if @rebuild
|
|
149
152
|
Bake.formatter.printError("Error: --conversion-info and --rebuild not allowed at the same time")
|
|
150
153
|
ExitHelper.exit(1)
|
|
151
|
-
end
|
|
154
|
+
end
|
|
152
155
|
if @clean
|
|
153
156
|
Bake.formatter.printError("Error: --conversion-info and -c not allowed at the same time")
|
|
154
157
|
ExitHelper.exit(1)
|
|
@@ -174,7 +177,7 @@ module Bake
|
|
|
174
177
|
ExitHelper.exit(1)
|
|
175
178
|
end
|
|
176
179
|
end
|
|
177
|
-
|
|
180
|
+
|
|
178
181
|
if @linkOnly
|
|
179
182
|
if @rebuild
|
|
180
183
|
Bake.formatter.printError("Error: --link-only and --rebuild not allowed at the same time")
|
|
@@ -200,13 +203,13 @@ module Bake
|
|
|
200
203
|
ExitHelper.exit(1)
|
|
201
204
|
end
|
|
202
205
|
end
|
|
203
|
-
|
|
206
|
+
|
|
204
207
|
if @lint and @docu
|
|
205
208
|
Bake.formatter.printError("Error: --lint and --docu not allowed at the same time")
|
|
206
209
|
ExitHelper.exit(1)
|
|
207
210
|
end
|
|
208
211
|
end
|
|
209
|
-
|
|
212
|
+
|
|
210
213
|
def check_valid_dir(dir)
|
|
211
214
|
if not File.exists?(dir)
|
|
212
215
|
Bake.formatter.printError("Error: Directory #{dir} does not exist")
|
|
@@ -215,8 +218,8 @@ module Bake
|
|
|
215
218
|
if not File.directory?(dir)
|
|
216
219
|
Bake.formatter.printError("Error: #{dir} is not a directory")
|
|
217
220
|
ExitHelper.exit(1)
|
|
218
|
-
end
|
|
219
|
-
end
|
|
221
|
+
end
|
|
222
|
+
end
|
|
220
223
|
|
|
221
224
|
def set_build_config(config)
|
|
222
225
|
if not @build_config.empty?
|
|
@@ -225,30 +228,30 @@ module Bake
|
|
|
225
228
|
end
|
|
226
229
|
@build_config = config
|
|
227
230
|
end
|
|
228
|
-
|
|
231
|
+
|
|
229
232
|
def set_main_dir(dir)
|
|
230
233
|
check_valid_dir(dir)
|
|
231
234
|
@main_dir = File.expand_path(dir.gsub(/[\\]/,'/'))
|
|
232
235
|
@main_project_name = File::basename(@main_dir)
|
|
233
236
|
@def_roots = calc_def_roots(@main_dir)
|
|
234
237
|
end
|
|
235
|
-
|
|
238
|
+
|
|
236
239
|
def set_bundle_dir(dir)
|
|
237
240
|
d = File.expand_path(dir.gsub(/[\\]/,'/'))
|
|
238
241
|
Bake::Bundle.instance.setOutputDir(d)
|
|
239
242
|
end
|
|
240
|
-
|
|
241
|
-
|
|
243
|
+
|
|
244
|
+
|
|
242
245
|
def set_root(dir)
|
|
243
246
|
check_valid_dir(dir)
|
|
244
247
|
r = File.expand_path(dir.gsub(/[\\]/,'/'))
|
|
245
248
|
@roots << r if not @roots.include?r
|
|
246
249
|
end
|
|
247
|
-
|
|
250
|
+
|
|
248
251
|
def set_adapt(name)
|
|
249
252
|
@adapt << name if not @adapt.include?name
|
|
250
253
|
end
|
|
251
|
-
|
|
254
|
+
|
|
252
255
|
def set_threads(num)
|
|
253
256
|
@threads = String === num ? num.to_i : num
|
|
254
257
|
if @threads <= 0
|
|
@@ -256,7 +259,7 @@ module Bake
|
|
|
256
259
|
ExitHelper.exit(1)
|
|
257
260
|
end
|
|
258
261
|
end
|
|
259
|
-
|
|
262
|
+
|
|
260
263
|
def set_set(str)
|
|
261
264
|
ar = str.split("=")
|
|
262
265
|
if not str.include?"=" or ar[0].length == 0
|
|
@@ -265,7 +268,7 @@ module Bake
|
|
|
265
268
|
end
|
|
266
269
|
@vars[ar[0]] = ar[1..-1].join("=")
|
|
267
270
|
end
|
|
268
|
-
|
|
271
|
+
|
|
269
272
|
end
|
|
270
273
|
|
|
271
274
|
end
|