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
e1572e5b
Commit
e1572e5b
authored
Sep 12, 2014
by
Kyle Fuller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Restore the existing source root directory
Related to #2449
parent
45d7bb3a
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
31 additions
and
42 deletions
+31
-42
migrator.rb
lib/cocoapods/installer/migrator.rb
+2
-2
sandbox.rb
lib/cocoapods/sandbox.rb
+2
-3
cocoapods-integration-specs
spec/cocoapods-integration-specs
+1
-1
sandbox_analyzer_spec.rb
spec/unit/installer/analyzer/sandbox_analyzer_spec.rb
+2
-2
migrator_spec.rb
spec/unit/installer/migrator_spec.rb
+0
-10
pod_source_installer_spec.rb
spec/unit/installer/pod_source_installer_spec.rb
+22
-22
project_spec.rb
spec/unit/project_spec.rb
+1
-1
sandbox_spec.rb
spec/unit/sandbox_spec.rb
+1
-1
No files found.
lib/cocoapods/installer/migrator.rb
View file @
e1572e5b
...
@@ -28,14 +28,14 @@ module Pod
...
@@ -28,14 +28,14 @@ module Pod
sandbox
.
root
.
children
.
each
do
|
child
|
sandbox
.
root
.
children
.
each
do
|
child
|
relative
=
child
.
relative_path_from
(
sandbox
.
root
)
relative
=
child
.
relative_path_from
(
sandbox
.
root
)
case
relative
.
to_s
case
relative
.
to_s
when
'Manifest.lock'
,
'Pods.xcodeproj'
,
'
Sources'
,
'
Headers'
,
when
'Manifest.lock'
,
'Pods.xcodeproj'
,
'Headers'
,
'Target Support Files'
,
'Local Podspecs'
'Target Support Files'
,
'Local Podspecs'
next
next
when
'BuildHeaders'
,
'PublicHeaders'
when
'BuildHeaders'
,
'PublicHeaders'
delete
(
child
)
delete
(
child
)
else
else
if
child
.
directory?
&&
child
.
extname
!=
'.xcodeproj'
if
child
.
directory?
&&
child
.
extname
!=
'.xcodeproj'
move
(
child
,
sandbox
.
sources_root
+
relative
)
next
else
else
delete
(
child
)
delete
(
child
)
end
end
...
...
lib/cocoapods/sandbox.rb
View file @
e1572e5b
...
@@ -29,8 +29,7 @@ module Pod
...
@@ -29,8 +29,7 @@ module Pod
# | +-- Pods-prefix.pch
# | +-- Pods-prefix.pch
# | +-- Pods.xcconfig
# | +-- Pods.xcconfig
# |
# |
# +-- Sources
# +-- [Pod Name]
# | +-- [Pod Name]
# |
# |
# +-- Manifest.lock
# +-- Manifest.lock
# |
# |
...
@@ -173,7 +172,7 @@ module Pod
...
@@ -173,7 +172,7 @@ module Pod
# the Pods are stored.
# the Pods are stored.
#
#
def
sources_root
def
sources_root
root
+
'Sources'
root
end
end
# @return [Pathname] the path for the directory where the
# @return [Pathname] the path for the directory where the
...
...
cocoapods-integration-specs
@
b7c1ab1a
Subproject commit
64203384a3ac363eab602bc6f09004d483f594e1
Subproject commit
b7c1ab1a977958c5f6f657ee8577703d04f79fc4
spec/unit/installer/analyzer/sandbox_analyzer_spec.rb
View file @
e1572e5b
...
@@ -168,7 +168,7 @@ module Pod
...
@@ -168,7 +168,7 @@ module Pod
it
'returns whether the folder containing the Pod with the given name exists'
do
it
'returns whether the folder containing the Pod with the given name exists'
do
@analyzer
.
send
(
:folder_exist?
,
'BananaLib'
).
should
.
be
.
false
@analyzer
.
send
(
:folder_exist?
,
'BananaLib'
).
should
.
be
.
false
path
=
temporary_directory
+
'Pods/
Sources/
BananaLib'
path
=
temporary_directory
+
'Pods/BananaLib'
path
.
mkpath
path
.
mkpath
@analyzer
.
send
(
:folder_exist?
,
'BananaLib'
).
should
.
be
.
true
@analyzer
.
send
(
:folder_exist?
,
'BananaLib'
).
should
.
be
.
true
...
@@ -176,7 +176,7 @@ module Pod
...
@@ -176,7 +176,7 @@ module Pod
it
'returns whether the folder containing the Pod with the given name is empty'
do
it
'returns whether the folder containing the Pod with the given name is empty'
do
@analyzer
.
send
(
:folder_empty?
,
'BananaLib'
).
should
.
be
.
true
@analyzer
.
send
(
:folder_empty?
,
'BananaLib'
).
should
.
be
.
true
path
=
temporary_directory
+
'Pods/
Sources/
BananaLib'
path
=
temporary_directory
+
'Pods/BananaLib'
path
.
mkpath
path
.
mkpath
File
.
open
(
path
+
'file'
,
'w'
)
{}
File
.
open
(
path
+
'file'
,
'w'
)
{}
@analyzer
.
send
(
:folder_empty?
,
'BananaLib'
).
should
.
be
.
false
@analyzer
.
send
(
:folder_empty?
,
'BananaLib'
).
should
.
be
.
false
...
...
spec/unit/installer/migrator_spec.rb
View file @
e1572e5b
...
@@ -2,16 +2,6 @@ require File.expand_path('../../../spec_helper', __FILE__)
...
@@ -2,16 +2,6 @@ require File.expand_path('../../../spec_helper', __FILE__)
module
Pod
module
Pod
describe
Installer
::
Migrator
do
describe
Installer
::
Migrator
do
it
'performs a migration'
do
manifest
=
stub
(
:cocoapods_version
=>
Version
.
new
(
'0.32'
))
config
.
sandbox
.
stubs
(
:manifest
).
returns
(
manifest
)
old_path
=
config
.
sandbox
.
root
+
'ARAnalytics'
old_path
.
mkdir
Installer
::
Migrator
.
migrate
(
config
.
sandbox
)
old_path
.
should
.
not
.
exist?
(
config
.
sandbox
.
sources_root
+
'ARAnalytics'
).
should
.
exist?
end
it
"doesn't perform migrations if they are not needed"
do
it
"doesn't perform migrations if they are not needed"
do
manifest
=
stub
(
:cocoapods_version
=>
Version
.
new
(
'999'
))
manifest
=
stub
(
:cocoapods_version
=>
Version
.
new
(
'999'
))
config
.
sandbox
.
stubs
(
:manifest
).
returns
(
manifest
)
config
.
sandbox
.
stubs
(
:manifest
).
returns
(
manifest
)
...
...
spec/unit/installer/pod_source_installer_spec.rb
View file @
e1572e5b
...
@@ -119,14 +119,14 @@ module Pod
...
@@ -119,14 +119,14 @@ module Pod
it
'cleans the paths non used by the installation'
do
it
'cleans the paths non used by the installation'
do
@installer
.
install!
@installer
.
install!
@installer
.
clean!
@installer
.
clean!
unused_file
=
config
.
sandbox
.
root
+
'
Sources/
BananaLib/sub-dir/sub-dir-2/somefile.txt'
unused_file
=
config
.
sandbox
.
root
+
'BananaLib/sub-dir/sub-dir-2/somefile.txt'
unused_file
.
should
.
not
.
exist
unused_file
.
should
.
not
.
exist
end
end
it
'preserves important files like the LICENSE and the README'
do
it
'preserves important files like the LICENSE and the README'
do
@installer
.
install!
@installer
.
install!
@installer
.
clean!
@installer
.
clean!
readme_file
=
config
.
sandbox
.
root
+
'
Sources/
BananaLib/README'
readme_file
=
config
.
sandbox
.
root
+
'BananaLib/README'
readme_file
.
should
.
exist
readme_file
.
should
.
exist
end
end
...
@@ -169,13 +169,13 @@ module Pod
...
@@ -169,13 +169,13 @@ module Pod
@installer
.
send
(
:download_source
)
@installer
.
send
(
:download_source
)
paths
=
@installer
.
send
(
:clean_paths
)
paths
=
@installer
.
send
(
:clean_paths
)
relative_paths
=
paths
.
map
{
|
p
|
p
.
gsub
(
"
#{
temporary_directory
}
/"
,
''
)
}
relative_paths
=
paths
.
map
{
|
p
|
p
.
gsub
(
"
#{
temporary_directory
}
/"
,
''
)
}
paths_without_git
=
relative_paths
.
reject
{
|
p
|
p
.
include?
'Pods/
Sources/
BananaLib/.git'
}
paths_without_git
=
relative_paths
.
reject
{
|
p
|
p
.
include?
'Pods/BananaLib/.git'
}
paths_without_git
.
sort
.
should
==
[
paths_without_git
.
sort
.
should
==
[
'Pods/
Sources/
BananaLib/BananaLib.podspec'
,
'Pods/BananaLib/BananaLib.podspec'
,
'Pods/
Sources/
BananaLib/libPusher'
,
'Pods/BananaLib/libPusher'
,
'Pods/
Sources/
BananaLib/sub-dir'
,
'Pods/BananaLib/sub-dir'
,
'Pods/
Sources/
BananaLib/sub-dir/sub-dir-2'
,
'Pods/BananaLib/sub-dir/sub-dir-2'
,
'Pods/
Sources/
BananaLib/sub-dir/sub-dir-2/somefile.txt'
,
'Pods/BananaLib/sub-dir/sub-dir-2/somefile.txt'
,
]
]
end
end
...
@@ -184,13 +184,13 @@ module Pod
...
@@ -184,13 +184,13 @@ module Pod
paths
=
@installer
.
send
(
:used_files
)
paths
=
@installer
.
send
(
:used_files
)
relative_paths
=
paths
.
map
{
|
p
|
p
.
gsub
(
"
#{
temporary_directory
}
/"
,
''
)
}
relative_paths
=
paths
.
map
{
|
p
|
p
.
gsub
(
"
#{
temporary_directory
}
/"
,
''
)
}
relative_paths
.
sort
.
should
==
[
relative_paths
.
sort
.
should
==
[
'Pods/
Sources/
BananaLib/Classes/Banana.h'
,
'Pods/BananaLib/Classes/Banana.h'
,
'Pods/
Sources/
BananaLib/Classes/Banana.m'
,
'Pods/BananaLib/Classes/Banana.m'
,
'Pods/
Sources/
BananaLib/Classes/BananaLib.pch'
,
'Pods/BananaLib/Classes/BananaLib.pch'
,
'Pods/
Sources/
BananaLib/Classes/BananaPrivate.h'
,
'Pods/BananaLib/Classes/BananaPrivate.h'
,
'Pods/
Sources/
BananaLib/LICENSE'
,
'Pods/BananaLib/LICENSE'
,
'Pods/
Sources/
BananaLib/README'
,
'Pods/BananaLib/README'
,
'Pods/
Sources/
BananaLib/Resources/logo-sidebar.png'
,
'Pods/BananaLib/Resources/logo-sidebar.png'
,
]
]
end
end
...
@@ -208,13 +208,13 @@ module Pod
...
@@ -208,13 +208,13 @@ module Pod
paths
=
@installer
.
send
(
:used_files
)
paths
=
@installer
.
send
(
:used_files
)
relative_paths
=
paths
.
map
{
|
p
|
p
.
gsub
(
"
#{
temporary_directory
}
/"
,
''
)
}
relative_paths
=
paths
.
map
{
|
p
|
p
.
gsub
(
"
#{
temporary_directory
}
/"
,
''
)
}
relative_paths
.
sort
.
should
==
[
relative_paths
.
sort
.
should
==
[
'Pods/
Sources/
BananaLib/Classes/Banana.h'
,
'Pods/BananaLib/Classes/Banana.h'
,
'Pods/
Sources/
BananaLib/Classes/Banana.m'
,
'Pods/BananaLib/Classes/Banana.m'
,
'Pods/
Sources/
BananaLib/Classes/BananaLib.pch'
,
'Pods/BananaLib/Classes/BananaLib.pch'
,
'Pods/
Sources/
BananaLib/Classes/BananaPrivate.h'
,
'Pods/BananaLib/Classes/BananaPrivate.h'
,
'Pods/
Sources/
BananaLib/LICENSE'
,
'Pods/BananaLib/LICENSE'
,
'Pods/
Sources/
BananaLib/README'
,
'Pods/BananaLib/README'
,
'Pods/
Sources/
BananaLib/Resources/logo-sidebar.png'
,
'Pods/BananaLib/Resources/logo-sidebar.png'
,
]
]
end
end
...
...
spec/unit/project_spec.rb
View file @
e1572e5b
...
@@ -52,7 +52,7 @@ module Pod
...
@@ -52,7 +52,7 @@ module Pod
path
=
config
.
sandbox
.
pod_dir
(
'BananaLib'
)
path
=
config
.
sandbox
.
pod_dir
(
'BananaLib'
)
group
=
@project
.
add_pod_group
(
'BananaLib'
,
@path
)
group
=
@project
.
add_pod_group
(
'BananaLib'
,
@path
)
group
.
source_tree
.
should
==
'<group>'
group
.
source_tree
.
should
==
'<group>'
group
.
path
.
should
==
'
Sources/
BananaLib'
group
.
path
.
should
==
'BananaLib'
Pathname
.
new
(
group
.
path
).
should
.
be
.
relative
Pathname
.
new
(
group
.
path
).
should
.
be
.
relative
end
end
...
...
spec/unit/sandbox_spec.rb
View file @
e1572e5b
...
@@ -78,7 +78,7 @@ module Pod
...
@@ -78,7 +78,7 @@ module Pod
it
'returns the directory where a Pod is stored'
do
it
'returns the directory where a Pod is stored'
do
@sandbox
.
pod_dir
(
'JSONKit'
).
should
==
@sandbox
.
pod_dir
(
'JSONKit'
).
should
==
temporary_directory
+
'Sandbox/
Sources/
JSONKit'
temporary_directory
+
'Sandbox/JSONKit'
end
end
it
'returns the directory where a local Pod is stored'
do
it
'returns the directory where a local Pod is stored'
do
...
...
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