Commit 8326ec07 authored by Samuel Giddins's avatar Samuel Giddins

[BuildSettings] Rename subclasses to include the word "Settings"

parent 47be0099
......@@ -426,7 +426,7 @@ module Pod
def create_test_xcconfig_files(test_native_targets, test_resource_bundle_targets)
target.supported_test_types.each do |test_type|
path = target.xcconfig_path(test_type.to_s)
update_changed_file(Target::BuildSettings::Pod.new(target, true), path)
update_changed_file(Target::BuildSettings::PodTargetSettings.new(target, true), path)
xcconfig_file_ref = add_file_to_support_group(path)
test_native_targets.each do |test_target|
......
......@@ -320,7 +320,7 @@ module Pod
settings = {}
user_build_configurations.each_key do |configuration_name|
settings[configuration_name] = BuildSettings::Aggregate.new(self, configuration_name)
settings[configuration_name] = BuildSettings::AggregateTargetSettings.new(self, configuration_name)
end
settings
......
......@@ -412,7 +412,7 @@ module Pod
end
# A subclass that generates build settings for a {PodTarget}
class Pod < BuildSettings
class PodTargetSettings < BuildSettings
#-------------------------------------------------------------------------#
# @!group Public API
......@@ -785,7 +785,7 @@ module Pod
end
# A subclass that generates build settings for a `PodTarget`
class Aggregate < BuildSettings
class AggregateTargetSettings < BuildSettings
#-------------------------------------------------------------------------#
# @!group Public API
......
......@@ -612,7 +612,7 @@ module Pod
end
def create_build_settings
BuildSettings::Pod.new(self, false)
BuildSettings::PodTargetSettings.new(self, false)
end
end
end
......@@ -3,7 +3,7 @@ require File.expand_path('../../../../spec_helper', __FILE__)
module Pod
class Target
class BuildSettings
describe Aggregate do
describe AggregateTargetSettings do
def specs
[fixture_spec('banana-lib/BananaLib.podspec')]
end
......@@ -22,7 +22,7 @@ module Pod
unless @specs.empty?
@target.target_definition.whitelist_pod_for_configuration(@specs.first.name, 'Release')
end
@generator = Aggregate.new(@target, 'Release')
@generator = AggregateTargetSettings.new(@target, 'Release')
end
shared 'Aggregate' do
......@@ -175,7 +175,7 @@ module Pod
end
it 'does not links the pod targets with the aggregate target for non-whitelisted configuration' do
@generator = Aggregate.new(@target, 'Debug')
@generator = AggregateTargetSettings.new(@target, 'Debug')
@xcconfig = @generator.generate
@xcconfig.to_hash['OTHER_LDFLAGS'].should.not.include '-l"Pods-BananaLib"'
end
......@@ -215,9 +215,9 @@ module Pod
:product_basename => 'PodTarget',
:target_definitions => [target_definition],
)
pod_target.stubs(:build_settings => Pod.new(pod_target, false))
pod_target.stubs(:build_settings => PodTargetSettings.new(pod_target, false))
aggregate_target = fixture_aggregate_target([pod_target])
@generator = Aggregate.new(aggregate_target, 'Debug')
@generator = AggregateTargetSettings.new(aggregate_target, 'Debug')
@generator.other_ldflags.should == %w(-ObjC -l"StaticLibrary" -l"VendoredDyld" -l"xml2" -framework "PodTarget" -framework "StaticFramework" -framework "VendoredFramework" -framework "XCTest")
end
end
......@@ -526,7 +526,7 @@ module Pod
describe 'an empty pod target' do
before do
@blank_target = fixture_aggregate_target
@generator = Aggregate.new(@blank_target, 'Release')
@generator = AggregateTargetSettings.new(@blank_target, 'Release')
end
it 'it should not have any framework search paths' do
......
......@@ -3,7 +3,7 @@ require File.expand_path('../../../../spec_helper', __FILE__)
module Pod
class Target
class BuildSettings
describe Pod do
describe PodTargetSettings do
describe 'in general' do
before do
@monkey_spec = fixture_spec('monkey/monkey.podspec')
......@@ -45,7 +45,7 @@ module Pod
:uses_modular_headers? => false,
:uses_swift? => false,
)
vendored_dep_target.stubs(:build_settings => Pod.new(vendored_dep_target, false))
vendored_dep_target.stubs(:build_settings => PodTargetSettings.new(vendored_dep_target, false))
@spec = fixture_spec('banana-lib/BananaLib.podspec')
@pod_target = fixture_pod_target(@spec, true)
......@@ -53,7 +53,7 @@ module Pod
@consumer = @pod_target.spec_consumers.first
@podfile = @pod_target.podfile
@generator = Pod.new(@pod_target, false)
@generator = PodTargetSettings.new(@pod_target, false)
@spec.pod_target_xcconfig = { 'OTHER_LDFLAGS' => '-no_compact_unwind' }
@spec.user_target_xcconfig = { 'CLANG_CXX_LANGUAGE_STANDARD' => 'c++11' }
......@@ -209,7 +209,7 @@ module Pod
:sandbox => config.sandbox,
:should_build? => true,
)
pod_target.stubs(:build_settings => Pod.new(pod_target, false))
pod_target.stubs(:build_settings => PodTargetSettings.new(pod_target, false))
@generator.spec_consumers.each { |sc| sc.stubs(:frameworks => []) }
@generator.stubs(:dependent_targets => [pod_target])
@generator.send :__clear__
......@@ -241,7 +241,7 @@ module Pod
it 'does not merge pod target xcconfig of test specifications for a non test xcconfig' do
@coconut_spec.pod_target_xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS' => 'NON_TEST_FLAG=1' }
@coconut_test_spec.pod_target_xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS' => 'TEST_ONLY=1' }
generator = Pod.new(@coconut_pod_target, false)
generator = PodTargetSettings.new(@coconut_pod_target, false)
xcconfig = generator.generate
xcconfig.to_hash['GCC_PREPROCESSOR_DEFINITIONS'].should == '$(inherited) COCOAPODS=1 NON_TEST_FLAG=1'
end
......@@ -249,41 +249,41 @@ module Pod
it 'merges the pod target xcconfig of non test specifications for test xcconfigs' do
@coconut_spec.pod_target_xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS' => 'NON_TEST_FLAG=1' }
@coconut_test_spec.pod_target_xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS' => 'TEST_ONLY=1' }
generator = Pod.new(@coconut_pod_target, true)
generator = PodTargetSettings.new(@coconut_pod_target, true)
xcconfig = generator.generate
xcconfig.to_hash['GCC_PREPROCESSOR_DEFINITIONS'].should == '$(inherited) COCOAPODS=1 NON_TEST_FLAG=1 TEST_ONLY=1'
end
it 'includes correct other ld flags' do
generator = Pod.new(@coconut_pod_target, true)
generator = PodTargetSettings.new(@coconut_pod_target, true)
xcconfig = generator.generate
xcconfig.to_hash['OTHER_LDFLAGS'].should == '$(inherited) -ObjC -l"CoconutLib"'
end
it 'includes correct other ld flags when requires frameworks' do
@coconut_pod_target.stubs(:requires_frameworks?).returns(true)
generator = Pod.new(@coconut_pod_target, true)
generator = PodTargetSettings.new(@coconut_pod_target, true)
xcconfig = generator.generate
xcconfig.to_hash['OTHER_LDFLAGS'].should == '$(inherited) -ObjC -framework "CoconutLib"'
end
it 'includes other ld flags for transitive dependent targets' do
@coconut_pod_target.dependent_targets = [@monkey_pod_target]
generator = Pod.new(@coconut_pod_target, true)
generator = PodTargetSettings.new(@coconut_pod_target, true)
xcconfig = generator.generate
xcconfig.to_hash['OTHER_LDFLAGS'].should == '$(inherited) -ObjC -l"CoconutLib" -l"monkey" -framework "dynamic-monkey"'
end
it 'includes other ld flags for test dependent targets' do
@coconut_pod_target.test_dependent_targets_by_spec_name = { @coconut_test_spec.name => [@monkey_pod_target] }
generator = Pod.new(@coconut_pod_target, true)
generator = PodTargetSettings.new(@coconut_pod_target, true)
xcconfig = generator.generate
xcconfig.to_hash['OTHER_LDFLAGS'].should == '$(inherited) -ObjC -l"CoconutLib" -l"monkey" -framework "dynamic-monkey"'
end
it 'adds settings for test dependent targets' do
@coconut_pod_target.test_dependent_targets_by_spec_name = { @coconut_test_spec.name => [@banana_pod_target] }
generator = Pod.new(@coconut_pod_target, true)
generator = PodTargetSettings.new(@coconut_pod_target, true)
xcconfig = generator.generate
xcconfig.to_hash['FRAMEWORK_SEARCH_PATHS'].should == '$(inherited) "${PODS_ROOT}/../../spec/fixtures/banana-lib"'
xcconfig.to_hash['LIBRARY_SEARCH_PATHS'].should == '$(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/BananaLib" "${PODS_CONFIGURATION_BUILD_DIR}/CoconutLib" "${PODS_ROOT}/../../spec/fixtures/banana-lib"'
......@@ -292,7 +292,7 @@ module Pod
it 'adds settings for test dependent targets excluding the parents targets' do
@coconut_pod_target.dependent_targets = [@banana_pod_target]
@coconut_pod_target.test_dependent_targets_by_spec_name = { @coconut_test_spec.name => [@banana_pod_target] }
generator = Pod.new(@coconut_pod_target, true)
generator = PodTargetSettings.new(@coconut_pod_target, true)
xcconfig = generator.generate
xcconfig.to_hash['FRAMEWORK_SEARCH_PATHS'].should == '$(inherited) "${PODS_ROOT}/../../spec/fixtures/banana-lib"'
xcconfig.to_hash['LIBRARY_SEARCH_PATHS'].should == '$(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/BananaLib" "${PODS_CONFIGURATION_BUILD_DIR}/CoconutLib" "${PODS_ROOT}/../../spec/fixtures/banana-lib"'
......@@ -302,11 +302,11 @@ module Pod
@banana_pod_target.spec_consumers.each { |sc| sc.stubs(:frameworks => %w(XCTest), :vendored_frameworks => []) }
@coconut_pod_target.dependent_targets = [@banana_pod_target]
generator = Pod.new(@coconut_pod_target, false)
generator = PodTargetSettings.new(@coconut_pod_target, false)
xcconfig = generator.generate
xcconfig.to_hash['FRAMEWORK_SEARCH_PATHS'].should == '$(inherited) "$(PLATFORM_DIR)/Developer/Library/Frameworks"'
generator = Pod.new(@banana_pod_target, false)
generator = PodTargetSettings.new(@banana_pod_target, false)
xcconfig = generator.generate
xcconfig.to_hash['FRAMEWORK_SEARCH_PATHS'].should == '$(inherited) "$(PLATFORM_DIR)/Developer/Library/Frameworks"'
end
......@@ -322,7 +322,7 @@ module Pod
@coconut_pod_target.sandbox.public_headers.add_search_path('CoconutLib', Platform.ios)
@coconut_pod_target.test_dependent_targets_by_spec_name = { @coconut_test_spec.name => [@monkey_pod_target] }
@coconut_pod_target.dependent_targets = [@banana_pod_target]
generator = Pod.new(@coconut_pod_target, true)
generator = PodTargetSettings.new(@coconut_pod_target, true)
xcconfig = generator.generate
xcconfig.to_hash['HEADER_SEARCH_PATHS'].should == '$(inherited) "${PODS_ROOT}/Headers/Private"' \
' "${PODS_ROOT}/Headers/Private/CoconutLib"' \
......@@ -344,7 +344,7 @@ module Pod
@coconut_pod_target.test_dependent_targets_by_spec_name = { @coconut_test_spec.name => [@monkey_pod_target] }
@coconut_pod_target.dependent_targets = [@banana_pod_target]
# This is not an test xcconfig so it should exclude header search paths for the 'monkey' pod
generator = Pod.new(@coconut_pod_target, false)
generator = PodTargetSettings.new(@coconut_pod_target, false)
xcconfig = generator.generate
xcconfig.to_hash['HEADER_SEARCH_PATHS'].should == '$(inherited) "${PODS_ROOT}/Headers/Private"' \
' "${PODS_ROOT}/Headers/Private/CoconutLib"' \
......@@ -364,7 +364,7 @@ module Pod
@coconut_pod_target.sandbox.public_headers.add_search_path('CoconutLib', Platform.ios)
@coconut_pod_target.test_dependent_targets_by_spec_name = { @coconut_test_spec.name => [@monkey_pod_target] }
@coconut_pod_target.dependent_targets = [@banana_pod_target]
generator = Pod.new(@coconut_pod_target, true)
generator = PodTargetSettings.new(@coconut_pod_target, true)
xcconfig = generator.generate
xcconfig.to_hash['HEADER_SEARCH_PATHS'].should == '$(inherited) "${PODS_ROOT}/Headers/Private"' \
' "${PODS_ROOT}/Headers/Private/CoconutLib"' \
......@@ -382,7 +382,7 @@ module Pod
@coconut_pod_target.sandbox.public_headers.add_search_path('CoconutLib', Platform.ios)
@coconut_pod_target.test_dependent_targets_by_spec_name = { @coconut_test_spec.name => [@monkey_pod_target] }
@coconut_pod_target.dependent_targets = [@banana_pod_target]
generator = Pod.new(@coconut_pod_target, false)
generator = PodTargetSettings.new(@coconut_pod_target, false)
xcconfig = generator.generate
xcconfig.to_hash['HEADER_SEARCH_PATHS'].should == '$(inherited) "${PODS_ROOT}/Headers/Private"' \
' "${PODS_ROOT}/Headers/Private/CoconutLib"' \
......@@ -391,27 +391,27 @@ module Pod
it 'does not include other ld flags for test dependent targets if its not a test xcconfig' do
@coconut_pod_target.test_dependent_targets_by_spec_name = { @coconut_test_spec.name => [@monkey_pod_target] }
generator = Pod.new(@coconut_pod_target, false)
generator = PodTargetSettings.new(@coconut_pod_target, false)
xcconfig = generator.generate
xcconfig.to_hash['LIBRARY_SEARCH_PATHS'].should.be.nil
xcconfig.to_hash['OTHER_LDFLAGS'].should.be.nil
end
it 'includes default runpath search path list for test xcconfigs' do
generator = Pod.new(@coconut_pod_target, true)
generator = PodTargetSettings.new(@coconut_pod_target, true)
xcconfig = generator.generate
xcconfig.to_hash['LD_RUNPATH_SEARCH_PATHS'].should == "$(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'"
end
it 'includes default runpath search path list for test xcconfigs for test bundle' do
@coconut_pod_target.stubs(:platform).returns(Platform.new(:osx, '10.10'))
generator = Pod.new(@coconut_pod_target, true)
generator = PodTargetSettings.new(@coconut_pod_target, true)
xcconfig = generator.generate
xcconfig.to_hash['LD_RUNPATH_SEARCH_PATHS'].should == "$(inherited) '@executable_path/../Frameworks' '@loader_path/../Frameworks'"
end
it 'does not set configuration build dir for test xcconfigs' do
generator = Pod.new(@coconut_pod_target, true)
generator = PodTargetSettings.new(@coconut_pod_target, true)
xcconfig = generator.generate
xcconfig.to_hash['CONFIGURATION_BUILD_DIR'].should.be.nil
end
......
......@@ -4,11 +4,11 @@ module Pod
class Target
describe BuildSettings do
def pod(pod_target, test_xcconfig = false)
BuildSettings::Pod.new(pod_target, test_xcconfig)
BuildSettings::PodTargetSettings.new(pod_target, test_xcconfig)
end
def aggregate(aggregate_target, configuration_name = 'Release')
BuildSettings::Aggregate.new(aggregate_target, configuration_name)
BuildSettings::AggregateTargetSettings.new(aggregate_target, configuration_name)
end
describe 'memoization' do
......
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