update ceedling to 0.29.0

This commit is contained in:
hathach
2019-11-01 17:48:59 +07:00
parent 774a9f63ab
commit b25faa97c2
59 changed files with 1962 additions and 736 deletions

View File

@@ -39,10 +39,29 @@ class ModuleGenerator < Plugin
:update_svn => ((defined? MODULE_GENERATOR_UPDATE_SVN ) ? MODULE_GENERATOR_UPDATE_SVN : false ),
}
# Read Boilerplate template file.
if (defined? MODULE_GENERATOR_BOILERPLATE_FILES)
bf = MODULE_GENERATOR_BOILERPLATE_FILES
if !bf[:src].nil? && File.exists?(bf[:src])
unity_generator_options[:boilerplates][:src] = File.read(bf[:src])
end
if !bf[:inc].nil? && File.exists?(bf[:inc])
unity_generator_options[:boilerplates][:inc] = File.read(bf[:inc])
end
if !bf[:tst].nil? && File.exists?(bf[:tst])
unity_generator_options[:boilerplates][:tst] = File.read(bf[:tst])
end
end
# If using "create[<module_root>:<module_name>]" option from command line.
unless optz[:module_root_path].to_s.empty?
unity_generator_options[:path_src] = File.join(optz[:module_root_path], unity_generator_options[:path_src])
unity_generator_options[:path_inc] = File.join(optz[:module_root_path], unity_generator_options[:path_inc])
unity_generator_options[:path_tst] = File.join(optz[:module_root_path], unity_generator_options[:path_tst])
unity_generator_options[:path_src] = File.join(optz[:module_root_path], unity_generator_options[:path_src])
unity_generator_options[:path_inc] = File.join(optz[:module_root_path], unity_generator_options[:path_inc])
unity_generator_options[:path_tst] = File.join(optz[:module_root_path], unity_generator_options[:path_tst])
end
return unity_generator_options

View File

@@ -10,15 +10,20 @@ namespace :module do
p = files.delete(pat)
optz[:pattern] = p unless p.nil?
end
files.each {
|v|
files.each do |v|
module_root_path, module_name = v.split(module_root_separator, 2)
if module_name
optz[:module_root_path] = module_root_path
v = module_name
end
@ceedling[:module_generator].create(v, optz)
}
if (v =~ /^test_?/i)
# If the name of the file starts with test, automatically treat it as one
@ceedling[:module_generator].create(v.sub(/^test_?/i,''), optz.merge({:pattern => 'test'}))
else
# Otherwise, go through the normal procedure
@ceedling[:module_generator].create(v, optz)
end
end
end
desc "Destroy module (source, header and test files)"
@@ -29,15 +34,14 @@ namespace :module do
p = files.delete(pat)
optz[:pattern] = p unless p.nil?
end
files.each {
|v|
files.each do |v|
module_root_path, module_name = v.split(module_root_separator, 2)
if module_name
optz[:module_root_path] = module_root_path
v = module_name
end
@ceedling[:module_generator].create(v, optz)
}
end
end
end