bake-toolkit 2.71.0 → 2.72.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 97f124f36bbd221636166d8e01a9854b4c680f235643dab7154d3d6e50df0c4c
4
- data.tar.gz: 664f60e7f0fec1089b08f55a7662c1d3f5c3e6ad81c7f5332b206e10ca28fc47
3
+ metadata.gz: bcfee442bc92aa4c2c56199a5828ead8044dceadd34a4d7be67addc58f91bc44
4
+ data.tar.gz: 56887689de79a09756c04214ab696688c52c827310e392563abb51490c583f6f
5
5
  SHA512:
6
- metadata.gz: 655d3a58f54e604245af4a38feb61e099ae8ea9af58ec135a181a312cca39ed1cb18461ca4733c8d2754090cf782e0e2ca918b490ddce55f071add4ce09d9824
7
- data.tar.gz: 14034133ac3b08bcfc0c3b54483bf0f1cc98138a2a04e452d0860ca91fb9914f37115b822a068cdbc42caf8d584ca8c0e96268f82cf601992e6403a4209625fe
6
+ metadata.gz: 8b081a75cc9d44b832df446fcf6ee548babdacac87a3c96300f5ac7ee290e3b5fcb0111eb51ad884ce78b67b9e807236cb2b8fd52ebdaf761982d8532137efef
7
+ data.tar.gz: 68cc7ca438a0633a09cf0b95df002695fffa6bb7f860dfa5c9ed76e2289d707bcb985b7fdb6ac5af2f671ff83fa3e3dd87920b234113e56a2edf09b9ec3c1616
@@ -70,7 +70,7 @@ module Bake
70
70
  end
71
71
  Bake.options.adapt.each do |a|
72
72
  adaptBaseName = File.expand_path(a.gsub(/\(.*\)/,"") + "/Adapt.meta")
73
- potentialAdapts << adaptBaseName if File.exists?adaptBaseName
73
+ potentialAdapts << adaptBaseName if File.exist?adaptBaseName
74
74
  end
75
75
  potentialAdapts.concat(Root.search_to_depth(r, "Adapt.meta", root.depth))
76
76
  end
data/lib/bake/cache.rb CHANGED
@@ -64,7 +64,7 @@ module Bake
64
64
  puts "Cache: Checking if referenced configs are up to date..." if Bake.options.debug
65
65
  cache.referencedConfigs.each do |pname,configs|
66
66
  configs.each do |config|
67
- fileExists = File.exists?(config.file_name)
67
+ fileExists = File.exist?(config.file_name)
68
68
  puts "Cache: Checking if #{config.file_name} exists: #{fileExists}" if Bake.options.debug
69
69
  if not fileExists
70
70
  Bake.options.nocache = true
@@ -97,7 +97,7 @@ module Bake
97
97
  if (cache != nil)
98
98
  cache.adapt_filenames.each do |fHash|
99
99
  f = fHash[:file]
100
- fileExists = File.exists?(f)
100
+ fileExists = File.exist?(f)
101
101
  puts "Cache: Checking if #{f} exists: #{fileExists}" if Bake.options.debug
102
102
  if !fileExists
103
103
  Bake.formatter.printInfo("Info: #{f} does not exist anymore, reloading meta information")
@@ -142,7 +142,7 @@ module Bake
142
142
  def load(filename)
143
143
  sumErrors = 0
144
144
 
145
- if not File.exists?filename
145
+ if not File.exist?filename
146
146
  Bake.formatter.printError("Error: #{filename} does not exist")
147
147
  ExitHelper.exit(1)
148
148
  end
@@ -75,7 +75,7 @@ module Bake
75
75
  end
76
76
 
77
77
  def self.checkFile(name)
78
- if File.exists?(name)
78
+ if File.exist?(name)
79
79
  puts "#{name} already exists"
80
80
  ExitHelper.exit(1)
81
81
  end
@@ -296,7 +296,7 @@ module Bake
296
296
  end
297
297
 
298
298
  def check_valid_dir(dir)
