Commit 6dad677f authored by Samuel Giddins's avatar Samuel Giddins

[AggregateTarget] Cache relevant pod target arrays

parent 22344e39
...@@ -140,8 +140,7 @@ module Pod ...@@ -140,8 +140,7 @@ module Pod
# #
def self.links_dependency?(aggregate_target, pod_target) def self.links_dependency?(aggregate_target, pod_target)
return true if aggregate_target.nil? || aggregate_target.target_definition.inheritance == 'complete' return true if aggregate_target.nil? || aggregate_target.target_definition.inheritance == 'complete'
targets = aggregate_target.pod_targets - aggregate_target.search_paths_aggregate_targets.flat_map(&:pod_targets) aggregate_target.pod_targets_to_link.include?(pod_target)
targets.include?(pod_target)
end end
# Adds build settings for dynamic vendored frameworks and libraries. # Adds build settings for dynamic vendored frameworks and libraries.
......
...@@ -140,7 +140,7 @@ module Pod ...@@ -140,7 +140,7 @@ module Pod
# @return [Array<AggregateTarget>] The aggregate targets whose pods this # @return [Array<AggregateTarget>] The aggregate targets whose pods this
# target must be able to import, but will not directly link against. # target must be able to import, but will not directly link against.
# #
attr_accessor :search_paths_aggregate_targets attr_reader :search_paths_aggregate_targets
# @param [String] build_configuration The build configuration for which the # @param [String] build_configuration The build configuration for which the
# the pod targets should be returned. # the pod targets should be returned.
...@@ -149,11 +149,16 @@ module Pod ...@@ -149,11 +149,16 @@ module Pod
# configuration. # configuration.
# #
def pod_targets_for_build_configuration(build_configuration) def pod_targets_for_build_configuration(build_configuration)
pod_targets.select do |pod_target| @pod_targets_for_build_configuration ||= {}
@pod_targets_for_build_configuration[build_configuration] ||= pod_targets.select do |pod_target|
pod_target.include_in_build_config?(target_definition, build_configuration) pod_target.include_in_build_config?(target_definition, build_configuration)
end end
end end
def pod_targets_to_link
@pod_targets_to_link ||= pod_targets.to_set - search_paths_aggregate_targets.flat_map(&:pod_targets)
end
# @return [Array<Specification>] The specifications used by this aggregate target. # @return [Array<Specification>] The specifications used by this aggregate target.
# #
def specs def specs
...@@ -191,9 +196,7 @@ module Pod ...@@ -191,9 +196,7 @@ module Pod
@framework_paths_by_config ||= begin @framework_paths_by_config ||= begin
framework_paths_by_config = {} framework_paths_by_config = {}
user_build_configurations.keys.each do |config| user_build_configurations.keys.each do |config|
relevant_pod_targets = pod_targets.select do |pod_target| relevant_pod_targets = pod_targets_for_build_configuration(config)
pod_target.include_in_build_config?(target_definition, config)
end
framework_paths_by_config[config] = relevant_pod_targets.flat_map { |pt| pt.framework_paths(false) } framework_paths_by_config[config] = relevant_pod_targets.flat_map { |pt| pt.framework_paths(false) }
end end
framework_paths_by_config framework_paths_by_config
...@@ -208,8 +211,7 @@ module Pod ...@@ -208,8 +211,7 @@ module Pod
pod_target.should_build? && pod_target.requires_frameworks? && !pod_target.static_framework? pod_target.should_build? && pod_target.requires_frameworks? && !pod_target.static_framework?
end end
user_build_configurations.keys.each_with_object({}) do |config, resources_by_config| user_build_configurations.keys.each_with_object({}) do |config, resources_by_config|
resources_by_config[config] = relevant_pod_targets.flat_map do |pod_target| resources_by_config[config] = (relevant_pod_targets & pod_targets_for_build_configuration(config)).flat_map do |pod_target|
next [] unless pod_target.include_in_build_config?(target_definition, config)
(pod_target.resource_paths(false) + [bridge_support_file].compact).uniq (pod_target.resource_paths(false) + [bridge_support_file].compact).uniq
end end
end end
......
...@@ -497,7 +497,7 @@ module Pod ...@@ -497,7 +497,7 @@ module Pod
it 'should include inherited search paths' do it 'should include inherited search paths' do
# It's the responsibility of the analyzer to # It's the responsibility of the analyzer to
# populate this when the file is loaded. # populate this when the file is loaded.
@blank_target.search_paths_aggregate_targets = [@target] @blank_target.search_paths_aggregate_targets.replace [@target]
@xcconfig = @generator.generate @xcconfig = @generator.generate
@xcconfig.to_hash['FRAMEWORK_SEARCH_PATHS'].should.not.be.nil @xcconfig.to_hash['FRAMEWORK_SEARCH_PATHS'].should.not.be.nil
end end
......
...@@ -12,8 +12,8 @@ module Pod ...@@ -12,8 +12,8 @@ module Pod
describe '::default_ld_flags' do describe '::default_ld_flags' do
it 'returns the default linker flags' do it 'returns the default linker flags' do
podfile = stub(:set_arc_compatibility_flag? => false) podfile = stub('podfile', :set_arc_compatibility_flag? => false)
target = stub(:podfile => podfile) target = stub('target', :podfile => podfile)
result = @sut.default_ld_flags(target) result = @sut.default_ld_flags(target)
result.should == '' result.should == ''
...@@ -22,9 +22,9 @@ module Pod ...@@ -22,9 +22,9 @@ module Pod
end end
it 'includes the ARC compatibility flag if required by the Podfile' do it 'includes the ARC compatibility flag if required by the Podfile' do
podfile = stub(:set_arc_compatibility_flag? => true) podfile = stub('podfile', :set_arc_compatibility_flag? => true)
spec_consumer = stub(:requires_arc? => true) spec_consumer = stub('spec_consumer', :requires_arc? => true)
target = stub(:podfile => podfile, :spec_consumers => [spec_consumer]) target = stub('target', :podfile => podfile, :spec_consumers => [spec_consumer])
result = @sut.default_ld_flags(target) result = @sut.default_ld_flags(target)
result.should == '-fobjc-arc' result.should == '-fobjc-arc'
...@@ -52,107 +52,109 @@ module Pod ...@@ -52,107 +52,109 @@ module Pod
describe '::add_spec_build_settings_to_xcconfig' do describe '::add_spec_build_settings_to_xcconfig' do
it 'adds the libraries of the xcconfig' do it 'adds the libraries of the xcconfig' do
xcconfig = Xcodeproj::Config.new xcconfig = Xcodeproj::Config.new
consumer = stub( consumer = stub('consumer',
:pod_target_xcconfig => {}, :pod_target_xcconfig => {},
:libraries => ['xml2'], :libraries => ['xml2'],
:frameworks => [], :frameworks => [],
:weak_frameworks => [], :weak_frameworks => [],
:platform_name => :ios, :platform_name => :ios,
) )
@sut.add_spec_build_settings_to_xcconfig(consumer, xcconfig) @sut.add_spec_build_settings_to_xcconfig(consumer, xcconfig)
xcconfig.to_hash['OTHER_LDFLAGS'].should == '-l"xml2"' xcconfig.to_hash['OTHER_LDFLAGS'].should == '-l"xml2"'
end end
it 'check that subspec subsets are removed from frameworks search paths' do it 'check that subspec subsets are removed from frameworks search paths' do
target1 = stub( target1 = stub('target1',
:specs => %w(A, B), :specs => %w(A, B),
:should_build? => true, :should_build? => true,
:requires_frameworks? => true, :requires_frameworks? => true,
:configuration_build_dir => 'AB', :configuration_build_dir => 'AB',
) )
target2 = stub( target2 = stub('target2',
:specs => ['B'], :specs => ['B'],
:should_build? => true, :should_build? => true,
:requires_frameworks? => true, :requires_frameworks? => true,
:configuration_build_dir => 'B', :configuration_build_dir => 'B',
) )
dependent_targets = [target1, target2] dependent_targets = [target1, target2]
build_settings = @sut.search_paths_for_dependent_targets(nil, dependent_targets) build_settings = @sut.search_paths_for_dependent_targets(nil, dependent_targets)
build_settings['FRAMEWORK_SEARCH_PATHS'].should == '"AB"' build_settings['FRAMEWORK_SEARCH_PATHS'].should == '"AB"'
end end
it 'adds the libraries of the xcconfig for a static framework' do it 'adds the libraries of the xcconfig for a static framework' do
spec = stub(:test_specification? => false) spec = stub('spec', :test_specification? => false)
target_definition = stub(:inheritance => 'search_paths') target_definition = stub('target_definition', :inheritance => 'search_paths')
consumer = stub( consumer = stub('consumer',
:pod_target_xcconfig => {}, :pod_target_xcconfig => {},
:libraries => ['xml2'], :libraries => ['xml2'],
:frameworks => [], :frameworks => [],
:weak_frameworks => [], :weak_frameworks => [],
:platform_name => :ios, :platform_name => :ios,
) )
file_accessor = stub( file_accessor = stub('file_accessor',
:spec => spec, :spec => spec,
:spec_consumer => consumer, :spec_consumer => consumer,
:vendored_static_frameworks => [], :vendored_static_frameworks => [],
:vendored_dynamic_frameworks => [], :vendored_dynamic_frameworks => [],
:vendored_static_libraries => [], :vendored_static_libraries => [],
:vendored_dynamic_libraries => [], :vendored_dynamic_libraries => [],
) )
pod_target = stub( pod_target = stub('pod_target',
:name => 'BananaLib', :name => 'BananaLib',
:sandbox => config.sandbox, :sandbox => config.sandbox,
:should_build? => true, :should_build? => true,
:requires_frameworks? => true, :requires_frameworks? => true,
:static_framework? => true, :static_framework? => true,
:dependent_targets => [], :dependent_targets => [],
:file_accessors => [file_accessor], :file_accessors => [file_accessor],
) )
pod_targets = [pod_target] pod_targets = [pod_target]
aggregate_target = stub( aggregate_target = stub('aggregate_target',
:target_definition => target_definition, :target_definition => target_definition,
:pod_targets => pod_targets, :pod_targets => pod_targets,
:search_paths_aggregate_targets => [], :search_paths_aggregate_targets => [],
) :pod_targets_to_link => pod_targets,
)
xcconfig = Xcodeproj::Config.new xcconfig = Xcodeproj::Config.new
@sut.generate_vendored_build_settings(aggregate_target, pod_targets, xcconfig) @sut.generate_vendored_build_settings(aggregate_target, pod_targets, xcconfig)
xcconfig.to_hash['OTHER_LDFLAGS'].should == '-l"xml2"' xcconfig.to_hash['OTHER_LDFLAGS'].should == '-l"xml2"'
end end
it 'checks OTHER_LDFLAGS and FRAMEWORK_SEARCH_PATHS for a vendored dependencies to a static framework' do it 'checks OTHER_LDFLAGS and FRAMEWORK_SEARCH_PATHS for a vendored dependencies to a static framework' do
spec = stub(:test_specification? => false) spec = stub('spec', :test_specification? => false)
target_definition = stub(:inheritance => 'search_paths') target_definition = stub('target_definition', :inheritance => 'search_paths')
consumer = stub( consumer = stub('consumer',
:pod_target_xcconfig => {}, :pod_target_xcconfig => {},
:libraries => ['xml2'], :libraries => ['xml2'],
:frameworks => [], :frameworks => [],
:weak_frameworks => [], :weak_frameworks => [],
:platform_name => :ios, :platform_name => :ios,
) )
file_accessor = stub( file_accessor = stub('file_accessor',
:spec => spec, :spec => spec,
:spec_consumer => consumer, :spec_consumer => consumer,
:vendored_static_frameworks => [config.sandbox.root + 'StaticFramework.framework'], :vendored_static_frameworks => [config.sandbox.root + 'StaticFramework.framework'],
:vendored_static_libraries => [config.sandbox.root + 'StaticLibrary.a'], :vendored_static_libraries => [config.sandbox.root + 'StaticLibrary.a'],
:vendored_dynamic_frameworks => [config.sandbox.root + 'VendoredFramework.framework'], :vendored_dynamic_frameworks => [config.sandbox.root + 'VendoredFramework.framework'],
:vendored_dynamic_libraries => [config.sandbox.root + 'VendoredDyld.dyld'], :vendored_dynamic_libraries => [config.sandbox.root + 'VendoredDyld.dyld'],
) )
dep_target = stub( dep_target = stub('dep_target',
:name => 'BananaLib', :name => 'BananaLib',
:sandbox => config.sandbox, :sandbox => config.sandbox,
:should_build? => false, :should_build? => false,
:requires_frameworks? => true, :requires_frameworks? => true,
:static_framework? => false, :static_framework? => false,
:dependent_targets => [], :dependent_targets => [],
:file_accessors => [file_accessor], :file_accessors => [file_accessor],
) )
dep_targets = [dep_target] dep_targets = [dep_target]
target = stub( target = stub('target',
:target_definition => target_definition, :target_definition => target_definition,
:pod_targets => dep_targets, :pod_targets => dep_targets,
:search_paths_aggregate_targets => [], :search_paths_aggregate_targets => [],
:static_framework => true, :static_framework => true,
) :pod_targets_to_link => dep_targets,
)
xcconfig = Xcodeproj::Config.new xcconfig = Xcodeproj::Config.new
@sut.generate_vendored_build_settings(target, dep_targets, xcconfig, true) @sut.generate_vendored_build_settings(target, dep_targets, xcconfig, true)
xcconfig.to_hash['OTHER_LDFLAGS'].should == '-l"StaticLibrary" -l"VendoredDyld" -l"xml2" -framework "StaticFramework" -framework "VendoredFramework"' xcconfig.to_hash['OTHER_LDFLAGS'].should == '-l"StaticLibrary" -l"VendoredDyld" -l"xml2" -framework "StaticFramework" -framework "VendoredFramework"'
...@@ -172,38 +174,38 @@ module Pod ...@@ -172,38 +174,38 @@ module Pod
end end
it 'check that include_ld_flags being false doesnt generate OTHER_LDFLAGS' do it 'check that include_ld_flags being false doesnt generate OTHER_LDFLAGS' do
spec = stub(:test_specification? => false) spec = stub('spec', :test_specification? => false)
target_definition = stub(:inheritance => 'search_paths') target_definition = stub('target_definition', :inheritance => 'search_paths')
consumer = stub( consumer = stub('consumer',
:pod_target_xcconfig => {}, :pod_target_xcconfig => {},
:libraries => ['xml2'], :libraries => ['xml2'],
:frameworks => [], :frameworks => [],
:weak_frameworks => [], :weak_frameworks => [],
:platform_name => :ios, :platform_name => :ios,
) )
file_accessor = stub( file_accessor = stub('file_accessor',
:spec => spec, :spec => spec,
:spec_consumer => consumer, :spec_consumer => consumer,
:vendored_static_frameworks => [config.sandbox.root + 'StaticFramework.framework'], :vendored_static_frameworks => [config.sandbox.root + 'StaticFramework.framework'],
:vendored_static_libraries => [config.sandbox.root + 'StaticLibrary.a'], :vendored_static_libraries => [config.sandbox.root + 'StaticLibrary.a'],
:vendored_dynamic_frameworks => [config.sandbox.root + 'VendoredFramework.framework'], :vendored_dynamic_frameworks => [config.sandbox.root + 'VendoredFramework.framework'],
:vendored_dynamic_libraries => [config.sandbox.root + 'VendoredDyld.dyld'], :vendored_dynamic_libraries => [config.sandbox.root + 'VendoredDyld.dyld'],
) )
dep_target = stub( dep_target = stub('dep_target',
:name => 'BananaLib', :name => 'BananaLib',
:sandbox => config.sandbox, :sandbox => config.sandbox,
:should_build? => false, :should_build? => false,
:requires_frameworks? => true, :requires_frameworks? => true,
:static_framework? => false, :static_framework? => false,
:dependent_targets => [], :dependent_targets => [],
:file_accessors => [file_accessor], :file_accessors => [file_accessor],
) )
dep_targets = [dep_target] dep_targets = [dep_target]
target = stub( target = stub('target',
:target_definition => target_definition, :target_definition => target_definition,
:pod_targets => dep_targets, :pod_targets => dep_targets,
:search_paths_aggregate_targets => [], :search_paths_aggregate_targets => [],
) )
xcconfig = Xcodeproj::Config.new xcconfig = Xcodeproj::Config.new
@sut.generate_vendored_build_settings(target, dep_targets, xcconfig, false) @sut.generate_vendored_build_settings(target, dep_targets, xcconfig, false)
xcconfig.to_hash['OTHER_LDFLAGS'].should.nil? xcconfig.to_hash['OTHER_LDFLAGS'].should.nil?
...@@ -211,42 +213,42 @@ module Pod ...@@ -211,42 +213,42 @@ module Pod
end end
it 'makes sure setting from search_paths get propagated for static frameworks' do it 'makes sure setting from search_paths get propagated for static frameworks' do
target_definition = stub(:inheritance => 'search_paths') target_definition = stub('target_definition', :inheritance => 'search_paths')
consumer = stub( consumer = stub('consumer',
:pod_target_xcconfig => {}, :pod_target_xcconfig => {},
:libraries => ['xml2'], :libraries => ['xml2'],
:frameworks => ['Foo'], :frameworks => ['Foo'],
:weak_frameworks => [], :weak_frameworks => [],
:platform_name => :ios, :platform_name => :ios,
) )
file_accessor = stub( file_accessor = stub('file_accessor',
:spec_consumer => consumer, :spec_consumer => consumer,
:vendored_static_frameworks => [], :vendored_static_frameworks => [],
:vendored_dynamic_frameworks => [], :vendored_dynamic_frameworks => [],
:vendored_static_libraries => [], :vendored_static_libraries => [],
:vendored_dynamic_libraries => [], :vendored_dynamic_libraries => [],
) )
pod_target = stub( pod_target = stub('pod_target',
:name => 'BananaLib', :name => 'BananaLib',
:sandbox => config.sandbox, :sandbox => config.sandbox,
:should_build? => true, :should_build? => true,
:requires_frameworks? => true, :requires_frameworks? => true,
:static_framework? => true, :static_framework? => true,
:dependent_targets => [], :dependent_targets => [],
:file_accessors => [file_accessor], :file_accessors => [file_accessor],
:product_basename => 'Foo', :product_basename => 'Foo',
) )
pod_targets = [pod_target] pod_targets = [pod_target]
aggregate_target = stub( aggregate_target = stub('aggregate_target',
:target_definition => target_definition, :target_definition => target_definition,
:pod_targets => pod_targets, :pod_targets => pod_targets,
:search_paths_aggregate_targets => [], :search_paths_aggregate_targets => [],
) )
test_aggregate_target = stub( test_aggregate_target = stub('test_aggregate_target',
:target_definition => target_definition, :target_definition => target_definition,
:pod_targets => [], :pod_targets => [],
:search_paths_aggregate_targets => [aggregate_target], :search_paths_aggregate_targets => [aggregate_target],
) )
xcconfig = Xcodeproj::Config.new xcconfig = Xcodeproj::Config.new
@sut.generate_other_ld_flags(test_aggregate_target, [], xcconfig) @sut.generate_other_ld_flags(test_aggregate_target, [], xcconfig)
xcconfig.to_hash['OTHER_LDFLAGS'].should == '-framework "Foo"' xcconfig.to_hash['OTHER_LDFLAGS'].should == '-framework "Foo"'
...@@ -254,51 +256,51 @@ module Pod ...@@ -254,51 +256,51 @@ module Pod
it 'includes HEADER_SEARCH_PATHS from search paths' do it 'includes HEADER_SEARCH_PATHS from search paths' do
xcconfig = Xcodeproj::Config.new xcconfig = Xcodeproj::Config.new
spec_consumer = stub(:user_target_xcconfig => { 'HEADER_SEARCH_PATHS' => 'my/path' }) spec_consumer = stub('spec_consumer', :user_target_xcconfig => { 'HEADER_SEARCH_PATHS' => 'my/path' })
pod_target = stub(:spec_consumers => [spec_consumer]) pod_target = stub('pod_target', :spec_consumers => [spec_consumer])
search_path_target = stub( search_path_target = stub('search_path_target',
:pod_targets_for_build_configuration => [pod_target], :pod_targets_for_build_configuration => [pod_target],
:pod_targets => [pod_target], :pod_targets => [pod_target],
) )
@sut.propagate_header_search_paths_from_search_paths(search_path_target, xcconfig) @sut.propagate_header_search_paths_from_search_paths(search_path_target, xcconfig)
xcconfig.to_hash['HEADER_SEARCH_PATHS'].should == '$(inherited) my/path' xcconfig.to_hash['HEADER_SEARCH_PATHS'].should == '$(inherited) my/path'
end end
it 'adds the frameworks of the xcconfig' do it 'adds the frameworks of the xcconfig' do
xcconfig = Xcodeproj::Config.new xcconfig = Xcodeproj::Config.new
consumer = stub( consumer = stub('consumer',
:pod_target_xcconfig => {}, :pod_target_xcconfig => {},
:libraries => [], :libraries => [],
:frameworks => ['CoreAnimation'], :frameworks => ['CoreAnimation'],
:weak_frameworks => [], :weak_frameworks => [],
:platform_name => :ios, :platform_name => :ios,
) )
@sut.add_spec_build_settings_to_xcconfig(consumer, xcconfig) @sut.add_spec_build_settings_to_xcconfig(consumer, xcconfig)
xcconfig.to_hash['OTHER_LDFLAGS'].should == '-framework "CoreAnimation"' xcconfig.to_hash['OTHER_LDFLAGS'].should == '-framework "CoreAnimation"'
end end
it 'adds the weak frameworks of the xcconfig' do it 'adds the weak frameworks of the xcconfig' do
xcconfig = Xcodeproj::Config.new xcconfig = Xcodeproj::Config.new
consumer = stub( consumer = stub('consumer',
:pod_target_xcconfig => {}, :pod_target_xcconfig => {},
:libraries => [], :libraries => [],
:frameworks => [], :frameworks => [],
:weak_frameworks => ['iAd'], :weak_frameworks => ['iAd'],
:platform_name => :ios, :platform_name => :ios,
) )
@sut.add_spec_build_settings_to_xcconfig(consumer, xcconfig) @sut.add_spec_build_settings_to_xcconfig(consumer, xcconfig)
xcconfig.to_hash['OTHER_LDFLAGS'].should == '-weak_framework "iAd"' xcconfig.to_hash['OTHER_LDFLAGS'].should == '-weak_framework "iAd"'
end end
it 'adds the ios developer frameworks search paths if needed' do it 'adds the ios developer frameworks search paths if needed' do
xcconfig = Xcodeproj::Config.new xcconfig = Xcodeproj::Config.new
consumer = stub( consumer = stub('consumer',
:pod_target_xcconfig => {}, :pod_target_xcconfig => {},
:libraries => [], :libraries => [],
:frameworks => ['SenTestingKit'], :frameworks => ['SenTestingKit'],
:weak_frameworks => [], :weak_frameworks => [],
:platform_name => :ios, :platform_name => :ios,
) )
@sut.add_spec_build_settings_to_xcconfig(consumer, xcconfig) @sut.add_spec_build_settings_to_xcconfig(consumer, xcconfig)
xcconfig.to_hash['FRAMEWORK_SEARCH_PATHS'].should.not.include('SDKROOT') xcconfig.to_hash['FRAMEWORK_SEARCH_PATHS'].should.not.include('SDKROOT')
xcconfig.to_hash['FRAMEWORK_SEARCH_PATHS'].should.not.include('DEVELOPER_LIBRARY_DIR') xcconfig.to_hash['FRAMEWORK_SEARCH_PATHS'].should.not.include('DEVELOPER_LIBRARY_DIR')
...@@ -306,13 +308,13 @@ module Pod ...@@ -306,13 +308,13 @@ module Pod
it 'adds the osx developer frameworks search paths if needed' do it 'adds the osx developer frameworks search paths if needed' do
xcconfig = Xcodeproj::Config.new xcconfig = Xcodeproj::Config.new
consumer = stub( consumer = stub('consumer',
:pod_target_xcconfig => {}, :pod_target_xcconfig => {},
:libraries => [], :libraries => [],
:frameworks => ['SenTestingKit'], :frameworks => ['SenTestingKit'],
:weak_frameworks => [], :weak_frameworks => [],
:platform_name => :osx, :platform_name => :osx,
) )
@sut.add_spec_build_settings_to_xcconfig(consumer, xcconfig) @sut.add_spec_build_settings_to_xcconfig(consumer, xcconfig)
xcconfig.to_hash['FRAMEWORK_SEARCH_PATHS'].should.not.include('DEVELOPER_LIBRARY_DIR') xcconfig.to_hash['FRAMEWORK_SEARCH_PATHS'].should.not.include('DEVELOPER_LIBRARY_DIR')
xcconfig.to_hash['FRAMEWORK_SEARCH_PATHS'].should.not.include('SDKROOT') xcconfig.to_hash['FRAMEWORK_SEARCH_PATHS'].should.not.include('SDKROOT')
...@@ -398,7 +400,7 @@ module Pod ...@@ -398,7 +400,7 @@ module Pod
describe '::add_language_specific_settings' do describe '::add_language_specific_settings' do
it 'does not add OTHER_SWIFT_FLAGS to the xcconfig if the target does not use swift' do it 'does not add OTHER_SWIFT_FLAGS to the xcconfig if the target does not use swift' do
target = stub(:uses_swift? => false) target = stub('target', :uses_swift? => false)
xcconfig = Xcodeproj::Config.new xcconfig = Xcodeproj::Config.new
@sut.add_language_specific_settings(target, xcconfig) @sut.add_language_specific_settings(target, xcconfig)
other_swift_flags = xcconfig.to_hash['OTHER_SWIFT_FLAGS'] other_swift_flags = xcconfig.to_hash['OTHER_SWIFT_FLAGS']
...@@ -406,7 +408,7 @@ module Pod ...@@ -406,7 +408,7 @@ module Pod
end end
it 'does not add the -suppress-warnings flag to the xcconfig if the target uses swift, but does not inhibit warnings' do it 'does not add the -suppress-warnings flag to the xcconfig if the target uses swift, but does not inhibit warnings' do
target = stub(:uses_swift? => true, :inhibit_warnings? => false) target = stub('target', :uses_swift? => true, :inhibit_warnings? => false)
xcconfig = Xcodeproj::Config.new xcconfig = Xcodeproj::Config.new
@sut.add_language_specific_settings(target, xcconfig) @sut.add_language_specific_settings(target, xcconfig)
other_swift_flags = xcconfig.to_hash['OTHER_SWIFT_FLAGS'] other_swift_flags = xcconfig.to_hash['OTHER_SWIFT_FLAGS']
...@@ -414,7 +416,7 @@ module Pod ...@@ -414,7 +416,7 @@ module Pod
end end
it 'adds the -suppress-warnings flag to the xcconfig if the target uses swift and inhibits warnings' do it 'adds the -suppress-warnings flag to the xcconfig if the target uses swift and inhibits warnings' do
target = stub(:uses_swift? => true, :inhibit_warnings? => true) target = stub('target', :uses_swift? => true, :inhibit_warnings? => true)
xcconfig = Xcodeproj::Config.new xcconfig = Xcodeproj::Config.new
@sut.add_language_specific_settings(target, xcconfig) @sut.add_language_specific_settings(target, xcconfig)
other_swift_flags = xcconfig.to_hash['OTHER_SWIFT_FLAGS'] other_swift_flags = xcconfig.to_hash['OTHER_SWIFT_FLAGS']
...@@ -426,71 +428,71 @@ module Pod ...@@ -426,71 +428,71 @@ module Pod
describe 'concerning settings for file accessors' do describe 'concerning settings for file accessors' do
it 'does not propagate framework or libraries from a test specification to an aggregate target' do it 'does not propagate framework or libraries from a test specification to an aggregate target' do
spec = stub(:test_specification? => true) spec = stub('spec', :test_specification? => true)
consumer = stub( consumer = stub('consumer',
:libraries => ['xml2'], :libraries => ['xml2'],
:frameworks => ['XCTest'], :frameworks => ['XCTest'],
:weak_frameworks => [], :weak_frameworks => [],
:spec => spec, :spec => spec,
) )
file_accessor = stub( file_accessor = stub('file_accessor',
:spec => spec, :spec => spec,
:spec_consumer => consumer, :spec_consumer => consumer,
:vendored_static_frameworks => [config.sandbox.root + 'StaticFramework.framework'], :vendored_static_frameworks => [config.sandbox.root + 'StaticFramework.framework'],
:vendored_static_libraries => [config.sandbox.root + 'StaticLibrary.a'], :vendored_static_libraries => [config.sandbox.root + 'StaticLibrary.a'],
:vendored_dynamic_frameworks => [config.sandbox.root + 'VendoredFramework.framework'], :vendored_dynamic_frameworks => [config.sandbox.root + 'VendoredFramework.framework'],
:vendored_dynamic_libraries => [config.sandbox.root + 'VendoredDyld.dyld'], :vendored_dynamic_libraries => [config.sandbox.root + 'VendoredDyld.dyld'],
) )
pod_target = stub( pod_target = stub('pod_target',
:file_accessors => [file_accessor], :file_accessors => [file_accessor],
:requires_frameworks? => true, :requires_frameworks? => true,
:dependent_targets => [], :dependent_targets => [],
:sandbox => config.sandbox, :sandbox => config.sandbox,
) )
target_definition = stub(:inheritance => 'complete') target_definition = stub('target_definition', :inheritance => 'complete')
aggregate_target = stub(:target_definition => target_definition) aggregate_target = stub('aggregate_target', :target_definition => target_definition)
xcconfig = Xcodeproj::Config.new xcconfig = Xcodeproj::Config.new
@sut.add_settings_for_file_accessors_of_target(aggregate_target, pod_target, xcconfig) @sut.add_settings_for_file_accessors_of_target(aggregate_target, pod_target, xcconfig)
xcconfig.to_hash['OTHER_LDFLAGS'].should.be.nil xcconfig.to_hash['OTHER_LDFLAGS'].should.be.nil
end end
it 'propagates correct frameworks or libraries to both test and non test xcconfigs' do it 'propagates correct frameworks or libraries to both test and non test xcconfigs' do
spec = stub(:test_specification? => false) spec = stub('spec', :test_specification? => false)
consumer = stub( consumer = stub('consumer',
:libraries => [], :libraries => [],
:frameworks => [], :frameworks => [],
:weak_frameworks => [], :weak_frameworks => [],
:spec => spec, :spec => spec,
) )
file_accessor = stub( file_accessor = stub('file_accessor',
:spec => spec, :spec => spec,
:spec_consumer => consumer, :spec_consumer => consumer,
:vendored_static_frameworks => [config.sandbox.root + 'StaticFramework.framework'], :vendored_static_frameworks => [config.sandbox.root + 'StaticFramework.framework'],
:vendored_static_libraries => [config.sandbox.root + 'StaticLibrary.a'], :vendored_static_libraries => [config.sandbox.root + 'StaticLibrary.a'],
:vendored_dynamic_frameworks => [config.sandbox.root + 'VendoredFramework.framework'], :vendored_dynamic_frameworks => [config.sandbox.root + 'VendoredFramework.framework'],
:vendored_dynamic_libraries => [config.sandbox.root + 'VendoredDyld.dyld'], :vendored_dynamic_libraries => [config.sandbox.root + 'VendoredDyld.dyld'],
) )
test_spec = stub(:test_specification? => true) test_spec = stub('test_spec', :test_specification? => true)
test_consumer = stub( test_consumer = stub('test_consumer',
:libraries => ['xml2'], :libraries => ['xml2'],
:frameworks => ['XCTest'], :frameworks => ['XCTest'],
:weak_frameworks => [], :weak_frameworks => [],
:spec => test_spec, :spec => test_spec,
) )
test_file_accessor = stub( test_file_accessor = stub('test_file_accessor',
:spec => test_spec, :spec => test_spec,
:spec_consumer => test_consumer, :spec_consumer => test_consumer,
:vendored_static_frameworks => [], :vendored_static_frameworks => [],
:vendored_static_libraries => [], :vendored_static_libraries => [],
:vendored_dynamic_frameworks => [], :vendored_dynamic_frameworks => [],
:vendored_dynamic_libraries => [], :vendored_dynamic_libraries => [],
) )
pod_target = stub( pod_target = stub('pod_target',
:file_accessors => [file_accessor, test_file_accessor], :file_accessors => [file_accessor, test_file_accessor],
:requires_frameworks? => true, :requires_frameworks? => true,
:dependent_targets => [], :dependent_targets => [],
:sandbox => config.sandbox, :sandbox => config.sandbox,
) )
xcconfig = Xcodeproj::Config.new xcconfig = Xcodeproj::Config.new
@sut.add_settings_for_file_accessors_of_target(nil, pod_target, xcconfig, true, false) @sut.add_settings_for_file_accessors_of_target(nil, pod_target, xcconfig, true, false)
xcconfig.to_hash['OTHER_LDFLAGS'].should == '-l"StaticLibrary" -l"VendoredDyld" -framework "StaticFramework" -framework "VendoredFramework"' xcconfig.to_hash['OTHER_LDFLAGS'].should == '-l"StaticLibrary" -l"VendoredDyld" -framework "StaticFramework" -framework "VendoredFramework"'
...@@ -500,56 +502,56 @@ module Pod ...@@ -500,56 +502,56 @@ module Pod
end end
it 'does propagate framework or libraries from a non test specification to an aggregate target' do it 'does propagate framework or libraries from a non test specification to an aggregate target' do
spec = stub(:test_specification? => false) spec = stub('spec', :test_specification? => false)
consumer = stub( consumer = stub('consumer',
:libraries => ['xml2'], :libraries => ['xml2'],
:frameworks => ['XCTest'], :frameworks => ['XCTest'],
:weak_frameworks => [], :weak_frameworks => [],
:spec => spec, :spec => spec,
) )
file_accessor = stub( file_accessor = stub('file_accessor',
:spec => spec, :spec => spec,
:spec_consumer => consumer, :spec_consumer => consumer,
:vendored_static_frameworks => [config.sandbox.root + 'StaticFramework.framework'], :vendored_static_frameworks => [config.sandbox.root + 'StaticFramework.framework'],
:vendored_static_libraries => [config.sandbox.root + 'StaticLibrary.a'], :vendored_static_libraries => [config.sandbox.root + 'StaticLibrary.a'],
:vendored_dynamic_frameworks => [config.sandbox.root + 'VendoredFramework.framework'], :vendored_dynamic_frameworks => [config.sandbox.root + 'VendoredFramework.framework'],
:vendored_dynamic_libraries => [config.sandbox.root + 'VendoredDyld.dyld'], :vendored_dynamic_libraries => [config.sandbox.root + 'VendoredDyld.dyld'],
) )
pod_target = stub( pod_target = stub('pod_target',
:file_accessors => [file_accessor], :file_accessors => [file_accessor],
:requires_frameworks? => true, :requires_frameworks? => true,
:dependent_targets => [], :dependent_targets => [],
:sandbox => config.sandbox, :sandbox => config.sandbox,
) )
target_definition = stub(:inheritance => 'complete') target_definition = stub('target_definition', :inheritance => 'complete')
aggregate_target = stub(:target_definition => target_definition) aggregate_target = stub('aggregate_target', :target_definition => target_definition)
xcconfig = Xcodeproj::Config.new xcconfig = Xcodeproj::Config.new
@sut.add_settings_for_file_accessors_of_target(aggregate_target, pod_target, xcconfig) @sut.add_settings_for_file_accessors_of_target(aggregate_target, pod_target, xcconfig)
xcconfig.to_hash['OTHER_LDFLAGS'].should.be == '-l"StaticLibrary" -l"VendoredDyld" -l"xml2" -framework "StaticFramework" -framework "VendoredFramework" -framework "XCTest"' xcconfig.to_hash['OTHER_LDFLAGS'].should.be == '-l"StaticLibrary" -l"VendoredDyld" -l"xml2" -framework "StaticFramework" -framework "VendoredFramework" -framework "XCTest"'
end end
it 'does propagate framework or libraries to a nil aggregate target' do it 'does propagate framework or libraries to a nil aggregate target' do
spec = stub(:test_specification? => false) spec = stub('spec', :test_specification? => false)
consumer = stub( consumer = stub('consumer',
:libraries => ['xml2'], :libraries => ['xml2'],
:frameworks => ['XCTest'], :frameworks => ['XCTest'],
:weak_frameworks => [], :weak_frameworks => [],
:spec => spec, :spec => spec,
) )
file_accessor = stub( file_accessor = stub('file_accessor',
:spec => spec, :spec => spec,
:spec_consumer => consumer, :spec_consumer => consumer,
:vendored_static_frameworks => [config.sandbox.root + 'StaticFramework.framework'], :vendored_static_frameworks => [config.sandbox.root + 'StaticFramework.framework'],
:vendored_static_libraries => [config.sandbox.root + 'StaticLibrary.a'], :vendored_static_libraries => [config.sandbox.root + 'StaticLibrary.a'],
:vendored_dynamic_frameworks => [config.sandbox.root + 'VendoredFramework.framework'], :vendored_dynamic_frameworks => [config.sandbox.root + 'VendoredFramework.framework'],
:vendored_dynamic_libraries => [config.sandbox.root + 'VendoredDyld.dyld'], :vendored_dynamic_libraries => [config.sandbox.root + 'VendoredDyld.dyld'],
) )
pod_target = stub( pod_target = stub('pod_target',
:file_accessors => [file_accessor], :file_accessors => [file_accessor],
:requires_frameworks? => true, :requires_frameworks? => true,
:dependent_targets => [], :dependent_targets => [],
:sandbox => config.sandbox, :sandbox => config.sandbox,
) )
xcconfig = Xcodeproj::Config.new xcconfig = Xcodeproj::Config.new
@sut.add_settings_for_file_accessors_of_target(nil, pod_target, xcconfig) @sut.add_settings_for_file_accessors_of_target(nil, pod_target, xcconfig)
xcconfig.to_hash['OTHER_LDFLAGS'].should.be == '-l"StaticLibrary" -l"VendoredDyld" -l"xml2" -framework "StaticFramework" -framework "VendoredFramework" -framework "XCTest"' xcconfig.to_hash['OTHER_LDFLAGS'].should.be == '-l"StaticLibrary" -l"VendoredDyld" -l"xml2" -framework "StaticFramework" -framework "VendoredFramework" -framework "XCTest"'
...@@ -557,6 +559,13 @@ module Pod ...@@ -557,6 +559,13 @@ module Pod
end end
describe 'for proper other ld flags' do describe 'for proper other ld flags' do
def stub_aggregate_target(pod_targets, target_definition = nil, search_paths_aggregate_targets: [])
target_definition.stubs(:abstract? => false) unless target_definition.respond_to?(:abstract?)
fixture_aggregate_target(pod_targets, target_definition).tap do |aggregate_target|
aggregate_target.search_paths_aggregate_targets.concat(search_paths_aggregate_targets).freeze
end
end
before do before do
@root = fixture('banana-lib') @root = fixture('banana-lib')
@path_list = Sandbox::PathList.new(@root) @path_list = Sandbox::PathList.new(@root)
...@@ -566,9 +575,9 @@ module Pod ...@@ -566,9 +575,9 @@ module Pod
end end
it 'should not include static framework other ld flags when inheriting search paths' do it 'should not include static framework other ld flags when inheriting search paths' do
target_definition = stub(:inheritance => 'search_paths') target_definition = stub('target_definition', :inheritance => 'search_paths')
aggregate_target = stub(:target_definition => target_definition, :pod_targets => [], :search_paths_aggregate_targets => []) aggregate_target = stub_aggregate_target([], target_definition)
pod_target = stub(:sandbox => config.sandbox) pod_target = stub('pod_target', :sandbox => config.sandbox)
xcconfig = Xcodeproj::Config.new xcconfig = Xcodeproj::Config.new
@sut.add_static_dependency_build_settings(aggregate_target, pod_target, xcconfig, @accessor, true) @sut.add_static_dependency_build_settings(aggregate_target, pod_target, xcconfig, @accessor, true)
xcconfig.to_hash['LIBRARY_SEARCH_PATHS'].should == '"${PODS_ROOT}/../../spec/fixtures/banana-lib"' xcconfig.to_hash['LIBRARY_SEARCH_PATHS'].should == '"${PODS_ROOT}/../../spec/fixtures/banana-lib"'
...@@ -577,9 +586,9 @@ module Pod ...@@ -577,9 +586,9 @@ module Pod
end end
it 'should include static framework other ld flags when inheriting search paths but explicitly declared' do it 'should include static framework other ld flags when inheriting search paths but explicitly declared' do
target_definition = stub(:inheritance => 'search_paths') target_definition = stub('target_definition', :inheritance => 'search_paths')
pod_target = stub(:name => 'BananaLib', :sandbox => config.sandbox) pod_target = stub('pod_target', :name => 'BananaLib', :sandbox => config.sandbox)
aggregate_target = stub(:target_definition => target_definition, :pod_targets => [pod_target], :search_paths_aggregate_targets => []) aggregate_target = stub_aggregate_target([pod_target], target_definition)
xcconfig = Xcodeproj::Config.new xcconfig = Xcodeproj::Config.new
@sut.add_static_dependency_build_settings(aggregate_target, pod_target, xcconfig, @accessor, true) @sut.add_static_dependency_build_settings(aggregate_target, pod_target, xcconfig, @accessor, true)
xcconfig.to_hash['LIBRARY_SEARCH_PATHS'].should == '"${PODS_ROOT}/../../spec/fixtures/banana-lib"' xcconfig.to_hash['LIBRARY_SEARCH_PATHS'].should == '"${PODS_ROOT}/../../spec/fixtures/banana-lib"'
...@@ -588,9 +597,9 @@ module Pod ...@@ -588,9 +597,9 @@ module Pod
end end
it 'should include static framework other ld flags when not inheriting search paths' do it 'should include static framework other ld flags when not inheriting search paths' do
target_definition = stub(:inheritance => 'complete') target_definition = stub('target_definition', :inheritance => 'complete')
aggregate_target = stub(:target_definition => target_definition) aggregate_target = stub_aggregate_target([], target_definition)
pod_target = stub(:sandbox => config.sandbox) pod_target = stub('pod_target', :sandbox => config.sandbox)
xcconfig = Xcodeproj::Config.new xcconfig = Xcodeproj::Config.new
@sut.add_static_dependency_build_settings(aggregate_target, pod_target, xcconfig, @accessor, true) @sut.add_static_dependency_build_settings(aggregate_target, pod_target, xcconfig, @accessor, true)
xcconfig.to_hash['LIBRARY_SEARCH_PATHS'].should == '"${PODS_ROOT}/../../spec/fixtures/banana-lib"' xcconfig.to_hash['LIBRARY_SEARCH_PATHS'].should == '"${PODS_ROOT}/../../spec/fixtures/banana-lib"'
...@@ -599,7 +608,7 @@ module Pod ...@@ -599,7 +608,7 @@ module Pod
end end
it 'should include static framework for pod targets' do it 'should include static framework for pod targets' do
pod_target = stub(:sandbox => config.sandbox) pod_target = stub('pod_target', :sandbox => config.sandbox)
xcconfig = Xcodeproj::Config.new xcconfig = Xcodeproj::Config.new
@sut.add_static_dependency_build_settings(nil, pod_target, xcconfig, @accessor, true) @sut.add_static_dependency_build_settings(nil, pod_target, xcconfig, @accessor, true)
xcconfig.to_hash['LIBRARY_SEARCH_PATHS'].should == '"${PODS_ROOT}/../../spec/fixtures/banana-lib"' xcconfig.to_hash['LIBRARY_SEARCH_PATHS'].should == '"${PODS_ROOT}/../../spec/fixtures/banana-lib"'
...@@ -608,55 +617,55 @@ module Pod ...@@ -608,55 +617,55 @@ module Pod
end end
it 'should link static dependency for pod targets' do it 'should link static dependency for pod targets' do
pod_target = stub(:name => 'BananaLib', :sandbox => config.sandbox) pod_target = stub('pod_target', :name => 'BananaLib', :sandbox => config.sandbox)
@sut.links_dependency?(nil, pod_target).should.be.true @sut.links_dependency?(nil, pod_target).should.be.true
end end
it 'should link static dependency when target explicitly specifies it' do it 'should link static dependency when target explicitly specifies it' do
target_definition = stub(:inheritance => 'complete') target_definition = stub('target_definition', :inheritance => 'complete')
pod_target = stub(:name => 'BananaLib', :sandbox => config.sandbox) pod_target = stub('pod_target', :name => 'BananaLib', :sandbox => config.sandbox)
aggregate_target = stub(:target_definition => target_definition, :pod_targets => [pod_target], :search_paths_aggregate_targets => []) aggregate_target = stub_aggregate_target([pod_target], target_definition)
@sut.links_dependency?(aggregate_target, pod_target).should.be.true @sut.links_dependency?(aggregate_target, pod_target).should.be.true
end end
it 'should link static dependency when target explicitly specifies it even with search paths' do it 'should link static dependency when target explicitly specifies it even with search paths' do
target_definition = stub(:inheritance => 'search_paths') target_definition = stub('target_definition', :inheritance => 'search_paths')
pod_target = stub(:name => 'BananaLib', :sandbox => config.sandbox) pod_target = stub('pod_target', :name => 'BananaLib', :sandbox => config.sandbox)
aggregate_target = stub(:target_definition => target_definition, :pod_targets => [pod_target], :search_paths_aggregate_targets => []) aggregate_target = stub_aggregate_target([pod_target], target_definition)
@sut.links_dependency?(aggregate_target, pod_target).should.be.true @sut.links_dependency?(aggregate_target, pod_target).should.be.true
end end
it 'should not link static dependency when inheriting search paths and parent includes dependency' do it 'should not link static dependency when inheriting search paths and parent includes dependency' do
parent_target_definition = stub parent_target_definition = stub
child_target_definition = stub(:inheritance => 'search_paths') child_target_definition = stub('child_target_definition', :inheritance => 'search_paths')
pod_target = stub(:name => 'BananaLib', :sandbox => config.sandbox) pod_target = stub('pod_target', :name => 'BananaLib', :sandbox => config.sandbox)
parent_aggregate_target = stub(:target_definition => parent_target_definition, :pod_targets => [pod_target], :search_paths_aggregate_targets => []) parent_aggregate_target = stub_aggregate_target([pod_target], parent_target_definition)
child_aggregate_target = stub(:target_definition => child_target_definition, :pod_targets => [], :search_paths_aggregate_targets => [parent_aggregate_target]) child_aggregate_target = stub_aggregate_target([], child_target_definition, :search_paths_aggregate_targets => [parent_aggregate_target])
@sut.links_dependency?(child_aggregate_target, pod_target).should.be.false @sut.links_dependency?(child_aggregate_target, pod_target).should.be.false
end end
it 'should link static transitive dependencies if the parent does not link them' do it 'should link static transitive dependencies if the parent does not link them' do
child_pod_target = stub(:name => 'ChildPod', :sandbox => config.sandbox) child_pod_target = stub('child_pod_target', :name => 'ChildPod', :sandbox => config.sandbox)
parent_pod_target = stub(:name => 'ParentPod', :sandbox => config.sandbox, :dependent_targets => [child_pod_target]) parent_pod_target = stub('parent_pod_target', :name => 'ParentPod', :sandbox => config.sandbox, :dependent_targets => [child_pod_target])
parent_target_definition = stub parent_target_definition = stub
child_target_definition = stub(:inheritance => 'search_paths') child_target_definition = stub('child_target_definition', :inheritance => 'search_paths')
parent_aggregate_target = stub(:target_definition => parent_target_definition, :pod_targets => [], :search_paths_aggregate_targets => []) parent_aggregate_target = stub_aggregate_target([], parent_target_definition)
child_aggregate_target = stub(:target_definition => child_target_definition, :pod_targets => [parent_pod_target, child_pod_target], :search_paths_aggregate_targets => [parent_aggregate_target]) child_aggregate_target = stub_aggregate_target([parent_pod_target, child_pod_target], child_target_definition, :search_paths_aggregate_targets => [parent_aggregate_target])
@sut.links_dependency?(child_aggregate_target, child_pod_target).should.be.true @sut.links_dependency?(child_aggregate_target, child_pod_target).should.be.true
@sut.links_dependency?(child_aggregate_target, parent_pod_target).should.be.true @sut.links_dependency?(child_aggregate_target, parent_pod_target).should.be.true
end end
it 'should link static only transitive dependencies that the parent does not link' do it 'should link static only transitive dependencies that the parent does not link' do
child_pod_target = stub(:name => 'ChildPod', :sandbox => config.sandbox) child_pod_target = stub('child_pod_target', :name => 'ChildPod', :sandbox => config.sandbox)
parent_pod_target = stub(:name => 'ParentPod', :sandbox => config.sandbox, :dependent_targets => [child_pod_target]) parent_pod_target = stub('parent_pod_target', :name => 'ParentPod', :sandbox => config.sandbox, :dependent_targets => [child_pod_target])
parent_target_definition = stub parent_target_definition = stub
child_target_definition = stub(:inheritance => 'search_paths') child_target_definition = stub('child_target_definition', :inheritance => 'search_paths')
parent_aggregate_target = stub(:target_definition => parent_target_definition, :pod_targets => [child_pod_target], :search_paths_aggregate_targets => []) parent_aggregate_target = stub('parent_aggregate_target', :target_definition => parent_target_definition, :pod_targets => [child_pod_target], :search_paths_aggregate_targets => [], :pod_targets_to_link => [child_pod_target])
child_aggregate_target = stub(:target_definition => child_target_definition, :pod_targets => [parent_pod_target, child_pod_target], :search_paths_aggregate_targets => [parent_aggregate_target]) child_aggregate_target = stub('child_aggregate_target', :target_definition => child_target_definition, :pod_targets => [parent_pod_target, child_pod_target], :search_paths_aggregate_targets => [parent_aggregate_target], :pod_targets_to_link => [parent_pod_target])
@sut.links_dependency?(child_aggregate_target, child_pod_target).should.be.false @sut.links_dependency?(child_aggregate_target, child_pod_target).should.be.false
@sut.links_dependency?(child_aggregate_target, parent_pod_target).should.be.true @sut.links_dependency?(child_aggregate_target, parent_pod_target).should.be.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