Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
cocoapods
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gengmeiios
cocoapods
Commits
ada88864
Commit
ada88864
authored
Feb 04, 2013
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[WIP][UserProjectIntegrator] Write the workspace only if needed
parent
839286a3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
8 deletions
+26
-8
CHANGELOG.md
CHANGELOG.md
+3
-0
user_project_integrator.rb
lib/cocoapods/installer/user_project_integrator.rb
+19
-8
user_project_integrator_spec.rb
spec/unit/installer/user_project_integrator_spec.rb
+4
-0
No files found.
CHANGELOG.md
View file @
ada88864
...
...
@@ -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
...
...
lib/cocoapods/installer/user_project_integrator.rb
View file @
ada88864
...
...
@@ -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
...
...
spec/unit/installer/user_project_integrator_spec.rb
View file @
ada88864
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment