bake-toolkit 2.63.2 → 2.64.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 007d1495eeb33f601eb10747f21cae6b0c478041092799bcfd284ab8cdce7253
4
- data.tar.gz: cabe15ec22fe017a9946b4287cc8321b5df6fd14b64dac6c0fa0b6f11c88f58a
3
+ metadata.gz: 511748b7bf298219c3c7f9ea2444ca6ac0049d67c1f01e2510bfd7ae619dfbd0
4
+ data.tar.gz: a28dea4db9569b991637e0a98e749bec0f5336a2ede3a76869488f701bc74646
5
5
  SHA512:
6
- metadata.gz: ec0beb0df1b8a9f191faba73671da192424f04714af16b80f047dac259808a778ac822a9f790ffcd679d86579a9100e1fc3325bc83b19a8d40b2b3c30ec6b769
7
- data.tar.gz: 2c75dc962078394be1033cd484834b90e4fd326c83a103b8fdb780d827f8f6a78f1689d2e383bc09d6e3aee0e1c0cf2d91a5fafad868eca6e7ad8f660eb09259
6
+ metadata.gz: 439f8755aa29bdefd4e65300f56a56883db480e0efd277d1692c5494f1368d2ae40226fdf7ddf76c622585735c0750edade07468490a17aa5c4b34e04d833b85
7
+ data.tar.gz: 3cd7e4828239cebc6e6a61180919c563a4b3e1bd3701eecdb1fe6f60d86610716dcc9f370da5d0f3ec46063b258f6c5e56f42d87b2233985905b33946822b38c
@@ -1,4 +1,5 @@
1
1
  require_relative '../../bake/model/loader'
2
+ require_relative '../../bake/config/loader'
2
3
  require_relative '../../bake/config/checks'
3
4
 
4
5
  module Bake
@@ -24,6 +25,10 @@ module Bake
24
25
  ExitHelper.exit(1)
25
26
  end
26
27
 
28
+ f.root_elements.each do |a|
29
+ Bake::Config::checkVer(a.requiredBakeVersion)
30
+ end
31
+
27
32
  configs = []
28
33
  f.root_elements.each { |re| configs.concat(re.getConfig) }
29
34
  AdaptConfig::checkSyntax(configs, filename)
@@ -161,7 +161,7 @@ module Bake
161
161
  [config, configname]
162
162
  end
163
163
 
164
- def checkVerFormat(ver)
164
+ def self.checkVerFormat(ver)
165
165
  return true if ver.empty?
166
166
  return false if ver.length > 3
167
167
  ver.each do |v|
@@ -170,7 +170,7 @@ module Bake
170
170
  true
171
171
  end
172
172
 
173
- def bailOutVer(reqVersion)
173
+ def self.bailOutVer(reqVersion)
174
174
  text1 = (reqVersion.minimum.empty? ? "" : "minimum = #{reqVersion.minimum}")
175
175
  text2 = ((reqVersion.minimum.empty? or reqVersion.maximum.empty?) ? "" : ", ")
176
176
  text3 = (reqVersion.maximum.empty? ? "" : "maximum = #{reqVersion.maximum}")
@@ -178,7 +178,7 @@ module Bake
178
178
  ExitHelper.exit(1)
179
179
  end
180
180
 
181
- def checkVer(reqVersion)
181
+ def self.checkVer(reqVersion)
182
182
  return if reqVersion.nil?
183
183
  min = reqVersion.minimum.split(".")
184
184
  max = reqVersion.maximum.split(".")
@@ -217,7 +217,7 @@ module Bake
217
217
  proj = projRoots[0]
218
218
 
219
219
  reqVersion = proj.getRequiredBakeVersion
220
- checkVer(reqVersion)
220
+ Bake::Config::checkVer(reqVersion)
221
221
 
222
222
  configs = proj.getConfig
223
223
  Bake::Configs::Checks::commonMetamodelCheck(configs, filename)
@@ -236,6 +236,7 @@ module Bake
236
236
  adaptRoots = f.root_elements.select { |re| Metamodel::Adapt === re }
237
237
  if adaptRoots.length > 0
238
238
  adaptRoots.each do |adapt|
239
+ Bake::Config::checkVer(adapt.requiredBakeVersion)
239
240
  adapt.mainProject = @mainProjectName if adapt.mainProject == "__THIS__"
240
241
  adaptConfigs = adapt.getConfig
241
242
  AdaptConfig.checkSyntax(adaptConfigs, filename, true)
@@ -284,6 +284,12 @@ module Bake
284
284
  has_attr 'env', Boolean, :defaultValueLiteral => "false"
285
285
  end
286
286
 
287
+ class CompilationCheck < ModelElement
288
+ has_attr 'exclude', String, :defaultValueLiteral => ""
289
+ has_attr 'include', String, :defaultValueLiteral => ""
290
+ has_attr 'ignore', String, :defaultValueLiteral => ""
291
+ end
292
+
287
293
  class BaseConfig_INTERNAL < ModelElement
288
294
  has_attr 'name', String, :defaultValueLiteral => ""
289
295
  has_attr 'extends', String, :defaultValueLiteral => ""
@@ -305,6 +311,7 @@ module Bake
305
311
  contains_many 'set', Set, 'parent'
306
312
  contains_many 'prebuild', Prebuild, 'parent'
307
313
  contains_one 'cdb', CompilationDB, 'parent'
314
+ contains_many 'compilationCheck', CompilationCheck, 'parent'
308
315
 
309
316
  module ClassModule
310
317
  def ident
@@ -356,6 +363,7 @@ module Bake
356
363
  has_attr 'mainConfig', String, :defaultValueLiteral => ""
357
364
  contains_many 'config', BaseConfig_INTERNAL, 'parent'
358
365
  contains_many 'scopes', Scope, 'parent'
366
+ contains_one 'requiredBakeVersion', RequiredBakeVersion, 'parent'
359
367
  end
360
368
 
361
369
  class If < Adapt
@@ -361,6 +361,10 @@ module Bake
361
361
  end
362
362
 
363
363
  def set_verbose(num)
364
+ if num.nil?
365
+ Bake.formatter.printError("Error: verbose must be between 0 and 3")
366
+ ExitHelper.exit(1)
367
+ end
364
368
  checkNum(num)
365
369
  @verbose = String === num ? num.to_i : num
366
370
  if @verbose < 0 || verbose > 3
@@ -7,47 +7,52 @@ require_relative '../common/utils'
7
7
  require_relative '../bake/toolchain/colorizing_formatter'
8
8
  require_relative '../bake/config/loader'
9
9
 
10
-
11
10
  begin
12
- require 'Win32API'
11
+ module Kernel32
12
+ require 'fiddle'
13
+ require 'fiddle/import'
14
+ require 'fiddle/types'
15
+ extend Fiddle::Importer
16
+ dlload 'kernel32'
17
+ include Fiddle::Win32Types
18
+ extern 'DWORD GetLongPathName(LPCSTR, LPSTR, DWORD)'
19
+ extern 'DWORD GetShortPathName(LPCSTR, LPSTR, DWORD)'
20
+ end
13
21
 
14
- def longname short_name
15
- max_path = 1024
16
- long_name = " " * max_path
17
- lfn_size = Win32API.new("kernel32", "GetLongPathName", ['P','P','L'],'L').call(short_name, long_name, max_path)
18
- return long_name[0..lfn_size-1]
19
- end
22
+ def longname short_name
23
+ max_path = 1024
24
+ long_name = " " * max_path
25
+ lfn_size = Kernel32.GetLongPathName(short_name, long_name, max_path)
26
+ return long_name[0..lfn_size-1]
27
+ end
20
28
 
21
- def shortname long_name
22
- max_path = 1024
23
- short_name = " " * max_path
24
- lfn_size = Win32API.new("kernel32", "GetShortPathName", ['P','P','L'],'L').call(long_name, short_name, max_path)
25
- return short_name[0..lfn_size-1]
26
- end
29
+ def shortname long_name
30
+ max_path = 1024
31
+ short_name = " " * max_path
32
+ lfn_size = Kernel32.GetShortPathName(long_name, short_name, max_path)
33
+ return short_name[0..lfn_size-1]
34
+ end
27
35
 