299
- if not File.exists?(dir)
299
+ if not File.exist?(dir)
300
300
  Bake.formatter.printError("Error: Directory #{dir} does not exist")
301
301
  ExitHelper.exit(1)
302
302
  end
@@ -103,7 +103,7 @@ module Bake
103
103
  end
104
104
 
105
105
  def check_valid_dir(dir)
106
- if not File.exists?(dir)
106
+ if not File.exist?(dir)
107
107
  Bake.formatter.printError("Error: Directory #{dir} does not exist")
108
108
  ExitHelper.exit(1)
109
109
  end
@@ -251,16 +251,16 @@ module Bake
251
251
  end
252
252
 
253
253
  @cct.each do |cct|
254
- if !File.exists?(cct)
254
+ if !File.exist?(cct)
255
255
  Bake.formatter.printError("Error: cct file not found: #{cct}")
256
256
  ExitHelper.exit(1)
257
257
  end
258
258
  end
259
- if !File.exists?(@acf)
259
+ if !File.exist?(@acf)
260
260
  Bake.formatter.printError("Error: acf file not found: #{@acf}")
261
261
  ExitHelper.exit(1)
262
262
  end
263
- if !File.exists?(@rcf)
263
+ if !File.exist?(@rcf)
264
264
  Bake.formatter.printError("Error: rcf file not found: #{@rcf}")
265
265
  ExitHelper.exit(1)
266
266
  end
@@ -1,57 +1,57 @@
1
- require_relative 'metamodel'
2
- require_relative 'language'
3
- require_relative '../../common/version'
4
-
5
- require 'rgen/environment'
6
- require 'rgen/fragment/fragmented_model'
7
-
8
- require 'rtext/default_loader'
9
-
10
- require_relative '../../common/ext/rgen'
11
- require_relative '../../common/exit_helper'
12
- require_relative '../../bake/toolchain/colorizing_formatter'
13
-
14
- module Bake
15
-
16
- class BakeryLoader
17
-
18
- attr_reader :model
19
-
20
- def initialize
21
- @env = RGen::Environment.new
22
- @model = RGen::Fragment::FragmentedModel.new(:env => @env)
23
- end
24
-
25
- def load(filename)
26
-
27
- sumErrors = 0
28
-
29
- if not File.exists?filename
30
- Bake.formatter.printError("Error: #{filename} does not exist")
31
- ExitHelper.exit(1)
32
- end
33
-
34
- loader = RText::DefaultLoader.new(
35
- Bake::BakeryLanguage,
36
- @model,
37
- :file_provider => proc { [filename] },
38
- :cache => @DumpFileCache)
39
- loader.load()
40
-
41
- f = @model.fragments[0]
42
-
43
- f.data[:problems].each do |p|
44
- Bake.formatter.printError(p.message, p.file, p.line)
45
- end
46
-
47
- if f.data[:problems].length > 0
48
- ExitHelper.exit(1)
49
- end
50
-
51
- return @env
52
-
53
- end
54
-
55
-
56
- end
1
+ require_relative 'metamodel'
2
+ require_relative 'language'
3
+ require_relative '../../common/version'
4
+
5
+ require 'rgen/environment'
6
+ require 'rgen/fragment/fragmented_model'
7
+
8
+ require 'rtext/default_loader'
9
+
10
+ require_relative '../../common/ext/rgen'
11
+ require_relative '../../common/exit_helper'
12
+ require_relative '../../bake/toolchain/colorizing_formatter'
13
+
14
+ module Bake
15
+
16
+ class BakeryLoader
17
+
18
+ attr_reader :model
19
+
20
+ def initialize
21
+ @env = RGen::Environment.new
22
+ @model = RGen::Fragment::FragmentedModel.new(:env => @env)
23
+ end
24
+
25
+ def load(filename)
26
+
27
+ sumErrors = 0
28
+
29
+ if not File.exist?filename
30
+ Bake.formatter.printError("Error: #{filename} does not exist")
31
+ ExitHelper.exit(1)
32
+ end
33
+
34
+ loader = RText::DefaultLoader.new(
35
+ Bake::BakeryLanguage,
36
+ @model,
37
+ :file_provider => proc { [filename] },
38
+ :cache => @DumpFileCache)
39
+ loader.load()
40
+
41
+ f = @model.fragments[0]
42
+
43
+ f.data[:problems].each do |p|
44
+ Bake.formatter.printError(p.message, p.file, p.line)
45
+ end
46
+
47
+ if f.data[:problems].length > 0
48
+ ExitHelper.exit(1)
49
+ end
50
+
51
+ return @env
52
+
53
+ end
54
+
55
+
56
+ end
57
57
  end
