Commit 12a91103 authored by Eloy Duran's avatar Eloy Duran

more stashing

parent 5df26a6f
......@@ -33,14 +33,18 @@ module Pod
end
def target_integrators
@podfile.target_definitions.values.map do |definition|
TargetIntegrator.new(definition)
end
@target_integrators ||= @podfile.target_definitions.values.map do |definition|
TargetIntegrator.new(definition) unless definition.empty?
end.compact
end
def user_projects
@podfile.target_definitions.values.map(&:xcodeproj)
end
def create_workspace!
workspace = Xcodeproj::Workspace.new_from_xcworkspace(workspace_path)
[user_project_path, pods_project_path].each do |project_path|
[pods_project_path, *user_projects].each do |project_path|
project_path = project_path.relative_path_from(config.project_root).to_s
workspace << project_path unless workspace.include?(project_path)
end
......@@ -54,6 +58,10 @@ module Pod
@target_definition = target_definition
end
def inspect
"#<#{self.class} for target `#{@target_definition.label}'>"
end
def integrate!
return if targets.empty?
add_xcconfig_base_configuration
......
......@@ -83,19 +83,22 @@ describe Pod::Installer::UserProjectIntegrator do
end
it "only tries to integrate Pods libraries into user targets that haven't been integrated yet" do
app, test_runner = @integrator.user_project.targets.to_a
app, test_runner = @integrator.target_integrators.first.user_project.targets.to_a
p app.frameworks_build_phases.first.files
test_runner.frameworks_build_phases.first.build_files.last.destroy
#p app, test_runner
targets = @integrator.targets.sort_by { |target| target.target_definition.label }
@integrator.stubs(:targets).returns(targets)
target_integrators = @integrator.target_integrators.sort_by { |target| target.target_definition.label }
@integrator.stubs(:target_integrators).returns(target_integrators)
#p target_integrators
targets.first.expects(:add_pods_library).never
targets.last.expects(:add_pods_library)
target_integrators.first.expects(:add_pods_library).never
target_integrators.last.expects(:add_pods_library)
@integrator.integrate!
end
it "does not even try to save the project if none of the target integrators had any work to do" do
@integrator.user_project.expects(:save_as).never
xit "does not even try to save the project if none of the target integrators had any work to do" do
@integrator.target_integrators.first.user_project.expects(:save_as).never
@integrator.integrate!
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