bake-toolkit 2.26.1 → 2.27.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/bakeqac +58 -97
- data/documentation/_build/html/_sources/changelog.txt +6 -2
- data/documentation/_build/html/_sources/index.txt +1 -1
- data/documentation/_build/html/_sources/syntax/adapt_configs.txt +107 -17
- data/documentation/_build/html/_static/syntax.html +3 -5
- data/documentation/_build/html/changelog.html +8 -2
- data/documentation/_build/html/index.html +4 -4
- data/documentation/_build/html/objects.inv +0 -0
- data/documentation/_build/html/searchindex.js +1 -1
- data/documentation/_build/html/syntax/adapt_configs.html +97 -13
- data/documentation/_build/html/syntax/project_meta_syntax.html +3 -5
- data/documentation/_build/html/syntax/syntax.html +4 -1
- data/lib/adapt/config/loader.rb +9 -7
- data/lib/bake/config/checks.rb +2 -2
- data/lib/bake/config/loader.rb +31 -2
- data/lib/bake/model/metamodel.rb +8 -4
- data/lib/bake/subst.rb +314 -314
- data/lib/common/utils.rb +22 -1
- data/lib/common/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e0e1f90912811da36dbf1370d42792187d92ad06
|
4
|
+
data.tar.gz: f3b95ad81adb8298b0ac6bbc2efd1527a797a276
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 189d2546359dcd6469d9780f70d753c73875f4ed382697e3ea9214fc139f3c10aece6baa9ffac3f54dfd824a4e14e4bb926a01e8756d1e4bdfd10e031d2de9e4
|
7
|
+
data.tar.gz: d10fa61a1f6e25b653f8c778e3a58cb6e06e5e2a1f839429100b7ebc1aecd77266d423faffd565446b5228ed3e9d775c55e1171f24e70d26f8ce3f7fe73bd4e6
|
data/bin/bakeqac
CHANGED
@@ -15,27 +15,53 @@ STDERR.sync = true
|
|
15
15
|
|
16
16
|
module Bake
|
17
17
|
|
18
|
-
|
19
|
-
cips = Dir.glob(@options.qacdata + "/**/*.cip")
|
20
|
-
if !cips.empty?
|
21
|
-
puts "Temporary debug output to find a highly sporadic bug regarding cip file, sorry for spam:"
|
22
|
-
puts "cip file name: #{cips[0]}"
|
23
|
-
puts "cip file size: #{File.size?(cips[0])}"
|
24
|
-
end
|
25
|
-
end
|
18
|
+
@@cipFileSize = 1
|
26
19
|
|
27
|
-
def self.
|
20
|
+
def self.checkCipSize()
|
28
21
|
cips = Dir.glob(@options.qacdata + "/**/*.cip")
|
29
22
|
if !cips.empty?
|
30
23
|
s = File.size?(cips[0])
|
31
|
-
if s.nil?
|
32
|
-
|
33
|
-
|
24
|
+
s = 0 if s.nil?
|
25
|
+
if s < @@cipFileSize
|
26
|
+
puts "cip file too small: #{cips[0]} has #{s} bytes"
|
27
|
+
return false
|
34
28
|
end
|
35
|
-
|
29
|
+
@@cipFileSize = s
|
30
|
+
return true
|
36
31
|
end
|
37
32
|
puts "cip file does not exist!"
|
38
|
-
return
|
33
|
+
return false
|
34
|
+
end
|
35
|
+
|
36
|
+
def self.executeQacli(cmd, immediateOutput = false)
|
37
|
+
timeStart = Time.now
|
38
|
+
cSizeCheck = true
|
39
|
+
licenseError = false
|
40
|
+
consoleOutput = ""
|
41
|
+
success = false
|
42
|
+
|
43
|
+
loop do
|
44
|
+
success, consoleOutput = ProcessHelper.run(cmd, immediateOutput)
|
45
|
+
licenseError = false
|
46
|
+
|
47
|
+
consoleOutput.each_line do |line|
|
48
|
+
if (line.include?("License Refused") && !line.include?("License Refused: C:"))
|
49
|
+
licenseError = true
|
50
|
+
puts "License refused!"
|
51
|
+
break
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
cSizeCheck = checkCipSize()
|
56
|
+
|
57
|
+
break unless ((@options.qacretry >= (Time.now - timeStart)) && (!cSizeCheck || licenseError))
|
58
|
+
puts "Retry seconds left: %d" % (@options.qacretry - (Time.now - timeStart))
|
59
|
+
end
|
60
|
+
checkError = !cSizeCheck || licenseError
|
61
|
+
puts "Retry timeout over -> failure." if @options.qacretry > 0 && checkError
|
62
|
+
|
63
|
+
success = false if checkError
|
64
|
+
return [success, consoleOutput, checkError]
|
39
65
|
end
|
40
66
|
|
41
67
|
###### PREREQUISITE 1: BAKEQAC OPTIONS ######
|
@@ -43,11 +69,7 @@ end
|
|
43
69
|
@options = BakeqacOptions.new(ARGV)
|
44
70
|
bakeOptions = Options.new([])
|
45
71
|
@options.parse_options(bakeOptions)
|
46
|
-
|
47
72
|
success = false
|
48
|
-
consoleOutput = ""
|
49
|
-
licenseError = false
|
50
|
-
cSize = 1
|
51
73
|
|
52
74
|
###### PREREQUISITE 2: BAKE OPTIONS ######
|
53
75
|
|
@@ -92,26 +114,8 @@ end
|
|
92
114
|
|
93
115
|
puts "bakeqac: creating database..."
|
94
116
|
|
95
|
-
|
96
|
-
|
97
|
-
FileUtils.rm_rf @options.qacdata
|
98
|
-
success, consoleOutput = ProcessHelper.run(cmd, true)
|
99
|
-
|
100
|
-
break if not success
|
101
|
-
|
102
|
-
printCip()
|
103
|
-
|
104
|
-
cips = Dir.glob(@options.qacdata + "/**/*.cip")
|
105
|
-
break if (!cips.empty?) && (!File.size?(cips[0]).nil?) # this is the regular case, note: "size?" returns nil if empty or not existing
|
106
|
-
|
107
|
-
cipCounter += 1
|
108
|
-
if cipCounter < 10
|
109
|
-
puts "cip file does not exist or is empty, trying again..."
|
110
|
-
else
|
111
|
-
success = false
|
112
|
-
break
|
113
|
-
end
|
114
|
-
end
|
117
|
+
FileUtils.rm_rf @options.qacdata
|
118
|
+
success, consoleOutput, checkError = executeQacli(cmd, true)
|
115
119
|
|
116
120
|
if success
|
117
121
|
cctFilename = @options.qacdata+"/prqa/config/"+File.basename(@options.cct[0])
|
@@ -137,7 +141,6 @@ end
|
|
137
141
|
else
|
138
142
|
puts consoleOutput
|
139
143
|
end
|
140
|
-
|
141
144
|
end
|
142
145
|
|
143
146
|
###### STEP 2: BUILD ######
|
@@ -164,43 +167,26 @@ end
|
|
164
167
|
|
165
168
|
puts "bakeqac: building and analyzing files..."
|
166
169
|
|
167
|
-
|
168
|
-
|
169
|
-
success, consoleOutput = ProcessHelper.run(cmd, false)
|
170
|
-
licenseError = false
|
170
|
+
success, consoleOutput, checkError = executeQacli(cmd)
|
171
|
+
success = false # we have to parse the output, qacli returns always an error here...
|
171
172
|
|
173
|
+
if !checkError
|
174
|
+
filterOutput = []
|
175
|
+
filter = []
|
176
|
+
endFound = false
|
172
177
|
consoleOutput.each_line do |line|
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
break unless ((@options.qacretry >= (Time.now - timeStart)) && (cSize == 0 || licenseError))
|
183
|
-
puts "Retry seconds left: %d" % (@options.qacretry - (Time.now - timeStart))
|
184
|
-
end
|
185
|
-
puts "Retry timeout over -> failure." if (@options.qacretry > 0 && (cSize == 0 || licenseError))
|
186
|
-
|
187
|
-
success = false # we have to parse the output, qacli returns always an error here...
|
188
|
-
filterOutput = []
|
189
|
-
filter = []
|
190
|
-
endFound = false
|
191
|
-
consoleOutput.each_line do |line|
|
192
|
-
scan_res = line.scan(/Project path: ([a-zA-Z]{0,1})(:{0,1})(.*)/)
|
193
|
-
if scan_res.length > 0
|
194
|
-
filter << (scan_res[0][0].downcase + scan_res[0][1] + scan_res[0][2].gsub(/\\/,"/").strip)
|
195
|
-
elsif !endFound
|
196
|
-
filterOutput << line
|
197
|
-
if line.start_with?("Rebuilding ")
|
198
|
-
endFound = true
|
199
|
-
success = true if line.include?("Rebuilding done") # don't know why the return value is 2 in this case...
|
178
|
+
scan_res = line.scan(/Project path: ([a-zA-Z]{0,1})(:{0,1})(.*)/)
|
179
|
+
if scan_res.length > 0
|
180
|
+
filter << (scan_res[0][0].downcase + scan_res[0][1] + scan_res[0][2].gsub(/\\/,"/").strip)
|
181
|
+
elsif !endFound
|
182
|
+
filterOutput << line
|
183
|
+
if line.start_with?("Rebuilding ")
|
184
|
+
endFound = true
|
185
|
+
success = true if line.include?("Rebuilding done") # don't know why the return value is 2 in this case...
|
186
|
+
end
|
200
187
|
end
|
201
188
|
end
|
202
189
|
end
|
203
|
-
success = false if (cSize == 0 || licenseError)
|
204
190
|
|
205
191
|
if @options.qacfilter
|
206
192
|
if success
|
@@ -214,8 +200,6 @@ end
|
|
214
200
|
else
|
215
201
|
puts consoleOutput # no filter
|
216
202
|
end
|
217
|
-
|
218
|
-
printCip()
|
219
203
|
end
|
220
204
|
|
221
205
|
|
@@ -241,27 +225,7 @@ end
|
|
241
225
|
cmd += ["-f", "%?u==0%(MSG: %:trc: %)%F(%l,%c): (%r:%N)%t%?v%(\n%v%)"]
|
242
226
|
end
|
243
227
|
|
244
|
-
|
245
|
-
loop do
|
246
|
-
success, consoleOutput = ProcessHelper.run(cmd, false)
|
247
|
-
licenseError = false
|
248
|
-
|
249
|
-
consoleOutput.each_line do |line|
|
250
|
-
if (line.include?("License Refused") && !line.include?("License Refused: C:"))
|
251
|
-
licenseError = true
|
252
|
-
puts "License refused!"
|
253
|
-
break
|
254
|
-
end
|
255
|
-
end
|
256
|
-
|
257
|
-
cSize = cipSize()
|
258
|
-
|
259
|
-
break unless ((@options.qacretry >= (Time.now - timeStart)) && (cSize == 0 || licenseError))
|
260
|
-
puts "Retry seconds left: %d" % (@options.qacretry - (Time.now - timeStart))
|
261
|
-
end
|
262
|
-
puts "Retry timeout over -> failure." if (@options.qacretry > 0 && (cSize == 0 || licenseError))
|
263
|
-
|
264
|
-
success = false if (cSize == 0 || licenseError)
|
228
|
+
success, consoleOutput, checkError = executeQacli(cmd)
|
265
229
|
|
266
230
|
if useFilter
|
267
231
|
if success
|
@@ -342,9 +306,6 @@ end
|
|
342
306
|
else
|
343
307
|
puts consoleOutput # no filter
|
344
308
|
end
|
345
|
-
|
346
|
-
printCip()
|
347
|
-
|
348
309
|
end
|
349
310
|
|
350
311
|
###### STEP 4a: REPORT SCRIPT CHECK (OPTIONAL) ######
|
@@ -1,9 +1,13 @@
|
|
1
1
|
Changelog
|
2
2
|
=========
|
3
3
|
|
4
|
+
January x, 2017 - bake-toolkit 2.27.0
|
5
|
+
* Added: local *Adapt* with conditions (e.g. toolchain), see :ref:`adapt_reference`.
|
6
|
+
* Changed: qac: cip workaround slightly adapted, removed temporary debug output.
|
7
|
+
|
4
8
|
December 23, 2016 - bake-toolkit 2.26.1
|
5
|
-
* Changed: qac: next try to add a workaround for the cip file bug
|
6
|
-
* Cosmetic: possible wrong message when reloading metas ("corrupt" instead of "changed")
|
9
|
+
* Changed: qac: next try to add a workaround for the cip file bug.
|
10
|
+
* Cosmetic: fixed possible wrong message when reloading metas ("corrupt" instead of "changed")
|
7
11
|
|
8
12
|
December 20, 2016 - bake-toolkit 2.26.0
|
9
13
|
* Changed: before this version, "-w" command line args (which define the workspace roots) have overwritten roots.bake file. Now these roots will be
|
@@ -1,8 +1,20 @@
|
|
1
|
+
.. _adapt_reference:
|
2
|
+
|
1
3
|
Adapt configs
|
2
4
|
=============
|
3
5
|
|
4
6
|
Introduction
|
5
|
-
|
7
|
+
------------
|
8
|
+
|
9
|
+
There are two major use cases:
|
10
|
+
|
11
|
+
- Changing the configs from outside, e.g. injecting a toolchain.
|
12
|
+
- Changing the configs depending on variables like the operating system.
|
13
|
+
|
14
|
+
Both is possible with the *Adapt* feature.
|
15
|
+
|
16
|
+
From command line
|
17
|
+
-----------------
|
6
18
|
|
7
19
|
If you want to manipulate existing configs without changing them, you can "adapt" them via command line.
|
8
20
|
|
@@ -10,7 +22,7 @@ If you want to manipulate existing configs without changing them, you can "adapt
|
|
10
22
|
|
11
23
|
User@Host:~$ bake test --adapt abc
|
12
24
|
|
13
|
-
bake searches for abc/Adapt.meta within the workspace roots. If found, the configs from the
|
25
|
+
bake searches for abc/Adapt.meta within the workspace roots. If found, the configs from the Adapt.meta are parsed:
|
14
26
|
|
15
27
|
.. code-block:: text
|
16
28
|
|
@@ -20,7 +32,7 @@ bake searches for abc/Adapt.meta within the workspace roots. If found, the confi
|
|
20
32
|
CustomConfig ... # 0..n
|
21
33
|
}
|
22
34
|
|
23
|
-
Here is an example to change the DefaultToolchain
|
35
|
+
Here is an example to change the DefaultToolchain (details explained below):
|
24
36
|
|
25
37
|
.. code-block:: text
|
26
38
|
|
@@ -30,12 +42,71 @@ Here is an example to change the DefaultToolchain
|
|
30
42
|
}
|
31
43
|
}
|
32
44
|
|
45
|
+
From Project.meta
|
46
|
+
-----------------
|
47
|
+
|
48
|
+
You can do the same within the Project.meta:
|
49
|
+
|
50
|
+
.. code-block:: text
|
51
|
+
|
52
|
+
Project {
|
53
|
+
...
|
54
|
+
}
|
55
|
+
Adapt {
|
56
|
+
...
|
57
|
+
}
|
58
|
+
Adapt {
|
59
|
+
...
|
60
|
+
}
|
61
|
+
|
62
|
+
Conditions and effectiveness
|
63
|
+
----------------------------
|
64
|
+
|
65
|
+
Be aware, these are two different things but look very similar.
|
66
|
+
|
67
|
+
Condition
|
68
|
+
~~~~~~~~~
|
69
|
+
|
70
|
+
An *Adapt* can have up to four attributes:
|
71
|
+
|
72
|
+
- **toolchain**: e.g. GCC
|
73
|
+
- **os**: can be Windows, Mac, Linux, Unix (which is != Linux)
|
74
|
+
- **mainConfig**: name of the main config
|
75
|
+
- **mainProject**: name of the main project
|
76
|
+
|
77
|
+
The "Adapt* configs will be only applied if all these attributes are either empty or true. Example:
|
78
|
+
|
79
|
+
.. code-block:: text
|
80
|
+
|
81
|
+
Adapt toolchain: GCC, os: Windows {
|
82
|
+
...
|
83
|
+
}
|
84
|
+
|
85
|
+
Here the *Adapt* configs will be applied if toolchain is GCC on Windows.
|
86
|
+
|
33
87
|
Effectiveness
|
34
|
-
|
88
|
+
~~~~~~~~~~~~~
|
35
89
|
|
36
|
-
The
|
37
|
-
|
38
|
-
|
90
|
+
The *Adapt* configs can be applied to all configs from regular build. This can be controlled by the config names and the project attributes.
|
91
|
+
Remember the example from the beginning?
|
92
|
+
|
93
|
+
.. code-block:: text
|
94
|
+
|
95
|
+
Adapt {
|
96
|
+
ExecutableConfig test, project: __MAIN__, type: replace {
|
97
|
+
DefaultToolchain GCC
|
98
|
+
}
|
99
|
+
}
|
100
|
+
|
101
|
+
This config is applied only to the config "test" of the main project.
|
102
|
+
|
103
|
+
__MAIN__, __ALL__ and __THIS__ are keywords:
|
104
|
+
|
105
|
+
- **__MAIN__** means the main project or main config
|
106
|
+
- **__ALL__** means all projects or configs
|
107
|
+
- **__THIS__** is only valid for project name, which can be used for *Adapts* within a Project.meta to restrict the adaption to the current project.
|
108
|
+
|
109
|
+
If you want to apply the changes only to the top level config, write:
|
39
110
|
|
40
111
|
.. code-block:: text
|
41
112
|
|
@@ -50,9 +121,9 @@ If you want to apply the changes to all configs, write:
|
|
50
121
|
It is possible to mix the keywords with reals project or config names.
|
51
122
|
|
52
123
|
Occurrences
|
53
|
-
|
124
|
+
-----------
|
54
125
|
|
55
|
-
You can specify more configs in one
|
126
|
+
You can specify more configs in one *Adapt* and you can specify more than one Adapt.meta file:
|
56
127
|
|
57
128
|
.. code-block:: text
|
58
129
|
|
@@ -73,10 +144,25 @@ You can specify more configs in one adapt file and you can specify more than one
|
|
73
144
|
|
74
145
|
User@Host:~$ bake test --adapt abc --adapt xy
|
75
146
|
|
76
|
-
|
147
|
+
Apply order
|
148
|
+
-----------
|
149
|
+
|
150
|
+
The *Adapt* configs will be applied in the order in which they were parsed. First the Adapt.metas referenced from the command line are read. Then the Project.metas are read
|
151
|
+
one by one as usual. If an *Adapt* is found, it will be appended to the list of *Adapts*. Note, *Adapts* will be applied immediately when a Project.meta is read.
|
152
|
+
|
153
|
+
If you inject a Toolchain from outside, e.g. "--adapt gcc", you can use the toolchain info for local *Adapts*:
|
154
|
+
|
155
|
+
.. code-block:: text
|
156
|
+
|
157
|
+
Project {
|
158
|
+
...
|
159
|
+
}
|
160
|
+
Adapt toolchain: GCC {
|
161
|
+
...
|
162
|
+
}
|
77
163
|
|
78
164
|
Types
|
79
|
-
|
165
|
+
-----
|
80
166
|
|
81
167
|
It is possible to specify the type of adaption:
|
82
168
|
|
@@ -84,15 +170,19 @@ It is possible to specify the type of adaption:
|
|
84
170
|
|
85
171
|
ExecutableConfig ..., type: replace
|
86
172
|
|
87
|
-
The type can be
|
173
|
+
The type can be
|
174
|
+
|
175
|
+
- **replace**
|
176
|
+
- **remove**
|
177
|
+
- **extend**
|
88
178
|
|
89
179
|
Type: extend
|
90
|
-
|
180
|
+
~~~~~~~~~~~~
|
91
181
|
|
92
182
|
This works exactly like for :doc:`derive_configs`.
|
93
183
|
|
94
184
|
Type: remove
|
95
|
-
|
185
|
+
~~~~~~~~~~~~
|
96
186
|
|
97
187
|
If parent elements can be found which matches to the child elements, they will be removed.
|
98
188
|
|
@@ -104,7 +194,7 @@ Example project config:
|
|
104
194
|
DefaultToolchain GCC
|
105
195
|
}
|
106
196
|
|
107
|
-
Example
|
197
|
+
Example *Adapt* configs:
|
108
198
|
|
109
199
|
.. code-block:: text
|
110
200
|
|
@@ -125,7 +215,7 @@ Example adapt configs:
|
|
125
215
|
}
|
126
216
|
|
127
217
|
Type: replace
|
128
|
-
|
218
|
+
~~~~~~~~~~~~~
|
129
219
|
|
130
220
|
This is for convenience. "replace" will remove all elements with the same type and extends the configs.
|
131
221
|
|
@@ -140,4 +230,4 @@ Example:
|
|
140
230
|
}
|
141
231
|
}
|
142
232
|
|
143
|
-
This removes all "Files" and the "DefaultToolchain" from the original config regardless their attributes and replaces them by the elements of the
|
233
|
+
This removes all "Files" and the "DefaultToolchain" from the original config regardless their attributes and replaces them by the elements of the *Adapt* config.
|