@@ -1,106 +1,106 @@
1
- require_relative '../../bake/toolchain/colorizing_formatter'
2
- require_relative '../../common/options/parser'
3
- require_relative '../../common/options/finder'
4
- require_relative '../../common/root'
5
-
6
- module Bake
7
-
8
- class BakeryOptions < Parser
9
- attr_reader :collection_name, :collection_dir # String
10
- attr_reader :roots # Root list
11
- attr_reader :color, :error # Boolean
12
- attr_reader :socket # Fixnum
13
-
14
- def initialize(argv)
15
- super(argv)
16
-
17
- @collection_name = ""
18
- @collection_dir = nil
19
- @color = nil
20
- @error = false
21
- @roots = []
22
- @socket = 0
23
-
24
- add_option(["-b", "" ], lambda { |x| set_collection_name(x) })
25
- add_option(["-m" ], lambda { |x| @collection_dir = x })
26
- add_option(["-r" ], lambda { @error = true })
27
- add_option(["-a" ], lambda { |x| Bake.formatter.setColorScheme(x.to_sym) })
28
- add_option(["-w" ], lambda { |x| set_root(x) })
29
- add_option(["--socket" ], lambda { |x| @socket = String === x ? x.to_i : x })
30
- add_option(["-h", "--help"], lambda { usage; ExitHelper.exit(0) })
31
- end
32
-
33
- def usage
34
- puts "\nUsage: bake <name> [options]"
35
- puts " [-b] <name> Name of the collection to build."
36
- puts " -m <dir> Directory containing the collection file (default is current directory)."
37
- puts " -r Stop on first error."
38
- puts " -a <scheme> Use ansi color sequences (console must support it). Possible values are 'white', 'black' and 'none' (default)."
39
- puts " -h, --help Print this help."
40
- puts " -w <root>[,<depth>] Add a workspace root (can be used multiple times). Additionally the search depth can be specified (>=0)."
41
- puts " If no root is specified, the parent directory of Collection.meta is added automatically."
42
- puts " --socket <num> Set socket for sending errors, receiving commands, etc. - used by e.g. Eclipse."
43
- puts "Note: all parameters except -b, -m and -h will be passed to bake - see bake help for more options."
44
- end
45
-
46
- def parse_options(bakeOptions)
47
- parse_internal(true, bakeOptions)
48
-
49
- searchDir = @collection_dir.nil? ? Dir.pwd : @collection_dir
50
- dir = Bake.findDirOfFileToRoot(searchDir,"Collection.meta")
51
- if dir
52
- set_collection_dir(dir)
53
- else
54
- Bake.formatter.printError("Error: Collection.meta not found in #{searchDir} or upwards")
55
- ExitHelper.exit(1)
56
- end
57
-
58
- def_roots = Root.calc_roots_bake(@collection_dir)
59
- @roots += def_roots
60
-
61
- if @roots.empty?
62
- @roots = []
63
- @roots = Root.calc_def_roots(@collection_dir)
64
- end
65
-
66
- @roots = Root.uniq(@roots)
67
- end
68
-
69
- def check_valid_dir(dir)
70
- if not File.exists?(dir)
71
- Bake.formatter.printError("Error: Directory #{dir} does not exist")
72
- ExitHelper.exit(1)
73
- end
74
- if not File.directory?(dir)
75
- Bake.formatter.printError("Error: #{dir} is not a directory")
76
- ExitHelper.exit(1)
77
- end
78
- end
79
-
80
- def set_collection_name(collection_name)
81
- if not @collection_name.empty?
82
- Bake.formatter.printError("Error: Cannot set collection name '#{collection_name}', because collection name is already set to '#{@collection_name}'")
83
- ExitHelper.exit(1)
84
- end
85
- @collection_name = collection_name
86
- end
87
-
88
- def set_collection_dir(dir)
89
- check_valid_dir(dir)
90
- @collection_dir = File.expand_path(dir.gsub(/[\\]/,'/'))
91
- end
92
-
93
- def set_root(dir)
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
102
- end
103
-
104
- end
105
-
106
- end
1
+ require_relative '../../bake/toolchain/colorizing_formatter'
2
+ require_relative '../../common/options/parser'
3
+ require_relative '../../common/options/finder'
4
+ require_relative '../../common/root'
5
+
6
+ module Bake
7
+
8
+ class BakeryOptions < Parser
9
+ attr_reader :collection_name, :collection_dir # String
10
+ attr_reader :roots # Root list
11
+ attr_reader :color, :error # Boolean
12
+ attr_reader :socket # Fixnum
13
+
14
+ def initialize(argv)
15
+ super(argv)
16
+
17
+ @collection_name = ""
18
+ @collection_dir = nil
19
+ @color = nil
20
+ @error = false
21
+ @roots = []
22
+ @socket = 0
23
+
24
+ add_option(["-b", "" ], lambda { |x| set_collection_name(x) })
25
+ add_option(["-m" ], lambda { |x| @collection_dir = x })
26
+ add_option(["-r" ], lambda { @error = true })
27
+ add_option(["-a" ], lambda { |x| Bake.formatter.setColorScheme(x.to_sym) })
28
+ add_option(["-w" ], lambda { |x| set_root(x) })
29
+ add_option(["--socket" ], lambda { |x| @socket = String === x ? x.to_i : x })
30
+ add_option(["-h", "--help"], lambda { usage; ExitHelper.exit(0) })
31
+ end
32
+
33
+ def usage
34
+ puts "\nUsage: bake <name> [options]"
35
+ puts " [-b] <name> Name of the collection to build."
36
+ puts " -m <dir> Directory containing the collection file (default is current directory)."
37
+ puts " -r Stop on first error."
38
+ puts " -a <scheme> Use ansi color sequences (console must support it). Possible values are 'white', 'black' and 'none' (default)."
39
+ puts " -h, --help Print this help."
40
+ puts " -w <root>[,<depth>] Add a workspace root (can be used multiple times). Additionally the search depth can be specified (>=0)."
41
+ puts " If no root is specified, the parent directory of Collection.meta is added automatically."
42
+ puts " --socket <num> Set socket for sending errors, receiving commands, etc. - used by e.g. Eclipse."
43
+ puts "Note: all parameters except -b, -m and -h will be passed to bake - see bake help for more options."
44
+ end
45
+
46
+ def parse_options(bakeOptions)
47
+ parse_internal(true, bakeOptions)
48
+
49
+ searchDir = @collection_dir.nil? ? Dir.pwd : @collection_dir
50
+ dir = Bake.findDirOfFileToRoot(searchDir,"Collection.meta")
51
+ if dir
52
+ set_collection_dir(dir)
53
+ else
54
+ Bake.formatter.printError("Error: Collection.meta not found in #{searchDir} or upwards")
55
+ ExitHelper.exit(1)
56
+ end
57
+
58
+ def_roots = Root.calc_roots_bake(@collection_dir)
59
+ @roots += def_roots
60
+
61
+ if @roots.empty?
62
+ @roots = []
63
+ @roots = Root.calc_def_roots(@collection_dir)
64
+ end
65
+
66
+ @roots = Root.uniq(@roots)
67
+ end
68
+
69
+ def check_valid_dir(dir)
70
+ if not File.exist?(dir)
71
+ Bake.formatter.printError("Error: Directory #{dir} does not exist")
72
+ ExitHelper.exit(1)
73
+ end
74
+ if not File.directory?(dir)
75
+ Bake.formatter.printError("Error: #{dir} is not a directory")
76
+ ExitHelper.exit(1)
77
+ end
78
+ end
79
+
80
+ def set_collection_name(collection_name)
81
+ if not @collection_name.empty?
82
+ Bake.formatter.printError("Error: Cannot set collection name '#{collection_name}', because collection name is already set to '#{@collection_name}'")
83
+ ExitHelper.exit(1)
84
+ end
85
+ @collection_name = collection_name
86
+ end
87
+
88
+ def set_collection_dir(dir)
89
+ check_valid_dir(dir)
90
+ @collection_dir = File.expand_path(dir.gsub(/[\\]/,'/'))
91
+ end
92
+
93
+ def set_root(dir)
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
102
+ end
103
+
104
+ end
105
+
106
+ end
data/lib/blocks/block.rb CHANGED
@@ -142,14 +142,14 @@ module Bake
142
142
  Bake.formatter.printInfo("\"#{d}\" uses path magic in IncludeDir, please use a Dependency to \"#{inc[0]}\" instead", elem) if warnIfLocal
