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

Integrate product_refs of generated frameworks

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