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
e2d37545
Commit
e2d37545
authored
Feb 12, 2018
by
Samuel Giddins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PodTarget] Add compatible header search paths for pods with header mappings dirs
parent
fb622fcb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
6 deletions
+27
-6
file_references_installer.rb
...xcode/pods_project_generator/file_references_installer.rb
+3
-3
pod_target.rb
lib/cocoapods/target/pod_target.rb
+20
-3
pod_xcconfig_spec.rb
spec/unit/generator/xcconfig/pod_xcconfig_spec.rb
+4
-0
No files found.
lib/cocoapods/installer/xcode/pods_project_generator/file_references_installer.rb
View file @
e2d37545
...
@@ -312,6 +312,7 @@ module Pod
...
@@ -312,6 +312,7 @@ module Pod
#
#
def
header_mappings
(
headers_sandbox
,
file_accessor
,
headers
,
visibility_scope
=
:private
)
def
header_mappings
(
headers_sandbox
,
file_accessor
,
headers
,
visibility_scope
=
:private
)
consumer
=
file_accessor
.
spec_consumer
consumer
=
file_accessor
.
spec_consumer
header_mappings_dir
=
consumer
.
header_mappings_dir
dir
=
headers_sandbox
dir
=
headers_sandbox
dir
+=
headers_sandbox
if
visibility_scope
==
:public
dir
+=
headers_sandbox
if
visibility_scope
==
:public
dir
+=
consumer
.
header_dir
if
consumer
.
header_dir
dir
+=
consumer
.
header_dir
if
consumer
.
header_dir
...
@@ -319,9 +320,8 @@ module Pod
...
@@ -319,9 +320,8 @@ module Pod
mappings
=
{}
mappings
=
{}
headers
.
each
do
|
header
|
headers
.
each
do
|
header
|
sub_dir
=
dir
sub_dir
=
dir
if
consumer
.
header_mappings_dir
if
header_mappings_dir
header_mappings_dir
=
file_accessor
.
path_list
.
root
+
consumer
.
header_mappings_dir
relative_path
=
header
.
relative_path_from
(
file_accessor
.
path_list
.
root
+
header_mappings_dir
)
relative_path
=
header
.
relative_path_from
(
header_mappings_dir
)
sub_dir
+=
relative_path
.
dirname
sub_dir
+=
relative_path
.
dirname
end
end
mappings
[
sub_dir
]
||=
[]
mappings
[
sub_dir
]
||=
[]
...
...
lib/cocoapods/target/pod_target.rb
View file @
e2d37545
...
@@ -585,16 +585,33 @@ module Pod
...
@@ -585,16 +585,33 @@ module Pod
#
#
def
header_search_paths
(
include_test_dependent_targets
=
false
)
def
header_search_paths
(
include_test_dependent_targets
=
false
)
header_search_paths
=
[]
header_search_paths
=
[]
header_search_paths
.
concat
(
build_headers
.
search_paths
(
platform
,
nil
,
defines_module
?
))
header_search_paths
.
concat
(
build_headers
.
search_paths
(
platform
,
nil
,
uses_modular_headers
?
))
header_search_paths
.
concat
(
sandbox
.
public_headers
.
search_paths
(
platform
,
pod_name
,
defines_module
?
))
header_search_paths
.
concat
(
sandbox
.
public_headers
.
search_paths
(
platform
,
pod_name
,
uses_modular_headers
?
))
dependent_targets
=
recursive_dependent_targets
dependent_targets
=
recursive_dependent_targets
dependent_targets
+=
recursive_test_dependent_targets
if
include_test_dependent_targets
dependent_targets
+=
recursive_test_dependent_targets
if
include_test_dependent_targets
dependent_targets
.
each
do
|
dependent_target
|
dependent_targets
.
each
do
|
dependent_target
|
header_search_paths
.
concat
(
sandbox
.
public_headers
.
search_paths
(
platform
,
dependent_target
.
pod_name
,
defines_module?
))
header_search_paths
.
concat
(
sandbox
.
public_headers
.
search_paths
(
platform
,
dependent_target
.
pod_name
,
defines_module?
&&
dependent_target
.
uses_modular_headers?
(
false
)
))
end
end
header_search_paths
.
uniq
header_search_paths
.
uniq
end
end
protected
# Returns whether the pod target should use modular headers.
#
# @param [Boolean] only_if_defines_modules
# whether the use of modular headers should require the target to define a module
#
# @note This must return false when a pod has a `header_mappings_dir`,
# as that allows the spec to completely customize the header structure, and
# therefore it might not be expecting the module name to be prepended
# to imports at all.
#
def
uses_modular_headers?
(
only_if_defines_modules
=
true
)
return
false
if
only_if_defines_modules
&&
!
defines_module?
spec_consumers
.
none?
(
&
:header_mappings_dir
)
end
private
private
# @param [TargetDefinition] target_definition
# @param [TargetDefinition] target_definition
...
...
spec/unit/generator/xcconfig/pod_xcconfig_spec.rb
View file @
e2d37545
...
@@ -11,6 +11,7 @@ module Pod
...
@@ -11,6 +11,7 @@ module Pod
vspec
=
stub
(
:test_specification?
=>
false
)
vspec
=
stub
(
:test_specification?
=>
false
)
consumer
=
stub
(
consumer
=
stub
(
"Spec Consumer (
#{
vspec
}
iOS)"
,
:pod_target_xcconfig
=>
{},
:pod_target_xcconfig
=>
{},
:libraries
=>
[
'xml2'
],
:libraries
=>
[
'xml2'
],
:frameworks
=>
[],
:frameworks
=>
[],
...
@@ -18,6 +19,7 @@ module Pod
...
@@ -18,6 +19,7 @@ module Pod
:platform_name
=>
:ios
,
:platform_name
=>
:ios
,
)
)
file_accessor
=
stub
(
file_accessor
=
stub
(
'File Accessor'
,
:spec
=>
vspec
,
:spec
=>
vspec
,
:spec_consumer
=>
consumer
,
:spec_consumer
=>
consumer
,
:vendored_static_frameworks
=>
[
config
.
sandbox
.
root
+
'AAA/StaticFramework.framework'
],
:vendored_static_frameworks
=>
[
config
.
sandbox
.
root
+
'AAA/StaticFramework.framework'
],
...
@@ -26,6 +28,7 @@ module Pod
...
@@ -26,6 +28,7 @@ module Pod
:vendored_dynamic_libraries
=>
[
config
.
sandbox
.
root
+
'DDD/VendoredDyld.dyld'
],
:vendored_dynamic_libraries
=>
[
config
.
sandbox
.
root
+
'DDD/VendoredDyld.dyld'
],
)
)
vendored_dep_target
=
stub
(
vendored_dep_target
=
stub
(
'Vendored Dependent Target'
,
:name
=>
'BananaLib'
,
:name
=>
'BananaLib'
,
:pod_name
=>
'BananaLib'
,
:pod_name
=>
'BananaLib'
,
:sandbox
=>
config
.
sandbox
,
:sandbox
=>
config
.
sandbox
,
...
@@ -34,6 +37,7 @@ module Pod
...
@@ -34,6 +37,7 @@ module Pod
:static_framework?
=>
false
,
:static_framework?
=>
false
,
:dependent_targets
=>
[],
:dependent_targets
=>
[],
:file_accessors
=>
[
file_accessor
],
:file_accessors
=>
[
file_accessor
],
:uses_modular_headers?
=>
false
,
)
)
@spec
=
fixture_spec
(
'banana-lib/BananaLib.podspec'
)
@spec
=
fixture_spec
(
'banana-lib/BananaLib.podspec'
)
...
...
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