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
e2819ac3
Commit
e2819ac3
authored
Feb 25, 2012
by
Luke Redpath
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TargetInstaller no longer needs access to #build_specifications
parent
a751ba23
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
26 deletions
+23
-26
installer.rb
lib/cocoapods/installer.rb
+16
-17
target_installer.rb
lib/cocoapods/installer/target_installer.rb
+4
-7
installer_spec.rb
spec/unit/installer_spec.rb
+3
-2
No files found.
lib/cocoapods/installer.rb
View file @
e2819ac3
...
...
@@ -2,29 +2,14 @@ module Pod
class
Installer
autoload
:TargetInstaller
,
'cocoapods/installer/target_installer'
module
Shared
def
dependent_specifications
@dependent_specifications
||=
Resolver
.
new
(
@podfile
,
@definition
?
@definition
.
dependencies
:
nil
).
resolve
end
def
build_specifications
dependent_specifications
.
reject
do
|
spec
|
spec
.
wrapper?
||
spec
.
defined_in_set
.
only_part_of_other_pod?
end
end
def
download_only_specifications
dependent_specifications
-
build_specifications
end
end
include
Config
::
Mixin
include
Shared
attr_reader
:sandbox
def
initialize
(
podfile
)
@podfile
=
podfile
# FIXME: pass this into the installer as a parameter
@sandbox
=
Sandbox
.
new
(
config
.
project_pods_root
)
end
...
...
@@ -189,5 +174,19 @@ module Pod
puts
"[!] From now on use `
#{
File
.
basename
(
xcworkspace
)
}
' instead of `
#{
File
.
basename
(
projpath
)
}
'."
end
end
def
dependent_specifications
@dependent_specifications
||=
Resolver
.
new
(
@podfile
,
@definition
?
@definition
.
dependencies
:
nil
).
resolve
end
def
build_specifications
dependent_specifications
.
reject
do
|
spec
|
spec
.
wrapper?
||
spec
.
defined_in_set
.
only_part_of_other_pod?
end
end
def
download_only_specifications
dependent_specifications
-
build_specifications
end
end
end
lib/cocoapods/installer/target_installer.rb
View file @
e2819ac3
...
...
@@ -2,7 +2,6 @@ module Pod
class
Installer
class
TargetInstaller
include
Config
::
Mixin
include
Shared
attr_reader
:podfile
,
:project
,
:target_definition
,
:target
...
...
@@ -34,11 +33,9 @@ module Pod
"
#{
@target_definition
.
lib_name
}
-resources.sh"
end
def
bridge_support_generator
Generator
::
BridgeSupport
.
new
(
build_specifications
.
map
do
|
spec
|
spec
.
header_files
.
map
do
|
header
|
config
.
project_pods_root
+
header
end
def
bridge_support_generator_for
(
pods
,
sandbox
)
Generator
::
BridgeSupport
.
new
(
pods
.
map
do
|
pod
|
pod
.
header_files
.
map
{
|
header
|
sandbox
.
root
+
header
}
end
.
flatten
)
end
...
...
@@ -98,7 +95,7 @@ module Pod
if
@podfile
.
generate_bridge_support?
bridge_support_metadata_path
=
sandbox
.
root
+
bridge_support_filename
puts
"* Generating BridgeSupport metadata file at `
#{
bridge_support_metadata_path
}
'"
if
config
.
verbose?
bridge_support_generator
.
save_as
(
bridge_support_metadata_path
)
bridge_support_generator
_for
(
pods
,
sandbox
)
.
save_as
(
bridge_support_metadata_path
)
copy_resources_script_for
(
pods
).
resources
<<
bridge_support_filename
end
puts
"* Generating xcconfig file at `
#{
sandbox
.
root
+
xcconfig_filename
}
'"
if
config
.
verbose?
...
...
spec/unit/installer_spec.rb
View file @
e2819ac3
...
...
@@ -39,12 +39,13 @@ describe "Pod::Installer" do
config
.
rootspec
=
podfile
expected
=
[]
installer
=
Pod
::
Installer
.
new
(
podfile
)
installer
.
build_specifications
.
each
do
|
spec
|
pods
=
installer
.
build_specifications
.
map
do
|
spec
|
spec
.
header_files
.
each
do
|
header
|
expected
<<
config
.
project_pods_root
+
header
end
Pod
::
LocalPod
.
new
(
spec
,
installer
.
sandbox
)
end
installer
.
target_installers
.
first
.
bridge_support_generator
.
headers
.
should
==
expected
installer
.
target_installers
.
first
.
bridge_support_generator
_for
(
pods
,
installer
.
sandbox
)
.
headers
.
should
==
expected
end
it
"omits empty target definitions"
do
...
...
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