Commit 1168e907 authored by Fabio Pelosin's avatar Fabio Pelosin

[TargetInstaller] Minor improvement to #add_files_to_build_phases.

parent 6b29904c
...@@ -91,10 +91,10 @@ module Pod ...@@ -91,10 +91,10 @@ module Pod
library.target = @target library.target = @target
end end
# Adds the build files of the pods to the target and adds a refence to # Adds the build files of the pods to the target and adds a reference to
# the frameworks of the Pods. # the frameworks of the Pods.
# #
# @note The Frameworks are used only for presentation purporses as the # @note The Frameworks are used only for presentation purposes as the
# xcconfig is the authoritative source about their information. # xcconfig is the authoritative source about their information.
# #
# @return [void] # @return [void]
...@@ -102,15 +102,14 @@ module Pod ...@@ -102,15 +102,14 @@ module Pod
def add_files_to_build_phases def add_files_to_build_phases
UI.message "- Adding Build files" do UI.message "- Adding Build files" do
library.file_accessors.each do |file_accessor| library.file_accessors.each do |file_accessor|
UI.message "- #{file_accessor.spec}"
file_accessor.source_files.each do |source_file|
file_reference = project.file_reference(source_file, file_accessor.spec_consumer.spec.name)
consumer = file_accessor.spec_consumer consumer = file_accessor.spec_consumer
flags = consumer.compiler_flags.dup flags = consumer.compiler_flags.dup
flags << '-fobjc-arc' if consumer.requires_arc flags << '-fobjc-arc' if consumer.requires_arc
flags = flags * " " flags = flags * " "
target.add_file_references([file_reference], flags) source_files = file_accessor.source_files
end file_refs = source_files.map { |sf| project.file_reference(sf) }
target.add_file_references(file_refs, flags)
file_accessor.spec_consumer.frameworks.each do |framework| file_accessor.spec_consumer.frameworks.each do |framework|
framework_ref = project.add_system_framework(framework, target) framework_ref = project.add_system_framework(framework, target)
end end
......
...@@ -11,14 +11,13 @@ module Pod ...@@ -11,14 +11,13 @@ module Pod
xcodeproj 'dummy' xcodeproj 'dummy'
end end
@target_definition = @podfile.target_definitions[:default] @target_definition = @podfile.target_definitions[:default]
@project = Project.new @project = Project.new(config.sandbox.project_path)
config.sandbox.project = @project config.sandbox.project = @project
path_list = Sandbox::PathList.new(fixture('banana-lib')) path_list = Sandbox::PathList.new(fixture('banana-lib'))
@spec = fixture_spec('banana-lib/BananaLib.podspec') @spec = fixture_spec('banana-lib/BananaLib.podspec')
file_accessor = Sandbox::FileAccessor.new(path_list, @spec.consumer(:ios)) file_accessor = Sandbox::FileAccessor.new(path_list, @spec.consumer(:ios))
source_files = config.sandbox.relativize_paths(file_accessor.source_files) @project.add_file_references(file_accessor.source_files, 'BananaLib', @project.pods)
@project.add_source_files(source_files, 'BananaLib', @project.pods)
@library = Library.new(@target_definition) @library = Library.new(@target_definition)
@library.platform = Platform.new(:ios, '6.0') @library.platform = Platform.new(:ios, '6.0')
......
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