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
header_files - private_headers
end
# @return [Hash{ Symbol => Array<Pathname> }] the resources of the
# specification grouped by destination.
# @return [Array<Pathname>] the resources of the specification.
#
def resources
paths_for_attribute(:resources, true)
......@@ -168,7 +167,7 @@ module Pod
def resource_bundles
result = {}
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
end
result
......@@ -257,12 +256,19 @@ module Pod
# @param [Array<String>] patterns
# 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.
#
# @param [Array<String>] exclude_patterns
# @option options [Array<String>] :exclude_patterns
# 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.
#
# @return [Array<Pathname>] A list of the paths.
......
......@@ -25,7 +25,7 @@ module Pod
config.sandbox.store_head_pod('BananaLib')
@spec.source = { :git => SpecHelper.fixture('banana-lib'), :tag => 'v1.0' }
@installer.install!
@installer.specific_source[:commit].should == '0b8b4084a43c38cfe308efa076fdeb3a64d9d2bc'
@installer.specific_source[:commit].should == '9c7802033af588bed9dd5cb089bc8998a65bbd29'
pod_folder = config.sandbox.pod_dir('BananaLib')
pod_folder.should.exist
end
......@@ -45,7 +45,7 @@ module Pod
sources = @installer.sandbox.checkout_sources
sources.should == { 'BananaLib' => {
:git => SpecHelper.fixture('banana-lib'),
:commit => '0b8b4084a43c38cfe308efa076fdeb3a64d9d2bc' },
:commit => '9c7802033af588bed9dd5cb089bc8998a65bbd29' },
}
end
......@@ -180,13 +180,19 @@ module Pod
paths = @installer.send(:used_files)
relative_paths = paths.map { |p| p.gsub("#{temporary_directory}/", '') }
relative_paths.sort.should == [
'Pods/BananaLib/Bananalib.framework',
'Pods/BananaLib/Classes/Banana.h',
'Pods/BananaLib/Classes/Banana.m',
'Pods/BananaLib/Classes/BananaLib.pch',
'Pods/BananaLib/Classes/BananaPrivate.h',
'Pods/BananaLib/Classes/BananaTrace.d',
'Pods/BananaLib/LICENSE',
'Pods/BananaLib/README',
'Pods/BananaLib/Resources/Images.xcassets',
'Pods/BananaLib/Resources/logo-sidebar.png',
'Pods/BananaLib/Resources/sub_dir',
'Pods/BananaLib/libBananalib.a',
'Pods/BananaLib/preserve_me.txt',
]
end
......@@ -204,13 +210,18 @@ module Pod
paths = @installer.send(:used_files)
relative_paths = paths.map { |p| p.gsub("#{temporary_directory}/", '') }
relative_paths.sort.should == [
'Pods/BananaLib/Bananalib.framework',
'Pods/BananaLib/Classes/Banana.h',
'Pods/BananaLib/Classes/Banana.m',
'Pods/BananaLib/Classes/BananaLib.pch',
'Pods/BananaLib/Classes/BananaPrivate.h',
'Pods/BananaLib/LICENSE',
'Pods/BananaLib/README',
'Pods/BananaLib/Resources/Images.xcassets',
'Pods/BananaLib/Resources/logo-sidebar.png',
'Pods/BananaLib/Resources/sub_dir',
'Pods/BananaLib/libBananalib.a',
'Pods/BananaLib/preserve_me.txt',
]
end
......
......@@ -100,6 +100,7 @@ module Pod
it 'returns the resources' do
@accessor.resources.sort.should == [
@root + 'Resources/Images.xcassets',
@root + 'Resources/logo-sidebar.png',
@root + 'Resources/sub_dir',
]
......
......@@ -21,6 +21,8 @@ module Pod
Classes/BananaPrivate.h
Classes/BananaTrace.d
README
Resources/Images.xcassets/Logo.imageset/Contents.json
Resources/Images.xcassets/Logo.imageset/logo.png
Resources/logo-sidebar.png
Resources/sub_dir/logo-sidebar.png
libBananalib.a
......@@ -45,6 +47,8 @@ module Pod
Bananalib.framework/Versions/Current
Classes
Resources
Resources/Images.xcassets
Resources/Images.xcassets/Logo.imageset
Resources/sub_dir
sub-dir
sub-dir/sub-dir-2
......@@ -127,6 +131,7 @@ module Pod
it 'can optionally include the directories in the results' do
paths = @path_list.relative_glob('Resources/*', :include_dirs => true).map(&:to_s)
paths.sort.should == %w(
Resources/Images.xcassets
Resources/logo-sidebar.png
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