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
7c344bdd
Commit
7c344bdd
authored
Sep 28, 2014
by
Marius Rackwitz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Refactor] Extract #generate_target from Analyzer#generate_targets
parent
ef070a7f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
39 deletions
+54
-39
analyzer.rb
lib/cocoapods/installer/analyzer.rb
+54
-39
No files found.
lib/cocoapods/installer/analyzer.rb
View file @
7c344bdd
...
@@ -180,52 +180,67 @@ module Pod
...
@@ -180,52 +180,67 @@ module Pod
def
generate_targets
def
generate_targets
targets
=
[]
targets
=
[]
result
.
specs_by_target
.
each
do
|
target_definition
,
specs
|
result
.
specs_by_target
.
each
do
|
target_definition
,
specs
|
# Setup the aggregate target
targets
<<
generate_target
(
target_definition
,
specs
)
target
=
AggregateTarget
.
new
(
target_definition
,
sandbox
)
end
targets
<<
target
targets
end
if
config
.
integrate_targets?
# Setup the aggregate target for a single user target
project_path
=
compute_user_project_path
(
target_definition
)
#
user_project
=
Xcodeproj
::
Project
.
open
(
project_path
)
# @param [TargetDefinition] target_definition
native_targets
=
compute_user_project_targets
(
target_definition
,
user_project
)
# the target definition for the user target.
#
target
.
host_requires_framework
|=
compute_user_project_targets_require_framework
(
native_targets
)
# @param [Array<Specification>] specs
target
.
user_project_path
=
project_path
# the specifications that need to be installed grouped by the
target
.
client_root
=
project_path
.
dirname
# given target definition.
target
.
user_target_uuids
=
native_targets
.
map
(
&
:uuid
)
#
target
.
user_build_configurations
=
compute_user_build_configurations
(
target_definition
,
native_targets
)
# @return [AggregateTarget]
target
.
archs
=
@archs_by_target_def
[
target_definition
]
#
else
def
generate_target
(
target_definition
,
specs
)
target
.
client_root
=
config
.
installation_root
target
=
AggregateTarget
.
new
(
target_definition
,
sandbox
)
target
.
user_target_uuids
=
[]
target
.
user_build_configurations
=
target_definition
.
build_configurations
||
{
'Release'
=>
:release
,
'Debug'
=>
:debug
}
if
config
.
integrate_targets?
if
target_definition
.
platform
.
name
==
:osx
project_path
=
compute_user_project_path
(
target_definition
)
target
.
archs
=
'$(ARCHS_STANDARD_64_BIT)'
user_project
=
Xcodeproj
::
Project
.
open
(
project_path
)
end
native_targets
=
compute_user_project_targets
(
target_definition
,
user_project
)
target
.
host_requires_framework
|=
compute_user_project_targets_require_framework
(
native_targets
)
target
.
user_project_path
=
project_path
target
.
client_root
=
project_path
.
dirname
target
.
user_target_uuids
=
native_targets
.
map
(
&
:uuid
)
target
.
user_build_configurations
=
compute_user_build_configurations
(
target_definition
,
native_targets
)
target
.
archs
=
@archs_by_target_def
[
target_definition
]
else
target
.
client_root
=
config
.
installation_root
target
.
user_target_uuids
=
[]
target
.
user_build_configurations
=
target_definition
.
build_configurations
||
{
'Release'
=>
:release
,
'Debug'
=>
:debug
}
if
target_definition
.
platform
.
name
==
:osx
target
.
archs
=
'$(ARCHS_STANDARD_64_BIT)'
end
end
end
# Group specs and subspecs by their root
# Group specs and subspecs by their root
grouped_specs
=
specs
.
map
do
|
spec
|
grouped_specs
=
specs
.
map
do
|
spec
|
specs
.
select
{
|
s
|
s
.
root
==
spec
.
root
}
specs
.
select
{
|
s
|
s
.
root
==
spec
.
root
}
end
.
uniq
end
.
uniq
# Create a target for each spec group and add it to the aggregate target
# Create a target for each spec group and add it to the aggregate target
grouped_specs
.
each
do
|
pod_specs
|
grouped_specs
.
each
do
|
pod_specs
|
pod_target
=
PodTarget
.
new
(
pod_specs
,
target_definition
,
sandbox
)
pod_target
=
PodTarget
.
new
(
pod_specs
,
target_definition
,
sandbox
)
pod_target
.
host_requires_framework
|=
target
.
host_requires_framework
pod_target
.
host_requires_framework
|=
target
.
host_requires_framework
if
config
.
integrate_targets?
if
config
.
integrate_targets?
pod_target
.
user_build_configurations
=
target
.
user_build_configurations
pod_target
.
user_build_configurations
=
target
.
user_build_configurations
pod_target
.
archs
=
@archs_by_target_def
[
target_definition
]
pod_target
.
archs
=
@archs_by_target_def
[
target_definition
]
else
else
pod_target
.
user_build_configurations
=
{}
pod_target
.
user_build_configurations
=
{}
if
target_definition
.
platform
.
name
==
:osx
if
target_definition
.
platform
.
name
==
:osx
pod_target
.
archs
=
'$(ARCHS_STANDARD_64_BIT)'
pod_target
.
archs
=
'$(ARCHS_STANDARD_64_BIT)'
end
end
end
target
.
pod_targets
<<
pod_target
end
end
target
.
pod_targets
<<
pod_target
end
end
targets
target
end
end
# Generates dependencies that require the specific version of the Pods
# Generates dependencies that require the specific version of the Pods
...
...
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