Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
cocoapods
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gengmeiios
cocoapods
Commits
29697f42
Commit
29697f42
authored
Oct 17, 2013
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[XCConfigHelper] Don't include missing frameworks in OS X
parent
75452ffc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
14 deletions
+36
-14
CHANGELOG.md
CHANGELOG.md
+6
-1
xcconfig_helper.rb
lib/cocoapods/generator/xcconfig/xcconfig_helper.rb
+10
-11
xcconfig_helper_spec.rb
spec/unit/generator/xcconfig/xcconfig_helper_spec.rb
+20
-2
No files found.
CHANGELOG.md
View file @
29697f42
...
...
@@ -19,7 +19,7 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
###### Bug Fixes
*
The architecture is now set in the build settings of the user build
configurations.
configurations.
[
Fabio Pelosin
](
https://github.com/irrationalfab
)
[
#1450
](
https://github.com/CocoaPods/CocoaPods/issues/1462
)
[
#1462
](
https://github.com/CocoaPods/CocoaPods/issues/1462
)
...
...
@@ -36,6 +36,11 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
[
Noah McCann
](
https://github.com/nmccann
)
[
#29
](
https://github.com/CocoaPods/Core/pull/29
)
*
The developer dir relative to the SDK is not added anymore if testing
frameworks are detected in OS X targets, as it doesn't exists, avoiding the
presentation of the relative warning in Xcode.
[
Fabio Pelosin
](
https://github.com/irrationalfab
)
## 0.26.2
[
CocoaPods
](
https://github.com/CocoaPods/CocoaPods/compare/0.26.1...0.26.2
)
...
...
lib/cocoapods/generator/xcconfig/xcconfig_helper.rb
View file @
29697f42
...
...
@@ -46,7 +46,7 @@ module Pod
xcconfig
.
libraries
.
merge
(
consumer
.
libraries
)
xcconfig
.
frameworks
.
merge
(
consumer
.
frameworks
)
xcconfig
.
weak_frameworks
.
merge
(
consumer
.
weak_frameworks
)
add_developers_frameworks_if_needed
(
xcconfig
)
add_developers_frameworks_if_needed
(
xcconfig
,
consumer
.
platform_name
)
end
# Configures the given Xcconfig with the the build settings for the given
...
...
@@ -87,14 +87,6 @@ module Pod
xcconfig
.
merge!
(
build_settings
)
end
# @return [Array<String>] The search paths for the developer frameworks.
#
DEVELOPER_FRAMEWORKS_SEARCH_PATHS
=
[
'$(inherited)'
,
'"$(SDKROOT)/Developer/Library/Frameworks"'
,
'"$(DEVELOPER_LIBRARY_DIR)/Frameworks"'
]
# Adds the search paths of the developer frameworks to the specification
# if needed. This is done because the `SenTestingKit` requires them and
# adding them to each specification which requires it is repetitive and
...
...
@@ -105,16 +97,23 @@ module Pod
#
# @return [void]
#
def
self
.
add_developers_frameworks_if_needed
(
xcconfig
)
def
self
.
add_developers_frameworks_if_needed
(
xcconfig
,
platform
)
matched_frameworks
=
xcconfig
.
frameworks
&
[
'XCTest'
,
'SenTestingKit'
]
unless
matched_frameworks
.
empty?
search_paths
=
xcconfig
.
attributes
[
'FRAMEWORK_SEARCH_PATHS'
]
||=
''
DEVELOPER_FRAMEWORKS_SEARCH_PATHS
.
each
do
|
search_path
|
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"'
end
search_paths_to_add
.
each
do
|
search_path
|
unless
search_paths
.
include?
(
search_path
)
search_paths
<<
' '
unless
search_paths
.
empty?
search_paths
<<
search_path
end
end
search_paths
end
end
...
...
spec/unit/generator/xcconfig/xcconfig_helper_spec.rb
View file @
29697f42
...
...
@@ -49,6 +49,7 @@ module Pod
:libraries
=>
[],
:frameworks
=>
[],
:weak_frameworks
=>
[],
:platform_name
=>
:ios
})
@sut
.
add_spec_build_settings_to_xcconfig
(
consumer
,
xcconfig
)
xcconfig
.
to_hash
[
'OTHER_LDFLAGS'
].
should
==
'-framework SenTestingKit'
...
...
@@ -61,6 +62,7 @@ module Pod
:libraries
=>
[
'xml2'
],
:frameworks
=>
[],
:weak_frameworks
=>
[],
:platform_name
=>
:ios
})
@sut
.
add_spec_build_settings_to_xcconfig
(
consumer
,
xcconfig
)
xcconfig
.
to_hash
[
'OTHER_LDFLAGS'
].
should
==
'-lxml2'
...
...
@@ -73,6 +75,7 @@ module Pod
:libraries
=>
[],
:frameworks
=>
[
'CoreAnimation'
],
:weak_frameworks
=>
[],
:platform_name
=>
:ios
})
@sut
.
add_spec_build_settings_to_xcconfig
(
consumer
,
xcconfig
)
xcconfig
.
to_hash
[
'OTHER_LDFLAGS'
].
should
==
'-framework CoreAnimation'
...
...
@@ -85,6 +88,7 @@ module Pod
:libraries
=>
[],
:frameworks
=>
[],
:weak_frameworks
=>
[
'iAd'
],
:platform_name
=>
:ios
})
@sut
.
add_spec_build_settings_to_xcconfig
(
consumer
,
xcconfig
)
xcconfig
.
to_hash
[
'OTHER_LDFLAGS'
].
should
==
'-weak_framework iAd'
...
...
@@ -97,6 +101,7 @@ module Pod
:libraries
=>
[],
:frameworks
=>
[
'SenTestingKit'
],
:weak_frameworks
=>
[],
:platform_name
=>
:ios
})
@sut
.
add_spec_build_settings_to_xcconfig
(
consumer
,
xcconfig
)
xcconfig
.
to_hash
[
'FRAMEWORK_SEARCH_PATHS'
].
should
.
include
(
'DEVELOPER_LIBRARY_DIR'
)
...
...
@@ -150,7 +155,7 @@ module Pod
describe
"::add_framework_build_settings"
do
it
"adds the developer frameworks search paths to the xcconfig if SenTestingKit has been detected"
do
xcconfig
=
Xcodeproj
::
Config
.
new
({
'OTHER_LDFLAGS'
=>
'-framework SenTestingKit'
})
@sut
.
add_developers_frameworks_if_needed
(
xcconfig
)
@sut
.
add_developers_frameworks_if_needed
(
xcconfig
,
:ios
)
frameworks_search_paths
=
xcconfig
.
to_hash
[
'FRAMEWORK_SEARCH_PATHS'
]
frameworks_search_paths
.
should
.
include?
(
'$(inherited)'
)
frameworks_search_paths
.
should
.
include?
(
'"$(SDKROOT)/Developer/Library/Frameworks"'
)
...
...
@@ -159,12 +164,25 @@ module Pod
it
"adds the developer frameworks search paths to the xcconfig if XCTest has been detected"
do
xcconfig
=
Xcodeproj
::
Config
.
new
({
'OTHER_LDFLAGS'
=>
'-framework XCTest'
})
@sut
.
add_developers_frameworks_if_needed
(
xcconfig
)
@sut
.
add_developers_frameworks_if_needed
(
xcconfig
,
:ios
)
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"'
)
end
it
"doesn't adds the developer frameworks relative to the SDK for OS X"
do
xcconfig
=
Xcodeproj
::
Config
.
new
({
'OTHER_LDFLAGS'
=>
'-framework XCTest'
})
@sut
.
add_developers_frameworks_if_needed
(
xcconfig
,
:ios
)
frameworks_search_paths
=
xcconfig
.
to_hash
[
'FRAMEWORK_SEARCH_PATHS'
]
frameworks_search_paths
.
should
.
include?
(
'"$(SDKROOT)/Developer/Library/Frameworks"'
)
xcconfig
=
Xcodeproj
::
Config
.
new
({
'OTHER_LDFLAGS'
=>
'-framework XCTest'
})
@sut
.
add_developers_frameworks_if_needed
(
xcconfig
,
:osx
)
frameworks_search_paths
=
xcconfig
.
to_hash
[
'FRAMEWORK_SEARCH_PATHS'
]
frameworks_search_paths
.
should
.
not
.
include?
(
'"$(SDKROOT)/Developer/Library/Frameworks"'
)
end
end
#---------------------------------------------------------------------#
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment