bake-toolkit 2.42.3 → 2.43.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
  SHA1:
3
- metadata.gz: db7a56decb2a548940290f127a619920e3904e32
4
- data.tar.gz: aee111f1f448b858250af2102509e89360d93412
3
+ metadata.gz: 979457d55561c9d98081d4a922d1af5cbcc4e1d9
4
+ data.tar.gz: 63ce64c5b31fe8ba2ebba2ee8ae4d28858ed8e93
5
5
  SHA512:
6
- metadata.gz: 5b548504948bba8662e3c239f72cb1f4e81edf0df45e3bbd5304fe3ca745694581809f66f79f4a888954f9ed44e4d681c5d542f80bd61888992d7b39f686f1f9
7
- data.tar.gz: d25bad6ab99a8268a55e300583ad4adc3a189174ad84ce123ef24620d5921081dae00adaca7d7501eaeb3e240cc0b147a27c29787a839bf334a9730638bc7131
6
+ metadata.gz: 76371243a25ea2d8d703c775996d76fbb635f0a4b7326ac23087db2e3db4fc1f2b3e4d672b6b905d37485a8efbbdf54faf13663bb1386cd81abc25712fa0275e
7
+ data.tar.gz: 04e358efa264dc5f433f919b9a9231040d61ad85ce7e3794a4c2bc82ef93e35f375a1231d9689ce44060c3004b69815a892735e5d7bf32a1b0fa3839acd42a2a
@@ -34,6 +34,10 @@ module Bake
34
34
  Bake.formatter.printError("InternalDefines only allowed in DefaultToolchain", c.internalDefines)
35
35
  ExitHelper.exit(1)
36
36
  end
37
+ if c.fileEndings && c.fileEndings.endings.empty?
38
+ Bake.formatter.printError("FileEnding must not be empty.", c.fileEndings)
39
+ ExitHelper.exit(1)
40
+ end
37
41
  end
38
42
  config.toolchain.lintPolicy.each do |l|
39
43
  Bake.formatter.printWarning("Lint support was removed. Please delete LintPolicy from Project.meta.", l)
@@ -43,6 +47,12 @@ module Bake
43
47
  config.defaultToolchain.lintPolicy.each do |l|
44
48
  Bake.formatter.printWarning("Lint support was removed. Please delete LintPolicy from Project.meta.", l)
45
49
  end
50
+ config.defaultToolchain.compiler.each do |c|
51
+ if c.fileEndings && c.fileEndings.endings.empty?
52
+ Bake.formatter.printError("FileEnding must not be empty.", c.fileEndings)
53
+ ExitHelper.exit(1)
54
+ end
55
+ end
46
56
  end
47
57
 
48
58
  config.includeDir.each do |inc|
@@ -1,45 +1,47 @@
1
- require 'bake/model/metamodel'
2
-
3
- require 'rtext/language'
4
-
5
-
6
-
7
- module Bake
8
-
9
- class Idp
10
- def call(e,notUsed1,notUsed2,notUsed3)
11
- e.respond_to?(:ident) ? e.ident() : nil
12
- end
13
- end
14
-
15
-
16
- Language =
17
- RText::Language.new(Metamodel.ecore,
18
- :feature_provider => proc {|c|
19
- RGen::Serializer::OppositeReferenceFilter.call(c.eAllStructuralFeatures).reject {|f|
20
- f.eAnnotations.any? {|a|
21
- a.details.any? {|d| d.key == 'internal' && d.value == 'true'}
22
- }
23
- }
24
- },
25
- :unlabled_arguments => proc {|c|
26
- if c.name == "Compiler" or c.name == "CompilerAdaptions"
27
- ["ctype"]
28
- elsif c.name == "Define"
29
- ["str"]
30
- elsif c.name == "Flags" or c.name == "LibPostfixFlags" or c.name == "LibPrefixFlags"
31
- ["overwrite"]
32
- elsif c.name == "DefaultToolchain"
33
- ["basedOn"]
34
- elsif c.name == "Description"
35
- ["text"]
36
- else
37
- ["name"]
38
- end
39
- },
40
- :identifier_provider => Idp.new,
41
- :line_number_attribute => "line_number",
42
- :fragment_ref_attribute => "fragment_ref"
43
- )
44
-
45
- end
1
+ require 'bake/model/metamodel'
2
+
3
+ require 'rtext/language'
4
+
5
+
6
+
7
+ module Bake
8
+
9
+ class Idp
10
+ def call(e,notUsed1,notUsed2,notUsed3)
11
+ e.respond_to?(:ident) ? e.ident() : nil
12
+ end
13
+ end
14
+
15
+
16
+ Language =
17
+ RText::Language.new(Metamodel.ecore,
18
+ :feature_provider => proc {|c|
19
+ RGen::Serializer::OppositeReferenceFilter.call(c.eAllStructuralFeatures).reject {|f|
20
+ f.eAnnotations.any? {|a|
21
+ a.details.any? {|d| d.key == 'internal' && d.value == 'true'}
22
+ }
23
+ }
24
+ },
25
+ :unlabled_arguments => proc {|c|
26
+ if c.name == "Compiler" or c.name == "CompilerAdaptions"
27
+ ["ctype"]
28
+ elsif c.name == "Define"
29
+ ["str"]
30
+ elsif c.name == "Flags" or c.name == "LibPostfixFlags" or c.name == "LibPrefixFlags"
31
+ ["overwrite"]
32
+ elsif c.name == "DefaultToolchain"
33
+ ["basedOn"]
34
+ elsif c.name == "Description"
35
+ ["text"]
36
+ elsif c.name == "SrcFileEndings"
37
+ ["endings"]
38
+ else
39
+ ["name"]
40
+ end
41
+ },
42
+ :identifier_provider => Idp.new,
43
+ :line_number_attribute => "line_number",
44
+ :fragment_ref_attribute => "fragment_ref"
45
+ )
46
+
47
+ end
@@ -49,6 +49,10 @@ module Bake
49
49
  has_attr 'str', String, :defaultValueLiteral => ""
