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
0e297f05
Commit
0e297f05
authored
Apr 07, 2015
by
AliSoftware
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'mr-xcassets-revised' into ali-xcassets-1546
parents
99424503
ec560f3c
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
7 deletions
+30
-7
file_accessor.rb
lib/cocoapods/sandbox/file_accessor.rb
+11
-5
banana-lib.tar.gz
spec/fixtures/banana-lib.tar.gz
+0
-0
pod_source_installer_spec.rb
spec/unit/installer/pod_source_installer_spec.rb
+13
-2
file_accessor_spec.rb
spec/unit/sandbox/file_accessor_spec.rb
+1
-0
path_list_spec.rb
spec/unit/sandbox/path_list_spec.rb
+5
-0
No files found.
lib/cocoapods/sandbox/file_accessor.rb
View file @
0e297f05
...
@@ -124,8 +124,7 @@ module Pod
...
@@ -124,8 +124,7 @@ module Pod
header_files
-
private_headers
header_files
-
private_headers
end
end
# @return [Hash{ Symbol => Array<Pathname> }] the resources of the
# @return [Array<Pathname>] the resources of the specification.
# specification grouped by destination.
#
#
def
resources
def
resources
paths_for_attribute
(
:resources
,
true
)
paths_for_attribute
(
:resources
,
true
)
...
@@ -168,7 +167,7 @@ module Pod
...
@@ -168,7 +167,7 @@ module Pod
def
resource_bundles
def
resource_bundles
result
=
{}
result
=
{}
spec_consumer
.
resource_bundles
.
each
do
|
name
,
file_patterns
|
spec_consumer
.
resource_bundles
.
each
do
|
name
,
file_patterns
|
paths
=
expanded_paths
(
file_patterns
,
:include_dirs
=>
true
)
paths
=
expanded_paths
(
file_patterns
,
:include_dirs
=>
true
,
:exclude_patterns
=>
%w(**/*.xcassets)
)
result
[
name
]
=
paths
result
[
name
]
=
paths
end
end
result
result
...
@@ -257,12 +256,19 @@ module Pod
...
@@ -257,12 +256,19 @@ module Pod
# @param [Array<String>] patterns
# @param [Array<String>] patterns
# The patterns to expand.
# The patterns to expand.
#
#
# @param [String] dir_pattern
# @param [Hash] options
# The options to use to expand the patterns to file paths.
#
# @option options [String] :dir_pattern
# The pattern to add to directories.
# The pattern to add to directories.
#
#
# @
param [Array<String>]
exclude_patterns
# @
option options [Array<String>] :
exclude_patterns
# The exclude patterns to pass to the PathList.
# The exclude patterns to pass to the PathList.
#
#
# @option options [Bool] :include_dirs
# Whether directories should be also included or just plain
# files.
#
# @raise [Informative] If the pod does not exists.
# @raise [Informative] If the pod does not exists.
#
#
# @return [Array<Pathname>] A list of the paths.
# @return [Array<Pathname>] A list of the paths.
...
...
spec/fixtures/banana-lib.tar.gz
View file @
0e297f05
No preview for this file type
spec/unit/installer/pod_source_installer_spec.rb
View file @
0e297f05
...
@@ -25,7 +25,7 @@ module Pod
...
@@ -25,7 +25,7 @@ module Pod
config
.
sandbox
.
store_head_pod
(
'BananaLib'
)
config
.
sandbox
.
store_head_pod
(
'BananaLib'
)
@spec
.
source
=
{
:git
=>
SpecHelper
.
fixture
(
'banana-lib'
),
:tag
=>
'v1.0'
}
@spec
.
source
=
{
:git
=>
SpecHelper
.
fixture
(
'banana-lib'
),
:tag
=>
'v1.0'
}
@installer
.
install!
@installer
.
install!
@installer
.
specific_source
[
:commit
].
should
==
'
0b8b4084a43c38cfe308efa076fdeb3a64d9d2bc
'
@installer
.
specific_source
[
:commit
].
should
==
'
9c7802033af588bed9dd5cb089bc8998a65bbd29
'
pod_folder
=
config
.
sandbox
.
pod_dir
(
'BananaLib'
)
pod_folder
=
config
.
sandbox
.
pod_dir
(
'BananaLib'
)
pod_folder
.
should
.
exist
pod_folder
.
should
.
exist
end
end
...
@@ -45,7 +45,7 @@ module Pod
...
@@ -45,7 +45,7 @@ module Pod
sources
=
@installer
.
sandbox
.
checkout_sources
sources
=
@installer
.
sandbox
.
checkout_sources
sources
.
should
==
{
'BananaLib'
=>
{
sources
.
should
==
{
'BananaLib'
=>
{
:git
=>
SpecHelper
.
fixture
(
'banana-lib'
),
:git
=>
SpecHelper
.
fixture
(
'banana-lib'
),
:commit
=>
'
0b8b4084a43c38cfe308efa076fdeb3a64d9d2bc
'
},
:commit
=>
'
9c7802033af588bed9dd5cb089bc8998a65bbd29
'
},
}
}
end
end
...
@@ -180,13 +180,19 @@ module Pod
...
@@ -180,13 +180,19 @@ module Pod
paths
=
@installer
.
send
(
:used_files
)
paths
=
@installer
.
send
(
:used_files
)
relative_paths
=
paths
.
map
{
|
p
|
p
.
gsub
(
"
#{
temporary_directory
}
/"
,
''
)
}
relative_paths
=
paths
.
map
{
|
p
|
p
.
gsub
(
"
#{
temporary_directory
}
/"
,
''
)
}
relative_paths
.
sort
.
should
==
[
relative_paths
.
sort
.
should
==
[
'Pods/BananaLib/Bananalib.framework'
,
'Pods/BananaLib/Classes/Banana.h'
,
'Pods/BananaLib/Classes/Banana.h'
,
'Pods/BananaLib/Classes/Banana.m'
,
'Pods/BananaLib/Classes/Banana.m'
,
'Pods/BananaLib/Classes/BananaLib.pch'
,
'Pods/BananaLib/Classes/BananaLib.pch'
,
'Pods/BananaLib/Classes/BananaPrivate.h'
,
'Pods/BananaLib/Classes/BananaPrivate.h'
,
'Pods/BananaLib/Classes/BananaTrace.d'
,
'Pods/BananaLib/LICENSE'
,
'Pods/BananaLib/LICENSE'
,
'Pods/BananaLib/README'
,
'Pods/BananaLib/README'
,
'Pods/BananaLib/Resources/Images.xcassets'
,
'Pods/BananaLib/Resources/logo-sidebar.png'
,
'Pods/BananaLib/Resources/logo-sidebar.png'
,
'Pods/BananaLib/Resources/sub_dir'
,
'Pods/BananaLib/libBananalib.a'
,
'Pods/BananaLib/preserve_me.txt'
,
]
]
end
end
...
@@ -204,13 +210,18 @@ module Pod
...
@@ -204,13 +210,18 @@ module Pod
paths
=
@installer
.
send
(
:used_files
)
paths
=
@installer
.
send
(
:used_files
)
relative_paths
=
paths
.
map
{
|
p
|
p
.
gsub
(
"
#{
temporary_directory
}
/"
,
''
)
}
relative_paths
=
paths
.
map
{
|
p
|
p
.
gsub
(
"
#{
temporary_directory
}
/"
,
''
)
}
relative_paths
.
sort
.
should
==
[
relative_paths
.
sort
.
should
==
[
'Pods/BananaLib/Bananalib.framework'
,
'Pods/BananaLib/Classes/Banana.h'
,
'Pods/BananaLib/Classes/Banana.h'
,
'Pods/BananaLib/Classes/Banana.m'
,
'Pods/BananaLib/Classes/Banana.m'
,
'Pods/BananaLib/Classes/BananaLib.pch'
,
'Pods/BananaLib/Classes/BananaLib.pch'
,
'Pods/BananaLib/Classes/BananaPrivate.h'
,
'Pods/BananaLib/Classes/BananaPrivate.h'
,
'Pods/BananaLib/LICENSE'
,
'Pods/BananaLib/LICENSE'
,
'Pods/BananaLib/README'
,
'Pods/BananaLib/README'
,
'Pods/BananaLib/Resources/Images.xcassets'
,
'Pods/BananaLib/Resources/logo-sidebar.png'
,
'Pods/BananaLib/Resources/logo-sidebar.png'
,
'Pods/BananaLib/Resources/sub_dir'
,
'Pods/BananaLib/libBananalib.a'
,
'Pods/BananaLib/preserve_me.txt'
,
]
]
end
end
...
...
spec/unit/sandbox/file_accessor_spec.rb
View file @
0e297f05
...
@@ -100,6 +100,7 @@ module Pod
...
@@ -100,6 +100,7 @@ module Pod
it
'returns the resources'
do
it
'returns the resources'
do
@accessor
.
resources
.
sort
.
should
==
[
@accessor
.
resources
.
sort
.
should
==
[
@root
+
'Resources/Images.xcassets'
,
@root
+
'Resources/logo-sidebar.png'
,
@root
+
'Resources/logo-sidebar.png'
,
@root
+
'Resources/sub_dir'
,
@root
+
'Resources/sub_dir'
,
]
]
...
...
spec/unit/sandbox/path_list_spec.rb
View file @
0e297f05
...
@@ -21,6 +21,8 @@ module Pod
...
@@ -21,6 +21,8 @@ module Pod
Classes/BananaPrivate.h
Classes/BananaPrivate.h
Classes/BananaTrace.d
Classes/BananaTrace.d
README
README
Resources/Images.xcassets/Logo.imageset/Contents.json
Resources/Images.xcassets/Logo.imageset/logo.png
Resources/logo-sidebar.png
Resources/logo-sidebar.png
Resources/sub_dir/logo-sidebar.png
Resources/sub_dir/logo-sidebar.png
libBananalib.a
libBananalib.a
...
@@ -45,6 +47,8 @@ module Pod
...
@@ -45,6 +47,8 @@ module Pod
Bananalib.framework/Versions/Current
Bananalib.framework/Versions/Current
Classes
Classes
Resources
Resources
Resources/Images.xcassets
Resources/Images.xcassets/Logo.imageset
Resources/sub_dir
Resources/sub_dir
sub-dir
sub-dir
sub-dir/sub-dir-2
sub-dir/sub-dir-2
...
@@ -127,6 +131,7 @@ module Pod
...
@@ -127,6 +131,7 @@ module Pod
it
'can optionally include the directories in the results'
do
it
'can optionally include the directories in the results'
do
paths
=
@path_list
.
relative_glob
(
'Resources/*'
,
:include_dirs
=>
true
).
map
(
&
:to_s
)
paths
=
@path_list
.
relative_glob
(
'Resources/*'
,
:include_dirs
=>
true
).
map
(
&
:to_s
)
paths
.
sort
.
should
==
%w(
paths
.
sort
.
should
==
%w(
Resources/Images.xcassets
Resources/logo-sidebar.png
Resources/logo-sidebar.png
Resources/sub_dir
Resources/sub_dir
)
)
...
...
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