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