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
c68ce09a
Commit
c68ce09a
authored
Aug 12, 2014
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[AggregateTarget] Add #user_targets
parent
ba68b811
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
14 deletions
+27
-14
target_integrator.rb
...ds/installer/user_project_integrator/target_integrator.rb
+1
-12
aggregate_target.rb
lib/cocoapods/target/aggregate_target.rb
+16
-1
target_integrator_spec.rb
...staller/user_project_integrator/target_integrator_spec.rb
+1
-1
aggregate_target_spec.rb
spec/unit/target/aggregate_target_spec.rb
+9
-0
No files found.
lib/cocoapods/installer/user_project_integrator/target_integrator.rb
View file @
c68ce09a
...
@@ -124,18 +124,7 @@ module Pod
...
@@ -124,18 +124,7 @@ module Pod
# match the given target.
# match the given target.
#
#
def
native_targets
def
native_targets
unless
@native_targets
@native_targets
||=
target
.
user_targets
(
user_project
)
target_uuids
=
target
.
user_target_uuids
@native_targets
=
target_uuids
.
map
do
|
uuid
|
native_target
=
user_project
.
objects_by_uuid
[
uuid
]
unless
native_target
raise
Informative
,
"[Bug] Unable to find the target with "
\
"the `
#{
uuid
}
` UUID for the `
#{
target
}
` integration library"
end
native_target
end
end
@native_targets
end
end
# @return [Array<PBXNativeTarget>] The list of the targets
# @return [Array<PBXNativeTarget>] The list of the targets
...
...
lib/cocoapods/target/aggregate_target.rb
View file @
c68ce09a
...
@@ -38,13 +38,28 @@ module Pod
...
@@ -38,13 +38,28 @@ module Pod
attr_accessor
:user_project_path
attr_accessor
:user_project_path
# @return [String] the list of the UUIDs of the user targets that will be
# @return [String] the list of the UUIDs of the user targets that will be
# integrated by this target as identified by the anal
i
zer.
# integrated by this target as identified by the anal
y
zer.
#
#
# @note The target instances are not stored to prevent editing different
# @note The target instances are not stored to prevent editing different
# instances.
# instances.
#
#
attr_accessor
:user_target_uuids
attr_accessor
:user_target_uuids
# @return [Array<PBXNativeTarget>] The list of all the user targets that
# will be integrated by this target.
#
def
user_targets
(
project
=
nil
)
project
||=
Xcodeproj
::
Project
.
open
(
user_project_path
)
user_target_uuids
.
map
do
|
uuid
|
native_target
=
project
.
objects_by_uuid
[
uuid
]
unless
native_target
raise
Informative
,
"[Bug] Unable to find the target with "
\
"the `
#{
uuid
}
` UUID for the `
#{
self
}
` integration library"
end
native_target
end
end
# @return [Hash<String, Xcodeproj::Config>] Map from configuration name to
# @return [Hash<String, Xcodeproj::Config>] Map from configuration name to
# configuration file for the target
# configuration file for the target
#
#
...
...
spec/unit/installer/user_project_integrator/target_integrator_spec.rb
View file @
c68ce09a
...
@@ -101,7 +101,7 @@ module Pod
...
@@ -101,7 +101,7 @@ module Pod
it
'returns the targets that need to be integrated'
do
it
'returns the targets that need to be integrated'
do
pods_library
=
@project
.
frameworks_group
.
new_product_ref_for_target
(
'Pods'
,
:static_library
)
pods_library
=
@project
.
frameworks_group
.
new_product_ref_for_target
(
'Pods'
,
:static_library
)
@target
.
frameworks_build_phase
.
add_file_reference
(
pods_library
)
@target
.
frameworks_build_phase
.
add_file_reference
(
pods_library
)
@
target_integrator
.
stubs
(
:user_project
).
returns
(
@project
)
@
project
.
save
@target_integrator
.
send
(
:native_targets_to_integrate
).
map
(
&
:name
).
should
.
be
.
empty
@target_integrator
.
send
(
:native_targets_to_integrate
).
map
(
&
:name
).
should
.
be
.
empty
end
end
...
...
spec/unit/target/aggregate_target_spec.rb
View file @
c68ce09a
...
@@ -24,6 +24,15 @@ module Pod
...
@@ -24,6 +24,15 @@ module Pod
it
"returns the name of its product"
do
it
"returns the name of its product"
do
@target
.
product_name
.
should
==
'libPods.a'
@target
.
product_name
.
should
==
'libPods.a'
end
end
it
'returns the user targets'
do
project_path
=
SpecHelper
.
fixture
(
'SampleProject/SampleProject.xcodeproj'
)
@target
.
user_project_path
=
project_path
@target
.
user_target_uuids
=
[
'A346496C14F9BE9A0080D870'
]
targets
=
@target
.
user_targets
targets
.
count
.
should
==
1
targets
.
first
.
class
.
should
==
Xcodeproj
::
Project
::
PBXNativeTarget
end
end
end
describe
"Support files"
do
describe
"Support files"
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