Commit 498ed866 authored by Fabio Pelosin's avatar Fabio Pelosin

[TargetIntegrator] Robustness against target with missing file references

Closes #938
parent 2c8ce4f6
...@@ -55,7 +55,9 @@ module Pod ...@@ -55,7 +55,9 @@ module Pod
non_integrated = targets.reject do |target| non_integrated = targets.reject do |target|
target.frameworks_build_phase.files.any? do |build_file| target.frameworks_build_phase.files.any? do |build_file|
file_ref = build_file.file_ref file_ref = build_file.file_ref
file_ref.isa == 'PBXFileReference' && file_ref.display_name == library.product_name file_ref &&
file_ref.isa == 'PBXFileReference' &&
file_ref.display_name == library.product_name
end end
end end
@targets = non_integrated @targets = non_integrated
......
...@@ -45,6 +45,14 @@ module Pod ...@@ -45,6 +45,14 @@ module Pod
@target_integrator.targets.map(&:name).should == %w[ SampleProject ] @target_integrator.targets.map(&:name).should == %w[ SampleProject ]
end end
it 'is robust against build files with missing file references' do
build_file = @sample_project.new(Xcodeproj::Project::PBXBuildFile)
build_file.file_ref = nil
@target_integrator.stubs(:user_project).returns(@sample_project)
@target.frameworks_build_phase.files << build_file
@target_integrator.targets.map(&:name).should == %w[ SampleProject ]
end
it 'does not perform the integration if there are no targets to integrate' do it 'does not perform the integration if there are no targets to integrate' do
@target_integrator.stubs(:targets).returns([]) @target_integrator.stubs(:targets).returns([])
@target_integrator.expects(:add_xcconfig_base_configuration).never @target_integrator.expects(:add_xcconfig_base_configuration).never
......
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