class StructCore::Processor::TargetsComponent
Public Class Methods
new(structure, working_directory)
click to toggle source
Calls superclass method
StructCore::Processor::ProcessorComponent::new
# File lib/spec/processor/targets.rb, line 11 def initialize(structure, working_directory) super(structure, working_directory) @target_metadata_component = TargetMetadataComponent.new(@structure, @working_directory) @target_component = TargetComponent.new(@structure, @working_directory) end
Public Instance Methods
process(project, dsl = nil, sources_cache = nil)
click to toggle source
# File lib/spec/processor/targets.rb, line 17 def process(project, dsl = nil, sources_cache = nil) output = [] output = process_xc_targets project if structure == :spec output = process_spec_targets project, dsl, sources_cache if structure == :xcodeproj && !dsl.nil? output end
process_spec_targets(project, dsl, sources_cache = nil)
click to toggle source
# File lib/spec/processor/targets.rb, line 33 def process_spec_targets(project, dsl, sources_cache = nil) embed_component = TargetEmbedsComponent.new(@structure, @working_directory, project) project.targets.map { |target| # Pre-create all target DSL objects before they're filled in, as this allows us to resolve target refs target_dsl = @target_metadata_component.process(target, dsl) next nil if target_dsl.nil? [target, target_dsl] }.compact.each { |data| target, target_dsl = data embed_component.register target, target_dsl @target_component.process target, target_dsl, dsl, sources_cache } embed_component.process dsl end
process_xc_targets(project)
click to toggle source
# File lib/spec/processor/targets.rb, line 26 def process_xc_targets(project) project.targets.map { |target| target_dsl = @target_metadata_component.process target @target_component.process target, target_dsl }.compact end