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
7c4a1c58
Commit
7c4a1c58
authored
Dec 13, 2014
by
Boris Bügling
Committed by
Marius Rackwitz
Dec 25, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove "Embed Pods Frameworks" build phase if no longer needed.
parent
201c13f8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
0 deletions
+46
-0
target_integrator.rb
...ds/installer/user_project_integrator/target_integrator.rb
+21
-0
target_integrator_spec.rb
...staller/user_project_integrator/target_integrator_spec.rb
+25
-0
No files found.
lib/cocoapods/installer/user_project_integrator/target_integrator.rb
View file @
7c4a1c58
...
...
@@ -31,6 +31,7 @@ module Pod
project_is_dirty
=
[
XCConfigIntegrator
.
integrate
(
target
,
native_targets
),
update_to_cocoapods_0_34
,
remove_embed_frameworks_script_phases
,
unless
native_targets_to_integrate
.
empty?
add_pods_library
add_embed_frameworks_script_phase
if
target
.
requires_frameworks?
...
...
@@ -145,6 +146,26 @@ module Pod
end
end
# Delete 'Embed Pods Frameworks' Build Phases if they exist
#
# @return [void]
#
def
remove_embed_frameworks_script_phases
return
false
if
target
.
requires_frameworks?
phase_name
=
'Embed Pods Frameworks'
result
=
false
native_targets
.
each
do
|
native_target
|
embed_build_phase
=
native_target
.
shell_script_build_phases
.
find
{
|
bp
|
bp
.
name
==
phase_name
}
next
unless
embed_build_phase
.
present?
native_target
.
build_phases
.
delete
(
embed_build_phase
)
result
=
true
end
result
end
# Adds a shell script build phase responsible to copy the resources
# generated by the TargetDefinition to the bundle of the product of the
# targets.
...
...
spec/unit/installer/user_project_integrator/target_integrator_spec.rb
View file @
7c4a1c58
...
...
@@ -100,6 +100,31 @@ module Pod
@target_integrator
.
send
(
:user_project
).
expects
(
:save
).
never
@target_integrator
.
integrate!
end
it
'adds an embed frameworks build phase if frameworks are used'
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 Pods Frameworks'
}
phase
.
nil?
.
should
==
false
end
it
'does not add an embed frameworks build phase by default'
do
@target_integrator
.
integrate!
target
=
@target_integrator
.
send
(
:native_targets
).
first
phase
=
target
.
shell_script_build_phases
.
find
{
|
bp
|
bp
.
name
==
'Embed Pods Frameworks'
}
phase
.
nil?
.
should
==
true
end
it
'removes existing embed frameworks build phases if frameworks are not used anymore'
do
@pod_bundle
.
stubs
(
:requires_frameworks?
=>
true
)
@target_integrator
.
integrate!
@pod_bundle
.
stubs
(
:requires_frameworks?
=>
false
)
@target_integrator
.
integrate!
target
=
@target_integrator
.
send
(
:native_targets
).
first
phase
=
target
.
shell_script_build_phases
.
find
{
|
bp
|
bp
.
name
==
'Embed Pods Frameworks'
}
phase
.
nil?
.
should
==
true
end
end
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