28
- def realname file
29
- longname(shortname(file))
30
- end
36
+ def realname file
37
+ x = longname(shortname(file))
38
+ end
31
39
 
32
- rescue LoadError
40
+ rescue Fiddle::DLError
33
41
 
34
- def realname file
42
+ def realname file
35
43
  file
36
- end
44
+ end
37
45
 
38
46
  end
39
47
 
40
48
 
41
-
42
-
43
-
44
49
  module Bake
45
50
 
46
51
  module Blocks
47
52
 
48
53
  class Compile < BlockBase
49
54
 
50
- attr_reader :objects, :include_list, :source_files_ignored_in_lib, :object_files_ignored_in_lib
55
+ attr_reader :objects, :source_files, :source_files_compiled, :include_list, :source_files_ignored_in_lib, :object_files_ignored_in_lib, :object_files
51
56
 
52
57
  def mutex
53
58
  @mutex ||= Mutex.new
@@ -421,6 +426,7 @@ module Bake
421
426
  Utils.gitIgnore(odir) if !Bake.options.dry
422
427
 
423
428
  fileListBlock = Set.new if Bake.options.filelist
429
+ @source_files_compiled = @source_files.dup
424
430
  compileJobs = Multithread::Jobs.new(@source_files) do |jobs|
425
431
  while source = jobs.get_next_or_nil do
426
432
 
@@ -539,7 +545,7 @@ module Bake
539
545
  end
540
546
 
541
547
  def calcSources(cleaning = false, keep = false)
542
- return @source_files if @source_files and not @source_files.empty?
548
+ return @source_files if @source_files && !@source_files.empty?
543
549
  @source_files = []
544
550
  @source_files_ignored_in_lib = []
545
551
  @source_files_link_directly = []
@@ -555,7 +561,7 @@ module Bake
555
561
  pr = sources.name
556
562
  pr = pr[2..-1] if pr.start_with?"./"
557
563
 
558
- res = Dir.glob_dir(pr, @projectDir).sort
564
+ res = Dir.glob_dir(pr, @projectDir).select {|f| !get_source_type(f).nil?}.sort
559
565
  if res.length == 0 and cleaning == false
560
566
  if not pr.include?"*" and not pr.include?"?"
561
567
  Bake.formatter.printError("Source file '#{pr}' not found", sources)
@@ -190,9 +190,15 @@ module Bake
190
190
  BlockBase.writeCmdLineFile(cmd, cmdLineFile)
191
191
  success = true
192
192
  consoleOutput = ""
193
- success, consoleOutput = ProcessHelper.run(realCmd, false, false, outPipe) if !Bake.options.dry
194
- process_result(cmdLinePrint, consoleOutput, linker[:ERROR_PARSER], nil, reason, success)
195
-
193
+ retry_linking = Bake.options.dev_features.include?("retry-linking") ? 5 : 1
194
+ begin
195
+ success, consoleOutput = ProcessHelper.run(realCmd, false, false, outPipe) if !Bake.options.dry
196
+ process_result(cmdLinePrint, consoleOutput, linker[:ERROR_PARSER], nil, reason, success)
197
+ rescue Exception
198
+ retry_linking -= 1
199
+ retry if !success && retry_linking > 0
200
+ raise
201
+ end
196
202
  check_config_file()
197
203
  end
198
204
 
@@ -1,7 +1,7 @@
1
1
  module Bake
2
2
  class Version
3
3
  def self.number
4
- "2.63.2"
4
+ "2.64.4"
5
5
  end
6
6
 
7
7
  def self.printBakeVersion(ry = "")
@@ -36,6 +36,7 @@ require_relative 'common/abortException'
36
36
 
37
37
  require_relative 'adapt/config/loader'
38
38
  require "thwait"
39
+ require 'pathname'
39
40
 
40
41
  module Bake
41
42
 
