bake-toolkit 2.60.2 → 2.61.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/adapt/config/loader.rb +1 -0
- data/lib/bake/config/checks.rb +27 -0
- data/lib/bake/config/loader.rb +22 -18
- data/lib/bake/model/metamodel.rb +5 -0
- data/lib/bake/options/options.rb +24 -10
- data/lib/bake/subst.rb +2 -0
- data/lib/bakery/options/options.rb +8 -4
- data/lib/common/cleanup.rb +3 -1
- data/lib/common/ext/file.rb +1 -1
- data/lib/common/options/parser.rb +2 -2
- data/lib/common/root.rb +1 -1
- data/lib/common/version.rb +1 -1
- data/lib/tocxx.rb +20 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3b7e3e8cf8a2ce67781a4f5701c0c7a3323ebe2d6b3a3b026bfd496655b3c545
|
4
|
+
data.tar.gz: 148d025bfbf226d78986655c586c6291c1f18c5f4925cc5c700324483db1ed58
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b9fe89d71c63358256e78d1d5aa196a7d6606361fe833dfd01169dbb520c327f62ba7cd4033505b84af3c9c7430f4f64d49fc2e677b9c0836b229d300246860
|
7
|
+
data.tar.gz: a4b40affee87172e2b69cbb03896b112999ff578bf49cc48f53e010f181e123aa0e301e4c0f0ae35529f1abce1f200d0593c519da69cc9e8a14ef92390855bc1
|
data/lib/adapt/config/loader.rb
CHANGED
data/lib/bake/config/checks.rb
CHANGED
@@ -3,6 +3,12 @@ module Bake
|
|
3
3
|
|
4
4
|
class Checks
|
5
5
|
|
6
|
+
@@warnedCase = []
|
7
|
+
|
8
|
+
def self.cleanupWarnings
|
9
|
+
@@warnedCase.clear
|
10
|
+
end
|
11
|
+
|
6
12
|
def self.symlinkCheck(filename)
|
7
13
|
dirOfProjMeta = File.dirname(filename)
|
8
14
|
Dir.chdir(dirOfProjMeta) do
|
@@ -19,6 +25,27 @@ module Bake
|
|
19
25
|
end
|
20
26
|
end
|
21
27
|
end
|
28
|
+
|
29
|
+
def self.sanityFolderName(dorg)
|
30
|
+
return if !Bake.options.caseSensitivityCheck
|
31
|
+
return if Bake.options.verbose < 1
|
32
|
+
d = dorg
|
33
|
+
while (d != File.dirname(d))
|
34
|
+
b = File.basename(d)
|
35
|
+
dnew = File.dirname(d)
|
36
|
+
Dir.chdir(dnew) do
|
37
|
+
files = Dir.glob("*")
|
38
|
+
if !files.include?(b)
|
39
|
+
possible = files.select{ |f| f.casecmp(b)==0 }
|
40
|
+
if possible.length > 0 && !@@warnedCase.include?(d)
|
41
|
+
@@warnedCase << d
|
42
|
+
Bake.formatter.printWarning("Warning: '#{b}' not found in '#{dnew}'. Alternatives: #{possible.map{|p| "'#{p}'"}.join(", ")}. Maybe a typo happened while entering a folder in the shell?")
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
d = dnew
|
47
|
+
end
|
48
|
+
end
|
22
49
|
|
23
50
|
def self.commonMetamodelCheck(configs, filename, isAdapt = false)
|
24
51
|
|
data/lib/bake/config/loader.rb
CHANGED
@@ -70,6 +70,7 @@ module Bake
|
|
70
70
|
end
|
71
71
|
|
72
72
|
def getFullProject(projName, configs, configname, isMain)
|
73
|
+
|
73
74
|
|
74
75
|
configname = resolveConfigName(configs, configname)
|
75
76
|
|
@@ -83,6 +84,7 @@ module Bake
|
|
83
84
|
@defaultToolchainName = config.defaultToolchain.basedOn unless config.defaultToolchain.nil?
|
84
85
|
@mainProjectName = config.parent.name
|
85
86
|
@mainConfigName = config.name
|
87
|
+
@configHashMain = {}
|
86
88
|
end
|
87
89
|
|
88
90
|
# check if config has to be manipulated
|
@@ -113,7 +115,18 @@ module Bake
|
|
113
115
|
configHash[s.name] = [] unless configHash.has_key?(s.name)
|
114
116
|
configHash[s.name] += s.value.split(";")
|
115
117
|
end
|
116
|
-
|
118
|
+
|
119
|
+
if !isMain
|
120
|
+
@configHashMain.each do |k,v|
|
121
|
+
if configHash.has_key?(k)
|
122
|
+
configHash[k] += v
|
123
|
+
configHash[k].uniq!
|
124
|
+
else
|
125
|
+
configHash[k] = v
|
126
|
+
end
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
117
130
|
checkCondition = lambda {|name,value|
|
118
131
|
return true if adaptHash[name].empty?
|
119
132
|
if !configHash.has_key?(name)
|
@@ -137,25 +150,15 @@ module Bake
|
|
137
150
|
end
|
138
151
|
end
|
139
152
|
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
def symlinkCheck(filename)
|
145
|
-
dirOfProjMeta = File.dirname(filename)
|
146
|
-
Dir.chdir(dirOfProjMeta) do
|
147
|
-
if Dir.pwd != dirOfProjMeta and File.dirname(Dir.pwd) != File.dirname(dirOfProjMeta)
|
148
|
-
isSym = false
|
149
|
-
begin
|
150
|
-
isSym = File.symlink?(dirOfProjMeta)
|
151
|
-
rescue
|
152
|
-
end
|
153
|
-
if isSym
|
154
|
-
Bake.formatter.printError("Symlinks only allowed with the same parent dir as the target: #{dirOfProjMeta} --> #{Dir.pwd}", filename)
|
155
|
-
ExitHelper.exit(1)
|
156
|
-
end
|
153
|
+
if isMain
|
154
|
+
config.scopes.each do |s|
|
155
|
+
@configHashMain[s.name] = [] unless @configHashMain.has_key?(s.name)
|
156
|
+
@configHashMain[s.name] += s.value.split(";")
|
157
157
|
end
|
158
158
|
end
|
159
|
+
|
160
|
+
@fullProjects[projName + "," + configname] = [config, configname]
|
161
|
+
[config, configname]
|
159
162
|
end
|
160
163
|
|
161
164
|
def checkVerFormat(ver)
|
@@ -200,6 +203,7 @@ module Bake
|
|
200
203
|
def loadProjMeta(filename)
|
201
204
|
|
202
205
|
Bake::Configs::Checks.symlinkCheck(filename)
|
206
|
+
Bake::Configs::Checks.sanityFolderName(filename)
|
203
207
|
|
204
208
|
f = @loader.load(filename)
|
205
209
|
|
data/lib/bake/model/metamodel.rb
CHANGED
@@ -131,6 +131,10 @@ module Bake
|
|
131
131
|
has_attr 'text', String, :defaultValueLiteral => ""
|
132
132
|
end
|
133
133
|
|
134
|
+
class CompilationDB < ModelElement
|
135
|
+
has_attr 'name', String, :defaultValueLiteral => "$(WorkingDir)/compile_commands.json"
|
136
|
+
end
|
137
|
+
|
134
138
|
class RequiredBakeVersion < ModelElement
|
135
139
|
has_attr 'minimum', String, :defaultValueLiteral => ""
|
136
140
|
has_attr 'maximum', String, :defaultValueLiteral => ""
|
@@ -299,6 +303,7 @@ module Bake
|
|
299
303
|
contains_one 'toolchain', Toolchain, 'parent'
|
300
304
|
contains_many 'set', Set, 'parent'
|
301
305
|
contains_many 'prebuild', Prebuild, 'parent'
|
306
|
+
contains_one 'cdb', CompilationDB, 'parent'
|
302
307
|
|
303
308
|
module ClassModule
|
304
309
|
def ident
|
data/lib/bake/options/options.rb
CHANGED
@@ -19,8 +19,8 @@ module Bake
|
|
19
19
|
end
|
20
20
|
|
21
21
|
class Options < Parser
|
22
|
-
attr_accessor :build_config, :nocache, :analyze, :eclipseOrder, :showConfigs
|
23
|
-
attr_reader :main_dir, :project, :filename, :main_project_name, :buildDirDelimiter, :dot, :dotFilename
|
22
|
+
attr_accessor :build_config, :nocache, :analyze, :eclipseOrder, :showConfigs, :cc2j_filename
|
23
|
+
attr_reader :main_dir, :working_dir, :project, :filename, :main_project_name, :buildDirDelimiter, :dot, :dotFilename # String
|
24
24
|
attr_reader :include_filter, :exclude_filter, :adapt # String List
|
25
25
|
attr_reader :conversion_info, :stopOnFirstError, :clean, :rebuild, :show_includes, :show_includes_and_defines, :projectPaths, :qac, :dry, :syncedOutput, :debug_threads, :skipBuildingLine # Boolean
|
26
26
|
attr_reader :linkOnly, :compileOnly, :no_autodir, :clobber, :docu, :debug, :prepro, :prebuild, :printTime, :json, :wparse, :caseSensitivityCheck, :fileCmd, :profiling # Boolean
|
@@ -193,6 +193,7 @@ module Bake
|
|
193
193
|
Bake.formatter.printError("Error: Project.meta not found in #{searchDir} or upwards")
|
194
194
|
ExitHelper.exit(1)
|
195
195
|
end
|
196
|
+
set_working_dir()
|
196
197
|
|
197
198
|
def_roots = Root.calc_roots_bake(@main_dir)
|
198
199
|
@roots += def_roots
|
@@ -323,11 +324,19 @@ module Bake
|
|
323
324
|
@main_project_name = File::basename(@main_dir)
|
324
325
|
end
|
325
326
|
|
327
|
+
def set_working_dir()
|
328
|
+
@working_dir = File.expand_path(Dir.pwd.gsub(/[\\]/,'/'))
|
329
|
+
end
|
330
|
+
|
326
331
|
def set_root(dir)
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
332
|
+
if File.file?(dir)
|
333
|
+
@roots += Root.calc_roots_bake(dir)
|
334
|
+
else
|
335
|
+
root = Root.extract_depth(dir)
|
336
|
+
check_valid_dir(root.dir)
|
337
|
+
root.dir = File.expand_path(root.dir.gsub(/[\\]/,'/'))
|
338
|
+
@roots << root
|
339
|
+
end
|
331
340
|
end
|
332
341
|
|
333
342
|
def set_adapt(name)
|
@@ -336,16 +345,21 @@ module Bake
|
|
336
345
|
end
|
337
346
|
end
|
338
347
|
|
339
|
-
def checkNum(num)
|
348
|
+
def checkNum(num, quite = false)
|
340
349
|
if String === num && !/\A\d+\z/.match(num)
|
341
|
-
|
342
|
-
|
350
|
+
if !quite
|
351
|
+
Bake.formatter.printError("Error: #{num} is not a positive number")
|
352
|
+
ExitHelper.exit(1)
|
353
|
+
else
|
354
|
+
return false
|
355
|
+
end
|
343
356
|
end
|
357
|
+
return true
|
344
358
|
end
|
345
359
|
|
346
360
|
def set_threads(num)
|
347
361
|
return if num == nil # -j without number shall behave the same as not set
|
348
|
-
checkNum(num)
|
362
|
+
return :ignore if !checkNum(num, true)
|
349
363
|
@threads = String === num ? num.to_i : num
|
350
364
|
if @threads <= 0
|
351
365
|
Bake.formatter.printError("Error: number of threads must be > 0")
|
data/lib/bake/subst.rb
CHANGED
@@ -202,6 +202,8 @@ module Bake
|
|
202
202
|
substStr << Bake.options.main_project_name
|
203
203
|
elsif var == "MainProjectDir"
|
204
204
|
substStr << Bake.options.main_dir
|
205
|
+
elsif var == "WorkingDir"
|
206
|
+
substStr << Bake.options.working_dir
|
205
207
|
elsif var == "ConfigName"
|
206
208
|
substStr << @@configName
|
207
209
|
elsif var == "ToolchainName" and defined?@@toolchainName
|
@@ -91,10 +91,14 @@ module Bake
|
|
91
91
|
end
|
92
92
|
|
93
93
|
def set_root(dir)
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
94
|
+
if File.file?(dir)
|
95
|
+
@roots += Root.calc_roots_bake(dir)
|
96
|
+
else
|
97
|
+
root = Root.extract_depth(dir)
|
98
|
+
check_valid_dir(root.dir)
|
99
|
+
root.dir = File.expand_path(root.dir.gsub(/[\\]/,'/'))
|
100
|
+
@roots << root
|
101
|
+
end
|
98
102
|
end
|
99
103
|
|
100
104
|
end
|
data/lib/common/cleanup.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require_relative "../blocks/block"
|
2
2
|
require_relative "ext/file"
|
3
|
+
require_relative "../bake/config/checks"
|
3
4
|
|
4
5
|
module Bake
|
5
6
|
|
@@ -10,7 +11,8 @@ module Bake
|
|
10
11
|
Bake::IDEInterface.instance.set_abort(false)
|
11
12
|
Blocks::Block.reset_block_counter
|
12
13
|
Blocks::Block.reset_delayed_result
|
13
|
-
|
14
|
+
Configs::Checks.cleanupWarnings
|
15
|
+
|
14
16
|
end
|
15
17
|
|
16
18
|
end
|
data/lib/common/ext/file.rb
CHANGED
@@ -52,7 +52,7 @@ class File
|
|
52
52
|
|
53
53
|
while i < max
|
54
54
|
if toSplitted[i] != fromSplitted[i]
|
55
|
-
if Bake.options.verbose >= 1
|
55
|
+
if Bake.options.verbose >= 1 && Bake.options.caseSensitivityCheck
|
56
56
|
if toSplitted[i].casecmp(fromSplitted[i]) == 0
|
57
57
|
if !@@warnedCase.include?(fromSplitted[0..i].join("/"))
|
58
58
|
fromsj = fromSplitted[0..i].join("/")
|
@@ -81,8 +81,8 @@ module Bake
|
|
81
81
|
if inPlaceArg
|
82
82
|
option.call(inPlaceArg, nil, nil)
|
83
83
|
else
|
84
|
-
option.call(@argv[pos+1], nil, nil) # do not use inplace value
|
85
|
-
pos = pos + 1
|
84
|
+
ignore = option.call(@argv[pos+1], nil, nil) # do not use inplace value
|
85
|
+
pos = pos + 1 if ignore != :ignore
|
86
86
|
end
|
87
87
|
else
|
88
88
|
option.call(nil, nil, nil)
|
data/lib/common/root.rb
CHANGED
@@ -58,7 +58,7 @@ module Bake
|
|
58
58
|
|
59
59
|
def self.calc_roots_bake(dir)
|
60
60
|
def_roots = []
|
61
|
-
rootsFile = searchRootsFile(dir)
|
61
|
+
rootsFile = (File.file?(dir) ? dir : searchRootsFile(dir))
|
62
62
|
if (rootsFile)
|
63
63
|
File.open(rootsFile).each do |line|
|
64
64
|
line = line.split("#")[0].strip.gsub(/[\\]/,'/')
|
data/lib/common/version.rb
CHANGED
data/lib/tocxx.rb
CHANGED
@@ -701,7 +701,17 @@ module Bake
|
|
701
701
|
makeDot
|
702
702
|
end
|
703
703
|
|
704
|
-
|
704
|
+
if !Bake.options.cc2j_filename
|
705
|
+
if !@mainConfig.cdb.nil?
|
706
|
+
Bake.options.cc2j_filename = @mainConfig.cdb.name
|
707
|
+
if !File.is_absolute?(Bake.options.cc2j_filename)
|
708
|
+
Bake.options.cc2j_filename = File.join(
|
709
|
+
File.rel_from_to_project(Dir.pwd, @mainConfig.parent.get_project_dir, false),
|
710
|
+
Bake.options.cc2j_filename)
|
711
|
+
end
|
712
|
+
end
|
713
|
+
end
|
714
|
+
|
705
715
|
metadata_json = Bake.options.dev_features.detect { |x| x.start_with?("metadata=") }
|
706
716
|
if metadata_json
|
707
717
|
metadata_file = metadata_json[9..-1]
|
@@ -730,7 +740,7 @@ module Bake
|
|
730
740
|
puts "File #{metadata_file} written."
|
731
741
|
ExitHelper.exit(0)
|
732
742
|
else
|
733
|
-
Bake.formatter.printError("Error: dev-feature metadata is only for LibraryConfig
|
743
|
+
Bake.formatter.printError("Error: dev-feature metadata is only for LibraryConfig or ExecutableConfig.")
|
734
744
|
ExitHelper.exit(1)
|
735
745
|
end
|
736
746
|
end
|
@@ -785,7 +795,14 @@ module Bake
|
|
785
795
|
|
786
796
|
if Bake.options.cc2j_filename
|
787
797
|
require "json"
|
788
|
-
|
798
|
+
begin
|
799
|
+
Bake.formatter.printInfo("Info: writing compilation database #{Bake.options.cc2j_filename}") if Bake.options.verbose >= 1
|
800
|
+
File.write(Bake.options.cc2j_filename, JSON.pretty_generate(Blocks::CC2J))
|
801
|
+
rescue Exception => ex
|
802
|
+
Bake.formatter.printError("Error: could not write compilation database: #{ex.message}")
|
803
|
+
puts ex.backtrace if Bake.options.debug
|
804
|
+
result = false
|
805
|
+
end
|
789
806
|
end
|
790
807
|
|
791
808
|
if Bake.options.filelist && !Bake.options.dry
|
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.61.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: 2020-
|
11
|
+
date: 2020-05-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rtext
|