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
2ca31f8f
Commit
2ca31f8f
authored
Mar 27, 2012
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Load only required podspecs for external dependencies [see 15c4ca3]
parent
80809dc0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
18 deletions
+22
-18
resolver.rb
lib/cocoapods/resolver.rb
+2
-2
sandbox.rb
lib/cocoapods/sandbox.rb
+20
-16
No files found.
lib/cocoapods/resolver.rb
View file @
2ca31f8f
...
@@ -15,8 +15,8 @@ module Pod
...
@@ -15,8 +15,8 @@ module Pod
@specs
=
{}
@specs
=
{}
result
=
@podfile
.
target_definitions
.
values
.
inject
({})
do
|
result
,
target_definition
|
result
=
@podfile
.
target_definitions
.
values
.
inject
({})
do
|
result
,
target_definition
|
puts
"
\n
--> Finding dependencies for
#{
target_definition
.
name
}
"
if
Config
.
instance
.
verbose?
puts
"
\n
--> Finding dependencies for
#{
target_definition
.
name
}
"
if
Config
.
instance
.
verbose?
@loaded_specs
=
[]
@loaded_specs
=
[]
find_dependency_sets
(
@podfile
,
target_definition
.
dependencies
)
find_dependency_sets
(
@podfile
,
target_definition
.
dependencies
)
result
[
target_definition
]
=
@specs
.
values_at
(
*
@loaded_specs
).
sort_by
(
&
:name
)
result
[
target_definition
]
=
@specs
.
values_at
(
*
@loaded_specs
).
sort_by
(
&
:name
)
result
result
...
...
lib/cocoapods/sandbox.rb
View file @
2ca31f8f
...
@@ -3,28 +3,28 @@ require 'fileutils'
...
@@ -3,28 +3,28 @@ require 'fileutils'
module
Pod
module
Pod
class
Sandbox
class
Sandbox
attr_reader
:root
attr_reader
:root
HEADERS_DIR
=
"Headers"
HEADERS_DIR
=
"Headers"
def
initialize
(
path
)
def
initialize
(
path
)
@root
=
Pathname
.
new
(
path
)
@root
=
Pathname
.
new
(
path
)
@header_search_paths
=
[
HEADERS_DIR
]
@header_search_paths
=
[
HEADERS_DIR
]
FileUtils
.
mkdir_p
(
@root
)
FileUtils
.
mkdir_p
(
@root
)
end
end
def
implode
def
implode
root
.
rmtree
root
.
rmtree
end
end
def
headers_root
def
headers_root
root
+
HEADERS_DIR
root
+
HEADERS_DIR
end
end
def
project_path
def
project_path
root
+
"Pods.xcodeproj"
root
+
"Pods.xcodeproj"
end
end
def
add_header_file
(
namespace_path
,
relative_header_path
)
def
add_header_file
(
namespace_path
,
relative_header_path
)
namespaced_header_path
=
headers_root
+
namespace_path
namespaced_header_path
=
headers_root
+
namespace_path
namespaced_header_path
.
mkpath
unless
File
.
exist?
(
namespaced_header_path
)
namespaced_header_path
.
mkpath
unless
File
.
exist?
(
namespaced_header_path
)
...
@@ -33,27 +33,31 @@ module Pod
...
@@ -33,27 +33,31 @@ module Pod
@header_search_paths
<<
namespaced_header_path
.
relative_path_from
(
root
)
@header_search_paths
<<
namespaced_header_path
.
relative_path_from
(
root
)
namespaced_header_path
+
relative_header_path
.
basename
namespaced_header_path
+
relative_header_path
.
basename
end
end
def
add_header_files
(
namespace_path
,
relative_header_paths
)
def
add_header_files
(
namespace_path
,
relative_header_paths
)
relative_header_paths
.
map
{
|
path
|
add_header_file
(
namespace_path
,
path
)
}
relative_header_paths
.
map
{
|
path
|
add_header_file
(
namespace_path
,
path
)
}
end
end
def
header_search_paths
def
header_search_paths
@header_search_paths
.
uniq
.
map
{
|
path
|
"$(PODS_ROOT)/
#{
path
}
"
}
@header_search_paths
.
uniq
.
map
{
|
path
|
"$(PODS_ROOT)/
#{
path
}
"
}
end
end
def
prepare_for_install
def
prepare_for_install
headers_root
.
rmtree
if
headers_root
.
exist?
headers_root
.
rmtree
if
headers_root
.
exist?
end
end
def
installed_pods
def
podspec_for_name
(
name
)
Dir
[
root
+
"**/*.podspec"
].
map
do
|
podspec
|
if
spec_path
=
Dir
[
root
+
"
#{
name
}
/*.podspec"
].
first
LocalPod
.
from_podspec
(
Pathname
.
new
(
podspec
),
self
)
Pathname
.
new
(
spec_path
)
elsif
spec_path
=
Dir
[
root
+
"Local Podspecs/
#{
name
}
.podspec"
].
first
Pathname
.
new
(
spec_path
)
end
end
end
end
def
installed_pod_named
(
name
)
def
installed_pod_named
(
name
)
installed_pods
.
find
{
|
pod
|
pod
.
name
==
name
}
if
spec_path
=
podspec_for_name
(
name
)
LocalPod
.
from_podspec
(
spec_path
,
self
)
end
end
end
end
end
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