50
50
  end
51
51
 
52
+ class SrcFileEndings < ModelElement
53
+ has_attr 'endings', String, :defaultValueLiteral => ""
54
+ end
55
+
52
56
  class InternalIncludes < ModelElement
53
57
  has_attr 'name', String, :defaultValueLiteral => ""
54
58
  end
@@ -79,6 +83,7 @@ module Bake
79
83
  contains_many 'define', Define, 'parent'
80
84
  contains_many 'flags', Flags, 'parent'
81
85
  contains_one 'internalDefines', InternalDefines, 'parent'
86
+ contains_one 'fileEndings', SrcFileEndings, 'parent'
82
87
  end
83
88
 
84
89
  class LintPolicy < ModelElement
@@ -93,6 +98,7 @@ module Bake
93
98
  has_attr 'basedOn', String, :defaultValueLiteral => ""
94
99
  has_attr 'outputDir', String, :defaultValueLiteral => ""
95
100
  has_attr 'eclipseOrder', Boolean, :defaultValueLiteral => "false"
101
+ has_attr 'keepObjFileEndings', Boolean, :defaultValueLiteral => "false"
96
102
  contains_many 'compiler', Compiler, 'parent'
97
103
  contains_one 'archiver', Archiver, 'parent'
98
104
  contains_one 'linker', Linker, 'parent'
@@ -117,7 +117,8 @@ module Bake
117
117
  },
118
118
 
119
119
  :DEP_FILE_SINGLE_LINE => false,
120
- :DOCU => ""
120
+ :DOCU => "",
121
+ :KEEP_FILE_ENDINGS => false
121
122
  }
122
123
 
123
124
  def self.add(name, basedOn = nil)
