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
ac5f166c
Commit
ac5f166c
authored
May 20, 2013
by
Fabio Pelosin
Committed by
Michele
Jun 02, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initial work for sandbox reorganization
parent
c4fedc56
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
119 additions
and
16 deletions
+119
-16
external_sources.rb
lib/cocoapods/external_sources.rb
+1
-1
installer.rb
lib/cocoapods/installer.rb
+9
-0
migrator.rb
lib/cocoapods/installer/migrator.rb
+82
-0
target_installer.rb
lib/cocoapods/installer/target_installer.rb
+2
-2
sandbox.rb
lib/cocoapods/sandbox.rb
+21
-10
headers_store.rb
lib/cocoapods/sandbox/headers_store.rb
+4
-3
No files found.
lib/cocoapods/external_sources.rb
View file @
ac5f166c
...
...
@@ -134,7 +134,7 @@ module Pod
#
def
pre_download
(
sandbox
)
UI
.
titled_section
(
"Pre-downloading: `
#{
name
}
`
#{
description
}
"
,
{
:verbose_prefix
=>
"-> "
})
do
target
=
sandbox
.
root
+
name
target
=
sandbox
.
pod_dir
(
name
)
target
.
rmtree
if
target
.
exist?
downloader
=
Downloader
.
for_target
(
target
,
params
)
downloader
.
cache_root
=
CACHE_ROOT
.
to_s
...
...
lib/cocoapods/installer.rb
View file @
ac5f166c
...
...
@@ -30,6 +30,7 @@ module Pod
autoload
:Analyzer
,
'cocoapods/installer/analyzer'
autoload
:FileReferencesInstaller
,
'cocoapods/installer/file_references_installer'
autoload
:Migrator
,
'cocoapods/installer/migrator'
autoload
:PodSourceInstaller
,
'cocoapods/installer/pod_source_installer'
autoload
:TargetInstaller
,
'cocoapods/installer/target_installer'
autoload
:UserProjectIntegrator
,
'cocoapods/installer/user_project_integrator'
...
...
@@ -81,12 +82,20 @@ module Pod
# @return [void]
#
def
install!
migrate_installation_if_needed
resolve_dependencies
download_dependencies
generate_pods_project
integrate_user_project
if
config
.
integrate_targets?
end
def
migrate_installation_if_needed
UI
.
section
"Performing existing installation migration"
do
migrator
=
Migrator
.
new
(
lockfile
.
cocoapods_version
,
sandbox
)
migrator
.
migrate!
end
end
def
resolve_dependencies
UI
.
section
"Analyzing dependencies"
do
analyze
...
...
lib/cocoapods/installer/migrator.rb
0 → 100644
View file @
ac5f166c
module
Pod
class
Installer
# Migrates installations performed by previous versions of CocoaPods.
#
class
Migrator
#
#
attr_reader
:installation_version
#
#
attr_reader
:sandbox
#
#
def
initialize
(
installation_version
,
sandbox
)
@installation_version
=
installation_version
@sandbox
=
sandbox
end
#
#
def
migrate!
migrate_to_0_20
if
version_minor
(
'0.20'
)
end
#-----------------------------------------------------------------------#
private
# @!group Migration Steps
def
migrate_to_0_20
title_options
=
{
:verbose_prefix
=>
"-> "
.
green
}
UI
.
titled_section
(
"Migrating to CocoaPods 0.20"
.
green
,
title_options
)
do
mkdir
(
sandbox
.
generated_dir_root
)
mkdir
(
sandbox
.
headers_root
)
mkdir
(
sandbox
.
sources_root
)
sandbox
.
root
.
children
.
each
do
|
child
|
relative
=
child
.
relative_path_from
(
sandbox
.
root
)
case
relative
.
to_s
when
'Generated'
next
when
'BuildHeaders'
,
'Headers'
move
(
child
,
sandbox
.
headers_root
+
relative
)
else
if
child
.
directory?
&&
child
.
extname
!=
'.xcodeproj'
move
(
child
,
sandbox
.
sources_root
+
relative
)
else
move
(
child
,
sandbox
.
generated_dir_root
+
relative
)
end
end
end
end
end
#-----------------------------------------------------------------------#
private
# @!group Private helpers
def
version_minor
(
target_version
)
installation_version
<
Version
.
new
(
target_version
)
end
def
mkdir
(
path
)
path
.
mkpath
end
def
move
(
path
,
new_name
)
path
.
rename
(
new_name
)
end
#-----------------------------------------------------------------------#
end
end
end
lib/cocoapods/installer/target_installer.rb
View file @
ac5f166c
...
...
@@ -176,8 +176,8 @@ module Pod
generator
.
save_as
(
path
)
add_file_to_support_group
(
path
)
relative_path
=
project
.
relativize
(
path
)
target
.
build_configurations
.
each
do
|
c
|
relative_path
=
path
.
relative_path_from
(
sandbox
.
root
)
c
.
build_settings
[
'GCC_PREFIX_HEADER'
]
=
relative_path
.
to_s
end
end
...
...
@@ -305,7 +305,7 @@ module Pod
# @return [PBXFileReference] the file reference of the added file.
#
def
add_file_to_support_group
(
path
)
relative_path
=
p
ath
.
relative_path_from
(
sandbox
.
root
)
relative_path
=
p
roject
.
relativize
(
path
)
support_files_group
.
new_file
(
relative_path
)
end
...
...
lib/cocoapods/sandbox.rb
View file @
ac5f166c
...
...
@@ -92,7 +92,7 @@ module Pod
# @return [void]
#
def
implode
root
.
rmtree
generated_dir_
root
.
rmtree
end
# Removes the files of the Pod with the given name from the sandbox.
...
...
@@ -124,13 +124,13 @@ module Pod
# @return [Pathname] the path of the manifest.
#
def
manifest_path
root
+
"Manifest.lock"
generated_dir_
root
+
"Manifest.lock"
end
# @return [Pathname] the path of the Pods project.
#
def
project_path
root
+
"Pods.xcodeproj"
generated_dir_
root
+
"Pods.xcodeproj"
end
# Returns the path for the directory where to store the support files of
...
...
@@ -143,7 +143,7 @@ module Pod
#
def
library_support_files_dir
(
name
)
# root + "Target Support Files/#{name}"
root
generated_dir_
root
end
# Returns the path where the Pod with the given name is stored, taking into
...
...
@@ -159,17 +159,28 @@ module Pod
if
local?
(
root_name
)
Pathname
.
new
(
local_pods
[
root_name
])
else
# root + "Sources/#{name}"
root
+
root_name
sources_root
+
root_name
end
end
# @return [Pathname]
the directory where to store the documentation.
# @return [Pathname]
#
def
documentation_dir
root
+
'
Documentation
'
def
generated_dir_root
root
+
'
Generated
'
end
# @return [Pathname]
#
def
headers_root
generated_dir_root
+
'Headers'
end
def
sources_root
generated_dir_root
+
'Sources'
end
#-------------------------------------------------------------------------#
public
...
...
@@ -197,7 +208,7 @@ module Pod
#
def
specifications_dir
(
external_source
=
false
)
# root + "Specifications"
root
+
"Local Podspecs"
generated_dir_
root
+
"Local Podspecs"
end
# Returns the path of the specification for the Pod with the
...
...
lib/cocoapods/sandbox/headers_store.rb
View file @
ac5f166c
...
...
@@ -9,7 +9,7 @@ module Pod
# @return [Pathname] the absolute path of this header directory.
#
def
root
@sandbox
.
root
+
@relative_path
sandbox
.
headers_
root
+
@relative_path
end
# @return [Sandbox] the sandbox where this header directory is stored.
...
...
@@ -58,7 +58,8 @@ module Pod
# headers directory.
#
# @param [Pathname] relative_header_path
# the path of the header file relative to the sandbox.
# the path of the header file relative to the Pods project
# (`PODS_ROOT` variable of the xcconfigs).
#
# @note This method adds the files to the search paths.
#
...
...
@@ -70,7 +71,7 @@ module Pod
namespaced_path
.
mkpath
unless
File
.
exist?
(
namespaced_path
)
relative_header_paths
.
map
do
|
relative_header_path
|
source
=
(
@
sandbox
.
root
+
relative_header_path
).
relative_path_from
(
namespaced_path
)
source
=
(
sandbox
.
root
+
relative_header_path
).
relative_path_from
(
namespaced_path
)
Dir
.
chdir
(
namespaced_path
)
do
FileUtils
.
ln_sf
(
source
,
relative_header_path
.
basename
)
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