Commit 9eddb385 authored by Eloy Durán's avatar Eloy Durán

[Integrator] Properly detect if the lib has been integrated.

Fixes #643 & #643. Related: #613.
parent bf2c6398
...@@ -13,6 +13,10 @@ ...@@ -13,6 +13,10 @@
###### Bug fixes ###### Bug fixes
- Always consider inline podspecs as needing installation. - Always consider inline podspecs as needing installation.
- Fix detection when the lib has already been integrated with the user’s target.
[#643](https://github.com/CocoaPods/CocoaPods/issues/643)
[#614](https://github.com/CocoaPods/CocoaPods/issues/614)
[#613](https://github.com/CocoaPods/CocoaPods/issues/613)
## 0.16.0.rc4 ## 0.16.0.rc4
[CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/0.16.0.rc3...0.16.0.rc4) [CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/0.16.0.rc3...0.16.0.rc4)
......
...@@ -59,4 +59,5 @@ end ...@@ -59,4 +59,5 @@ end
if ENV['COCOA_PODS_ENV'] == 'development' if ENV['COCOA_PODS_ENV'] == 'development'
require 'awesome_print' require 'awesome_print'
require 'pry'
end end
...@@ -140,7 +140,7 @@ module Pod ...@@ -140,7 +140,7 @@ module Pod
# Reject any target that already has this Pods library in one of its frameworks build phases # Reject any target that already has this Pods library in one of its frameworks build phases
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.proxy? && file_ref.name == @target_definition.lib_name !file_ref.proxy? && file_ref.display_name == @target_definition.lib_name
end end
end end
end end
......
...@@ -97,6 +97,12 @@ describe Pod::Installer::UserProjectIntegrator do ...@@ -97,6 +97,12 @@ describe Pod::Installer::UserProjectIntegrator do
app_target = app_integrator.user_project.targets.find { |t| t.name == 'SampleProject' } app_target = app_integrator.user_project.targets.find { |t| t.name == 'SampleProject' }
app_target.frameworks_build_phase.files.last.remove_from_project app_target.frameworks_build_phase.files.last.remove_from_project
# Set the name of the libPods.a PBXFileReference to `nil` to ensure the file’s basename
# is used instead. Not sure yet what makes it so that the name is nil in the first place.
test_target = test_runner_integrator.user_project.targets.find { |t| t.name == 'TestRunner' }
build_file = test_target.frameworks_build_phase.files.last
build_file.file_ref.name = nil
app_integrator.expects(:add_pods_library) app_integrator.expects(:add_pods_library)
test_runner_integrator.expects(:add_pods_library).never test_runner_integrator.expects(:add_pods_library).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