@@ -1,119 +1,123 @@
1
- require 'bake/model/metamodel_ext'
2
- require 'bake/model/metamodel'
3
- require 'set'
4
- require 'bake/toolchain/colorizing_formatter'
5
- require 'common/exit_helper'
6
- require 'common/utils'
7
-
8
-
9
- def remove_empty_strings_and_join(a, j=' ')
10
- return a.reject{|e|e.to_s.empty?}.join(j)
11
- end
12
-
13
- def adjustFlags(orgStr, flags)
14
- orgSplitted = Bake::Utils::flagSplit(orgStr, false)
15
-
16
- flags.each do |f|
17
- if f.overwrite != ""
18
- orgSplitted = Bake::Utils::flagSplit(f.overwrite, false)
19
- end
20
-
21
- if f.remove != ""
22
- rmSplitted = Bake::Utils::flagSplit(f.remove, false)
23
- orgSplitted.delete_if {|o| rmSplitted.any? { |r|
24
- begin
25
- o.match("\\A"+r+"\\Z")
26
- rescue Exception => e
27
- Bake.formatter.printError(e.message, f)
28
- Bake::ExitHelper.exit(1)
29
- end
30
- }}
31
- end
32
-
33
- if f.add != ""
34
- Bake::Utils::flagSplit(f.add, false).each do |a|
35
- orgSplitted << a unless orgSplitted.any? { |o| o==a }
36
- end
37
- end
38
-
39
- end
40
-
41
- orgSplitted.join(" ")
42
- end
43
-
44
- def integrateToolchain(tcs, toolchain)
45
- return tcs unless toolchain
46
-
47
- tcs[:OUTPUT_DIR] = toolchain.outputDir if toolchain.outputDir != ""
48
- integrateLinker(tcs, toolchain.linker) if toolchain.respond_to?"linker"
49
- integrateArchiver(tcs, toolchain.archiver)
50
- toolchain.compiler.each do |c|
51
- integrateCompiler(tcs, c, c.ctype)
52
- end
53
- integrateDocu(tcs, toolchain.docu) if toolchain.docu
54
- end
55
-
56
- def integrateDocu(tcs, docu)
57
- tcs[:DOCU] = docu.name if docu.name != ""
58
- end
59
-
60
- def integrateLinker(tcs, linker)
61
- return tcs unless linker
62
- tcs[:LINKER][:COMMAND] = linker.command if linker.command != ""
63
- tcs[:LINKER][:LINK_ONLY_DIRECT_DEPS] = linker.onlyDirectDeps
64
- tcs[:LINKER][:PREFIX] = linker.prefix if linker.prefix != ""
65
- tcs[:LINKER][:FLAGS] = adjustFlags(tcs[:LINKER][:FLAGS], linker.flags)
66
- tcs[:LINKER][:LIB_PREFIX_FLAGS] = adjustFlags(tcs[:LINKER][:LIB_PREFIX_FLAGS], linker.libprefixflags)
67
- tcs[:LINKER][:LIB_POSTFIX_FLAGS] = adjustFlags(tcs[:LINKER][:LIB_POSTFIX_FLAGS], linker.libpostfixflags)
68
- end
69
-
70
- def integrateArchiver(tcs, archiver)
71
- return tcs unless archiver
72
- tcs[:ARCHIVER][:COMMAND] = archiver.command if archiver.command != ""
73
- tcs[:ARCHIVER][:PREFIX] = archiver.prefix if archiver.prefix != ""
74
- tcs[:ARCHIVER][:FLAGS] = adjustFlags(tcs[:ARCHIVER][:FLAGS], archiver.flags)
75
- end
76
-
77
- def integrateCompiler(tcs, compiler, type)
78
- return tcs unless compiler
79
- if compiler.respond_to?"command"
80
- tcs[:COMPILER][type][:COMMAND] = compiler.command if compiler.command != ""
81
- end
82
- if compiler.respond_to?"prefix"
83
- tcs[:COMPILER][type][:PREFIX] = compiler.prefix if compiler.prefix != ""
84
- end
85
-
86
- tcs[:COMPILER][type][:FLAGS] = adjustFlags(tcs[:COMPILER][type][:FLAGS], compiler.flags)
87
- compiler.define.each do |d|
88
- tcs[:COMPILER][type][:DEFINES] << d.str unless tcs[:COMPILER][type][:DEFINES].include? d.str
89
- end
90
- end
91
-
92
- def integrateCompilerFile(tcs, compiler)
93
- [:CPP, :C, :ASM].each do |t|
94
- integrateCompiler(tcs, compiler, t)
95
- end
96
- return tcs
97
- end
98
-
99
-
100
- def sanitize_filename(filename)
101
- filename.strip do |name|
102
- # NOTE: File.basename doesn't work right with Windows paths on Unix
103
- # get only the filename, not the whole path
104
- name.gsub! /^.*(\\|\/)/, ''
105
-
106
- # Finally, replace all non alphanumeric, underscore
107
- # or periods with underscore
108
- # name.gsub! /[^\w\.\-]/, '_'
109
- # Basically strip out the non-ascii alphabets too
110
- # and replace with x.
111
- # You don't want all _ :)
112
- name.gsub!(/[^0-9A-Za-z.\-]/, 'x')
113
- end
114
- end
115
-
116
- def add_line_if_no_comment(array, str)
117
- s = str.split("#")[0].strip
118
- array << s unless s.empty?
119
- end
1
+ require 'bake/model/metamodel_ext'
2
+ require 'bake/model/metamodel'
3
+ require 'set'
4
+ require 'bake/toolchain/colorizing_formatter'
5
+ require 'common/exit_helper'
6
+ require 'common/utils'
7
+
8
+
9
+ def remove_empty_strings_and_join(a, j=' ')
10
+ return a.reject{|e|e.to_s.empty?}.join(j)
11
+ end
12
+
13
+ def adjustFlags(orgStr, flags)
14
+ orgSplitted = Bake::Utils::flagSplit(orgStr, false)
15
+
16
+ flags.each do |f|
17
+ if f.overwrite != ""
18
+ orgSplitted = Bake::Utils::flagSplit(f.overwrite, false)
19
+ end
20
+
21
+ if f.remove != ""
22
+ rmSplitted = Bake::Utils::flagSplit(f.remove, false)
23
+ orgSplitted.delete_if {|o| rmSplitted.any? { |r|
24
+ begin
25
+ o.match("\\A"+r+"\\Z")
26
+ rescue Exception => e
27
+ Bake.formatter.printError(e.message, f)
28
+ Bake::ExitHelper.exit(1)
29
+ end
30
+ }}
31
+ end
32
+
33
+ if f.add != ""
34
+ Bake::Utils::flagSplit(f.add, false).each do |a|
35
+ orgSplitted << a unless orgSplitted.any? { |o| o==a }
36
+ end
37
+ end
38
+
39
+ end
40
+
41
+ orgSplitted.join(" ")
42
+ end
43
+
44
+ def integrateToolchain(tcs, toolchain)
45
+ return tcs unless toolchain
46
+
47
+ tcs[:KEEP_FILE_ENDINGS] = @mainConfig.defaultToolchain.keepObjFileEndings
48
+ tcs[:OUTPUT_DIR] = toolchain.outputDir if toolchain.outputDir != ""
49
+ integrateLinker(tcs, toolchain.linker) if toolchain.respond_to?"linker"
50
+ integrateArchiver(tcs, toolchain.archiver)
51
+ toolchain.compiler.each do |c|
52
+ integrateCompiler(tcs, c, c.ctype)
53
+ end
54
+ integrateDocu(tcs, toolchain.docu) if toolchain.docu
55
+ end
56
+
57
+ def integrateDocu(tcs, docu)
58
+ tcs[:DOCU] = docu.name if docu.name != ""
59
+ end
60
+
61
+ def integrateLinker(tcs, linker)
62
+ return tcs unless linker
63
+ tcs[:LINKER][:COMMAND] = linker.command if linker.command != ""
64
+ tcs[:LINKER][:LINK_ONLY_DIRECT_DEPS] = linker.onlyDirectDeps
65
+ tcs[:LINKER][:PREFIX] = linker.prefix if linker.prefix != ""
66
+ tcs[:LINKER][:FLAGS] = adjustFlags(tcs[:LINKER][:FLAGS], linker.flags)
67
+ tcs[:LINKER][:LIB_PREFIX_FLAGS] = adjustFlags(tcs[:LINKER][:LIB_PREFIX_FLAGS], linker.libprefixflags)
68
+ tcs[:LINKER][:LIB_POSTFIX_FLAGS] = adjustFlags(tcs[:LINKER][:LIB_POSTFIX_FLAGS], linker.libpostfixflags)
69
+ end
70
+
71
+ def integrateArchiver(tcs, archiver)
72
+ return tcs unless archiver
73
+ tcs[:ARCHIVER][:COMMAND] = archiver.command if archiver.command != ""
74
+ tcs[:ARCHIVER][:PREFIX] = archiver.prefix if archiver.prefix != ""
75
+ tcs[:ARCHIVER][:FLAGS] = adjustFlags(tcs[:ARCHIVER][:FLAGS], archiver.flags)
76
+ end
77
+
78
+ def integrateCompiler(tcs, compiler, type)
79
+ return tcs unless compiler
80
+ if compiler.respond_to?"command"
81
+ tcs[:COMPILER][type][:COMMAND] = compiler.command if compiler.command != ""
82
+ end
83
+ if compiler.respond_to?"prefix"
84
+ tcs[:COMPILER][type][:PREFIX] = compiler.prefix if compiler.prefix != ""
85
+ end
86
+ if compiler.fileEndings
87
+ tcs[:COMPILER][type][:SOURCE_FILE_ENDINGS] = compiler.fileEndings.endings.split(",").map{|e| e.strip}
88
+ end
89
+
90
+ tcs[:COMPILER][type][:FLAGS] = adjustFlags(tcs[:COMPILER][type][:FLAGS], compiler.flags)
91
+ compiler.define.each do |d|
92
+ tcs[:COMPILER][type][:DEFINES] << d.str unless tcs[:COMPILER][type][:DEFINES].include? d.str
93
+ end
94
+ end
95
+
96
+ def integrateCompilerFile(tcs, compiler)
97
+ [:CPP, :C, :ASM].each do |t|
98
+ integrateCompiler(tcs, compiler, t)
99
+ end
100
+ return tcs
101
+ end
102
+
103
+
104
+ def sanitize_filename(filename)
105
+ filename.strip do |name|
106
+ # NOTE: File.basename doesn't work right with Windows paths on Unix
107
+ # get only the filename, not the whole path
108
+ name.gsub! /^.*(\\|\/)/, ''
109
+
110
+ # Finally, replace all non alphanumeric, underscore
111
+ # or periods with underscore
112
+ # name.gsub! /[^\w\.\-]/, '_'
113
+ # Basically strip out the non-ascii alphabets too
114
+ # and replace with x.
115
+ # You don't want all _ :)
116
+ name.gsub!(/[^0-9A-Za-z.\-]/, 'x')
117
+ end
118
+ end
119
+
120
+ def add_line_if_no_comment(array, str)
121
+ s = str.split("#")[0].strip
122
+ array << s unless s.empty?
123
+ end
@@ -359,7 +359,6 @@ module Bake
359
359
  # todo: sync output if commandline and makefile!!!!!!!!!!!!!!!!!!!