143
143
  end
144
144
 
145
- if File.exists?(@projectDir + "/" + d) # prio 2: local, e.g. "include"
145
+ if File.exist?(@projectDir + "/" + d) # prio 2: local, e.g. "include"
146
146
  res << d
147
147
  end
148
148
 
149
149
  # prio 3: check if dir exists without Project.meta entry
150
150
  Bake.options.roots.each do |r|
151
151
  absIncDir = r.dir+"/"+d
152
- if File.exists?(absIncDir)
152
+ if File.exist?(absIncDir)
153
153
  res << File.rel_from_to_project(@projectDir,absIncDir,false)
154
154
  Bake.formatter.printInfo("\"#{d}\" uses path magic in IncludeDir, please create a Project.meta in \"#{absIncDir}\" or upwards and use a Dependency instead", elem) if warnIfLocal && res.length == 1
155
155
  end
@@ -15,7 +15,7 @@ module Bake
15
15
  end
16
16
 
17
17
  def check_config_file()
18
- if File.exists?(@config.file_name) and File.mtime(@config.file_name) > @config_date
18
+ if File.exist?(@config.file_name) and File.mtime(@config.file_name) > @config_date
19
19
  begin
20
20
  FileUtils.touch(@config.file_name) if !Bake.options.dry
21
21
  rescue Exception=>e
