Commit 917dcf2d authored by Samuel E. Giddins's avatar Samuel E. Giddins

Merge pull request #5028 from CocoaPods/mr-fix-resource-bundle-paths

Fix resource bundle build path
parents b6152cc8 5080144e
......@@ -41,6 +41,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[Marius Rackwitz](https://github.com/mrackwitz)
[#5022](https://github.com/CocoaPods/CocoaPods/issues/5022)
* Fixes build paths for resources bundles.
[Marius Rackwitz](https://github.com/mrackwitz)
[#5028](https://github.com/CocoaPods/CocoaPods/pull/5028)
* Validate that a Podfile does not declare the same target twice.
[Samuel Giddins](https://github.com/segiddins)
[#5029](https://github.com/CocoaPods/CocoaPods/issues/5029)
......
......@@ -177,9 +177,7 @@ module Pod
c.build_settings['PRODUCT_NAME'] = bundle_name
relative_info_plist_path = info_plist_path.relative_path_from(sandbox.root)
c.build_settings['INFOPLIST_FILE'] = relative_info_plist_path.to_s
if target.requires_frameworks? && target.scoped?
c.build_settings['CONFIGURATION_BUILD_DIR'] = target.configuration_build_dir
end
c.build_settings['CONFIGURATION_BUILD_DIR'] = target.configuration_build_dir
# Set the correct device family for this bundle, based on the platform
device_family_by_platform = {
......
......@@ -16,26 +16,10 @@ module Pod
#
attr_reader :build_headers
# @return [Bool] whether the target needs to be scoped by target definition,
# because the spec is used with different subspec sets across them.
#
# @note The target products of {PodTarget}s are named after their specs.
# The namespacing cannot directly happen in the product name itself,
# because this must be equal to the module name and this will be
# used in source code, which should stay agnostic over the
# dependency manager.
# We need namespacing because multiple targets can exist for the
# same podspec and their products should not collide. This
# duplication is needed when multiple user targets have the same
# dependency, but they require different sets of subspecs or they
# are on different platforms.
#
def scoped?
!scope_suffix.nil?
end
# @return [String] used for the label and the directory name, which is used to
# scope the build product in the default configuration build dir.
# @return [String] used as suffix in the label
#
# @note This affects the value returned by #configuration_build_dir
# and accessors relying on this as #build_product_path.
#
attr_reader :scope_suffix
......@@ -44,10 +28,10 @@ module Pod
#
attr_accessor :dependent_targets
# @param [Array<Specification>] @spec #see spec
# @param [Array<TargetDefinition>] target_definitions @see target_definitions
# @param [Sandbox] sandbox @see sandbox
# @param [String] scope_suffix @see scope_suffix
# @param [Array<Specification>] specs @see #specs
# @param [Array<TargetDefinition>] target_definitions @see #target_definitions
# @param [Sandbox] sandbox @see #sandbox
# @param [String] scope_suffix @see #scope_suffix
#
def initialize(specs, target_definitions, sandbox, scope_suffix = nil)
raise "Can't initialize a PodTarget without specs!" if specs.nil? || specs.empty?
......@@ -89,14 +73,10 @@ module Pod
# @return [String] the label for the target.
#
def label
if scoped?
if scope_suffix[0] == '.'
"#{root_spec.name}#{scope_suffix}"
else
"#{root_spec.name}-#{scope_suffix}"
end
if scope_suffix.nil? || scope_suffix[0] == '.'
"#{root_spec.name}#{scope_suffix}"
else
root_spec.name
"#{root_spec.name}-#{scope_suffix}"
end
end
......
Subproject commit 231c8fc93b5ab52c79f95a211a99059d596a6af2
Subproject commit d194806b4d127ac46f137f828533d4112f2ed996
......@@ -176,6 +176,24 @@ module Pod
end
end
it 'sets the correct product name' do
@bundle_target.build_configurations.each do |bc|
bc.build_settings['PRODUCT_NAME'].should == 'banana_bundle'
end
end
it 'sets the correct Info.plist file path' do
@bundle_target.build_configurations.each do |bc|
bc.build_settings['INFOPLIST_FILE'].should == 'Target Support Files/BananaLib-Pods-SampleProject/ResourceBundle-banana_bundle-Info.plist'
end
end
it 'sets the correct build dir' do
@bundle_target.build_configurations.each do |bc|
bc.build_settings['CONFIGURATION_BUILD_DIR'].should == '$CONFIGURATION_BUILD_DIR/BananaLib-Pods-SampleProject'
end
end
it 'sets the correct targeted device family for the resource bundle targets' do
@bundle_target.build_configurations.each do |bc|
bc.build_settings['TARGETED_DEVICE_FAMILY'].should == '1,2'
......
......@@ -10,11 +10,11 @@ module Pod
end
describe 'Meta' do
describe '#scoped' do
describe '#scope_suffix' do
it 'returns target copies per target definition, which are scoped' do
@pod_target.should.not.be.scoped
@pod_target.scoped.first.should.be.scoped
@pod_target.should.not.be.scoped
@pod_target.scope_suffix.should.be.nil
@pod_target.scoped.first.scope_suffix.should == 'Pods'
@pod_target.scope_suffix.should.be.nil
end
end
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