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
fc373229
Commit
fc373229
authored
Jul 17, 2015
by
Samuel E. Giddins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FileAccessor] Partition dynamic and static vendored artifacts
parent
338a8400
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
5 deletions
+29
-5
aggregate_xcconfig.rb
lib/cocoapods/generator/xcconfig/aggregate_xcconfig.rb
+1
-1
installer.rb
lib/cocoapods/installer.rb
+1
-2
file_accessor.rb
lib/cocoapods/sandbox/file_accessor.rb
+25
-0
validator.rb
lib/cocoapods/validator.rb
+2
-2
No files found.
lib/cocoapods/generator/xcconfig/aggregate_xcconfig.rb
View file @
fc373229
...
@@ -53,7 +53,7 @@ module Pod
...
@@ -53,7 +53,7 @@ module Pod
#
#
def
generate
def
generate
includes_static_libs
=
!
target
.
requires_frameworks?
includes_static_libs
=
!
target
.
requires_frameworks?
includes_static_libs
||=
pod_targets
.
flat_map
(
&
:file_accessors
).
any?
{
|
fa
|
!
fa
.
vendored_
librarie
s
.
empty?
}
includes_static_libs
||=
pod_targets
.
flat_map
(
&
:file_accessors
).
any?
{
|
fa
|
!
fa
.
vendored_
static_libraries
.
empty?
||
!
fa
.
vendored_static_framework
s
.
empty?
}
config
=
{
config
=
{
'OTHER_LDFLAGS'
=>
'$(inherited) '
+
XCConfigHelper
.
default_ld_flags
(
target
,
includes_static_libs
),
'OTHER_LDFLAGS'
=>
'$(inherited) '
+
XCConfigHelper
.
default_ld_flags
(
target
,
includes_static_libs
),
'PODS_ROOT'
=>
target
.
relative_pods_root
,
'PODS_ROOT'
=>
target
.
relative_pods_root
,
...
...
lib/cocoapods/installer.rb
View file @
fc373229
...
@@ -418,8 +418,7 @@ module Pod
...
@@ -418,8 +418,7 @@ module Pod
dependended_upon_targets
=
pod_targets
.
select
{
|
t
|
dependencies
.
include?
(
t
.
pod_name
)
&&
!
t
.
should_build?
}
dependended_upon_targets
=
pod_targets
.
select
{
|
t
|
dependencies
.
include?
(
t
.
pod_name
)
&&
!
t
.
should_build?
}
static_libs
=
dependended_upon_targets
.
flat_map
(
&
:file_accessors
).
flat_map
do
|
fa
|
static_libs
=
dependended_upon_targets
.
flat_map
(
&
:file_accessors
).
flat_map
do
|
fa
|
static_frameworks
=
fa
.
vendored_frameworks
.
reject
{
|
fw
|
`file
#{
fw
+
fw
.
basename
(
'.framework'
)
}
2>&1`
=~
/dynamically linked/
}
fa
.
vendored_static_libraries
+
fa
.
vendored_static_frameworks
fa
.
vendored_libraries
+
static_frameworks
end
end
unless
static_libs
.
empty?
unless
static_libs
.
empty?
...
...
lib/cocoapods/sandbox/file_accessor.rb
View file @
fc373229
...
@@ -152,6 +152,16 @@ module Pod
...
@@ -152,6 +152,16 @@ module Pod
paths_for_attribute
(
:vendored_frameworks
,
true
)
paths_for_attribute
(
:vendored_frameworks
,
true
)
end
end
def
vendored_dynamic_frameworks
vendored_frameworks
.
select
do
|
framework
|
dynamic_binary?
(
framework
+
framework
.
basename
(
'.*'
))
end
end
def
vendored_static_frameworks
vendored_frameworks
-
vendored_dynamic_frameworks
end
# @param [Pathname] framework
# @param [Pathname] framework
# The vendored framework to search into.
# The vendored framework to search into.
# @return [Pathname] The path of the header directory of the
# @return [Pathname] The path of the header directory of the
...
@@ -187,6 +197,16 @@ module Pod
...
@@ -187,6 +197,16 @@ module Pod
paths_for_attribute
(
:vendored_libraries
)
paths_for_attribute
(
:vendored_libraries
)
end
end
def
vendored_dynamic_libraries
vendored_libraries
.
select
do
|
library
|
dynamic_binary?
(
library
)
end
end
def
vendored_static_libraries
vendored_libraries
-
vendored_dynamic_libraries
end
# @return [Hash{String => Array<Pathname>}] A hash that describes the
# @return [Hash{String => Array<Pathname>}] A hash that describes the
# resource bundles of the Pod. The keys represent the name of
# resource bundles of the Pod. The keys represent the name of
# the bundle while the values the path of the resources.
# the bundle while the values the path of the resources.
...
@@ -315,6 +335,11 @@ module Pod
...
@@ -315,6 +335,11 @@ module Pod
result
.
flatten
.
compact
.
uniq
result
.
flatten
.
compact
.
uniq
end
end
def
dynamic_binary?
(
binary
)
return
unless
binary
.
file?
Executable
.
execute_command
(
'file'
,
[
binary
],
false
)
=~
/dynamically linked/
end
#-----------------------------------------------------------------------#
#-----------------------------------------------------------------------#
end
end
end
end
...
...
lib/cocoapods/validator.rb
View file @
fc373229
...
@@ -382,8 +382,8 @@ module Pod
...
@@ -382,8 +382,8 @@ module Pod
deployment_target
=
spec
.
subspec_by_name
(
subspec_name
).
deployment_target
(
consumer
.
platform_name
)
deployment_target
=
spec
.
subspec_by_name
(
subspec_name
).
deployment_target
(
consumer
.
platform_name
)
unless
file_accessor
.
nil?
unless
file_accessor
.
nil?
dynamic_frameworks
=
file_accessor
.
vendored_
frameworks
.
select
{
|
fw
|
`file
#{
fw
+
fw
.
basename
(
'.framework'
)
}
2>&1`
=~
/dynamically linked/
}
dynamic_frameworks
=
file_accessor
.
vendored_
dynamic_frameworks
dynamic_libraries
=
file_accessor
.
vendored_
libraries
.
select
{
|
lib
|
`file
#{
lib
}
2>&1`
=~
/dynamically linked/
}
dynamic_libraries
=
file_accessor
.
vendored_
dynamic_libraries
if
(
dynamic_frameworks
.
count
>
0
||
dynamic_libraries
.
count
>
0
)
&&
consumer
.
platform_name
==
:ios
&&
if
(
dynamic_frameworks
.
count
>
0
||
dynamic_libraries
.
count
>
0
)
&&
consumer
.
platform_name
==
:ios
&&
(
deployment_target
.
nil?
||
Version
.
new
(
deployment_target
).
major
<
8
)
(
deployment_target
.
nil?
||
Version
.
new
(
deployment_target
).
major
<
8
)
error
(
'dynamic'
,
'Dynamic frameworks and libraries are only supported on iOS 8.0 and onwards.'
)
error
(
'dynamic'
,
'Dynamic frameworks and libraries are only supported on iOS 8.0 and onwards.'
)
...
...
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