@@ -30,7 +30,7 @@ module Bake
30
30
  return if Bake.options.dry
31
31
  filename = File.expand_path(filename, @projectDir)
32
32
  begin
33
- if File.exists?(filename)
33
+ if File.exist?(filename)
34
34
  FileUtils.rm(filename)
35
35
  else
36
36
  FileUtils::mkdir_p(File.dirname(filename))
@@ -77,25 +77,25 @@ module Bake
77
77
  return "because linkOnly was specified" if Bake.options.linkOnly
78
78
 
79
79
  # exe
80
- return "because executable does not exist" if not File.exists?(@exe_name)
80
+ return "because executable does not exist" if not File.exist?(@exe_name)
81
81
 
82
82
  eTime = File.mtime(@exe_name)
83
83
 
84
84
  # linkerscript
85
85
  if @linker_script
86
- return "because linker script does not exist - will most probably result in an error" if not File.exists?(@linker_script)
86
+ return "because linker script does not exist - will most probably result in an error" if not File.exist?(@linker_script)
87
87
  return "because linker script is newer than executable" if eTime < File.mtime(@linker_script)
88
88
  end
89
89
 
90
90
  # sources
91
91
  @compileBlock.objects.each do |obj|
92
- return "because object #{obj} does not exist" if not File.exists?(obj)
92
+ return "because object #{obj} does not exist" if not File.exist?(obj)
93
93
  return "because object #{obj} is newer than executable" if eTime < File.mtime(obj)
