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
170fa2e4
Commit
170fa2e4
authored
Dec 17, 2012
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[LocalPod] Fix xcconfig generation.
parent
6ee55e15
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
42 deletions
+41
-42
Gemfile.lock
Gemfile.lock
+1
-1
xcconfig.rb
lib/cocoapods/generator/xcconfig.rb
+1
-3
local_pod.rb
lib/cocoapods/local_pod.rb
+38
-37
xcconfig_spec.rb
spec/unit/generator/xcconfig_spec.rb
+1
-1
No files found.
Gemfile.lock
View file @
170fa2e4
...
...
@@ -9,7 +9,7 @@ GIT
GIT
remote: git://github.com/CocoaPods/Xcodeproj.git
revision:
e3dc945c7fdbbd9f977f6bc14b3e6023b99dc5e1
revision:
9acba540a10bb50e69f4fb95052885d53ce76e1f
specs:
xcodeproj (0.4.0)
activesupport (~> 3.2.6)
...
...
lib/cocoapods/generator/xcconfig.rb
View file @
170fa2e4
...
...
@@ -43,11 +43,9 @@ module Pod
# @note The value `PODS_HEADERS_SEARCH_PATHS` is used to store the headers
# so xcconfig can reference the variable.
#
# @todo Add Xcodeproj::Config#[]
#
def
generate
ld_flags
=
'-ObjC'
if
set_arc_compatibility_flag
&&
pods
.
any?
{
|
pod
|
pod
.
requires_arc?
}
if
set_arc_compatibility_flag
&&
pods
.
map
(
&
:specifications
).
flatten
.
any?
{
|
pod
|
pod
.
requires_arc
}
ld_flags
<<
' -fobjc-arc'
end
...
...
lib/cocoapods/local_pod.rb
View file @
170fa2e4
...
...
@@ -115,6 +115,10 @@ module Pod
top_specification
.
name
end
#--------------------------------------#
public
# @!group Installation
# Creates the root path of the pod.
...
...
@@ -194,6 +198,10 @@ module Pod
files
end
#--------------------------------------#
public
# @!group Files
# @return [Pathname] Returns the relative path from the sandbox.
...
...
@@ -237,7 +245,6 @@ module Pod
result
end
# Finds the source files that every activated {Specification} requires.
#
# @note If the same file is required by two specifications the one at the
...
...
@@ -377,15 +384,19 @@ module Pod
end
end
# @todo check implementation
#--------------------------------------#
public
# @return [Xcodeproj::Config] the configuration for the Pod.
#
def
xcconfig
config
=
Xcodeproj
::
Config
.
new
specifications
.
each
do
|
s
|
config
.
merge
(
s
.
xcconfig
)
config
.
libraries
.
merge
(
s
.
libraries
)
config
.
frameworks
.
merge
(
s
.
frameworks
)
config
.
weak_frameworks
.
merge
(
s
.
weak_frameworks
)
specifications
.
each
do
|
s
pec
|
config
.
merge
!
(
spec
.
xcconfig
)
config
.
libraries
.
merge
(
s
pec
.
libraries
)
config
.
frameworks
.
merge
(
s
pec
.
frameworks
)
config
.
weak_frameworks
.
merge
(
s
pec
.
weak_frameworks
)
end
config
end
...
...
@@ -422,6 +433,10 @@ module Pod
result
end
#--------------------------------------#
public
# @!group Xcodeproj integration
# Adds the file references, to the given `Pods.xcodeproj` project, for the
...
...
@@ -458,8 +473,6 @@ module Pod
# @raise If the {#add_file_references_to_project} was not called before of
# calling this method.
#
# @todo Check compiler flags implementation and xcconfig implementation.
#
# @return [void]
#
def
add_build_files_to_target
(
target
)
...
...
@@ -490,18 +503,14 @@ module Pod
end
end
# @return Whether the pod requires ARC.
#
# TODO: this should be not used anymore.
#
def
requires_arc?
top_specification
.
requires_arc
end
#--------------------------------------#
private
# @!group Private helpers
# @return [Array<Pathname>] The implementation files
# (the files the need to compiled) of the pod.
#
(the files the need to compiled) of the pod.
#
def
implementation_files
relative_source_files
.
reject
{
|
f
|
f
.
extname
==
'.h'
||
f
.
extname
==
'.hpp'
||
f
.
extname
==
'.hh'
}
...
...
@@ -517,17 +526,13 @@ module Pod
# folders as the keys and the absolute paths of the header files as
# the values.
#
# @todo This is being overridden in the RestKit 0.9.4 spec, need to do
# something with that, and this method also still exists in
# Specification.
#
# @todo This is not overridden anymore in specification refactor and the
# code Pod::Specification#copy_header_mapping can be moved here.
# @todo This is being overridden in the RestKit 0.9.4 spec and that
# override should be fixed.
#
def
header_mappings
(
files_by_spec
)
mappings
=
{}
files_by_spec
.
each
do
|
spec
,
paths
|
paths
=
paths
-
headers_excluded_from_search_paths
paths
=
paths
dir
=
spec
.
header_dir
?
(
headers_sandbox
+
spec
.
header_dir
)
:
headers_sandbox
paths
.
each
do
|
from
|
from_relative
=
from
.
relative_path_from
(
root
)
...
...
@@ -539,22 +544,12 @@ module Pod
end
# @return [<Pathname>] The name of the folder where the headers of this pod
# will be namespaced.
#
will be namespaced.
#
def
headers_sandbox
@headers_sandbox
||=
Pathname
.
new
(
top_specification
.
name
)
end
# @return [<Pathname>] The relative path of the headers that should not be
# included in the linker search paths.
#
def
headers_excluded_from_search_paths
#TODO
# paths = paths_by_spec(:exclude_header_search_paths, '*.{h,hpp,hh}')
# paths.values.compact.uniq
[]
end
# @!group Paths Patterns
# The paths obtained by resolving the patterns of an attribute
...
...
@@ -588,13 +583,13 @@ module Pod
# Converts patterns of paths to the {Pathname} of the files present in the
# pod.
#
# @param [String, FileList, Array<String
, Pathname
>] patterns
# @param [String, FileList, Array<String>] patterns
# The patterns to expand.
#
# @param [String] dir_pattern
# The pattern to add to directories.
#
# @param [
String
] exclude_patterns
# @param [
Array<String>
] exclude_patterns
# The exclude patterns to pass to the PathList.
#
# @raise [Informative] If the pod does not exists.
...
...
@@ -615,6 +610,10 @@ module Pod
patterns
=
[
patterns
]
if
patterns
.
is_a?
(
String
)
file_lists
=
patterns
.
select
{
|
p
|
p
.
is_a?
(
FileList
)
}
unless
file_lists
.
empty?
UI
.
warn
"[
#{
name
}
] The usage of Rake FileList is deprecated. Use `exclude_files`."
end
glob_patterns
=
patterns
-
file_lists
result
=
[]
...
...
@@ -629,6 +628,8 @@ module Pod
result
.
flatten
.
compact
.
uniq
end
#-------------------------------------------------------------------------#
# A {LocalSourcedPod} is a {LocalPod} that interacts with the files of
# a folder controlled by the users. As such this class does not alter
# in any way the contents of the folder.
...
...
spec/unit/generator/xcconfig_spec.rb
View file @
170fa2e4
...
...
@@ -36,7 +36,7 @@ module Pod
end
it
"configures the project to load all members that implement Objective-c classes or categories from the static library"
do
@xcconfig
.
to_hash
[
'OTHER_LDFLAGS'
].
should
==
'-ObjC'
@xcconfig
.
to_hash
[
'OTHER_LDFLAGS'
].
should
.
include
'-ObjC'
end
it
'does not add the -fobjc-arc to OTHER_LDFLAGS by default as Xcode 4.3.2 does not support it'
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