360
360
  @outputStep = nil
361
361
  allSteps.each { |step| @outputStep = independent?(method, step) ? step : nil }
362
-
363
362
  while !allSteps.empty?
364
363
  parallel = []
365
364
  while allSteps.first && independent?(method, allSteps.first)
@@ -410,7 +409,7 @@ module Bake
410
409
  @inDeps = true
411
410
  depResult = callDeps(:execute)
412
411
  @inDeps = false
413
- return @result if blockAbort?(depResult)
412
+ return @result && depResult if blockAbort?(depResult)
414
413
 
415
414
  Bake::IDEInterface.instance.set_build_info(@projectName, @configName)
416
415
 
@@ -448,7 +447,6 @@ module Bake
448
447
  end
449
448
  end
450
449
 
451
-
452
450
  return (depResult && @result)# && @@delayed_result)
453
451
  end
454
452
 
@@ -34,7 +34,8 @@ module Bake
34
34
  def get_object_file(source)
35
35
  # until now all OBJECT_FILE_ENDING are equal in all three types
36
36
 
37
- srcWithoutDotDot = source.chomp(File.extname(source)).gsub(/\.\./, "__")
37
+ sourceEndingAdapted = @block.tcs[:KEEP_FILE_ENDINGS] ? source : source.chomp(File.extname(source))
38
+ srcWithoutDotDot = sourceEndingAdapted.gsub(/\.\./, "__")
38
39
  if srcWithoutDotDot[0] == '/'
