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
3f54a47d
Commit
3f54a47d
authored
Apr 07, 2015
by
AliSoftware
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[xcassets] Fix / Deactivate some specs no longer relevant
parent
0e297f05
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
9 deletions
+21
-9
aggregate_target_installer.rb
.../installer/target_installer/aggregate_target_installer.rb
+5
-1
copy_resources_script_spec.rb
spec/unit/generator/copy_resources_script_spec.rb
+7
-4
file_references_installer_spec.rb
spec/unit/installer/file_references_installer_spec.rb
+4
-1
aggregate_target_installer_spec.rb
...aller/target_installer/aggregate_target_installer_spec.rb
+5
-3
No files found.
lib/cocoapods/installer/target_installer/aggregate_target_installer.rb
View file @
3f54a47d
...
@@ -113,7 +113,11 @@ module Pod
...
@@ -113,7 +113,11 @@ module Pod
resources_by_config
=
{}
resources_by_config
=
{}
target
.
user_build_configurations
.
keys
.
each
do
|
config
|
target
.
user_build_configurations
.
keys
.
each
do
|
config
|
file_accessors
=
library_targets
.
select
{
|
t
|
t
.
include_in_build_config?
(
config
)
}.
flat_map
(
&
:file_accessors
)
file_accessors
=
library_targets
.
select
{
|
t
|
t
.
include_in_build_config?
(
config
)
}.
flat_map
(
&
:file_accessors
)
resource_bundles
=
file_accessors
.
flat_map
{
|
accessor
|
accessor
.
resource_bundles
.
keys
.
map
{
|
name
|
"${BUILT_PRODUCTS_DIR}/
#{
name
.
shellescape
}
.bundle"
}
}
resource_bundles
=
file_accessors
.
flat_map
do
|
accessor
|
accessor
.
resource_bundles
.
keys
.
map
do
|
name
|
Pathname
.
new
"${BUILT_PRODUCTS_DIR}/
#{
name
.
shellescape
}
.bundle"
end
end
resources_by_config
[
config
]
=
resource_bundles
.
uniq
resources_by_config
[
config
]
=
resource_bundles
.
uniq
resources_by_config
[
config
]
<<
bridge_support_file
if
bridge_support_file
resources_by_config
[
config
]
<<
bridge_support_file
if
bridge_support_file
end
end
...
...
spec/unit/generator/copy_resources_script_spec.rb
View file @
3f54a47d
require
File
.
expand_path
(
'../../../spec_helper'
,
__FILE__
)
require
File
.
expand_path
(
'../../../spec_helper'
,
__FILE__
)
# TODO: The Copy Resources Script is soon to be deprecated with PR #3263
# We probably will remove all those family of specs
#
module
Pod
module
Pod
describe
Generator
::
CopyResourcesScript
do
describe
Generator
::
CopyResourcesScript
do
it
'returns the copy resources script'
do
x
it
'returns the copy resources script'
do
resources
=
{
'Release'
=>
[
'path/to/resource.png'
]
}
resources
=
{
'Release'
=>
[
'path/to/resource.png'
]
}
generator
=
Pod
::
Generator
::
CopyResourcesScript
.
new
(
resources
,
Platform
.
new
(
:ios
,
'6.0'
))
generator
=
Pod
::
Generator
::
CopyResourcesScript
.
new
(
resources
,
Platform
.
new
(
:ios
,
'6.0'
))
generator
.
send
(
:script
).
should
.
include
'path/to/resource.png'
generator
.
send
(
:script
).
should
.
include
'path/to/resource.png'
generator
.
send
(
:script
).
should
.
include
'storyboard'
generator
.
send
(
:script
).
should
.
include
'storyboard'
end
end
it
'instructs ibtool to use the --reference-external-strings-file if set to do so'
do
x
it
'instructs ibtool to use the --reference-external-strings-file if set to do so'
do
resources
=
{
'Release'
=>
[
'path/to/resource.png'
]
}
resources
=
{
'Release'
=>
[
'path/to/resource.png'
]
}
generator_1
=
Pod
::
Generator
::
CopyResourcesScript
.
new
(
resources
,
Platform
.
new
(
:ios
,
'4.0'
))
generator_1
=
Pod
::
Generator
::
CopyResourcesScript
.
new
(
resources
,
Platform
.
new
(
:ios
,
'4.0'
))
generator_2
=
Pod
::
Generator
::
CopyResourcesScript
.
new
(
resources
,
Platform
.
new
(
:ios
,
'6.0'
))
generator_2
=
Pod
::
Generator
::
CopyResourcesScript
.
new
(
resources
,
Platform
.
new
(
:ios
,
'6.0'
))
...
@@ -18,7 +21,7 @@ module Pod
...
@@ -18,7 +21,7 @@ module Pod
generator_2
.
send
(
:script
).
should
.
include
'--reference-external-strings-file'
generator_2
.
send
(
:script
).
should
.
include
'--reference-external-strings-file'
end
end
it
'adds configuration dependent resources with a call wrapped in an if statement'
do
x
it
'adds configuration dependent resources with a call wrapped in an if statement'
do
resources
=
{
'Debug'
=>
%w(Lookout.framework)
}
resources
=
{
'Debug'
=>
%w(Lookout.framework)
}
generator
=
Pod
::
Generator
::
CopyResourcesScript
.
new
(
resources
,
Platform
.
new
(
:ios
,
'6.0'
))
generator
=
Pod
::
Generator
::
CopyResourcesScript
.
new
(
resources
,
Platform
.
new
(
:ios
,
'6.0'
))
script
=
generator
.
send
(
:script
)
script
=
generator
.
send
(
:script
)
...
@@ -29,7 +32,7 @@ module Pod
...
@@ -29,7 +32,7 @@ module Pod
eos
eos
end
end
it
'adds resource bundles with a call wrapped in an if statement'
do
x
it
'adds resource bundles with a call wrapped in an if statement'
do
resources
=
{
'Debug'
=>
%w(${BUILT_PRODUCTS_DIR}/Resources.bundle)
}
resources
=
{
'Debug'
=>
%w(${BUILT_PRODUCTS_DIR}/Resources.bundle)
}
generator
=
Pod
::
Generator
::
CopyResourcesScript
.
new
(
resources
,
Platform
.
new
(
:ios
,
'6.0'
))
generator
=
Pod
::
Generator
::
CopyResourcesScript
.
new
(
resources
,
Platform
.
new
(
:ios
,
'6.0'
))
script
=
generator
.
send
(
:script
)
script
=
generator
.
send
(
:script
)
...
...
spec/unit/installer/file_references_installer_spec.rb
View file @
3f54a47d
...
@@ -42,7 +42,10 @@ module Pod
...
@@ -42,7 +42,10 @@ module Pod
file_ref
.
path
.
should
==
'libBananalib.a'
file_ref
.
path
.
should
==
'libBananalib.a'
end
end
it
'adds the files references of the resources the Pods project'
do
# TODO: Remove this as PR #3263 does not add the resources to the Pods project anymore
# But we should replace this with a spec that tests that resources are added
# to the User's project instead
xit
'adds the files references of the resources the Pods project'
do
@installer
.
install!
@installer
.
install!
file_ref
=
@installer
.
pods_project
[
'Pods/BananaLib/Resources/logo-sidebar.png'
]
file_ref
=
@installer
.
pods_project
[
'Pods/BananaLib/Resources/logo-sidebar.png'
]
file_ref
.
should
.
be
.
not
.
nil
file_ref
.
should
.
be
.
not
.
nil
...
...
spec/unit/installer/target_installer/aggregate_target_installer_spec.rb
View file @
3f54a47d
...
@@ -134,7 +134,8 @@ module Pod
...
@@ -134,7 +134,8 @@ module Pod
@installer
.
install!
@installer
.
install!
end
end
it
'creates a create copy resources script'
do
# TODO: Remove this; the Copy Resources Script will soon be obsoleted by PR #3263
xit
'creates a create copy resources script'
do
@installer
.
install!
@installer
.
install!
support_files_dir
=
config
.
sandbox
.
target_support_files_dir
(
'Pods'
)
support_files_dir
=
config
.
sandbox
.
target_support_files_dir
(
'Pods'
)
script
=
support_files_dir
+
'Pods-resources.sh'
script
=
support_files_dir
+
'Pods-resources.sh'
...
@@ -166,16 +167,17 @@ module Pod
...
@@ -166,16 +167,17 @@ module Pod
it
'uniques resources by config'
do
it
'uniques resources by config'
do
a_path
=
Pathname
.
new
(
@project
.
path
.
dirname
+
'/duplicated/path.jpg'
)
a_path
=
Pathname
.
new
(
@project
.
path
.
dirname
+
'/duplicated/path.jpg'
)
a_bundle_name
=
'banana'
duplicated_paths
=
[
a_path
,
a_path
]
duplicated_paths
=
[
a_path
,
a_path
]
@installer
.
target
.
pod_targets
.
each
do
|
pod_target
|
@installer
.
target
.
pod_targets
.
each
do
|
pod_target
|
pod_target
.
file_accessors
.
each
do
|
accessor
|
pod_target
.
file_accessors
.
each
do
|
accessor
|
accessor
.
stubs
(
:resource
s
=>
duplicated_paths
)
accessor
.
stubs
(
:resource
_bundles
=>
{
a_bundle_name
=>
duplicated_paths
}
)
end
end
end
end
resources_by_config
=
@installer
.
send
(
:resources_by_config
)
resources_by_config
=
@installer
.
send
(
:resources_by_config
)
resources_by_config
.
each_value
do
|
resources
|
resources_by_config
.
each_value
do
|
resources
|
resources
.
length
.
should
==
1
resources
.
length
.
should
==
1
resources
[
0
].
basename
.
should
==
a_path
.
basename
resources
[
0
].
basename
.
to_s
.
should
==
a_bundle_name
+
'.bundle'
end
end
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