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