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
20711f75
Commit
20711f75
authored
Jul 24, 2015
by
Boris Bügling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract `add_file` method.
Originally from
5121dff5
parent
f1a18677
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
7 deletions
+29
-7
headers_store.rb
lib/cocoapods/sandbox/headers_store.rb
+29
-7
No files found.
lib/cocoapods/sandbox/headers_store.rb
View file @
20711f75
...
@@ -71,18 +71,40 @@ module Pod
...
@@ -71,18 +71,40 @@ module Pod
# @return [Array<Pathname>]
# @return [Array<Pathname>]
#
#
def
add_files
(
namespace
,
relative_header_paths
,
platform
)
def
add_files
(
namespace
,
relative_header_paths
,
platform
)
relative_header_paths
.
map
do
|
relative_header_path
|
add_file
(
namespace
,
relative_header_path
,
relative_header_path
.
basename
,
platform
)
end
end
# Adds a header to the directory under different name.
#
# @param [Pathname] namespace
# the path where the header file should be stored relative to the
# headers directory.
#
# @param [Pathname] relative_header_path
# the path of the header file relative to the Pods project
# (`PODS_ROOT` variable of the xcconfigs).
#
# @param [String] final_name
# the name under which the file should be available in the
# headers directory.
#
# @note This method adds the file to the search paths.
#
# @return [Pathname]
#
def
add_file
(
namespace
,
relative_header_path
,
final_name
,
platform
)
add_search_path
(
namespace
,
platform
)
add_search_path
(
namespace
,
platform
)
namespaced_path
=
root
+
namespace
namespaced_path
=
root
+
namespace
namespaced_path
.
mkpath
unless
File
.
exist?
(
namespaced_path
)
namespaced_path
.
mkpath
unless
File
.
exist?
(
namespaced_path
)
relative_header_paths
.
map
do
|
relative_header_path
|
absolute_source
=
(
sandbox
.
root
+
relative_header_path
)
absolute_source
=
(
sandbox
.
root
+
relative_header_path
)
source
=
absolute_source
.
relative_path_from
(
namespaced_path
)
source
=
absolute_source
.
relative_path_from
(
namespaced_path
)
Dir
.
chdir
(
namespaced_path
)
do
Dir
.
chdir
(
namespaced_path
)
do
FileUtils
.
ln_sf
(
source
,
final_name
)
FileUtils
.
ln_sf
(
source
,
relative_header_path
.
basename
)
end
namespaced_path
+
relative_header_path
.
basename
end
end
namespaced_path
+
relative_header_path
.
basename
end
end
# Adds an header search path to the sandbox.
# Adds an header search path to the sandbox.
...
...
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