Commit 48b7e5c5 authored by Fabio Pelosin's avatar Fabio Pelosin

[TargetIntegrator] Detect the target with the matching name.

parent 919c0acc
...@@ -110,10 +110,15 @@ module Pod ...@@ -110,10 +110,15 @@ module Pod
def targets def targets
@targets ||= begin @targets ||= begin
if link_with = @target_definition.link_with if link_with = @target_definition.link_with
# Find explicitly named targets. # Find explicitly linked targets.
user_project.targets.select do |target| user_project.targets.select do |target|
link_with.include? target.name link_with.include? target.name
end end
elsif @target_definition.name != :default
# Find the target with the matching name.
target = user_project.targets.find { |target| target.name == @target_definition.name.to_s }
raise Informative, "Unable to find a target named `#{@target_definition.name.to_s}'" unless target
[target]
else else
# Default to the first, which in a simple project is probably an app target. # Default to the first, which in a simple project is probably an app target.
[user_project.targets.first] [user_project.targets.first]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment