Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Changed order of Framework_Search_Paths fixes #1558 #1562

Merged
merged 3 commits into from

4 participants

@kwales

This fix is for issue #1558.

@coveralls

Coverage Status

Coverage remained the same when pulling fd82604 on kwales:issue_1558_Framework_Search_Paths into cb5e0db on CocoaPods:master.

@coveralls

Coverage Status

Coverage remained the same when pulling fa692b6 on kwales:issue_1558_Framework_Search_Paths into cb5e0db on CocoaPods:master.

@alloy
Owner

I assume you have tested this manually for both iOS and OS X?

It looks completely arbitrary, so I would like to see some unit tests to verify that iOS and OS X targets get the right search paths, otherwise the chance is too high that we introduce regressions in the future.

@fabiopelosin

XCTest

Just tested this: the behavior of Xcode 5 for new targets with XCTest:

OS X target:

FRAMEWORK_SEARCH_PATHS = $(DEVELOPER_FRAMEWORKS_DIR) $(inherited)

iOS target:

FRAMEWORK_SEARCH_PATHS = $(SDKROOT)/Developer/Library/Frameworks $(inherited) $(DEVELOPER_FRAMEWORKS_DIR)

SenTestingKit

OS X target:

FRAMEWORK_SEARCH_PATHS = $(DEVELOPER_LIBRARY_DIR)/Frameworks

iOS target:

FRAMEWORK_SEARCH_PATHS = $(SDKROOT)/Developer/Library/Frameworks

I think that we can assume $(DEVELOPER_FRAMEWORKS_DIR) = $(DEVELOPER_LIBRARY_DIR)/Frameworks as this is the environment of the build scripts:

setenv DEVELOPER_LIBRARY_DIR /Applications/Xcode.app/Contents/Developer/Library
setenv DEVELOPER_FRAMEWORKS_DIR /Applications/Xcode.app/Contents/Developer/Library/Frameworks

To sum up I think that this patch is reasonable and can be accepted once the test are provided.

@kwales

@alloy @irrationalfab I just noticed that v 0.28.0 was released, but this pull request did not make it. Any idea when this might be released?

@fabiopelosin fabiopelosin merged commit 3464fca into from
@fabiopelosin

In the next release (hopefully soon). Thanks for the contribution! :beers:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 7, 2013
  1. Changed order of Framework_Search_Paths fixes #1558

    Kevin Wales authored
Commits on Nov 12, 2013
  1. Updated unit tests

    Kevin Wales authored
This page is out of date. Refresh to see the latest.
View
6 CHANGELOG.md
@@ -46,6 +46,12 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
[Joshua Kalpin](https://github.com/Kapin)
[Core#38](https://github.com/CocoaPods/Core/pull/38)
+* Altered Framework_Search_Paths required by SenTestingKit so that
+ $(SDKROOT)/Developer/Library/Frameworks is used for iOS and
+ $(DEVELOPER_LIBRARY_DIR)/Frameworks is used for OSX
+ [Kevin Wales](https://github.com/kwales)
+ [#1562](https://github.com/CocoaPods/pull/1562)
+
## 0.27.1
[CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/0.26.2...0.27.1)
View
3  lib/cocoapods/generator/xcconfig/xcconfig_helper.rb
@@ -103,9 +103,10 @@ def self.add_developers_frameworks_if_needed(xcconfig, platform)
search_paths = xcconfig.attributes['FRAMEWORK_SEARCH_PATHS'] ||= ''
search_paths_to_add = []
search_paths_to_add << '$(inherited)'
- search_paths_to_add << '"$(DEVELOPER_LIBRARY_DIR)/Frameworks"'
if platform == :ios
search_paths_to_add << '"$(SDKROOT)/Developer/Library/Frameworks"'
+ else
+ search_paths_to_add << '"$(DEVELOPER_LIBRARY_DIR)/Frameworks"'
end
search_paths_to_add.each do |search_path|
unless search_paths.include?(search_path)
View
21 spec/unit/generator/xcconfig/xcconfig_helper_spec.rb
@@ -94,7 +94,7 @@ module XCConfig
xcconfig.to_hash['OTHER_LDFLAGS'].should == '-weak_framework iAd'
end
- it "adds the developer frameworks search paths if needed" do
+ it "adds the ios developer frameworks search paths if needed" do
xcconfig = Xcodeproj::Config.new
consumer = stub({
:xcconfig => {},
@@ -104,7 +104,22 @@ module XCConfig
:platform_name => :ios
})
@sut.add_spec_build_settings_to_xcconfig(consumer, xcconfig)
+ xcconfig.to_hash['FRAMEWORK_SEARCH_PATHS'].should.include('SDKROOT')
+ xcconfig.to_hash['FRAMEWORK_SEARCH_PATHS'].should.not.include('DEVELOPER_LIBRARY_DIR')
+ end
+
+ it "adds the osx developer frameworks search paths if needed" do
+ xcconfig = Xcodeproj::Config.new
+ consumer = stub({
+ :xcconfig => {},
+ :libraries => [],
+ :frameworks => ['SenTestingKit'],
+ :weak_frameworks => [],
+ :platform_name => :osx
+ })
+ @sut.add_spec_build_settings_to_xcconfig(consumer, xcconfig)
xcconfig.to_hash['FRAMEWORK_SEARCH_PATHS'].should.include('DEVELOPER_LIBRARY_DIR')
+ xcconfig.to_hash['FRAMEWORK_SEARCH_PATHS'].should.not.include('SDKROOT')
end
end
@@ -159,7 +174,7 @@ module XCConfig
frameworks_search_paths = xcconfig.to_hash['FRAMEWORK_SEARCH_PATHS']
frameworks_search_paths.should.include?('$(inherited)')
frameworks_search_paths.should.include?('"$(SDKROOT)/Developer/Library/Frameworks"')
- frameworks_search_paths.should.include?('"$(DEVELOPER_LIBRARY_DIR)/Frameworks"')
+ frameworks_search_paths.should.not.include?('"$(DEVELOPER_LIBRARY_DIR)/Frameworks"')
end
it "adds the developer frameworks search paths to the xcconfig if XCTest has been detected" do
@@ -168,7 +183,7 @@ module XCConfig
frameworks_search_paths = xcconfig.to_hash['FRAMEWORK_SEARCH_PATHS']
frameworks_search_paths.should.include?('$(inherited)')
frameworks_search_paths.should.include?('"$(SDKROOT)/Developer/Library/Frameworks"')
- frameworks_search_paths.should.include?('"$(DEVELOPER_LIBRARY_DIR)/Frameworks"')
+ frameworks_search_paths.should.not.include?('"$(DEVELOPER_LIBRARY_DIR)/Frameworks"')
end
it "doesn't adds the developer frameworks relative to the SDK for OS X" do
Something went wrong with that request. Please try again.