mirror of
https://github.com/ThrowTheSwitch/CMock.git
synced 2026-06-05 21:15:20 +00:00
make the cmock modifier files optional as 2nd argument in config
This commit is contained in:
@@ -39,8 +39,8 @@ task :ci => [:default]
|
||||
task :cruise => [:default]
|
||||
|
||||
desc 'Load configuration'
|
||||
task :config, :config_file do |_t, args|
|
||||
configure_toolchain(args[:config_file])
|
||||
task :config, [:config_file, :cmock_overlay] do |_t, args|
|
||||
configure_toolchain(args[:config_file], args[:cmock_overlay])
|
||||
end
|
||||
|
||||
desc 'Return error on Failures'
|
||||
|
||||
@@ -35,7 +35,7 @@ module RakefileHelpers
|
||||
nil
|
||||
end
|
||||
|
||||
def load_configuration(config_file)
|
||||
def load_configuration(config_file, cmock_overlay = nil)
|
||||
$cfg_file = config_file
|
||||
$proj = load_yaml(File.read('./project.yml'))
|
||||
|
||||
@@ -46,7 +46,7 @@ module RakefileHelpers
|
||||
puts "Loading Unity target: #{unity_target}"
|
||||
$unity_cfg = load_yaml(File.read(unity_target))
|
||||
|
||||
cmock_file = find_cmock_target(cmock_targets_dir, $cfg_file)
|
||||
cmock_file = cmock_overlay || find_cmock_target(cmock_targets_dir, $cfg_file)
|
||||
if cmock_file
|
||||
puts "Loading CMock overlay: #{cmock_targets_dir}/#{cmock_file}"
|
||||
$cmock_cfg = load_yaml(File.read("#{cmock_targets_dir}/#{cmock_file}"))
|
||||
@@ -67,9 +67,11 @@ module RakefileHelpers
|
||||
CLEAN.include("#{$proj[:project][:build_root]}*.*")
|
||||
end
|
||||
|
||||
def configure_toolchain(config_file = DEFAULT_CONFIG_FILE)
|
||||
config_file += '.yml' unless config_file =~ /\.yml$/
|
||||
load_configuration(config_file)
|
||||
def configure_toolchain(config_file = DEFAULT_CONFIG_FILE, cmock_overlay = nil)
|
||||
config_file ||= DEFAULT_CONFIG_FILE
|
||||
config_file += '.yml' unless config_file =~ /\.yml$/i
|
||||
cmock_overlay += '.yml' if cmock_overlay && cmock_overlay !~ /\.yml$/i
|
||||
load_configuration(config_file, cmock_overlay)
|
||||
configure_clean
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user