@@ -852,6 +853,84 @@ module Bake
852
853
  if Bake.options.linkOnly and @@linkBlock == 0
853
854
  Bake.formatter.printSuccess("\nNothing to link.")
854
855
  else
856
+ # CompilationCheck
857
+ if !Bake.options.project &&
858
+ !Bake.options.filename &&
859
+ !Bake.options.linkOnly &&
860
+ !Bake.options.prepro &&
861
+ !Bake.options.compileOnly &&
862
+ !Bake.options.clean
863
+
864
+ ccChecks = []
865
+ ccIncludes = Set.new
866
+ ccExcludes = Set.new
867
+ ccIgnores = Set.new
868
+ @referencedConfigs.each do |projName, configs|
869
+ configs.compilationCheck.each do |cc|
870
+ ccChecks << cc
871
+ end
872
+ end
873
+ ccChecks.each do |cc|
874
+ Dir.chdir(cc.parent.parent.get_project_dir) do
875
+ Dir.glob(cc.include).select {|f| File.file?(f)}.each {|f| ccIncludes << File.expand_path(f)}
876
+ Dir.glob(cc.exclude).select {|f| File.file?(f)}.each {|f| ccExcludes << File.expand_path(f)}
877
+ Dir.glob(cc.ignore). select {|f| File.file?(f)}.each {|f| ccIgnores << File.expand_path(f)}
878
+ end
879
+ end
880
+ ccIncludes -= ccIgnores
881
+ ccExcludes -= ccIgnores
882
+ ccIncludes -= ccExcludes
883
+
884
+ if !ccIncludes.empty? || !ccExcludes.empty?
885
+ inCompilation = Set.new
886
+ Blocks::ALL_BLOCKS.each do |name,block|
887
+ block.mainSteps.each do |b|
888
+ if Blocks::Compile === b && !b.source_files_compiled.nil?
889
+ b.source_files_compiled.each do |s|
890
+ inCompilation << File.expand_path(s, b.projectDir)
891
+ type = b.get_source_type(s)
892
+ if type != :ASM && b.object_files && b.object_files.has_key?(s)
893
+ o = b.object_files[s]
894
+ dep_filename = b.calcDepFile(o, type)
895
+ dep_filename_conv = b.calcDepFileConv(dep_filename)
896
+ File.readlines(File.expand_path(dep_filename_conv, b.projectDir)).map{|line| line.strip}.each do |dep|
897
+ header = File.expand_path(dep, b.projectDir)
898
+ if File.exist?(header)
899
+ inCompilation << header
900
+ end
901
+ end
902
+ end
903
+ end
904
+ end
905
+ end
906
+ end
907
+
908
+ pnPwd = Pathname.new(Dir.pwd)
909
+ ccNotIncluded = (ccIncludes - inCompilation).to_a
910
+ ccNotExcluded = inCompilation.select {|i| ccExcludes.include?(i) }
911
+ ccNotIncluded.each do |cc|
912
+ cc = Pathname.new(cc).relative_path_from(pnPwd)
913
+ Bake.formatter.printWarning("Warning: file not included in build: #{cc}")
914
+ end
915
+ ccNotExcluded.each do |cc|
916
+ cc = Pathname.new(cc).relative_path_from(pnPwd)
917
+ Bake.formatter.printWarning("Warning: file not excluded from build: #{cc}")
918
+ end
919
+
920
+ if Bake.options.verbose >= 3
921
+ if ccNotIncluded.empty? && ccNotExcluded.empty?
922
+ Bake.formatter.printInfo("Info: CompilationCheck passed")
923
+ end
924
+ end
925
+
926
+ elsif !ccChecks.empty?
927
+ if Bake.options.verbose >= 3
928
+ Bake.formatter.printInfo("Info: CompilationCheck passed")
929
+ end
930
+ end
931
+ end
932
+
933
+
855
934
  Bake.formatter.printSuccess("\n#{taskType} done.")
856
935
  end
857
936
  end
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.63.2
4
+ version: 2.64.4
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-06-22 00:00:00.000000000 Z
11
+ date: 2020-07-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rtext