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
c3545057
Commit
c3545057
authored
Jun 11, 2016
by
Ben Asher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added spec for removing embed phases on upgrade
- More app extension -> embedded target
parent
f2118095
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
3 deletions
+39
-3
target_integrator.rb
...ds/installer/user_project_integrator/target_integrator.rb
+3
-3
target_integrator_spec.rb
...staller/user_project_integrator/target_integrator_spec.rb
+36
-0
No files found.
lib/cocoapods/installer/user_project_integrator/target_integrator.rb
View file @
c3545057
...
@@ -57,7 +57,7 @@ module Pod
...
@@ -57,7 +57,7 @@ module Pod
add_pods_library
add_pods_library
add_embed_frameworks_script_phase
add_embed_frameworks_script_phase
remove_embed_frameworks_script_phase_from_
app_extension
s
remove_embed_frameworks_script_phase_from_
embedded_target
s
add_copy_resources_script_phase
add_copy_resources_script_phase
add_check_manifest_lock_script_phase
add_check_manifest_lock_script_phase
end
end
...
@@ -114,13 +114,13 @@ module Pod
...
@@ -114,13 +114,13 @@ module Pod
end
end
end
end
# Removes the embed frameworks build phase from
app extension
targets
# Removes the embed frameworks build phase from
embedded
targets
#
#
# @note Older versions of CocoaPods would add this build phase to embedded
# @note Older versions of CocoaPods would add this build phase to embedded
# targets. They should be removed on upgrade because embedded targets
# targets. They should be removed on upgrade because embedded targets
# will have their frameworks embedded in their host targets.
# will have their frameworks embedded in their host targets.
#
#
def
remove_embed_frameworks_script_phase_from_
app_extension
s
def
remove_embed_frameworks_script_phase_from_
embedded_target
s
native_targets
.
each
do
|
native_target
|
native_targets
.
each
do
|
native_target
|
if
AggregateTarget
::
EMBED_FRAMEWORKS_IN_HOST_TARGET_TYPES
.
include?
native_target
.
symbol_type
if
AggregateTarget
::
EMBED_FRAMEWORKS_IN_HOST_TARGET_TYPES
.
include?
native_target
.
symbol_type
remove_embed_frameworks_script_phase
(
native_target
)
remove_embed_frameworks_script_phase
(
native_target
)
...
...
spec/unit/installer/user_project_integrator/target_integrator_spec.rb
View file @
c3545057
...
@@ -202,6 +202,42 @@ module Pod
...
@@ -202,6 +202,42 @@ module Pod
phase
=
target
.
shell_script_build_phases
.
find
{
|
bp
|
bp
.
name
==
@embed_framework_phase_name
}
phase
=
target
.
shell_script_build_phases
.
find
{
|
bp
|
bp
.
name
==
@embed_framework_phase_name
}
phase
.
nil?
.
should
==
false
phase
.
nil?
.
should
==
false
end
end
it
'removes embed frameworks build phases from app extension targets'
do
@pod_bundle
.
stubs
(
:requires_frameworks?
=>
true
)
@target_integrator
.
integrate!
target
=
@target_integrator
.
send
(
:native_targets
).
first
phase
=
target
.
shell_script_build_phases
.
find
{
|
bp
|
bp
.
name
==
@embed_framework_phase_name
}
phase
.
nil?
.
should
==
false
target
.
stubs
(
:symbol_type
).
returns
(
:app_extension
)
@target_integrator
.
integrate!
phase
=
target
.
shell_script_build_phases
.
find
{
|
bp
|
bp
.
name
==
@embed_framework_phase_name
}
phase
.
nil?
.
should
==
true
end
it
'removes embed frameworks build phases from watch extension targets'
do
@pod_bundle
.
stubs
(
:requires_frameworks?
=>
true
)
@target_integrator
.
integrate!
target
=
@target_integrator
.
send
(
:native_targets
).
first
phase
=
target
.
shell_script_build_phases
.
find
{
|
bp
|
bp
.
name
==
@embed_framework_phase_name
}
phase
.
nil?
.
should
==
false
target
.
stubs
(
:symbol_type
).
returns
(
:watch_extension
)
@target_integrator
.
integrate!
phase
=
target
.
shell_script_build_phases
.
find
{
|
bp
|
bp
.
name
==
@embed_framework_phase_name
}
phase
.
nil?
.
should
==
true
end
it
'removes embed frameworks build phases from framework targets'
do
@pod_bundle
.
stubs
(
:requires_frameworks?
=>
true
)
@target_integrator
.
integrate!
target
=
@target_integrator
.
send
(
:native_targets
).
first
phase
=
target
.
shell_script_build_phases
.
find
{
|
bp
|
bp
.
name
==
@embed_framework_phase_name
}
phase
.
nil?
.
should
==
false
target
.
stubs
(
:symbol_type
).
returns
(
:framework
)
@target_integrator
.
integrate!
phase
=
target
.
shell_script_build_phases
.
find
{
|
bp
|
bp
.
name
==
@embed_framework_phase_name
}
phase
.
nil?
.
should
==
true
end
end
end
describe
'Private helpers'
do
describe
'Private helpers'
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