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
bc127ecf
Commit
bc127ecf
authored
Jan 05, 2016
by
Samuel Giddins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PostInstallHooksContext] Make array of user targets available
parent
f41d364a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
4 deletions
+17
-4
CHANGELOG.md
CHANGELOG.md
+4
-0
post_install_hooks_context.rb
lib/cocoapods/installer/post_install_hooks_context.rb
+9
-2
post_install_hooks_context_spec.rb
spec/unit/installer/post_install_hooks_context_spec.rb
+4
-2
No files found.
CHANGELOG.md
View file @
bc127ecf
...
@@ -17,6 +17,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
...
@@ -17,6 +17,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[
Jed Lewison
](
https://github.com/jedlewison
)
[
Jed Lewison
](
https://github.com/jedlewison
)
[
#4722
](
https://github.com/CocoaPods/CocoaPods/issues/4722
)
[
#4722
](
https://github.com/CocoaPods/CocoaPods/issues/4722
)
*
Add
`user_targets`
method to the
`UmbrellaTargetDescription`
in the
post-install hooks context.
[
Samuel Giddins
](
https://github.com/segiddins
)
##### Bug Fixes
##### Bug Fixes
*
Always fetch a
`:podspec`
dependency's podspec when it is missing in the
*
Always fetch a
`:podspec`
dependency's podspec when it is missing in the
...
...
lib/cocoapods/installer/post_install_hooks_context.rb
View file @
bc127ecf
...
@@ -38,7 +38,7 @@ module Pod
...
@@ -38,7 +38,7 @@ module Pod
aggregate_targets
.
each
do
|
umbrella
|
aggregate_targets
.
each
do
|
umbrella
|
desc
=
UmbrellaTargetDescription
.
new
desc
=
UmbrellaTargetDescription
.
new
desc
.
user_project
=
umbrella
.
user_project
desc
.
user_project
=
umbrella
.
user_project
desc
.
user_target
_uuids
=
umbrella
.
user_target_uuid
s
desc
.
user_target
s
=
umbrella
.
user_target
s
desc
.
specs
=
umbrella
.
specs
desc
.
specs
=
umbrella
.
specs
desc
.
platform_name
=
umbrella
.
platform
.
name
desc
.
platform_name
=
umbrella
.
platform
.
name
desc
.
platform_deployment_target
=
umbrella
.
platform
.
deployment_target
.
to_s
desc
.
platform_deployment_target
=
umbrella
.
platform
.
deployment_target
.
to_s
...
@@ -69,6 +69,11 @@ module Pod
...
@@ -69,6 +69,11 @@ module Pod
user_project
.
path
if
user_project
user_project
.
path
if
user_project
end
end
# @return [Array<PBXNativeTarget>]
# The list of user targets integrated by this umbrella target.
#
attr_accessor
:user_targets
# @return [Array<String>] The list of the UUIDs of the
# @return [Array<String>] The list of the UUIDs of the
# user targets integrated by this umbrella
# user targets integrated by this umbrella
# target. They can be used to find the
# target. They can be used to find the
...
@@ -76,7 +81,9 @@ module Pod
...
@@ -76,7 +81,9 @@ module Pod
# to find the targets opening the project with
# to find the targets opening the project with
# Xcodeproj.
# Xcodeproj.
#
#
attr_accessor
:user_target_uuids
def
user_target_uuids
user_targets
.
map
(
&
:uuid
)
end
# @return [Array<Specification>] The list of the
# @return [Array<Specification>] The list of the
# specifications of the target.
# specifications of the target.
...
...
spec/unit/installer/post_install_hooks_context_spec.rb
View file @
bc127ecf
...
@@ -8,11 +8,12 @@ module Pod
...
@@ -8,11 +8,12 @@ module Pod
spec
=
fixture_spec
(
'banana-lib/BananaLib.podspec'
)
spec
=
fixture_spec
(
'banana-lib/BananaLib.podspec'
)
user_project
=
Xcodeproj
::
Project
.
open
(
SpecHelper
.
create_sample_app_copy_from_fixture
(
'SampleProject'
))
user_project
=
Xcodeproj
::
Project
.
open
(
SpecHelper
.
create_sample_app_copy_from_fixture
(
'SampleProject'
))
user_target
=
user_project
.
native_targets
.
find
{
|
np
|
np
.
name
==
'SampleProject'
}
target_definition
=
Podfile
::
TargetDefinition
.
new
(
'Pods'
,
nil
)
target_definition
=
Podfile
::
TargetDefinition
.
new
(
'Pods'
,
nil
)
pod_target
=
PodTarget
.
new
([
spec
],
[
target_definition
],
config
.
sandbox
)
pod_target
=
PodTarget
.
new
([
spec
],
[
target_definition
],
config
.
sandbox
)
umbrella
=
AggregateTarget
.
new
(
target_definition
,
config
.
sandbox
)
umbrella
=
AggregateTarget
.
new
(
target_definition
,
config
.
sandbox
)
umbrella
.
user_project
=
user_project
umbrella
.
user_project
=
user_project
umbrella
.
user_target_uuids
=
[
'UUID'
]
umbrella
.
user_target_uuids
=
[
user_target
.
uuid
]
umbrella
.
stubs
(
:platform
).
returns
(
Platform
.
new
(
:ios
,
'8.0'
))
umbrella
.
stubs
(
:platform
).
returns
(
Platform
.
new
(
:ios
,
'8.0'
))
umbrella
.
pod_targets
=
[
pod_target
]
umbrella
.
pod_targets
=
[
pod_target
]
...
@@ -23,7 +24,8 @@ module Pod
...
@@ -23,7 +24,8 @@ module Pod
result
.
sandbox
.
should
==
sandbox
result
.
sandbox
.
should
==
sandbox
result
.
umbrella_targets
.
count
.
should
==
1
result
.
umbrella_targets
.
count
.
should
==
1
umbrella_target
=
result
.
umbrella_targets
.
first
umbrella_target
=
result
.
umbrella_targets
.
first
umbrella_target
.
user_target_uuids
.
should
==
[
'UUID'
]
umbrella_target
.
user_targets
.
should
==
[
user_target
]
umbrella_target
.
user_target_uuids
.
should
==
[
user_target
.
uuid
]
umbrella_target
.
user_project
.
should
==
user_project
umbrella_target
.
user_project
.
should
==
user_project
umbrella_target
.
specs
.
should
==
[
spec
]
umbrella_target
.
specs
.
should
==
[
spec
]
umbrella_target
.
platform_name
.
should
==
:ios
umbrella_target
.
platform_name
.
should
==
:ios
...
...
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