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
4ee54d23
Commit
4ee54d23
authored
Oct 05, 2015
by
Samuel E. Giddins
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4137 from CocoaPods/mr-static-link-aggregate-target
[Installer] Always Link the AggregateTarget as static
parents
bf62a31f
34db8c3f
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
64 additions
and
13 deletions
+64
-13
CHANGELOG.md
CHANGELOG.md
+6
-0
aggregate_target_installer.rb
.../installer/target_installer/aggregate_target_installer.rb
+1
-0
target_integrator.rb
...ds/installer/user_project_integrator/target_integrator.rb
+20
-9
cocoapods-integration-specs
spec/cocoapods-integration-specs
+1
-1
aggregate_target_installer_spec.rb
...aller/target_installer/aggregate_target_installer_spec.rb
+7
-0
target_integrator_spec.rb
...staller/user_project_integrator/target_integrator_spec.rb
+29
-3
No files found.
CHANGELOG.md
View file @
4ee54d23
...
@@ -92,6 +92,12 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
...
@@ -92,6 +92,12 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
## 0.39.0.beta.4 (2015-09-02)
## 0.39.0.beta.4 (2015-09-02)
##### Enhancements
*
Always link the aggregate target as static to the user project.
[
Marius Rackwitz
](
https://github.com/mrackwitz
)
[
#4137
](
https://github.com/CocoaPods/CocoaPods/pull/4137
)
##### Bug Fixes
##### Bug Fixes
*
Using vendored frameworks without a
`Headers`
directory will no longer cause a
*
Using vendored frameworks without a
`Headers`
directory will no longer cause a
...
...
lib/cocoapods/installer/target_installer/aggregate_target_installer.rb
View file @
4ee54d23
...
@@ -47,6 +47,7 @@ module Pod
...
@@ -47,6 +47,7 @@ module Pod
'OTHER_LIBTOOLFLAGS'
=>
''
,
'OTHER_LIBTOOLFLAGS'
=>
''
,
'PODS_ROOT'
=>
'$(SRCROOT)'
,
'PODS_ROOT'
=>
'$(SRCROOT)'
,
'SKIP_INSTALL'
=>
'YES'
,
'SKIP_INSTALL'
=>
'YES'
,
'MACH_O_TYPE'
=>
'staticlib'
,
}
}
super
.
merge
(
settings
)
super
.
merge
(
settings
)
end
end
...
...
lib/cocoapods/installer/user_project_integrator/target_integrator.rb
View file @
4ee54d23
...
@@ -132,8 +132,26 @@ module Pod
...
@@ -132,8 +132,26 @@ module Pod
end
end
if
requires_update
if
requires_update
add_embed_frameworks_script_phase
add_embed_frameworks_script_phase
true
end
end
frameworks
=
user_project
.
frameworks_group
native_targets
.
each
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
requires_update
=
true
end
end
end
requires_update
end
end
# Adds spec product reference to the frameworks build phase of the
# Adds spec product reference to the frameworks build phase of the
...
@@ -161,15 +179,8 @@ module Pod
...
@@ -161,15 +179,8 @@ module Pod
target_basename
=
target
.
product_basename
target_basename
=
target
.
product_basename
new_product_ref
=
frameworks
.
files
.
find
{
|
f
|
f
.
path
==
target
.
product_name
}
||
new_product_ref
=
frameworks
.
files
.
find
{
|
f
|
f
.
path
==
target
.
product_name
}
||
frameworks
.
new_product_ref_for_target
(
target_basename
,
target
.
product_type
)
frameworks
.
new_product_ref_for_target
(
target_basename
,
target
.
product_type
)
build_
file
=
build_
phase
.
build_file
(
new_product_ref
)
||
build_phase
.
build_file
(
new_product_ref
)
||
build_phase
.
add_file_reference
(
new_product_ref
,
true
)
build_phase
.
add_file_reference
(
new_product_ref
,
true
)
if
target
.
requires_frameworks?
# Weak link the aggregate target's product, because as it contains
# no symbols, it isn't copied into the app bundle. dyld will so
# never try to find the missing executable at runtime.
build_file
.
settings
||=
{}
build_file
.
settings
[
'ATTRIBUTES'
]
=
[
'Weak'
]
end
end
end
end
end
...
...
cocoapods-integration-specs
@
5d5cc41d
Subproject commit
2bc57fad4912e84ed1a82e3ba0b3153c4577b1b4
Subproject commit
5d5cc41dd34abe88f20c797bd10a7a05bc76f33a
spec/unit/installer/target_installer/aggregate_target_installer_spec.rb
View file @
4ee54d23
...
@@ -101,6 +101,13 @@ module Pod
...
@@ -101,6 +101,13 @@ module Pod
end
end
end
end
it
'will be built as static library'
do
@installer
.
install!
@installer
.
target
.
native_target
.
build_configurations
.
each
do
|
config
|
config
.
build_settings
[
'MACH_O_TYPE'
].
should
==
'staticlib'
end
end
it
'will be skipped when installing'
do
it
'will be skipped when installing'
do
@installer
.
install!
@installer
.
install!
@installer
.
target
.
native_target
.
build_configurations
.
each
do
|
config
|
@installer
.
target
.
native_target
.
build_configurations
.
each
do
|
config
|
...
...
spec/unit/installer/user_project_integrator/target_integrator_spec.rb
View file @
4ee54d23
...
@@ -47,17 +47,43 @@ module Pod
...
@@ -47,17 +47,43 @@ module Pod
phase
.
shell_script
.
strip
.
should
==
"
\"
${SRCROOT}/../Pods/Target Support Files/Pods/Pods-resources.sh
\"
"
phase
.
shell_script
.
strip
.
should
==
"
\"
${SRCROOT}/../Pods/Target Support Files/Pods/Pods-resources.sh
\"
"
end
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
it
'adds references to the Pods static libraries to the Frameworks group'
do
@target_integrator
.
integrate!
@target_integrator
.
integrate!
@target_integrator
.
send
(
:user_project
)[
'Frameworks/libPods.a'
].
should
.
not
.
nil?
@target_integrator
.
send
(
:user_project
)[
'Frameworks/libPods.a'
].
should
.
not
.
be
.
nil
end
end
it
'adds the libPods static library to the "Link binary with libraries" build phase of each target'
do
it
'adds the libPods static library to the "Link binary with libraries" build phase of each target'
do
@target_integrator
.
integrate!
@target_integrator
.
integrate!
target
=
@target_integrator
.
send
(
:native_targets
).
first
target
=
@target_integrator
.
send
(
:native_targets
).
first
phase
=
target
.
frameworks_build_phase
phase
=
target
.
frameworks_build_phase
ref
=
phase
.
files
.
find
{
|
f
|
f
.
file_ref
.
path
==
'libPods.a'
}
build_file
=
phase
.
files
.
find
{
|
f
|
f
.
file_ref
.
path
==
'libPods.a'
}
ref
.
should
.
not
.
be
.
nil
build_file
.
should
.
not
.
be
.
nil
end
it
'adds references to the Pods static framework to the Frameworks group'
do
@pod_bundle
.
stubs
(
:requires_frameworks?
=>
true
)
@target_integrator
.
integrate!
@target_integrator
.
send
(
:user_project
)[
'Frameworks/Pods.framework'
].
should
.
not
.
be
.
nil
end
it
'adds the Pods static framework to the "Link binary with libraries" build phase of each target'
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
.
should
.
not
.
be
.
nil
end
end
it
'adds a Copy Pods Resources build phase to each target'
do
it
'adds a Copy Pods Resources build phase to each target'
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