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
44d20e49
Commit
44d20e49
authored
May 17, 2016
by
Marius Rackwitz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PodTargetInstaller] Create a build phase to symlink header folders
parent
5496974a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
2 deletions
+46
-2
pod_target_installer.rb
...oapods/installer/target_installer/pod_target_installer.rb
+21
-0
pod_target_installer_spec.rb
...t/installer/target_installer/pod_target_installer_spec.rb
+25
-2
No files found.
lib/cocoapods/installer/target_installer/pod_target_installer.rb
View file @
44d20e49
...
@@ -32,6 +32,7 @@ module Pod
...
@@ -32,6 +32,7 @@ module Pod
target
.
file_accessors
.
flat_map
(
&
:public_headers
).
map
(
&
:basename
)
target
.
file_accessors
.
flat_map
(
&
:public_headers
).
map
(
&
:basename
)
end
end
end
end
create_build_phase_to_symlink_header_folders
end
end
create_prefix_header
create_prefix_header
create_dummy_source
create_dummy_source
...
@@ -216,6 +217,26 @@ module Pod
...
@@ -216,6 +217,26 @@ module Pod
end
end
end
end
# Creates a build phase which links the versioned header folders
# of the OS X into the framework bundle's root root directory.
# This is only necessary because the way how headers are copied
# via custom copy file build phases in combination with
# header_mappings_dir interferes with xcodebuild's expectations
# about the existence of private or public headers.
#
# @return [void]
#
def
create_build_phase_to_symlink_header_folders
return
unless
target
.
platform
.
name
==
:osx
&&
header_mappings_dir
build_phase
=
native_target
.
new_shell_script_build_phase
(
'Create Symlinks to Header Folders'
)
build_phase
.
shell_script
=
<<-
eos
.
strip_heredoc
cd $CONFIGURATION_BUILD_DIR/$WRAPPER_NAME
ln -fs ${PUBLIC_HEADERS_FOLDER_PATH
\#
$WRAPPER_NAME/} ${PUBLIC_HEADERS_FOLDER_PATH
\#\$
CONTENTS_FOLDER_PATH/}
ln -fs ${PRIVATE_HEADERS_FOLDER_PATH
\#\$
WRAPPER_NAME/} ${PRIVATE_HEADERS_FOLDER_PATH
\#\$
CONTENTS_FOLDER_PATH/}
eos
end
# Creates a prefix header file which imports `UIKit` or `Cocoa` according
# Creates a prefix header file which imports `UIKit` or `Cocoa` according
# to the platform of the target. This file also include any prefix header
# to the platform of the target. This file also include any prefix header
# content reported by the specification of the pods.
# content reported by the specification of the pods.
...
...
spec/unit/installer/target_installer/pod_target_installer_spec.rb
View file @
44d20e49
...
@@ -300,10 +300,11 @@ module Pod
...
@@ -300,10 +300,11 @@ module Pod
@project
.
add_file_reference
(
file
,
group
)
@project
.
add_file_reference
(
file
,
group
)
end
end
@installer
.
stubs
(
:target
).
returns
(
@pod_target
)
@installer
.
stubs
(
:target
).
returns
(
@pod_target
)
@installer
.
install!
end
end
it
'creates custom copy files phases for framework pods'
do
it
'creates custom copy files phases for framework pods'
do
@installer
.
install!
target
=
@project
.
native_targets
.
first
target
=
@project
.
native_targets
.
first
target
.
name
.
should
==
'snake'
target
.
name
.
should
==
'snake'
...
@@ -340,12 +341,34 @@ module Pod
...
@@ -340,12 +341,34 @@ module Pod
end
end
it
'uses relative file paths to generate umbrella header'
do
it
'uses relative file paths to generate umbrella header'
do
content
=
@pod_target
.
umbrella_header_path
.
read
@installer
.
install!
content
=
@pod_target
.
umbrella_header_path
.
read
content
.
should
=~
%r{"A/Boa.h"}
content
.
should
=~
%r{"A/Boa.h"}
content
.
should
=~
%r{"A/Garden.h"}
content
.
should
=~
%r{"A/Garden.h"}
content
.
should
=~
%r{"A/Rattle.h"}
content
.
should
=~
%r{"A/Rattle.h"}
end
end
it
'creates a build phase to symlink header folders on OS X'
do
@pod_target
.
stubs
(
:platform
).
returns
(
Platform
.
osx
)
@installer
.
install!
target
=
@project
.
native_targets
.
first
build_phase
=
target
.
shell_script_build_phases
.
find
do
|
bp
|
bp
.
name
==
'Create Symlinks to Header Folders'
end
build_phase
.
should
.
not
.
be
.
nil
end
end
it
"doesn't create a build phase to symlink header folders by default on OS X"
do
@pod_target
.
stubs
(
:platform
).
returns
(
Platform
.
osx
)
@installer
.
install!
target
=
@project
.
native_targets
.
first
target
.
shell_script_build_phases
.
should
==
[]
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