lib/cocoapods/installer/user_project_integrator.rb
def create_workspace
        all_projects = user_project_paths.sort.push(sandbox.project_path).uniq
        file_references = all_projects.map do |path|
          relative_path = path.relative_path_from(workspace_path.dirname).to_s
          Xcodeproj::Workspace::FileReference.new(relative_path, 'group')
        end

        if workspace_path.exist?
          workspace = Xcodeproj::Workspace.new_from_xcworkspace(workspace_path)
          new_file_references = file_references - workspace.file_references
          unless new_file_references.empty?
            new_file_references.each { |fr| workspace << fr }
            workspace.save_as(workspace_path)
          end

        else
          UI.notice "Please close any current Xcode sessions and use `#{workspace_path.basename}` for this project from now on."
          workspace = Xcodeproj::Workspace.new(*file_references)
          workspace.save_as(workspace_path)
        end
      end
# 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
        file_references = all_projects.map do |path|
          relative_path = path.relative_path_from(workspace_path.dirname).to_s
          Xcodeproj::Workspace::FileReference.new(relative_path, 'group')
        end
        if workspace_path.exist?
          workspace = Xcodeproj::Workspace.new_from_xcworkspace(workspace_path)
          new_file_references = file_references - workspace.file_references
          unless new_file_references.empty?
            new_file_references.each { |fr| workspace << fr }
            workspace.save_as(workspace_path)
          end
        else
          UI.notice "Please close any current Xcode sessions and use `#{workspace_path.basename}` for this project from now on."
          workspace = Xcodeproj::Workspace.new(*file_references)
          workspace.save_as(workspace_path)
        end
      end
def create_workspace all_projects = user_project_paths . sort . push ( sandbox . project_path ) . uniq file_references = all_projects . map do | path | relative_path = path . relative_path_from ( workspace_path . dirname ) . to_s Xcodeproj :: Workspace :: FileReference . new ( relative_path , 'group' ) end if workspace_path . exist? workspace = Xcodeproj :: Workspace . new_from_xcworkspace ( workspace_path ) new_file_references = file_references - workspace . file_references unless new_file_references . empty? new_file_references . each { | fr | workspace << fr } workspace . save_as ( workspace_path ) end else UI . notice "Please close any current Xcode sessions and use `#{workspace_path.basename}` for this project from now on." workspace = Xcodeproj :: Workspace . new ( * file_references ) 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? `