Commit 639ef6ee authored by Kevin Coleman's avatar Kevin Coleman

Implemented logic to add linker flags for only dynamic vendored frameworks and…

Implemented logic to add linker flags for only dynamic vendored frameworks and libraries of pod dependencies.
parent 4af70740
...@@ -52,11 +52,12 @@ module Pod ...@@ -52,11 +52,12 @@ module Pod
def self.add_settings_for_file_accessors_of_target(target, xcconfig) def self.add_settings_for_file_accessors_of_target(target, xcconfig)
target.file_accessors.each do |file_accessor| target.file_accessors.each do |file_accessor|
XCConfigHelper.add_spec_build_settings_to_xcconfig(file_accessor.spec_consumer, xcconfig) XCConfigHelper.add_spec_build_settings_to_xcconfig(file_accessor.spec_consumer, xcconfig)
XCConfigHelper.add_static_dependency_build_settings(target, xcconfig, file_accessor)
end end
XCConfigHelper.add_vendored_dependency_build_settings(target, xcconfig) XCConfigHelper.add_dynamic_dependency_build_settings(target, xcconfig)
end end
# Adds build settings for vendored frameworks and libraries. # Adds build settings for static vendored frameworks and libraries.
# #
# @param [PodTarget] target # @param [PodTarget] target
# The pod target, which holds the list of +Spec::FileAccessor+. # The pod target, which holds the list of +Spec::FileAccessor+.
...@@ -64,19 +65,36 @@ module Pod ...@@ -64,19 +65,36 @@ module Pod
# @param [Xcodeproj::Config] xcconfig # @param [Xcodeproj::Config] xcconfig
# The xcconfig to edit. # The xcconfig to edit.
# #
def self.add_vendored_dependency_build_settings(target, xcconfig) def self.add_static_dependency_build_settings(target, xcconfig, file_accessor)
file_accessor.vendored_static_frameworks.each do |vendored_static_framework|
XCConfigHelper.add_framework_build_settings(vendored_static_framework, xcconfig, target.sandbox.root)
end
file_accessor.vendored_static_libraries.each do |vendored_static_library|
XCConfigHelper.add_library_build_settings(vendored_static_library, xcconfig, target.sandbox.root)
end
end
# Adds build settings for dynamic vendored frameworks and libraries.
#
# @param [PodTarget] target
# The pod target, which holds the list of +Spec::FileAccessor+.
#
# @param [Xcodeproj::Config] xcconfig
# The xcconfig to edit.
#
def self.add_dynamic_dependency_build_settings(target, xcconfig)
if target.requires_frameworks? if target.requires_frameworks?
target.dependent_targets.each do |dependent_target| target.dependent_targets.each do |dependent_target|
XCConfigHelper.add_vendored_dependency_build_settings(dependent_target, xcconfig) XCConfigHelper.add_dynamic_dependency_build_settings(dependent_target, xcconfig)
end end
end end
target.file_accessors.each do |file_accessor| target.file_accessors.each do |file_accessor|
file_accessor.vendored_frameworks.each do |vendored_framework| file_accessor.vendored_dynamic_frameworks.each do |vendored_dynamic_framework|
XCConfigHelper.add_framework_build_settings(vendored_framework, xcconfig, target.sandbox.root) XCConfigHelper.add_framework_build_settings(vendored_dynamic_framework, xcconfig, target.sandbox.root)
end end
file_accessor.vendored_libraries.each do |vendored_library| file_accessor.vendored_dynamic_libraries.each do |vendored_dynamic_library|
XCConfigHelper.add_library_build_settings(vendored_library, xcconfig, target.sandbox.root) XCConfigHelper.add_library_build_settings(vendored_dynamic_library, xcconfig, target.sandbox.root)
end end
end end
end end
......
...@@ -7,6 +7,8 @@ Pod::Spec.new do |s| ...@@ -7,6 +7,8 @@ Pod::Spec.new do |s|
s.homepage = "http://httpbin.org/html" s.homepage = "http://httpbin.org/html"
s.source = { :git => "http://monkey.local/monkey.git", :tag => s.version.to_s } s.source = { :git => "http://monkey.local/monkey.git", :tag => s.version.to_s }
s.license = 'MIT' s.license = 'MIT'
s.vendored_library = 'monkey.a'
s.public_header_files = 'monkey.h' s.vendored_framework = 'monkey.framework'
s.vendored_library = 'monkey.a'
s.public_header_files = 'monkey.h'
end end
...@@ -7,7 +7,6 @@ module Pod ...@@ -7,7 +7,6 @@ module Pod
describe 'in general' do describe 'in general' do
before do before do
@monkey_spec = fixture_spec('monkey/monkey.podspec') @monkey_spec = fixture_spec('monkey/monkey.podspec')
@monkey_spec.vendored_framework = 'monkey.framework'
@monkey_pod_target = fixture_pod_target(@monkey_spec) @monkey_pod_target = fixture_pod_target(@monkey_spec)
@spec = fixture_spec('banana-lib/BananaLib.podspec') @spec = fixture_spec('banana-lib/BananaLib.podspec')
...@@ -56,6 +55,10 @@ module Pod ...@@ -56,6 +55,10 @@ module Pod
@xcconfig.to_hash['OTHER_LDFLAGS'].should.include('-framework "monkey"') @xcconfig.to_hash['OTHER_LDFLAGS'].should.include('-framework "monkey"')
end end
it 'includes does not include vendored static frameworks for dependecy pods of the specification' do
@xcconfig.to_hash['OTHER_LDFLAGS'].should.not.include('-l"monkey.a"')
end
it 'does not configure the project to load all members that implement Objective-c classes or categories from the static library' do it 'does not configure the project to load all members that implement Objective-c classes or categories from the static library' do
@xcconfig.to_hash['OTHER_LDFLAGS'].should.not.include '-ObjC' @xcconfig.to_hash['OTHER_LDFLAGS'].should.not.include '-ObjC'
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