Skip to content
This repository

Changed order of Framework_Search_Paths fixes #1558 #1562

Merged
merged 3 commits into from 8 months ago

4 participants

Kevin Wales Coveralls Eloy Durán Fabio Pelosin
Kevin Wales

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.

Eloy Durán
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.

Fabio Pelosin

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.

Kevin Wales

@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?

Fabio Pelosin irrationalfab merged commit 3464fca into from
Fabio Pelosin

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

Showing 3 unique commits by 1 author.

Nov 07, 2013
Kevin Wales Changed order of Framework_Search_Paths fixes #1558 fd82604
Kevin Wales sets framework_search_paths conditionally based on platform fa692b6
Nov 12, 2013
Kevin Wales Updated unit tests 3464fca
This page is out of date. Refresh to see the latest.
6 CHANGELOG.md
Source Rendered
@@ -46,6 +46,12 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
46 46 [Joshua Kalpin](https://github.com/Kapin)
47 47 [Core#38](https://github.com/CocoaPods/Core/pull/38)
48 48
  49 +* Altered Framework_Search_Paths required by SenTestingKit so that
  50 + $(SDKROOT)/Developer/Library/Frameworks is used for iOS and
  51 + $(DEVELOPER_LIBRARY_DIR)/Frameworks is used for OSX
  52 + [Kevin Wales](https://github.com/kwales)
  53 + [#1562](https://github.com/CocoaPods/pull/1562)
  54 +
49 55
50 56 ## 0.27.1
51 57 [CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/0.26.2...0.27.1)
3  lib/cocoapods/generator/xcconfig/xcconfig_helper.rb
@@ -103,9 +103,10 @@ def self.add_developers_frameworks_if_needed(xcconfig, platform)
103 103 search_paths = xcconfig.attributes['FRAMEWORK_SEARCH_PATHS'] ||= ''
104 104 search_paths_to_add = []
105 105 search_paths_to_add << '$(inherited)'
106   - search_paths_to_add << '"$(DEVELOPER_LIBRARY_DIR)/Frameworks"'
107 106 if platform == :ios
108 107 search_paths_to_add << '"$(SDKROOT)/Developer/Library/Frameworks"'
  108 + else
  109 + search_paths_to_add << '"$(DEVELOPER_LIBRARY_DIR)/Frameworks"'
109 110 end
110 111 search_paths_to_add.each do |search_path|
111 112 unless search_paths.include?(search_path)
21 spec/unit/generator/xcconfig/xcconfig_helper_spec.rb
@@ -94,7 +94,7 @@ module XCConfig
94 94 xcconfig.to_hash['OTHER_LDFLAGS'].should == '-weak_framework iAd'
95 95 end
96 96
97   - it "adds the developer frameworks search paths if needed" do
  97 + it "adds the ios developer frameworks search paths if needed" do
98 98 xcconfig = Xcodeproj::Config.new
99 99 consumer = stub({
100 100 :xcconfig => {},
@@ -104,7 +104,22 @@ module XCConfig
104 104 :platform_name => :ios
105 105 })
106 106 @sut.add_spec_build_settings_to_xcconfig(consumer, xcconfig)
  107 + xcconfig.to_hash['FRAMEWORK_SEARCH_PATHS'].should.include('SDKROOT')
  108 + xcconfig.to_hash['FRAMEWORK_SEARCH_PATHS'].should.not.include('DEVELOPER_LIBRARY_DIR')
  109 + end
  110 +
  111 + it "adds the osx developer frameworks search paths if needed" do
  112 + xcconfig = Xcodeproj::Config.new
  113 + consumer = stub({
  114 + :xcconfig => {},
  115 + :libraries => [],
  116 + :frameworks => ['SenTestingKit'],
  117 + :weak_frameworks => [],
  118 + :platform_name => :osx
  119 + })
  120 + @sut.add_spec_build_settings_to_xcconfig(consumer, xcconfig)
107 121 xcconfig.to_hash['FRAMEWORK_SEARCH_PATHS'].should.include('DEVELOPER_LIBRARY_DIR')
  122 + xcconfig.to_hash['FRAMEWORK_SEARCH_PATHS'].should.not.include('SDKROOT')
108 123 end
109 124 end
110 125
@@ -159,7 +174,7 @@ module XCConfig
159 174 frameworks_search_paths = xcconfig.to_hash['FRAMEWORK_SEARCH_PATHS']
160 175 frameworks_search_paths.should.include?('$(inherited)')
161 176 frameworks_search_paths.should.include?('"$(SDKROOT)/Developer/Library/Frameworks"')
162   - frameworks_search_paths.should.include?('"$(DEVELOPER_LIBRARY_DIR)/Frameworks"')
  177 + frameworks_search_paths.should.not.include?('"$(DEVELOPER_LIBRARY_DIR)/Frameworks"')
163 178 end
164 179
165 180 it "adds the developer frameworks search paths to the xcconfig if XCTest has been detected" do
@@ -168,7 +183,7 @@ module XCConfig
168 183 frameworks_search_paths = xcconfig.to_hash['FRAMEWORK_SEARCH_PATHS']
169 184 frameworks_search_paths.should.include?('$(inherited)')
170 185 frameworks_search_paths.should.include?('"$(SDKROOT)/Developer/Library/Frameworks"')
171   - frameworks_search_paths.should.include?('"$(DEVELOPER_LIBRARY_DIR)/Frameworks"')
  186 + frameworks_search_paths.should.not.include?('"$(DEVELOPER_LIBRARY_DIR)/Frameworks"')
172 187 end
173 188
174 189 it "doesn't adds the developer frameworks relative to the SDK for OS X" do

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.