Commit ada88864 authored by Fabio Pelosin's avatar Fabio Pelosin

[WIP][UserProjectIntegrator] Write the workspace only if needed

parent 839286a3
......@@ -13,6 +13,9 @@
- Add support for `prefix_header_contents` in subspecs
- Add Rake FileList warning.
- Release: Enable CocoaPods Core-warnings
- Subspecs now do not inherit the files patterns from the parent spec.
- The workspace is written only if needed greatly reducing the occasions in
which Xcode asks to revert.
###### Specification DSL
......
......@@ -69,20 +69,31 @@ module Pod
private
# Creates and saved the workspace containing the Pods project and the
# user projects.
# user projects, if needed.
#
# @note If the workspace alreayd containts the projects it is not saved
# to avoid Xcode from diplatying the revert dialog: `Do you want to
# keep the Xcode version or revert to the version on disk?`
#
# @return [void]
#
def create_workspace
workspace = Xcodeproj::Workspace.new_from_xcworkspace(workspace_path)
[sandbox.project_path, *user_project_paths].each do |project_path|
path = project_path.relative_path_from(workspace_path.dirname).to_s
workspace << path unless workspace.include?(path)
end
unless workspace_path.exist?
projpaths = [sandbox.project_path, *user_project_paths].map do |path|
path.relative_path_from(workspace_path.dirname).to_s
end.uniq
if workspace_path.exist?
current_workspace = Xcodeproj::Workspace.new_from_xcworkspace(workspace_path)
if current_workspace.projpaths != projpaths
workspace = Xcodeproj::Workspace.new(*projpaths)
workspace.save_as(workspace_path)
end
else
UI.notice "From now on use `#{workspace_path.basename}'."
workspace = Xcodeproj::Workspace.new(*projpaths)
workspace.save_as(workspace_path)
end
workspace.save_as(workspace_path)
end
# Integrates the targets of the user projects with the libraries
......
......@@ -71,6 +71,10 @@ module Pod
@integrator.integrate!
UI.warnings.should.include?('The Podfile does not contain any dependency')
end
xit "It writes the workspace only if needed" do
end
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