Commit 866e9e39 authored by Samuel E. Giddins's avatar Samuel E. Giddins

Merge branch 'flufff42-install-resources-script-expansion'

parents 0505ce41 0b702445
......@@ -20,6 +20,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[Boris Bügling](https://github.com/neonichu)
[#3102](https://github.com/CocoaPods/CocoaPods/issues/3102)
* Correct escaping of resource bundles in 'Copy Pods Resources' script.
[Seán Labastille](https://github.com/flufff42)
[#3082](https://github.com/CocoaPods/CocoaPods/issues/3082)
## 0.36.0.beta.2
......
......@@ -76,7 +76,7 @@ module Pod
unless resources.empty?
script += %(if [[ "$CONFIGURATION" == "#{config}" ]]; then\n)
resources.each do |resource|
script += " install_resource '#{resource}'\n"
script += %( install_resource "#{resource}"\n)
end
script += "fi\n"
end
......
......@@ -118,7 +118,7 @@ module Pod
target.user_build_configurations.keys.each do |config|
file_accessors = library_targets.select { |t| t.include_in_build_config?(config) }.flat_map(&:file_accessors)
resource_paths = file_accessors.flat_map { |accessor| accessor.resources.flat_map { |res| res.relative_path_from(project.path.dirname) } }
resource_bundles = file_accessors.flat_map { |accessor| accessor.resource_bundles.keys.map { |name| "${BUILT_PRODUCTS_DIR}/#{name}.bundle" } }
resource_bundles = file_accessors.flat_map { |accessor| accessor.resource_bundles.keys.map { |name| "${BUILT_PRODUCTS_DIR}/#{name.shellescape}.bundle" } }
resources_by_config[config] = resource_paths + resource_bundles
resources_by_config[config] << bridge_support_file if bridge_support_file
end
......
......@@ -24,7 +24,18 @@ module Pod
script = generator.send(:script)
script.should.include <<-eos.strip_heredoc
if [[ "$CONFIGURATION" == "Debug" ]]; then
install_resource 'Lookout.framework'
install_resource "Lookout.framework"
fi
eos
end
it 'adds resource bundles with a call wrapped in an if statement' do
resources = { 'Debug' => %w(${BUILT_PRODUCTS_DIR}/Resources.bundle) }
generator = Pod::Generator::CopyResourcesScript.new(resources, Platform.new(:ios, '6.0'))
script = generator.send(:script)
script.should.include <<-eos.strip_heredoc
if [[ "$CONFIGURATION" == "Debug" ]]; then
install_resource "${BUILT_PRODUCTS_DIR}/Resources.bundle"
fi
eos
end
......
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