bake-toolkit 2.44.1 → 2.45.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/bin/bakery +183 -183
- data/lib/adapt/config/loader.rb +33 -0
- data/lib/bake/subst.rb +3 -7
- data/lib/bakery/buildPattern.rb +25 -24
- data/lib/bakery/model/metamodel.rb +49 -48
- data/lib/bakery/toBake.rb +76 -76
- data/lib/common/options/finder.rb +4 -0
- 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: 400957c27fbeb739bd5336401fa1b035bccd52bd
|
4
|
+
data.tar.gz: c201d3549f44eebacb2cb4e2025e45195e5e58d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6501c573bfc1abf80ac5fc735a6471f845c46e8ad43b55a7aae46c7a0d28b37256311e2c310b7ef84248e90e7b54c3ebe0bb681e8674a79b1efa9f8cb90d3301
|
7
|
+
data.tar.gz: 6c1e2c956d311b80e79c14321acd3a57f1449cd5c971989fb9e5e8fb12f732e077fa3a1cb30c15060879906d359cf3360a5c35c0609bdedab1878239f1e7a323
|
data/bin/bakery
CHANGED
@@ -1,183 +1,183 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
$timeStart = Time.now
|
4
|
-
|
5
|
-
$:.unshift(File.dirname(__FILE__)+"/../lib")
|
6
|
-
require 'common/version'
|
7
|
-
|
8
|
-
require 'common/utils'
|
9
|
-
|
10
|
-
Bake::Version.printBakeryVersion
|
11
|
-
|
12
|
-
STDOUT.sync = true
|
13
|
-
STDERR.sync = true
|
14
|
-
|
15
|
-
$stars = "************************************************"
|
16
|
-
|
17
|
-
require 'bake/toolchain/colorizing_formatter'
|
18
|
-
require 'bake/options/options'
|
19
|
-
require 'tocxx'
|
20
|
-
require "bakery/model/loader"
|
21
|
-
require "bakery/options/options"
|
22
|
-
require "bakery/toBake"
|
23
|
-
require "bakery/buildPattern"
|
24
|
-
require 'common/ext/stdout'
|
25
|
-
require 'common/cleanup'
|
26
|
-
|
27
|
-
module Bake
|
28
|
-
|
29
|
-
@options = BakeryOptions.new(ARGV)
|
30
|
-
bakeOptions = Options.new([])
|
31
|
-
@options.parse_options(bakeOptions)
|
32
|
-
|
33
|
-
env = nil
|
34
|
-
begin
|
35
|
-
loader = BakeryLoader.new
|
36
|
-
env = loader.load(@options.collection_dir+"/Collection.meta")
|
37
|
-
rescue SystemExit => e
|
38
|
-
raise e
|
39
|
-
rescue Exception => e
|
40
|
-
puts e
|
41
|
-
puts e.backtrace
|
42
|
-
ExitHelper.exit(1)
|
43
|
-
end
|
44
|
-
|
45
|
-
|
46
|
-
if @options.collection_name.empty?
|
47
|
-
puts "Please specify a collection name. Possible values are:"
|
48
|
-
env.find(:class => BakeryModel::Collection).each { |e|
|
49
|
-
puts "* " + e.name
|
50
|
-
}
|
51
|
-
ExitHelper.exit(0)
|
52
|
-
end
|
53
|
-
|
54
|
-
|
55
|
-
def self.getCollections(env, name)
|
56
|
-
cols = env.find(:class => BakeryModel::Collection, :name => name)
|
57
|
-
@toBuild |= getBuildPattern(cols, name)
|
58
|
-
@colsAll |= cols
|
59
|
-
cols[0].collections.each do |cRef|
|
60
|
-
alreadyProcessed = false
|
61
|
-
@colsAll.each do |ca|
|
62
|
-
alreadyProcessed = true if ca.name == cRef.name
|
63
|
-
end
|
64
|
-
getCollections(env, cRef.name) unless alreadyProcessed
|
65
|
-
end
|
66
|
-
end
|
67
|
-
|
68
|
-
@toBuild = []
|
69
|
-
@colsAll = []
|
70
|
-
getCollections(env, @options.collection_name)
|
71
|
-
|
72
|
-
maxRuns = @toBuild.length
|
73
|
-
currentRun = 0
|
74
|
-
failedRuns = []
|
75
|
-
|
76
|
-
passedParams = []
|
77
|
-
excludeParam = false
|
78
|
-
wasMinus = false
|
79
|
-
ARGV.each do |x|
|
80
|
-
if (x=="-b" or x=="-m" or x=="--socket")
|
81
|
-
excludeParam = true
|
82
|
-
next
|
83
|
-
end
|
84
|
-
if excludeParam
|
85
|
-
excludeParam = false
|
86
|
-
next
|
87
|
-
end
|
88
|
-
if x.length > 0
|
89
|
-
if x[0] == "-"
|
90
|
-
wasMinus = true
|
91
|
-
else
|
92
|
-
next if not wasMinus
|
93
|
-
wasMinus = false
|
94
|
-
end
|
95
|
-
end
|
96
|
-
passedParams << x
|
97
|
-
end
|
98
|
-
|
99
|
-
if @options.socket != 0
|
100
|
-
Bake::IDEInterface.instance.connect(@options.socket)
|
101
|
-
end
|
102
|
-
|
103
|
-
msg1 = "bakery "
|
104
|
-
|
105
|
-
exitValue = 0
|
106
|
-
abort = false
|
107
|
-
@toBuild.each do |bp|
|
108
|
-
currentRun += 1
|
109
|
-
p = File.dirname(bp.proj)
|
110
|
-
pRel = File.rel_from_to_project(Dir.pwd, p, false)
|
111
|
-
pRel = "." if pRel.empty?
|
112
|
-
cmd = (["-m", pRel, "-b", bp.conf] + passedParams)
|
113
|
-
cmdWithNum = "bakery #{currentRun} of #{maxRuns}: bake " + cmd.join(" ")
|
114
|
-
puts "\n#{$stars}"
|
115
|
-
Bake.formatter.printInfo(cmdWithNum)
|
116
|
-
puts $stars
|
117
|
-
|
118
|
-
|
119
|
-
runOk = false
|
120
|
-
begin
|
121
|
-
Bake.options = Options.new(cmd)
|
122
|
-
Bake.options.parse_options
|
123
|
-
tocxx = ToCxx.new
|
124
|
-
tocxx.doit()
|
125
|
-
runOk = (ExitHelper.exit_code == 0)
|
126
|
-
if Bake::IDEInterface.instance.get_abort
|
127
|
-
abort = true
|
128
|
-
msg1 << "aborted"
|
129
|
-
exitValue = 1
|
130
|
-
break
|
131
|
-
end
|
132
|
-
rescue SystemExit
|
133
|
-
runOk = (ExitHelper.exit_code == 0)
|
134
|
-
rescue Exception => e
|
135
|
-
puts e.message
|
136
|
-
end
|
137
|
-
|
138
|
-
Bake::cleanup
|
139
|
-
ExitHelper.reset_exit_code
|
140
|
-
|
141
|
-
if runOk == false && abort == false
|
142
|
-
exitValue = 1
|
143
|
-
failedRuns << "bake " + cmd.join(" ")
|
144
|
-
if @options.error
|
145
|
-
msg1 << "stopped on first error"
|
146
|
-
abort = true
|
147
|
-
break
|
148
|
-
end
|
149
|
-
end
|
150
|
-
end
|
151
|
-
|
152
|
-
print "\n"
|
153
|
-
|
154
|
-
if not abort
|
155
|
-
if failedRuns.length > 0
|
156
|
-
msg1 << "summary: #{failedRuns.length} of #{maxRuns} builds failed"
|
157
|
-
else
|
158
|
-
msg1 << "summary: #{maxRuns} of #{maxRuns} builds ok"
|
159
|
-
end
|
160
|
-
|
161
|
-
timeEnd = Time.now
|
162
|
-
timeDiff = timeEnd - $timeStart
|
163
|
-
failedRuns.each_with_index do |f,i|
|
164
|
-
msg1 << "\n#{i+1}: #{f}"
|
165
|
-
end
|
166
|
-
msg1 << "\ntime: %02d:%02d minutes" % [timeDiff/60, timeDiff%60]
|
167
|
-
end
|
168
|
-
|
169
|
-
if failedRuns.length == 0
|
170
|
-
Bake.formatter.printSuccess($stars)
|
171
|
-
Bake.formatter.printSuccess(msg1)
|
172
|
-
Bake.formatter.printSuccess($stars)
|
173
|
-
else
|
174
|
-
Bake.formatter.printError($stars)
|
175
|
-
Bake.formatter.printError(msg1)
|
176
|
-
Bake.formatter.printError($stars)
|
177
|
-
end
|
178
|
-
|
179
|
-
Bake::IDEInterface.instance.disconnect()
|
180
|
-
|
181
|
-
ExitHelper.exit(exitValue)
|
182
|
-
end
|
183
|
-
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
$timeStart = Time.now
|
4
|
+
|
5
|
+
$:.unshift(File.dirname(__FILE__)+"/../lib")
|
6
|
+
require 'common/version'
|
7
|
+
|
8
|
+
require 'common/utils'
|
9
|
+
|
10
|
+
Bake::Version.printBakeryVersion
|
11
|
+
|
12
|
+
STDOUT.sync = true
|
13
|
+
STDERR.sync = true
|
14
|
+
|
15
|
+
$stars = "************************************************"
|
16
|
+
|
17
|
+
require 'bake/toolchain/colorizing_formatter'
|
18
|
+
require 'bake/options/options'
|
19
|
+
require 'tocxx'
|
20
|
+
require "bakery/model/loader"
|
21
|
+
require "bakery/options/options"
|
22
|
+
require "bakery/toBake"
|
23
|
+
require "bakery/buildPattern"
|
24
|
+
require 'common/ext/stdout'
|
25
|
+
require 'common/cleanup'
|
26
|
+
|
27
|
+
module Bake
|
28
|
+
|
29
|
+
@options = BakeryOptions.new(ARGV)
|
30
|
+
bakeOptions = Options.new([])
|
31
|
+
@options.parse_options(bakeOptions)
|
32
|
+
|
33
|
+
env = nil
|
34
|
+
begin
|
35
|
+
loader = BakeryLoader.new
|
36
|
+
env = loader.load(@options.collection_dir+"/Collection.meta")
|
37
|
+
rescue SystemExit => e
|
38
|
+
raise e
|
39
|
+
rescue Exception => e
|
40
|
+
puts e
|
41
|
+
puts e.backtrace
|
42
|
+
ExitHelper.exit(1)
|
43
|
+
end
|
44
|
+
|
45
|
+
|
46
|
+
if @options.collection_name.empty?
|
47
|
+
puts "Please specify a collection name. Possible values are:"
|
48
|
+
env.find(:class => BakeryModel::Collection).each { |e|
|
49
|
+
puts "* " + e.name
|
50
|
+
}
|
51
|
+
ExitHelper.exit(0)
|
52
|
+
end
|
53
|
+
|
54
|
+
|
55
|
+
def self.getCollections(env, name)
|
56
|
+
cols = env.find(:class => BakeryModel::Collection, :name => name)
|
57
|
+
@toBuild |= getBuildPattern(cols, name)
|
58
|
+
@colsAll |= cols
|
59
|
+
cols[0].collections.each do |cRef|
|
60
|
+
alreadyProcessed = false
|
61
|
+
@colsAll.each do |ca|
|
62
|
+
alreadyProcessed = true if ca.name == cRef.name
|
63
|
+
end
|
64
|
+
getCollections(env, cRef.name) unless alreadyProcessed
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
@toBuild = []
|
69
|
+
@colsAll = []
|
70
|
+
getCollections(env, @options.collection_name)
|
71
|
+
|
72
|
+
maxRuns = @toBuild.length
|
73
|
+
currentRun = 0
|
74
|
+
failedRuns = []
|
75
|
+
|
76
|
+
passedParams = []
|
77
|
+
excludeParam = false
|
78
|
+
wasMinus = false
|
79
|
+
ARGV.each do |x|
|
80
|
+
if (x=="-b" or x=="-m" or x=="--socket")
|
81
|
+
excludeParam = true
|
82
|
+
next
|
83
|
+
end
|
84
|
+
if excludeParam
|
85
|
+
excludeParam = false
|
86
|
+
next
|
87
|
+
end
|
88
|
+
if x.length > 0
|
89
|
+
if x[0] == "-"
|
90
|
+
wasMinus = true
|
91
|
+
else
|
92
|
+
next if not wasMinus
|
93
|
+
wasMinus = false
|
94
|
+
end
|
95
|
+
end
|
96
|
+
passedParams << x
|
97
|
+
end
|
98
|
+
|
99
|
+
if @options.socket != 0
|
100
|
+
Bake::IDEInterface.instance.connect(@options.socket)
|
101
|
+
end
|
102
|
+
|
103
|
+
msg1 = "bakery "
|
104
|
+
|
105
|
+
exitValue = 0
|
106
|
+
abort = false
|
107
|
+
@toBuild.each do |bp|
|
108
|
+
currentRun += 1
|
109
|
+
p = File.dirname(bp.proj)
|
110
|
+
pRel = File.rel_from_to_project(Dir.pwd, p, false)
|
111
|
+
pRel = "." if pRel.empty?
|
112
|
+
cmd = (["-m", pRel, "-b", bp.conf] + bp.args.split + passedParams)
|
113
|
+
cmdWithNum = "bakery #{currentRun} of #{maxRuns}: bake " + cmd.join(" ")
|
114
|
+
puts "\n#{$stars}"
|
115
|
+
Bake.formatter.printInfo(cmdWithNum)
|
116
|
+
puts $stars
|
117
|
+
|
118
|
+
|
119
|
+
runOk = false
|
120
|
+
begin
|
121
|
+
Bake.options = Options.new(cmd)
|
122
|
+
Bake.options.parse_options
|
123
|
+
tocxx = ToCxx.new
|
124
|
+
tocxx.doit()
|
125
|
+
runOk = (ExitHelper.exit_code == 0)
|
126
|
+
if Bake::IDEInterface.instance.get_abort
|
127
|
+
abort = true
|
128
|
+
msg1 << "aborted"
|
129
|
+
exitValue = 1
|
130
|
+
break
|
131
|
+
end
|
132
|
+
rescue SystemExit
|
133
|
+
runOk = (ExitHelper.exit_code == 0)
|
134
|
+
rescue Exception => e
|
135
|
+
puts e.message
|
136
|
+
end
|
137
|
+
|
138
|
+
Bake::cleanup
|
139
|
+
ExitHelper.reset_exit_code
|
140
|
+
|
141
|
+
if runOk == false && abort == false
|
142
|
+
exitValue = 1
|
143
|
+
failedRuns << "bake " + cmd.join(" ")
|
144
|
+
if @options.error
|
145
|
+
msg1 << "stopped on first error"
|
146
|
+
abort = true
|
147
|
+
break
|
148
|
+
end
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
152
|
+
print "\n"
|
153
|
+
|
154
|
+
if not abort
|
155
|
+
if failedRuns.length > 0
|
156
|
+
msg1 << "summary: #{failedRuns.length} of #{maxRuns} builds failed"
|
157
|
+
else
|
158
|
+
msg1 << "summary: #{maxRuns} of #{maxRuns} builds ok"
|
159
|
+
end
|
160
|
+
|
161
|
+
timeEnd = Time.now
|
162
|
+
timeDiff = timeEnd - $timeStart
|
163
|
+
failedRuns.each_with_index do |f,i|
|
164
|
+
msg1 << "\n#{i+1}: #{f}"
|
165
|
+
end
|
166
|
+
msg1 << "\ntime: %02d:%02d minutes" % [timeDiff/60, timeDiff%60]
|
167
|
+
end
|
168
|
+
|
169
|
+
if failedRuns.length == 0
|
170
|
+
Bake.formatter.printSuccess($stars)
|
171
|
+
Bake.formatter.printSuccess(msg1)
|
172
|
+
Bake.formatter.printSuccess($stars)
|
173
|
+
else
|
174
|
+
Bake.formatter.printError($stars)
|
175
|
+
Bake.formatter.printError(msg1)
|
176
|
+
Bake.formatter.printError($stars)
|
177
|
+
end
|
178
|
+
|
179
|
+
Bake::IDEInterface.instance.disconnect()
|
180
|
+
|
181
|
+
ExitHelper.exit(exitValue)
|
182
|
+
end
|
183
|
+
|
data/lib/adapt/config/loader.rb
CHANGED
@@ -71,6 +71,39 @@ module Bake
|
|
71
71
|
def chooseProjectFilenames(potentialAdapts)
|
72
72
|
@@filenames = []
|
73
73
|
Bake.options.adapt.each do |a|
|
74
|
+
a.gsub!(/\\/,"/")
|
75
|
+
found = false
|
76
|
+
|
77
|
+
# from working dir
|
78
|
+
if File.exist?(a) && File.file?(a)
|
79
|
+
@@filenames << File.expand_path(a)
|
80
|
+
found = true
|
81
|
+
end
|
82
|
+
next if found
|
83
|
+
|
84
|
+
# from main dir
|
85
|
+
Dir.chdir Bake.options.main_dir do
|
86
|
+
if File.exist?(a) && File.file?(a)
|
87
|
+
@@filenames << (Bake.options.main_dir + "/" + a)
|
88
|
+
found = true
|
89
|
+
end
|
90
|
+
end
|
91
|
+
next if found
|
92
|
+
|
93
|
+
# from roots
|
94
|
+
Bake.options.roots.each do |root|
|
95
|
+
r = root.dir
|
96
|
+
Dir.chdir r do
|
97
|
+
if File.exist?(a) && File.file?(a)
|
98
|
+
@@filenames << (r + "/" + a)
|
99
|
+
found = true
|
100
|
+
end
|
101
|
+
end
|
102
|
+
break if found
|
103
|
+
end
|
104
|
+
next if found
|
105
|
+
|
106
|
+
# old style
|
74
107
|
adapts = potentialAdapts.find_all { |p| p.include?("/"+a+"/Adapt.meta") or p == a+"/Adapt.meta" }
|
75
108
|
if adapts.empty?
|
76
109
|
Bake.formatter.printError("Adaption project #{a} not found")
|
data/lib/bake/subst.rb
CHANGED
@@ -102,9 +102,9 @@ module Bake
|
|
102
102
|
else
|
103
103
|
cmd_result = false
|
104
104
|
consoleOutput = ""
|
105
|
+
cmd = [substString(s.cmd, s)]
|
105
106
|
begin
|
106
107
|
Dir.chdir(@@projDir) do
|
107
|
-
cmd = [substString(s.cmd, s)]
|
108
108
|
cmd_result, consoleOutput = ProcessHelper.run(cmd)
|
109
109
|
@@userVarMap[s.name] = consoleOutput.chomp
|
110
110
|
if s.env
|
@@ -116,12 +116,8 @@ module Bake
|
|
116
116
|
consoleOutput = e.message
|
117
117
|
end
|
118
118
|
if (cmd_result == false)
|
119
|
-
Bake.formatter.
|
120
|
-
|
121
|
-
if s.env
|
122
|
-
ENV[s.name] = ""
|
123
|
-
config.setEnvVar(s.name, "")
|
124
|
-
end
|
119
|
+
Bake.formatter.printError("Command not successful: #{cmd.join(" ")}", s)
|
120
|
+
ExitHelper.exit(1)
|
125
121
|
end
|
126
122
|
end
|
127
123
|
|
data/lib/bakery/buildPattern.rb
CHANGED
@@ -1,24 +1,25 @@
|
|
1
|
-
module Bake
|
2
|
-
|
3
|
-
class BuildPattern
|
4
|
-
attr_reader :proj, :conf, :coll_p
|
5
|
-
def initialize(proj, conf, coll_p)
|
6
|
-
@proj = proj
|
7
|
-
@conf = conf
|
8
|
-
@
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
1
|
+
module Bake
|
2
|
+
|
3
|
+
class BuildPattern
|
4
|
+
attr_reader :proj, :conf, :args, :coll_p
|
5
|
+
def initialize(proj, conf, args, coll_p)
|
6
|
+
@proj = proj
|
7
|
+
@conf = conf
|
8
|
+
@args = args
|
9
|
+
@coll_p = coll_p
|
10
|
+
end
|
11
|
+
def getId
|
12
|
+
proj + "*******" + conf
|
13
|
+
end
|
14
|
+
def hash
|
15
|
+
getId.hash
|
16
|
+
end
|
17
|
+
def eql?(comparee)
|
18
|
+
self == comparee
|
19
|
+
end
|
20
|
+
def ==(comparee)
|
21
|
+
self.getId == comparee.getId
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
@@ -1,48 +1,49 @@
|
|
1
|
-
require 'rgen/metamodel_builder'
|
2
|
-
require 'rgen/metamodel_builder/data_types'
|
3
|
-
|
4
|
-
module Bake
|
5
|
-
|
6
|
-
module BakeryModel
|
7
|
-
extend RGen::MetamodelBuilder::ModuleExtension
|
8
|
-
|
9
|
-
class ModelElement < RGen::MetamodelBuilder::MMBase
|
10
|
-
abstract
|
11
|
-
has_attr 'line_number', Integer do
|
12
|
-
annotation :details => {'internal' => 'true'}
|
13
|
-
end
|
14
|
-
has_attr 'file_name', String do
|
15
|
-
annotation :details => {'internal' => 'true'}
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
class Project < ModelElement
|
20
|
-
has_attr 'name', String, :defaultValueLiteral => ""
|
21
|
-
has_attr 'config', String, :defaultValueLiteral => ""
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
has_attr '
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
contains_many '
|
34
|
-
contains_many '
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
1
|
+
require 'rgen/metamodel_builder'
|
2
|
+
require 'rgen/metamodel_builder/data_types'
|
3
|
+
|
4
|
+
module Bake
|
5
|
+
|
6
|
+
module BakeryModel
|
7
|
+
extend RGen::MetamodelBuilder::ModuleExtension
|
8
|
+
|
9
|
+
class ModelElement < RGen::MetamodelBuilder::MMBase
|
10
|
+
abstract
|
11
|
+
has_attr 'line_number', Integer do
|
12
|
+
annotation :details => {'internal' => 'true'}
|
13
|
+
end
|
14
|
+
has_attr 'file_name', String do
|
15
|
+
annotation :details => {'internal' => 'true'}
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
class Project < ModelElement
|
20
|
+
has_attr 'name', String, :defaultValueLiteral => ""
|
21
|
+
has_attr 'config', String, :defaultValueLiteral => ""
|
22
|
+
has_attr 'args', String, :defaultValueLiteral => ""
|
23
|
+
end
|
24
|
+
class Exclude < ModelElement
|
25
|
+
has_attr 'name', String, :defaultValueLiteral => ""
|
26
|
+
has_attr 'config', String, :defaultValueLiteral => ""
|
27
|
+
end
|
28
|
+
class SubCollection < ModelElement
|
29
|
+
has_attr 'name', String, :defaultValueLiteral => ""
|
30
|
+
end
|
31
|
+
class Collection < ModelElement
|
32
|
+
has_attr 'name', String, :defaultValueLiteral => ""
|
33
|
+
contains_many 'project', Project, 'collection'
|
34
|
+
contains_many 'exclude', Exclude, 'collection'
|
35
|
+
contains_many 'collections', SubCollection, 'collection'
|
36
|
+
end
|
37
|
+
|
38
|
+
module Project::ClassModule
|
39
|
+
def isFound
|
40
|
+
@isFound ||= false
|
41
|
+
end
|
42
|
+
def found
|
43
|
+
@isFound = true
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
data/lib/bakery/toBake.rb
CHANGED
@@ -1,76 +1,76 @@
|
|
1
|
-
require "bakery/buildPattern"
|
2
|
-
|
3
|
-
module Bake
|
4
|
-
|
5
|
-
def self.getBuildPattern(cols, name)
|
6
|
-
|
7
|
-
colMeta = @options.collection_dir+"/Collection.meta"
|
8
|
-
|
9
|
-
if (cols.length == 0)
|
10
|
-
Bake.formatter.printError("Collection #{name} not found", colMeta)
|
11
|
-
ExitHelper.exit(1)
|
12
|
-
elsif (cols.length > 1)
|
13
|
-
Bake.formatter.printError("Collection #{name} found more than once", colMeta)
|
14
|
-
ExitHelper.exit(1)
|
15
|
-
end
|
16
|
-
|
17
|
-
col = cols[0]
|
18
|
-
|
19
|
-
col.project.each do |p|
|
20
|
-
if p.name == ""
|
21
|
-
Bake.formatter.printError("Project name empty", p)
|
22
|
-
ExitHelper.exit(1)
|
23
|
-
end
|
24
|
-
if p.config == ""
|
25
|
-
Bake.formatter.printError("Config name empty", p)
|
26
|
-
ExitHelper.exit(1)
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
toBuildPattern = []
|
31
|
-
@options.roots.each do |root|
|
32
|
-
col.project.each do |p|
|
33
|
-
projs = Root.search_to_depth(root.dir,p.name + "/Project.meta", root.depth)
|
34
|
-
if projs.length == 0
|
35
|
-
toBuildPattern << BuildPattern.new(nil, nil, p) # remember it for sorted info printout
|
36
|
-
end
|
37
|
-
projs.each do |f|
|
38
|
-
toBuildPattern << BuildPattern.new(f, "^"+p.config.gsub("*","(\\w*)")+"$", p)
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
toBuild = []
|
44
|
-
toBuildPattern.each do |bp|
|
45
|
-
next unless bp.proj
|
46
|
-
contents = File.open(bp.proj, "r") {|io| io.read }
|
47
|
-
contents.split("\n").each do |c|
|
48
|
-
res = c.match("\\s*(Library|Executable|Custom){1}Config\\s
|
49
|
-
if res
|
50
|
-
if res[2].match(bp.conf) != nil
|
51
|
-
toBuild << BuildPattern.new(bp.proj, res[2], nil)
|
52
|
-
bp.coll_p.found
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
|
-
col.exclude.each do |p|
|
59
|
-
p.name = "/"+p.name.gsub("*","(\\w*)")+"/Project.meta"
|
60
|
-
p.config = "^"+p.config.gsub("*","(\\w*)")+"$"
|
61
|
-
end
|
62
|
-
|
63
|
-
toBuild.delete_if do |bp|
|
64
|
-
exclude = false
|
65
|
-
col.exclude.each do |p|
|
66
|
-
exclude = true if (bp.proj.match(p.name) != nil and bp.conf.match(p.config) != nil)
|
67
|
-
end
|
68
|
-
exclude
|
69
|
-
end
|
70
|
-
|
71
|
-
toBuild.uniq!
|
72
|
-
|
73
|
-
return toBuild
|
74
|
-
end
|
75
|
-
|
76
|
-
end
|
1
|
+
require "bakery/buildPattern"
|
2
|
+
|
3
|
+
module Bake
|
4
|
+
|
5
|
+
def self.getBuildPattern(cols, name)
|
6
|
+
|
7
|
+
colMeta = @options.collection_dir+"/Collection.meta"
|
8
|
+
|
9
|
+
if (cols.length == 0)
|
10
|
+
Bake.formatter.printError("Collection #{name} not found", colMeta)
|
11
|
+
ExitHelper.exit(1)
|
12
|
+
elsif (cols.length > 1)
|
13
|
+
Bake.formatter.printError("Collection #{name} found more than once", colMeta)
|
14
|
+
ExitHelper.exit(1)
|
15
|
+
end
|
16
|
+
|
17
|
+
col = cols[0]
|
18
|
+
|
19
|
+
col.project.each do |p|
|
20
|
+
if p.name == ""
|
21
|
+
Bake.formatter.printError("Project name empty", p)
|
22
|
+
ExitHelper.exit(1)
|
23
|
+
end
|
24
|
+
if p.config == ""
|
25
|
+
Bake.formatter.printError("Config name empty", p)
|
26
|
+
ExitHelper.exit(1)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
toBuildPattern = []
|
31
|
+
@options.roots.each do |root|
|
32
|
+
col.project.each do |p|
|
33
|
+
projs = Root.search_to_depth(root.dir,p.name + "/Project.meta", root.depth)
|
34
|
+
if projs.length == 0
|
35
|
+
toBuildPattern << BuildPattern.new(nil, nil, p.args, p) # remember it for sorted info printout
|
36
|
+
end
|
37
|
+
projs.each do |f|
|
38
|
+
toBuildPattern << BuildPattern.new(f, "^"+p.config.gsub("*","(\\w*)")+"$", p.args, p)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
toBuild = []
|
44
|
+
toBuildPattern.each do |bp|
|
45
|
+
next unless bp.proj
|
46
|
+
contents = File.open(bp.proj, "r") {|io| io.read }
|
47
|
+
contents.split("\n").each do |c|
|
48
|
+
res = c.match("\\s*(Library|Executable|Custom){1}Config\\s*\"?([\\w:-]*)\"?")
|
49
|
+
if res
|
50
|
+
if res[2].match(bp.conf) != nil
|
51
|
+
toBuild << BuildPattern.new(bp.proj, res[2], bp.args, nil)
|
52
|
+
bp.coll_p.found
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
col.exclude.each do |p|
|
59
|
+
p.name = "/"+p.name.gsub("*","(\\w*)")+"/Project.meta"
|
60
|
+
p.config = "^"+p.config.gsub("*","(\\w*)")+"$"
|
61
|
+
end
|
62
|
+
|
63
|
+
toBuild.delete_if do |bp|
|
64
|
+
exclude = false
|
65
|
+
col.exclude.each do |p|
|
66
|
+
exclude = true if (bp.proj.match(p.name) != nil and bp.conf.match(p.config) != nil)
|
67
|
+
end
|
68
|
+
exclude
|
69
|
+
end
|
70
|
+
|
71
|
+
toBuild.uniq!
|
72
|
+
|
73
|
+
return toBuild
|
74
|
+
end
|
75
|
+
|
76
|
+
end
|
@@ -1,6 +1,10 @@
|
|
1
1
|
module Bake
|
2
2
|
|
3
3
|
def self.findDirOfFileToRoot(dir, filename)
|
4
|
+
if !File.exists?(dir)
|
5
|
+
Bake.formatter.printError("Error: #{dir} does not exist")
|
6
|
+
ExitHelper.exit(1)
|
7
|
+
end
|
4
8
|
loop do
|
5
9
|
completeName = dir + "/" + filename
|
6
10
|
return dir if File.exist?(completeName)
|
data/lib/common/version.rb
CHANGED
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.45.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: 2018-
|
11
|
+
date: 2018-05-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rtext
|