Commit 0e297f05 authored by AliSoftware's avatar AliSoftware

Merge branch 'mr-xcassets-revised' into ali-xcassets-1546

parents 99424503 ec560f3c
...@@ -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
...@@ -254,15 +253,22 @@ module Pod ...@@ -254,15 +253,22 @@ module Pod
# Matches the given patterns to the file present in the root of the path # Matches the given patterns to the file present in the root of the path
# list. # list.
# #
# @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.
......
...@@ -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
......
...@@ -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',
] ]
......
...@@ -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
) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment