Commit 17a5f930 authored by Marius Rackwitz's avatar Marius Rackwitz

[Refactor] Renamed TargetInstaller#target to native_target

parent 411bfb13
...@@ -39,10 +39,10 @@ module Pod ...@@ -39,10 +39,10 @@ module Pod
name = library.label name = library.label
platform = library.platform.name platform = library.platform.name
deployment_target = library.platform.deployment_target.to_s deployment_target = library.platform.deployment_target.to_s
@target = project.new_target(:static_library, name, platform, deployment_target) @native_target = project.new_target(:static_library, name, platform, deployment_target)
library.user_build_configurations.each do |bc_name, type| library.user_build_configurations.each do |bc_name, type|
configuration = @target.add_build_configuration(bc_name, type) configuration = @native_target.add_build_configuration(bc_name, type)
end end
settings = { 'OTHER_LDFLAGS' => '', 'OTHER_LIBTOOLFLAGS' => '' } settings = { 'OTHER_LDFLAGS' => '', 'OTHER_LIBTOOLFLAGS' => '' }
...@@ -50,11 +50,11 @@ module Pod ...@@ -50,11 +50,11 @@ module Pod
settings['ARCHS'] = library.archs settings['ARCHS'] = library.archs
end end
@target.build_configurations.each do |configuration| @native_target.build_configurations.each do |configuration|
configuration.build_settings.merge!(settings) configuration.build_settings.merge!(settings)
end end
library.target = @target library.native_target = @native_target
end end
# Creates the directory where to store the support files of the target. # Creates the directory where to store the support files of the target.
...@@ -73,7 +73,7 @@ module Pod ...@@ -73,7 +73,7 @@ module Pod
generator = Generator::DummySource.new(library.label) generator = Generator::DummySource.new(library.label)
generator.save_as(path) generator.save_as(path)
file_reference = add_file_to_support_group(path) file_reference = add_file_to_support_group(path)
target.source_build_phase.add_file_reference(file_reference) native_target.source_build_phase.add_file_reference(file_reference)
end end
# @return [PBXNativeTarget] the target generated by the installation # @return [PBXNativeTarget] the target generated by the installation
...@@ -81,7 +81,7 @@ module Pod ...@@ -81,7 +81,7 @@ module Pod
# #
# @note Generated by the {#add_target} step. # @note Generated by the {#add_target} step.
# #
attr_reader :target attr_reader :native_target
private private
......
...@@ -43,7 +43,7 @@ module Pod ...@@ -43,7 +43,7 @@ module Pod
# @return [void] # @return [void]
# #
def create_xcconfig_file def create_xcconfig_file
target.build_configurations.each do |configuration| native_target.build_configurations.each do |configuration|
path = library.xcconfig_path(configuration.name) path = library.xcconfig_path(configuration.name)
gen = Generator::XCConfig::AggregateXCConfig.new(library, configuration.name) gen = Generator::XCConfig::AggregateXCConfig.new(library, configuration.name)
gen.save_as(path) gen.save_as(path)
...@@ -74,7 +74,7 @@ module Pod ...@@ -74,7 +74,7 @@ module Pod
def create_bridge_support_file def create_bridge_support_file
if target_definition.podfile.generate_bridge_support? if target_definition.podfile.generate_bridge_support?
path = library.bridge_support_path path = library.bridge_support_path
headers = target.headers_build_phase.files.map { |bf| sandbox.root + bf.file_ref.path } headers = native_target.headers_build_phase.files.map { |bf| sandbox.root + bf.file_ref.path }
generator = Generator::BridgeSupport.new(headers) generator = Generator::BridgeSupport.new(headers)
generator.save_as(path) generator.save_as(path)
add_file_to_support_group(path) add_file_to_support_group(path)
......
...@@ -39,9 +39,9 @@ module Pod ...@@ -39,9 +39,9 @@ module Pod
all_source_files = file_accessor.source_files all_source_files = file_accessor.source_files
regular_source_files = all_source_files.reject { |sf| sf.extname == '.d' } regular_source_files = all_source_files.reject { |sf| sf.extname == '.d' }
regular_file_refs = regular_source_files.map { |sf| project.reference_for_path(sf) } regular_file_refs = regular_source_files.map { |sf| project.reference_for_path(sf) }
target.add_file_references(regular_file_refs, flags) native_target.add_file_references(regular_file_refs, flags)
other_file_refs = (all_source_files - regular_source_files).map { |sf| project.reference_for_path(sf) } other_file_refs = (all_source_files - regular_source_files).map { |sf| project.reference_for_path(sf) }
target.add_file_references(other_file_refs, nil) native_target.add_file_references(other_file_refs, nil)
end end
end end
...@@ -57,7 +57,7 @@ module Pod ...@@ -57,7 +57,7 @@ module Pod
file_accessor.resource_bundles.each do |bundle_name, paths| file_accessor.resource_bundles.each do |bundle_name, paths|
# Add a dependency on an existing Resource Bundle target if possible # Add a dependency on an existing Resource Bundle target if possible
if bundle_target = project.targets.find { |target| target.name == bundle_name } if bundle_target = project.targets.find { |target| target.name == bundle_name }
target.add_dependency(bundle_target) native_target.add_dependency(bundle_target)
next next
end end
file_references = paths.map { |sf| project.reference_for_path(sf) } file_references = paths.map { |sf| project.reference_for_path(sf) }
...@@ -68,7 +68,7 @@ module Pod ...@@ -68,7 +68,7 @@ module Pod
bundle_target.add_build_configuration(bc_name, type) bundle_target.add_build_configuration(bc_name, type)
end end
target.add_dependency(bundle_target) native_target.add_dependency(bundle_target)
end end
end end
end end
...@@ -88,7 +88,7 @@ module Pod ...@@ -88,7 +88,7 @@ module Pod
private_gen.save_as(path) private_gen.save_as(path)
xcconfig_file_ref = add_file_to_support_group(path) xcconfig_file_ref = add_file_to_support_group(path)
target.build_configurations.each do |c| native_target.build_configurations.each do |c|
c.base_configuration_reference = xcconfig_file_ref c.base_configuration_reference = xcconfig_file_ref
end end
end end
...@@ -106,7 +106,7 @@ module Pod ...@@ -106,7 +106,7 @@ module Pod
generator.save_as(path) generator.save_as(path)
add_file_to_support_group(path) add_file_to_support_group(path)
target.build_configurations.each do |c| native_target.build_configurations.each do |c|
relative_path = path.relative_path_from(project.path.dirname) relative_path = path.relative_path_from(project.path.dirname)
c.build_settings['GCC_PREFIX_HEADER'] = relative_path.to_s c.build_settings['GCC_PREFIX_HEADER'] = relative_path.to_s
end end
......
...@@ -32,7 +32,7 @@ module Pod ...@@ -32,7 +32,7 @@ module Pod
it 'adds the architectures to the custom build configurations of the user target' do it 'adds the architectures to the custom build configurations of the user target' do
@pod_target.archs = '$(ARCHS_STANDARD_64_BIT)' @pod_target.archs = '$(ARCHS_STANDARD_64_BIT)'
@installer.send(:add_target) @installer.send(:add_target)
@installer.send(:target).resolved_build_setting('ARCHS').should == { @installer.send(:native_target).resolved_build_setting('ARCHS').should == {
'Release' => '$(ARCHS_STANDARD_64_BIT)', 'Release' => '$(ARCHS_STANDARD_64_BIT)',
'Debug' => '$(ARCHS_STANDARD_64_BIT)', 'Debug' => '$(ARCHS_STANDARD_64_BIT)',
'AppStore' => '$(ARCHS_STANDARD_64_BIT)', 'AppStore' => '$(ARCHS_STANDARD_64_BIT)',
......
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