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
a751ba23
Commit
a751ba23
authored
Feb 25, 2012
by
Luke Redpath
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some minor clean-up and refactoring.
parent
7ddf9227
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
14 deletions
+31
-14
installer.rb
lib/cocoapods/installer.rb
+13
-9
sandbox.rb
lib/cocoapods/sandbox.rb
+10
-2
local_pod_spec.rb
spec/unit/local_pod_spec.rb
+1
-1
sandbox_spec.rb
spec/unit/sandbox_spec.rb
+7
-2
No files found.
lib/cocoapods/installer.rb
View file @
a751ba23
...
...
@@ -77,13 +77,10 @@ module Pod
end
def
install!
@sandbox
.
prepare_for_install
puts
"Installing dependencies of:
#{
@podfile
.
defined_in_file
}
"
if
config
.
verbose?
pods
=
install_dependencies!
root
=
config
.
project_pods_root
headers_symlink_root
=
config
.
headers_symlink_root
# Clean old header symlinks
FileUtils
.
rm_r
(
headers_symlink_root
,
:secure
=>
true
)
if
File
.
exists?
(
headers_symlink_root
)
puts
"Generating support files"
unless
config
.
silent?
target_installers
.
each
do
|
target_installer
|
...
...
@@ -94,14 +91,21 @@ module Pod
puts
"* Running post install hooks"
if
config
.
verbose?
# Post install hooks run _before_ saving of project, so that they can alter it before saving.
run_post_install_hooks
puts
"* Writing Xcode project file to `
#{
@sandbox
.
project_path
}
'"
if
config
.
verbose?
project
.
save_as
(
@sandbox
.
project_path
)
end
def
run_post_install_hooks
# we loop over target installers instead of pods, because we yield the target installer
# to the spec post install hook.
target_installers
.
each
do
|
target_installer
|
target_installer
.
build_specifications
.
each
{
|
spec
|
spec
.
post_install
(
target_installer
)
}
end
@podfile
.
post_install!
(
self
)
projpath
=
File
.
join
(
root
,
'Pods.xcodeproj'
)
puts
"* Writing Xcode project file to `
#{
projpath
}
'"
if
config
.
verbose?
project
.
save_as
(
projpath
)
end
def
generate_lock_file!
(
pods
)
...
...
lib/cocoapods/sandbox.rb
View file @
a751ba23
...
...
@@ -13,12 +13,16 @@ module Pod
root
.
rmtree
end
def
headers_
path
def
headers_
root
root
+
"Headers"
end
def
project_path
root
+
"Pods.xcodeproj"
end
def
add_header_file
(
namespace_path
,
relative_header_path
)
namespaced_header_path
=
headers_
path
+
namespace_path
namespaced_header_path
=
headers_
root
+
namespace_path
namespaced_header_path
.
mkpath
unless
File
.
exist?
(
namespaced_header_path
)
source
=
(
root
+
relative_header_path
).
relative_path_from
(
namespaced_header_path
)
Dir
.
chdir
(
namespaced_header_path
)
{
FileUtils
.
ln_sf
(
source
,
relative_header_path
.
basename
)}
...
...
@@ -33,5 +37,9 @@ module Pod
def
header_search_paths
@header_search_paths
.
uniq
.
map
{
|
path
|
"$(PODS_ROOT)/
#{
path
}
"
}
end
def
prepare_for_install
headers_root
.
rmtree
if
headers_root
.
exist?
end
end
end
spec/unit/local_pod_spec.rb
View file @
a751ba23
...
...
@@ -61,7 +61,7 @@ describe Pod::LocalPod do
it
"can link it's headers into the sandbox"
do
@pod
.
link_headers
expected_header_path
=
@sandbox
.
headers_
path
+
"BananaLib/Banana.h"
expected_header_path
=
@sandbox
.
headers_
root
+
"BananaLib/Banana.h"
expected_header_path
.
should
.
be
.
symlink
File
.
read
(
expected_header_path
).
should
==
(
@sandbox
.
root
+
@pod
.
header_files
[
0
]).
read
end
...
...
spec/unit/sandbox_spec.rb
View file @
a751ba23
...
...
@@ -23,8 +23,8 @@ describe Pod::Sandbox do
FileUtils
.
mkdir
(
TMP_POD_ROOT
)
# put it back again
end
it
"returns it's headers
path
"
do
@sandbox
.
headers_
path
.
should
==
Pathname
.
new
(
File
.
join
(
TMP_POD_ROOT
,
"Headers"
))
it
"returns it's headers
root
"
do
@sandbox
.
headers_
root
.
should
==
Pathname
.
new
(
File
.
join
(
TMP_POD_ROOT
,
"Headers"
))
end
it
"can add namespaced headers to it's header path using symlinks and return the relative path"
do
...
...
@@ -68,4 +68,9 @@ describe Pod::Sandbox do
@sandbox
.
header_search_paths
.
should
==
[
"$(PODS_ROOT)/Headers/ExampleLib"
]
end
it
'clears out its headers root when preparing for install'
do
@sandbox
.
prepare_for_install
@sandbox
.
headers_root
.
should
.
not
.
exist
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