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
e83f01b0
Commit
e83f01b0
authored
Apr 06, 2013
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Generator::Xcconfig] Add developer frameworks search paths if needed
Closes #771
parent
b9c37bc7
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
87 additions
and
10 deletions
+87
-10
CHANGELOG.md
CHANGELOG.md
+9
-6
xcconfig.rb
lib/cocoapods/generator/xcconfig.rb
+58
-4
xcconfig_spec.rb
spec/unit/generator/xcconfig_spec.rb
+20
-0
No files found.
CHANGELOG.md
View file @
e83f01b0
...
@@ -3,6 +3,15 @@
...
@@ -3,6 +3,15 @@
•
[
cocoapods-core
](
https://github.com/CocoaPods/Core/compare/0.17.2...0.17.3
)
•
[
cocoapods-core
](
https://github.com/CocoaPods/Core/compare/0.17.2...0.17.3
)
•
[
Xcodeproj
](
https://github.com/CocoaPods/Xcodeproj/compare/0.5.2...0.5.4
)
•
[
Xcodeproj
](
https://github.com/CocoaPods/Xcodeproj/compare/0.5.2...0.5.4
)
###### Enhancements
*
The
`pod search`
commands now accepts the
`--ios`
and the
`--osx`
arguments
to filter the results by platform.
[
#625
](
https://github.com/CocoaPods/CocoaPods/issues/625
)
*
The developer frameworks are automatically added if
`SenTestingKit`
is
detected. There is no need to specify them in specifications anymore.
[
#771
](
https://github.com/CocoaPods/CocoaPods/issues/771
)
###### Bug fixes
###### Bug fixes
*
Improved handling for Xcode projects containing non ASCII characters.
*
Improved handling for Xcode projects containing non ASCII characters.
...
@@ -16,12 +25,6 @@
...
@@ -16,12 +25,6 @@
[
#935
](
https://github.com/CocoaPods/CocoaPods/issues/935
)
[
#935
](
https://github.com/CocoaPods/CocoaPods/issues/935
)
###### Ancillary enhancements
*
The
`pod search`
commands now accepts the
`--ios`
and the
`--osx`
arguments
to filter the results by platform.
[
#625
](
https://github.com/CocoaPods/CocoaPods/issues/625
)
## 0.17.2
## 0.17.2
[
CocoaPods
](
https://github.com/CocoaPods/CocoaPods/compare/0.17.1...0.17.2
)
[
CocoaPods
](
https://github.com/CocoaPods/CocoaPods/compare/0.17.1...0.17.2
)
...
...
lib/cocoapods/generator/xcconfig.rb
View file @
e83f01b0
...
@@ -61,10 +61,7 @@ module Pod
...
@@ -61,10 +61,7 @@ module Pod
})
})
spec_consumers
.
each
do
|
consumer
|
spec_consumers
.
each
do
|
consumer
|
@xcconfig
.
merge!
(
consumer
.
xcconfig
);
add_spec_build_settings_to_xcconfig
(
consumer
,
@xcconfig
)
@xcconfig
.
libraries
.
merge
(
consumer
.
libraries
);
@xcconfig
.
frameworks
.
merge
(
consumer
.
frameworks
);
@xcconfig
.
weak_frameworks
.
merge
(
consumer
.
weak_frameworks
);
end
end
@xcconfig
@xcconfig
...
@@ -124,6 +121,63 @@ module Pod
...
@@ -124,6 +121,63 @@ module Pod
def
quote
(
strings
)
def
quote
(
strings
)
strings
.
sort
.
map
{
|
s
|
%W|"
#{
s
}
"|
}.
join
(
" "
)
strings
.
sort
.
map
{
|
s
|
%W|"
#{
s
}
"|
}.
join
(
" "
)
end
end
# Configures the given Xcconfig according to the build settings of the
# given Specification.
#
# @param [Specification::Consumer] consumer
# The consumer of the specification.
#
# @param [Xcodeproj::Config] xcconfig
# The xcconfig to edit.
#
# @return [void]
#
def
add_spec_build_settings_to_xcconfig
(
consumer
,
xcconfig
)
xcconfig
.
merge!
(
consumer
.
xcconfig
)
xcconfig
.
libraries
.
merge
(
consumer
.
libraries
)
xcconfig
.
frameworks
.
merge
(
consumer
.
frameworks
)
xcconfig
.
weak_frameworks
.
merge
(
consumer
.
weak_frameworks
)
add_developers_frameworks_if_needed
(
consumer
,
xcconfig
)
end
# @return [Array<String>] The search paths for the developer frameworks.
#
# @todo Inheritance should be properly handled in Xcconfigs.
#
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
# error prone.
#
# @param [Specification::Consumer] consumer
# The consumer of the specification.
#
# @param [Xcodeproj::Config] xcconfig
# The xcconfig to edit.
#
# @return [void]
#
def
add_developers_frameworks_if_needed
(
consumer
,
xcconfig
)
if
xcconfig
.
frameworks
.
include?
(
'SenTestingKit'
)
search_paths
=
xcconfig
.
attributes
[
'FRAMEWORK_SEARCH_PATHS'
]
||=
''
DEVELOPER_FRAMEWORKS_SEARCH_PATHS
.
each
do
|
search_path
|
unless
search_paths
.
include?
(
search_path
)
search_paths
<<
' '
unless
search_paths
.
empty?
search_paths
<<
search_path
end
end
end
end
#-----------------------------------------------------------------------#
end
end
end
end
end
end
...
...
spec/unit/generator/xcconfig_spec.rb
View file @
e83f01b0
...
@@ -91,6 +91,26 @@ module Pod
...
@@ -91,6 +91,26 @@ module Pod
@xcconfig
.
to_hash
[
'OTHER_LDFLAGS'
].
should
.
include
(
'-weak_framework iAd'
)
@xcconfig
.
to_hash
[
'OTHER_LDFLAGS'
].
should
.
include
(
'-weak_framework iAd'
)
end
end
it
"includes the developer frameworks search paths when SenTestingKit is detected"
do
spec
=
fixture_spec
(
'banana-lib/BananaLib.podspec'
)
consumer
=
spec
.
consumer
(
:ios
)
generator
=
Generator
::
XCConfig
.
new
(
config
.
sandbox
,
[
consumer
],
'./Pods'
)
spec
.
xcconfig
=
{
'OTHER_LDFLAGS'
=>
'-no_compact_unwind'
}
spec
.
frameworks
=
[
'SenTestingKit'
]
xcconfig
=
generator
.
generate
xcconfig
.
to_hash
[
'FRAMEWORK_SEARCH_PATHS'
].
should
==
'$(inherited) "$(SDKROOT)/Developer/Library/Frameworks" "$(DEVELOPER_LIBRARY_DIR)/Frameworks"'
end
it
"doesn't include the developer frameworks if already present"
do
spec
=
fixture_spec
(
'banana-lib/BananaLib.podspec'
)
consumer_1
=
spec
.
consumer
(
:ios
)
consumer_2
=
spec
.
consumer
(
:ios
)
generator
=
Generator
::
XCConfig
.
new
(
config
.
sandbox
,
[
consumer_1
,
consumer_2
],
'./Pods'
)
spec
.
frameworks
=
[
'SenTestingKit'
]
xcconfig
=
generator
.
generate
xcconfig
.
to_hash
[
'FRAMEWORK_SEARCH_PATHS'
].
should
==
'$(inherited) "$(SDKROOT)/Developer/Library/Frameworks" "$(DEVELOPER_LIBRARY_DIR)/Frameworks"'
end
#-----------------------------------------------------------------------#
#-----------------------------------------------------------------------#
it
'returns the settings that the pods project needs to override'
do
it
'returns the settings that the pods project needs to override'
do
...
...
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