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
fdf990bb
Commit
fdf990bb
authored
Feb 26, 2016
by
Marius Rackwitz
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4954 from CocoaPods/mr-fix-resource-bundles
Fix resource bundle paths for improved deduplication
parents
9e215a01
38fef694
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
12 deletions
+31
-12
CHANGELOG.md
CHANGELOG.md
+3
-1
aggregate_target_installer.rb
.../installer/target_installer/aggregate_target_installer.rb
+11
-8
cocoapods-integration-specs
spec/cocoapods-integration-specs
+1
-1
aggregate_target_installer_spec.rb
...aller/target_installer/aggregate_target_installer_spec.rb
+16
-2
No files found.
CHANGELOG.md
View file @
fdf990bb
...
@@ -12,7 +12,9 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
...
@@ -12,7 +12,9 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
##### Bug Fixes
##### Bug Fixes
*
None.
*
Fixes paths passed for resources bundles in the copy resources script.
[
Marius Rackwitz
](
https://github.com/mrackwitz
)
[
#4954
](
https://github.com/CocoaPods/CocoaPods/pull/4954
)
## 1.0.0.beta.4 (2016-02-24)
## 1.0.0.beta.4 (2016-02-24)
...
...
lib/cocoapods/installer/target_installer/aggregate_target_installer.rb
View file @
fdf990bb
...
@@ -107,15 +107,18 @@ module Pod
...
@@ -107,15 +107,18 @@ module Pod
library_targets
=
target
.
pod_targets
.
reject
do
|
pod_target
|
library_targets
=
target
.
pod_targets
.
reject
do
|
pod_target
|
pod_target
.
should_build?
&&
pod_target
.
requires_frameworks?
pod_target
.
should_build?
&&
pod_target
.
requires_frameworks?
end
end
resources_by_config
=
{}
target
.
user_build_configurations
.
keys
.
each_with_object
({})
do
|
config
,
resources_by_config
|
target
.
user_build_configurations
.
keys
.
each
do
|
config
|
resources_by_config
[
config
]
=
library_targets
.
flat_map
do
|
library_target
|
file_accessors
=
library_targets
.
select
{
|
t
|
t
.
include_in_build_config?
(
target_definition
,
config
)
}.
flat_map
(
&
:file_accessors
)
next
[]
unless
library_target
.
include_in_build_config?
(
target_definition
,
config
)
resource_paths
=
file_accessors
.
flat_map
{
|
accessor
|
accessor
.
resources
.
flat_map
{
|
res
|
res
.
relative_path_from
(
project
.
path
.
dirname
)
}
}
resource_paths
=
library_target
.
file_accessors
.
flat_map
do
|
accessor
|
resource_bundles
=
file_accessors
.
flat_map
{
|
accessor
|
accessor
.
resource_bundles
.
keys
.
map
{
|
name
|
"${BUILT_PRODUCTS_DIR}/
#{
name
.
shellescape
}
.bundle"
}
}
accessor
.
resources
.
flat_map
{
|
res
|
res
.
relative_path_from
(
project
.
path
.
dirname
)
}
resources_by_config
[
config
]
=
(
resource_paths
+
resource_bundles
).
uniq
end
resources_by_config
[
config
]
<<
bridge_support_file
if
bridge_support_file
resource_bundles
=
library_target
.
file_accessors
.
flat_map
do
|
accessor
|
accessor
.
resource_bundles
.
keys
.
map
{
|
name
|
"
#{
library_target
.
configuration_build_dir
}
/
#{
name
.
shellescape
}
.bundle"
}
end
(
resource_paths
+
resource_bundles
+
[
bridge_support_file
].
compact
).
uniq
end
end
end
resources_by_config
end
end
# Creates a script that copies the resources to the bundle of the client
# Creates a script that copies the resources to the bundle of the client
...
...
cocoapods-integration-specs
@
af3e74dc
Subproject commit
47109cc7cb10a3b17fa7c57437b3895448a79789
Subproject commit
af3e74dcca333d15396a1ca60e7552277e0a9926
spec/unit/installer/target_installer/aggregate_target_installer_spec.rb
View file @
fdf990bb
...
@@ -150,10 +150,24 @@ module Pod
...
@@ -150,10 +150,24 @@ module Pod
script
.
read
.
should
.
not
.
include?
(
'logo-sidebar.png'
)
script
.
read
.
should
.
not
.
include?
(
'logo-sidebar.png'
)
end
end
xit
'adds the resources bundles to the copy resources script'
do
it
'adds the resources bundles to the copy resources script'
do
@pod_target
.
file_accessors
.
first
.
stubs
(
:resource_bundles
).
returns
(
'Trees'
=>
[
Pathname
(
'palm.jpg'
)],
'Leafs'
=>
[
Pathname
(
'leaf.jpg'
)],
)
resources_by_config
=
@installer
.
send
(
:resources_by_config
)
resources_by_config
.
each_value
do
|
resources
|
resources
.
should
.
include
'$CONFIGURATION_BUILD_DIR/BananaLib/Trees.bundle'
resources
.
should
.
include
'$CONFIGURATION_BUILD_DIR/BananaLib/Leafs.bundle'
end
end
end
xit
'adds the bridge support file to the copy resources script, if one was created'
do
it
'adds the bridge support file to the copy resources script, if one was created'
do
@installer
.
stubs
(
:bridge_support_file
).
returns
(
@installer
.
target
.
bridge_support_path
)
resources_by_config
=
@installer
.
send
(
:resources_by_config
)
resources_by_config
.
each_value
do
|
resources
|
resources
.
should
.
include
@installer
.
target
.
bridge_support_path
end
end
end
it
'does add pods to the embed frameworks script'
do
it
'does add pods to the embed frameworks script'
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