Commit 37ebd5af authored by Marius Rackwitz's avatar Marius Rackwitz

Integrate product_refs of generated frameworks

parent c31b4b76
......@@ -36,7 +36,7 @@ module Pod
# @return [void]
#
def add_target
product_type = target.requires_framework? ? :framework : :static_library
product_type = target.product_type
name = target.label
platform = target.platform.name
deployment_target = target.platform.deployment_target.to_s
......
......@@ -102,7 +102,7 @@ module Pod
frameworks = user_project.frameworks_group
native_targets_to_integrate.each do |native_target|
library = frameworks.files.select { |f| f.path == target.product_name }.first ||
frameworks.new_product_ref_for_target(target.name, :static_library)
frameworks.new_product_ref_for_target(target.name, target.product_type)
unless native_target.frameworks_build_phase.files_references.include?(library)
native_target.frameworks_build_phase.add_file_reference(library)
end
......
......@@ -27,10 +27,21 @@ module Pod
label
end
# @return [String] the name of the library.
# @return [String] the name of the product.
#
def product_name
"lib#{label}.a"
if requires_framework?
"#{label}.framework"
else
"lib#{label}.a"
end
end
# @return [Symbol] either :framework or :static_library, depends on
# #requires_framework?.
#
def product_type
requires_framework? ? :framework : :static_library
end
# @return [String] the XCConfig namespaced prefix.
......
......@@ -133,12 +133,24 @@ module Pod
@target.host_requires_framework = true
end
it 'returns the product name' do
@target.product_name.should == 'Pods.framework'
end
it 'returns :framework as product type' do
@target.product_type.should == :framework
end
it 'returns that it requires being built as framework' do
@target.requires_framework?.should == true
end
end
describe 'Host does not requires frameworks' do
it 'returns the product name' do
@target.product_name.should == 'libPods.a'
end
it 'returns :static_library as product type' do
@target.product_type.should == :static_library
end
......@@ -160,6 +172,14 @@ module Pod
@target.uses_swift?.should == true
end
it 'returns the product name' do
@target.product_name.should == 'Pods.framework'
end
it 'returns :framework as product type' do
@target.product_type.should == :framework
end
it 'returns that it requires being built as framework' do
@target.requires_framework?.should == true
end
......
......@@ -117,12 +117,28 @@ module Pod
@pod_target.host_requires_framework = true
end
it 'returns the product name' do
@pod_target.product_name.should == 'Pods-BananaLib.framework'
end
it 'returns :framework as product type' do
@pod_target.product_type.should == :framework
end
it 'returns that it requires being built as framework' do
@pod_target.requires_framework?.should == true
end
end
describe 'Host does not requires frameworks' do
it 'returns the product name' do
@pod_target.product_name.should == 'libPods-BananaLib.a'
end
it 'returns :static_library as product type' do
@pod_target.product_type.should == :static_library
end
it 'returns that it does not require being built as framework' do
@pod_target.requires_framework?.should == false
end
......@@ -138,6 +154,14 @@ module Pod
@pod_target.uses_swift?.should == true
end
it 'returns the product name' do
@pod_target.product_name.should == 'Pods-OrangeFramework.framework'
end
it 'returns :framework as product type' do
@pod_target.product_type.should == :framework
end
it 'returns that it requires being built as framework' do
@pod_target.requires_framework?.should == true
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