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
08ea793e
Commit
08ea793e
authored
Apr 23, 2018
by
Samuel Giddins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[BuildSettings] Link vendored static frameworks into dynamic framework pod targets
parent
29f2b7bd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
90 additions
and
5 deletions
+90
-5
build_settings.rb
lib/cocoapods/target/build_settings.rb
+3
-1
aggregate_target_settings_spec.rb
...t/target/build_settings/aggregate_target_settings_spec.rb
+86
-3
pod_target_settings_spec.rb
spec/unit/target/build_settings/pod_target_settings_spec.rb
+1
-1
No files found.
lib/cocoapods/target/build_settings.rb
View file @
08ea793e
...
...
@@ -520,6 +520,7 @@ module Pod
return
[]
if
(
!
target
.
requires_frameworks?
||
target
.
static_framework?
)
&&
!
test_xcconfig?
frameworks
=
vendored_dynamic_frameworks
.
map
{
|
l
|
File
.
basename
(
l
,
'.framework'
)
}
frameworks
.
concat
vendored_static_frameworks
.
map
{
|
l
|
File
.
basename
(
l
,
'.framework'
)
}
unless
test_xcconfig?
frameworks
.
concat
consumer_frameworks
frameworks
.
concat
dependent_targets
.
flat_map
{
|
pt
|
pt
.
build_settings
.
dynamic_frameworks_to_import
}
frameworks
.
concat
dependent_targets
.
flat_map
{
|
pt
|
pt
.
build_settings
.
static_frameworks_to_import
}
if
test_xcconfig?
...
...
@@ -528,7 +529,8 @@ module Pod
# @return [Array<String>]
define_build_settings_method
:static_frameworks_to_import
,
:memoized
=>
true
do
static_frameworks_to_import
=
vendored_static_frameworks
.
map
{
|
f
|
File
.
basename
(
f
,
'.framework'
)
}
static_frameworks_to_import
=
[]
static_frameworks_to_import
.
concat
vendored_static_frameworks
.
map
{
|
f
|
File
.
basename
(
f
,
'.framework'
)
}
unless
target
.
should_build?
&&
target
.
requires_frameworks?
&&
!
target
.
static_framework?
static_frameworks_to_import
<<
target
.
product_basename
if
target
.
should_build?
&&
target
.
requires_frameworks?
&&
target
.
static_framework?
static_frameworks_to_import
end
...
...
spec/unit/target/build_settings/aggregate_target_settings_spec.rb
View file @
08ea793e
...
...
@@ -209,8 +209,7 @@ module Pod
pod_target
=
stub
(
'pod_target'
,
:file_accessors
=>
[
file_accessor
],
:spec_consumers
=>
[
consumer
],
:requires_frameworks?
=>
true
,
:static_framework?
=>
false
,
:requires_frameworks?
=>
false
,
:dependent_targets
=>
[],
:recursive_dependent_targets
=>
[],
:sandbox
=>
config
.
sandbox
,
...
...
@@ -225,7 +224,7 @@ module Pod
pod_target
.
stubs
(
:build_settings
=>
PodTargetSettings
.
new
(
pod_target
,
false
))
aggregate_target
=
fixture_aggregate_target
([
pod_target
])
@generator
=
AggregateTargetSettings
.
new
(
aggregate_target
,
'Debug'
)
@generator
.
other_ldflags
.
should
==
%w(-ObjC -l"
StaticLibrary" -l"VendoredDyld" -l"xml2" -framework "PodTarget
" -framework "StaticFramework" -framework "VendoredFramework" -framework "XCTest")
@generator
.
other_ldflags
.
should
==
%w(-ObjC -l"
PodTarget" -l"StaticLibrary" -l"VendoredDyld" -l"xml2
" -framework "StaticFramework" -framework "VendoredFramework" -framework "XCTest")
end
end
...
...
@@ -414,6 +413,90 @@ module Pod
@target_definition
.
stubs
(
:swift_version
).
returns
(
'2.3'
)
@generator
.
generate
.
to_hash
.
key?
(
'EMBEDDED_CONTENT_CONTAINS_SWIFT'
).
should
==
false
end
it
'does propagate framework or libraries from a non test specification to an aggregate target'
do
target_definition
=
stub
(
'target_definition'
,
:inheritance
=>
'complete'
,
:abstract?
=>
false
,
:podfile
=>
Podfile
.
new
,
:platform
=>
Platform
.
ios
)
spec
=
stub
(
'spec'
,
:test_specification?
=>
false
)
consumer
=
stub
(
'consumer'
,
:libraries
=>
[
'xml2'
],
:frameworks
=>
[
'XCTest'
],
:weak_frameworks
=>
[],
:spec
=>
spec
,
)
file_accessor
=
stub
(
'file_accessor'
,
:spec
=>
spec
,
:spec_consumer
=>
consumer
,
:vendored_static_frameworks
=>
[
config
.
sandbox
.
root
+
'StaticFramework.framework'
],
:vendored_static_libraries
=>
[
config
.
sandbox
.
root
+
'StaticLibrary.a'
],
:vendored_dynamic_frameworks
=>
[
config
.
sandbox
.
root
+
'VendoredFramework.framework'
],
:vendored_dynamic_libraries
=>
[
config
.
sandbox
.
root
+
'VendoredDyld.dyld'
],
)
file_accessor
.
stubs
(
:vendored_frameworks
=>
file_accessor
.
vendored_static_frameworks
+
file_accessor
.
vendored_dynamic_frameworks
,
:vendored_dynamic_artifacts
=>
file_accessor
.
vendored_dynamic_frameworks
+
file_accessor
.
vendored_dynamic_libraries
,
:vendored_static_artifacts
=>
file_accessor
.
vendored_static_frameworks
+
file_accessor
.
vendored_static_libraries
)
pod_target
=
stub
(
'pod_target'
,
:file_accessors
=>
[
file_accessor
],
:spec_consumers
=>
[
consumer
],
:requires_frameworks?
=>
true
,
:static_framework?
=>
false
,
:dependent_targets
=>
[],
:recursive_dependent_targets
=>
[],
:sandbox
=>
config
.
sandbox
,
:should_build?
=>
true
,
:configuration_build_dir
=>
'CBD'
,
:include_in_build_config?
=>
true
,
:uses_swift?
=>
false
,
:build_product_path
=>
'BPP'
,
:product_basename
=>
'PodTarget'
,
:target_definitions
=>
[
target_definition
],
)
pod_target
.
stubs
(
:build_settings
=>
PodTargetSettings
.
new
(
pod_target
,
false
))
aggregate_target
=
fixture_aggregate_target
([
pod_target
])
@generator
=
AggregateTargetSettings
.
new
(
aggregate_target
,
'Debug'
)
@generator
.
other_ldflags
.
should
==
%w(-ObjC -l"StaticLibrary" -l"VendoredDyld" -l"xml2" -framework "PodTarget" -framework "VendoredFramework" -framework "XCTest")
end
it
'does propagate framework or libraries from a non test specification static framework to an aggregate target'
do
target_definition
=
stub
(
'target_definition'
,
:inheritance
=>
'complete'
,
:abstract?
=>
false
,
:podfile
=>
Podfile
.
new
,
:platform
=>
Platform
.
ios
)
spec
=
stub
(
'spec'
,
:test_specification?
=>
false
)
consumer
=
stub
(
'consumer'
,
:libraries
=>
[
'xml2'
],
:frameworks
=>
[
'XCTest'
],
:weak_frameworks
=>
[],
:spec
=>
spec
,
)
file_accessor
=
stub
(
'file_accessor'
,
:spec
=>
spec
,
:spec_consumer
=>
consumer
,
:vendored_static_frameworks
=>
[
config
.
sandbox
.
root
+
'StaticFramework.framework'
],
:vendored_static_libraries
=>
[
config
.
sandbox
.
root
+
'StaticLibrary.a'
],
:vendored_dynamic_frameworks
=>
[
config
.
sandbox
.
root
+
'VendoredFramework.framework'
],
:vendored_dynamic_libraries
=>
[
config
.
sandbox
.
root
+
'VendoredDyld.dyld'
],
)
file_accessor
.
stubs
(
:vendored_frameworks
=>
file_accessor
.
vendored_static_frameworks
+
file_accessor
.
vendored_dynamic_frameworks
,
:vendored_dynamic_artifacts
=>
file_accessor
.
vendored_dynamic_frameworks
+
file_accessor
.
vendored_dynamic_libraries
,
:vendored_static_artifacts
=>
file_accessor
.
vendored_static_frameworks
+
file_accessor
.
vendored_static_libraries
)
pod_target
=
stub
(
'pod_target'
,
:file_accessors
=>
[
file_accessor
],
:spec_consumers
=>
[
consumer
],
:requires_frameworks?
=>
true
,
:static_framework?
=>
true
,
:dependent_targets
=>
[],
:recursive_dependent_targets
=>
[],
:sandbox
=>
config
.
sandbox
,
:should_build?
=>
true
,
:configuration_build_dir
=>
'CBD'
,
:include_in_build_config?
=>
true
,
:uses_swift?
=>
false
,
:build_product_path
=>
'BPP'
,
:product_basename
=>
'PodTarget'
,
:target_definitions
=>
[
target_definition
],
)
pod_target
.
stubs
(
:build_settings
=>
PodTargetSettings
.
new
(
pod_target
,
false
))
aggregate_target
=
fixture_aggregate_target
([
pod_target
])
@generator
=
AggregateTargetSettings
.
new
(
aggregate_target
,
'Debug'
)
@generator
.
other_ldflags
.
should
==
%w(-ObjC -l"StaticLibrary" -l"VendoredDyld" -l"xml2" -framework "PodTarget" -framework "StaticFramework" -framework "VendoredFramework" -framework "XCTest")
end
end
#-----------------------------------------------------------------------#
...
...
spec/unit/target/build_settings/pod_target_settings_spec.rb
View file @
08ea793e
...
...
@@ -220,7 +220,7 @@ module Pod
@generator
.
spec_consumers
.
each
{
|
sc
|
sc
.
stubs
(
:frameworks
=>
[])
}
@generator
.
stubs
(
:dependent_targets
=>
[
pod_target
])
@generator
.
send
:__clear__
@generator
.
other_ldflags
.
should
.
be
==
%w(-l"VendoredDyld" -l"xml2" -framework "VendoredFramework" -framework "XCTest" -weak_framework "iAd")
@generator
.
other_ldflags
.
should
.
be
==
%w(-l"VendoredDyld" -l"xml2" -framework "
Bananalib" -framework "
VendoredFramework" -framework "XCTest" -weak_framework "iAd")
end
end
...
...
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