94
94
  end if @compileBlock
95
95
 
96
96
  # libs
97
97
  libs.each do |lib|
98
- return "because library #{lib} does not exist" if not File.exists?(lib)
98
+ return "because library #{lib} does not exist" if not File.exist?(lib)
99
99
  return "because library #{lib} is newer than executable" if eTime < File.mtime(lib)
100
100
  end
101
101
  false
@@ -52,13 +52,13 @@ module Bake
52
52
  Dir.mutex.synchronize do
53
53
  Dir.chdir(@projectDir) do
54
54
  # lib
55
- return "because library does not exist" if not File.exists?(@archive_name)
55
+ return "because library does not exist" if not File.exist?(@archive_name)
56
56
 
57
57
  aTime = File.mtime(@archive_name)
58
58
 
59
59
  # sources
60
60
  @objects.each do |obj|
61
- return "because object #{obj} does not exist" if not File.exists?(obj)
61
+ return "because object #{obj} does not exist" if not File.exist?(obj)
62
62
  return "because object #{obj} is newer than executable" if aTime < File.mtime(obj)
63
63
  end
64
64
  end
@@ -87,7 +87,7 @@ module Bake
87
87
  @objects.concat(Dir.glob_dir("#{@block.output_dir}/**/*#{e}", @projectDir))
88
88
  end
89
89
  if @objects.empty?
90
- if !File.exists?(File.expand_path(@archive_name, @projectDir))
90
+ if !File.exist?(File.expand_path(@archive_name, @projectDir))
91
91
  SyncOut.mutex.synchronize do
92
92
  puts "No object files, library won't be created" if Bake.options.verbose >= 2
93
93
  end
@@ -83,7 +83,7 @@ module Bake
83
83
  else
84
84
  Bake.options.roots.each do |r|
85
85
  absIncDir = r.dir+"/"+nameOfP
86
- if File.exists?(absIncDir)
86
+ if File.exist?(absIncDir)
87
87
  dirOfP = absIncDir
88
88
  break
89
89
  end
@@ -49,7 +49,7 @@ module Bake
49
49
 
50
50
  iname = mainBlock.convPath(iinc)
51
51
  if iname != ""
52
- if not File.exists?(iname)
52
+ if not File.exist?(iname)
53
53
  Bake.formatter.printError("InternalIncludes file #{iname} does not exist", iinc)
54
54
  ExitHelper.exit(1)
55
55
  end
@@ -74,7 +74,7 @@ module Bake
74
74
  if (c.internalDefines)
75
75
  dname = mainBlock.convPath(c.internalDefines)
76
76
  if dname != ""
77
- if not File.exists?(dname)
77
+ if not File.exist?(dname)
78
78
  Bake.formatter.printError("InternalDefines file #{dname} does not exist", c.internalDefines)
79
79
  ExitHelper.exit(1)
80
80
  end
@@ -1,7 +1,7 @@
1
1
  module Bake
2
2
 
3
3
  def self.findDirOfFileToRoot(dir, filename)
4
- if !File.exists?(dir)
4
+ if !File.exist?(dir)
5
5
  Bake.formatter.printError("Error: #{dir} does not exist")
6
6
  ExitHelper.exit(1)
7
7
  end
@@ -1,7 +1,7 @@
1
1
  module Bake
2
2
  class Version
3
3
  def self.number
4
- "2.71.0"
4
+ "2.72.0"
5
5
  end
6
6
 
7
7
  def self.printBakeVersion(ry = "")
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.71.0
4
+ version: 2.72.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: 2021-12-13 00:00:00.000000000 Z
11
+ date: 2023-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rtext
@@ -286,7 +286,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
286
286
  - !ruby/object:Gem::Version
287
287
  version: '0'
288
288
  requirements: []
289
- rubygems_version: 3.2.22
289
+ rubygems_version: 3.4.2
290
290
  signing_key:
291
291
  specification_version: 4
292
292
  summary: Build tool to compile C/C++ projects fast and easy.