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
a8eca8bb
Commit
a8eca8bb
authored
Sep 07, 2015
by
Marius Rackwitz
Committed by
Samuel Giddins
Oct 05, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[TargetIntegrator] Migrate weak-linked integrations
parent
271f9e7b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
0 deletions
+35
-0
target_integrator.rb
...ds/installer/user_project_integrator/target_integrator.rb
+24
-0
target_integrator_spec.rb
...staller/user_project_integrator/target_integrator_spec.rb
+11
-0
No files found.
lib/cocoapods/installer/user_project_integrator/target_integrator.rb
View file @
a8eca8bb
...
...
@@ -137,6 +137,30 @@ module Pod
end
end
# Reset the linking of the product reference to strong.
#
# @return [Bool] whether any changes to the project were made.
#
# @todo This can be removed for CocoaPods 1.0
#
def
update_to_cocoapods_0_40
frameworks
=
user_project
.
frameworks_group
native_targets_to_embed_in
.
any?
do
|
native_target
|
build_phase
=
native_target
.
frameworks_build_phase
product_ref
=
frameworks
.
files
.
find
{
|
f
|
f
.
path
==
target
.
product_name
}
if
product_ref
build_file
=
build_phase
.
build_file
(
product_ref
)
if
build_file
\
&&
build_file
.
settings
.
is_a?
(
Hash
)
\
&&
build_file
.
settings
[
'ATTRIBUTES'
].
is_a?
(
Array
)
\
&&
build_file
.
settings
[
'ATTRIBUTES'
].
include?
(
'Weak'
)
build_file
.
settings
=
nil
end
end
end
end
# Adds spec product reference to the frameworks build phase of the
# {TargetDefinition} integration libraries. Adds a file reference to
# the frameworks group of the project and adds it to the frameworks
...
...
spec/unit/installer/user_project_integrator/target_integrator_spec.rb
View file @
a8eca8bb
...
...
@@ -47,6 +47,17 @@ module Pod
phase
.
shell_script
.
strip
.
should
==
"
\"
${SRCROOT}/../Pods/Target Support Files/Pods/Pods-resources.sh
\"
"
end
it
'fixes the "Link binary with libraries" build phase of legacy installations'
do
@pod_bundle
.
stubs
(
:requires_frameworks?
=>
true
)
@target_integrator
.
integrate!
target
=
@target_integrator
.
send
(
:native_targets
).
first
phase
=
target
.
frameworks_build_phase
build_file
=
phase
.
files
.
find
{
|
f
|
f
.
file_ref
.
path
==
'Pods.framework'
}
build_file
.
settings
=
{
'ATTRIBUTES'
=>
%w(Weak)
}
@target_integrator
.
integrate!
build_file
.
settings
.
should
.
be
.
nil
end
it
'adds references to the Pods static libraries to the Frameworks group'
do
@target_integrator
.
integrate!
@target_integrator
.
send
(
:user_project
)[
'Frameworks/libPods.a'
].
should
.
not
.
be
.
nil
...
...
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