lib/ambient.rb in ambient-xcode-0.4.0 vs lib/ambient.rb in ambient-xcode-0.5.0
- old
+ new
@@ -29,11 +29,12 @@
def project_helper
@project_helper ||= ProjectHelper.new
end
- def set_parent_target(target, child, parent)
+ def set_parent_scheme(target: nil, child: nil, parent: nil)
+ target = target || :all
@parents[target] ||= {}
@parents[target][child] = parent
end
def set_option(option, value, target: nil, scheme: nil, parent: nil)
@@ -73,10 +74,11 @@
run_ambientfile(ambientfile)
project_helper.print_info
reset_project_to_defaults if @use_defaults
reset_targets_to_defaults if @use_defaults
reset_capabilites_to_defaults if @use_defaults
+ load_in_parent_scheme_values
process_project_options
process_scheme_options
process_shared_target_options
process_target_options
process_capabilities
@@ -114,11 +116,10 @@
project_helper.process_shared_target_options(@shared_target_options)
end
def process_target_options
puts "applying ambient target settings"
- load_in_parent_target_values
project_helper.process_target_options(@target_options)
end
def process_capabilities
puts "applying ambient capabilities"
@@ -128,16 +129,22 @@
def process_development_teams
puts "applying ambient development teams"
project_helper.process_development_teams(@development_teams)
end
- def load_in_parent_target_values
+ def load_in_parent_scheme_values
@parents.each do |target, parents|
parents.each do |child, parent|
if parent
- options = @target_options[target]
- child_options = options[child]
- parent_options = options[parent]
+ if target == :all
+ puts "Identified #{child} as a child of #{parent}"
+ child_options = @scheme_options[child]
+ parent_options = @scheme_options[parent]
+ else
+ target_options = @target_options[target]
+ child_options = target_options[child]
+ parent_options = target_options[parent]
+ end
child_options.merge!(parent_options) { |_, child, _| child }
end
end
end
end