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
5b1e1d1f
Commit
5b1e1d1f
authored
Feb 26, 2016
by
Marius Rackwitz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[AggregateTargetInstaller] Fix resource bundle paths
parent
72c8e833
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
9 deletions
+21
-9
aggregate_target_installer.rb
.../installer/target_installer/aggregate_target_installer.rb
+11
-8
aggregate_target_installer_spec.rb
...aller/target_installer/aggregate_target_installer_spec.rb
+10
-1
No files found.
lib/cocoapods/installer/target_installer/aggregate_target_installer.rb
View file @
5b1e1d1f
...
@@ -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
...
...
spec/unit/installer/target_installer/aggregate_target_installer_spec.rb
View file @
5b1e1d1f
...
@@ -150,7 +150,16 @@ module Pod
...
@@ -150,7 +150,16 @@ 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
it
'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
...
...
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