lib/cocoapods/installer/user_project_integrator.rb
# Creates and saved the workspace containing the Pods project and the
# user projects, if needed.
#
# @note If the workspace already contains the projects it is not saved
#       to avoid Xcode from displaying the revert dialog: `Do you want to
#       keep the Xcode version or revert to the version on disk?`
#
# @return [void]
#
Creates and saved the workspace containing the Pods project and the
user projects, if needed.
Creates and saved the workspace containing the Pods project and the user projects if needed .
def create_workspace
        all_projects = user_project_paths.sort.push(sandbox.project_path).uniq
        projpaths = all_projects.map do |path|
          path.relative_path_from(workspace_path.dirname).to_s
        end
        if workspace_path.exist?
          workspace = Xcodeproj::Workspace.new_from_xcworkspace(workspace_path)
          new_projpaths = projpaths - workspace.projpaths
          unless new_projpaths.empty?
            workspace.projpaths.concat(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
      end
def create_workspace all_projects = user_project_paths . sort . push ( sandbox . project_path ) . uniq projpaths = all_projects . map do | path | path . relative_path_from ( workspace_path . dirname ) . to_s end if workspace_path . exist? workspace = Xcodeproj :: Workspace . new_from_xcworkspace ( workspace_path ) new_projpaths = projpaths - workspace . projpaths unless new_projpaths . empty? workspace . projpaths . concat ( 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 end
Creates and saved the workspace containing the Pods project and the
user projects, if needed.
Creates and saved the workspace containing the Pods project and the user projects if needed .
None
void
note
If the workspace already contains the projects it is not saved to avoid Xcode from displaying the revert dialog: `Do you want to keep the Xcode version or revert to the version on disk?`
If the workspace already contains the projects it is not saved to avoid Xcode from displaying the revert dialog : ` Do you want to keep the Xcode version or revert to the version on disk? `