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
bba8eb4e
Commit
bba8eb4e
authored
May 03, 2015
by
Marius Rackwitz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[TargetIntegrator] Only embed application and unit test bundle targets
parent
bfcacb51
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
1 deletion
+28
-1
target_integrator.rb
...ds/installer/user_project_integrator/target_integrator.rb
+9
-1
target_integrator_spec.rb
...staller/user_project_integrator/target_integrator_spec.rb
+19
-0
No files found.
lib/cocoapods/installer/user_project_integrator/target_integrator.rb
View file @
bba8eb4e
...
...
@@ -9,6 +9,11 @@ module Pod
class
TargetIntegrator
autoload
:XCConfigIntegrator
,
'cocoapods/installer/user_project_integrator/target_integrator/xcconfig_integrator'
# @return [Array<Symbol>] the symbol types, which require that the pod
# frameworks are embedded in the output directory / product bundle.
#
EMBED_FRAMEWORK_TARGET_TYPES
=
[
:application
,
:unit_test_bundle
].
freeze
# @return [Target] the target that should be integrated.
#
attr_reader
:target
...
...
@@ -136,7 +141,10 @@ module Pod
#
def
add_embed_frameworks_script_phase
phase_name
=
'Embed Pods Frameworks'
native_targets_to_integrate
.
each
do
|
native_target
|
targets_to_embed_in
=
native_targets_to_integrate
.
select
do
|
target
|
EMBED_FRAMEWORK_TARGET_TYPES
.
include?
(
target
.
symbol_type
)
end
targets_to_embed_in
.
each
do
|
native_target
|
embed_build_phase
=
native_target
.
shell_script_build_phases
.
find
{
|
bp
|
bp
.
name
==
phase_name
}
unless
embed_build_phase
.
present?
UI
.
message
(
"Adding Build Phase '
#{
phase_name
}
' to project."
)
...
...
spec/unit/installer/user_project_integrator/target_integrator_spec.rb
View file @
bba8eb4e
...
...
@@ -115,6 +115,25 @@ module Pod
phase
.
nil?
.
should
==
true
end
it
'does not add an embed frameworks build phase if the target to integrate is a framework'
do
target
=
@target_integrator
.
send
(
:native_targets
).
first
target
.
stubs
(
:symbol_type
).
returns
(
:framework
)
@target_integrator
.
integrate!
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 from integrated framework targets'
do
@pod_bundle
.
stubs
(
:requires_frameworks?
=>
true
)
@target_integrator
.
integrate!
@pod_bundle
.
stubs
(
:requires_frameworks?
=>
false
)
target
=
@target_integrator
.
send
(
:native_targets
).
first
target
.
stubs
(
:symbol_type
).
returns
(
:framework
)
@target_integrator
.
integrate!
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!
...
...
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