Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

Fixes #643 & #643. Related: #613.
  • Loading branch information...
commit 9eddb385b8778901cd8c38968649a027c6adf54c 1 parent bf2c639
@alloy alloy authored
View
4 CHANGELOG.md
@@ -13,6 +13,10 @@
###### Bug fixes
- 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
[CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/0.16.0.rc3...0.16.0.rc4)
View
1  lib/cocoapods.rb
@@ -59,4 +59,5 @@ module Generator
if ENV['COCOA_PODS_ENV'] == 'development'
require 'awesome_print'
+ require 'pry'
end
View
2  lib/cocoapods/installer/user_project_integrator.rb
@@ -140,7 +140,7 @@ def targets
# 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|
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
View
6 spec/functional/user_project_integrator_spec.rb
@@ -97,6 +97,12 @@ def integrate!
app_target = app_integrator.user_project.targets.find { |t| t.name == 'SampleProject' }
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)
test_runner_integrator.expects(:add_pods_library).never

1 comment on commit 9eddb38

@alloy
Owner

Ugh, the second ticket that’s fixed by this is #614.

Please sign in to comment.
Something went wrong with that request. Please try again.