39
40
  srcWithoutDotDot = "_" + srcWithoutDotDot
40
41
  elsif srcWithoutDotDot[1] == ':'
@@ -65,7 +65,13 @@ module Bake
65
65
  return true
66
66
  end
67
67
  else
68
- @objects = Dir.glob_dir("#{@block.output_dir}/**/*.o", @projectDir)
68
+
69
+ @objects = []
70
+ [:CPP, :C, :ASM].map do |t|
71
+ @block.tcs[:COMPILER][t][:OBJECT_FILE_ENDING]
72
+ end.uniq.each do |e|
73
+ @objects << Dir.glob_dir("#{@block.output_dir}/**/*#{e}", @projectDir)
74
+ end
69
75
  if @objects.empty?
70
76
  if !File.exists?(File.expand_path(@archive_name, @projectDir))
71
77
  SyncOut.mutex.synchronize do
@@ -130,7 +136,14 @@ module Bake
130
136
  def clean
131
137
  if @block.prebuild
132
138
  Dir.chdir(@projectDir) do
133
- @objects = Dir.glob_dir("#{@block.output_dir}/**/*.o", @projectDir)
139
+
140
+ @objects = []
141
+ [:CPP, :C, :ASM].map do |t|
142
+ @block.tcs[:COMPILER][t][:OBJECT_FILE_ENDING]
143
+ end.uniq.each do |e|
144
+ @objects << Dir.glob_dir("#{@block.output_dir}/**/*#{e}", @projectDir)
145
+ end
146
+
134
147
  if !@objects.empty? && File.exist?(@archive_name)
135
148
  puts "Deleting file #{@archive_name}" if Bake.options.verbose >= 2
136
149
  if !Bake.options.dry
@@ -1,7 +1,7 @@
1
1
  module Bake
2
2
  class Version
3
3
  def self.number
4
- "2.42.3"
4
+ "2.43.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.42.3
4
+ version: 2.43.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-01-12 00:00:00.000000000 Z
11
+ date: 2018-02-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rtext