Skip to content

Commit

Permalink
Merge branch 'issue_1558_Framework_Search_Paths' of https://github.co…
Browse files Browse the repository at this point in the history
…m/kwales/CocoaPods into kwales-issue_1558_Framework_Search_Paths

* 'issue_1558_Framework_Search_Paths' of https://github.com/kwales/CocoaPods:
  Updated unit tests
  sets framework_search_paths conditionally based on platform
  Changed order of Framework_Search_Paths fixes #1558

Conflicts:
	CHANGELOG.md
  • Loading branch information
fabiopelosin committed Nov 14, 2013
2 parents 9f03ab9 + 3464fca commit 7c740de
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 4 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,16 @@

To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides/installing_cocoapods.html).

## Master

###### Bug Fixes

* Fixed the developer frameworks search paths so that
`$(SDKROOT)/Developer/Library/Frameworks` is used for iOS and
`$(DEVELOPER_LIBRARY_DIR)/Frameworks` is used for OS X
[Kevin Wales](https://github.com/kwales)
[#1562](https://github.com/CocoaPods/pull/1562)

## 0.28.0
[CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/0.27.1...0.28.0)
[CocoaPods-core](https://github.com/CocoaPods/Core/compare/0.27.1...0.28.0)
Expand Down
3 changes: 2 additions & 1 deletion lib/cocoapods/generator/xcconfig/xcconfig_helper.rb
Expand Up @@ -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)
Expand Down
21 changes: 18 additions & 3 deletions spec/unit/generator/xcconfig/xcconfig_helper_spec.rb
Expand Up @@ -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 => {},
Expand All @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 7c740de

Please sign in to comment.