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
b863ece7
Commit
b863ece7
authored
May 15, 2012
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[LocalPod] Resolve compiler flags per specification.
parent
68b63814
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
5 deletions
+25
-5
local_pod.rb
lib/cocoapods/local_pod.rb
+25
-5
No files found.
lib/cocoapods/local_pod.rb
View file @
b863ece7
...
@@ -120,14 +120,30 @@ module Pod
...
@@ -120,14 +120,30 @@ module Pod
specifications
.
map
{
|
s
|
s
.
xcconfig
}.
reduce
(
:merge
)
specifications
.
map
{
|
s
|
s
.
xcconfig
}.
reduce
(
:merge
)
end
end
#TODO: fix
def
add_to_target
(
target
)
def
add_to_target
(
target
)
implementation_files
.
each
do
|
file
|
sources_files_by_specification
.
each
do
|
spec
,
files
|
# TODO: respect the compiler flags of each subspec
files
.
each
do
|
file
|
target
.
add_source_file
(
file
,
nil
,
top_specification
.
compiler_flags
.
strip
)
target
.
add_source_file
(
file
,
nil
,
spec
.
compiler_flags
.
strip
)
end
end
end
end
end
# returns an hash where the source_files are groupped by specification.
# If the same file is required by two specifications the one at the
# higher level in the inheritance chain wins.
def
sources_files_by_specification
files_by_spec
=
{}
processed_files
=
[]
specifications
.
sort_by
{
|
s
|
s
.
name
.
length
}.
each
do
|
spec
|
files
=
[]
expanded_paths
(
spec
.
source_files
,
:glob
=>
'*.{h,m,mm,c,cpp}'
,
:relative_to_sandbox
=>
true
).
each
do
|
file
|
files
<<
file
unless
processed_files
.
include?
(
file
)
end
files_by_spec
[
spec
]
=
files
processed_files
+=
files
end
files_by_spec
end
def
requires_arc?
def
requires_arc?
top_specification
.
requires_arc
top_specification
.
requires_arc
...
@@ -150,7 +166,7 @@ module Pod
...
@@ -150,7 +166,7 @@ module Pod
# TODO this is being overriden in the RestKit 0.9.4 spec, need to do
# TODO this is being overriden in the RestKit 0.9.4 spec, need to do
# something with that, and this method also still exists in Specification.
# something with that, and this method also still exists in Specification.
def
copy_header_mappings
def
copy_header_mappings
search_path_headers
=
header_files
-
chained_expanded_paths
(
:exclude_headers
,
:relative_to_sandbox
=>
true
)
search_path_headers
=
header_files
-
exclude_headers
search_path_headers
.
inject
({})
do
|
mappings
,
from
|
search_path_headers
.
inject
({})
do
|
mappings
,
from
|
from_without_prefix
=
from
.
relative_path_from
(
relative_root
)
from_without_prefix
=
from
.
relative_path_from
(
relative_root
)
to
=
top_specification
.
header_dir
+
top_specification
.
copy_header_mapping
(
from_without_prefix
)
to
=
top_specification
.
header_dir
+
top_specification
.
copy_header_mapping
(
from_without_prefix
)
...
@@ -159,6 +175,10 @@ module Pod
...
@@ -159,6 +175,10 @@ module Pod
end
end
end
end
def
exclude_headers
chained_expanded_paths
(
:exclude_headers
,
:relative_to_sandbox
=>
true
)
end
def
chained_expanded_paths
(
accessor
,
options
=
{})
def
chained_expanded_paths
(
accessor
,
options
=
{})
specifications
.
map
{
|
s
|
expanded_paths
(
s
.
send
(
accessor
),
options
)
}.
compact
.
flatten
.
uniq
specifications
.
map
{
|
s
|
expanded_paths
(
s
.
send
(
accessor
),
options
)
}.
compact
.
flatten
.
uniq
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