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
3b83f2a6
Commit
3b83f2a6
authored
Mar 28, 2012
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[colors] Added colors to install
parent
a8717ff2
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
13 deletions
+27
-13
command.rb
lib/cocoapods/command.rb
+2
-0
install.rb
lib/cocoapods/command/install.rb
+1
-0
installer.rb
lib/cocoapods/installer.rb
+21
-9
resolver.rb
lib/cocoapods/resolver.rb
+2
-3
source.rb
lib/cocoapods/source.rb
+1
-1
No files found.
lib/cocoapods/command.rb
View file @
3b83f2a6
require
'colored'
module
Pod
class
Command
autoload
:ErrorReport
,
'cocoapods/command/error_report'
...
...
lib/cocoapods/command/install.rb
View file @
3b83f2a6
...
...
@@ -40,6 +40,7 @@ module Pod
raise
Informative
,
"The specified project `
#{
@projpath
}
' does not exist."
end
if
@update_repo
puts
"
\n
Updating Spec Repositories
\n
"
.
yellow
if
config
.
verbose?
Repo
.
new
(
ARGV
.
new
([
"update"
])).
run
end
Installer
.
new
(
podfile
,
@projpath
).
install!
...
...
lib/cocoapods/installer.rb
View file @
3b83f2a6
...
...
@@ -45,10 +45,11 @@ module Pod
def
install_dependencies!
activated_specifications
.
map
do
|
spec
|
LocalPod
.
new
(
spec
,
sandbox
).
tap
do
|
pod
|
marker
=
config
.
verbose
?
"
\n
-> "
.
green
:
''
if
pod
.
exists?
||
spec
.
local?
puts
"Using
#{
pod
}
"
unless
config
.
silent?
puts
marker
+
"Using
#{
pod
}
"
unless
config
.
silent?
else
puts
"Installing
#{
spec
}
"
unless
config
.
silent?
puts
marker
+
"Installing
#{
spec
}
"
.
green
unless
config
.
silent?
downloader
=
Downloader
.
for_pod
(
pod
)
downloader
.
download
...
...
@@ -59,7 +60,7 @@ module Pod
end
if
config
.
doc?
puts
"Installing Documentation for
#{
spec
}
"
if
config
.
verbose?
puts
"Installing Documentation for
#{
spec
}
"
.
green
if
config
.
verbose?
Generator
::
Documentation
.
new
(
pod
).
generate
(
config
.
doc_install?
)
end
end
...
...
@@ -70,10 +71,13 @@ module Pod
def
install!
@sandbox
.
prepare_for_install
puts
"Installing dependencies of:
#{
@podfile
.
defined_in_file
}
"
if
config
.
verbose?
puts_title
"Resolving dependencies of:
#{
@podfile
.
defined_in_file
}
"
self
.
dependency_specifications_for_each_target_definition
=
@resolver
.
resolve
puts_title
"Installing dependencies"
pods
=
install_dependencies!
puts
"Generating support files"
unless
config
.
silent?
puts
_title
(
"Generating support files
\n
"
,
false
)
target_installers
.
each
do
|
target_installer
|
target_specs
=
activated_specifications_for_target
(
target_installer
.
target_definition
)
pods_for_target
=
pods
.
select
{
|
pod
|
target_specs
.
include?
(
pod
.
specification
)
}
...
...
@@ -86,7 +90,7 @@ module Pod
# Post install hooks run _before_ saving of project, so that they can alter it before saving.
run_post_install_hooks
puts
"* Writing Xcode project file to `
#{
@sandbox
.
project_path
}
'"
if
config
.
verbose?
puts
"* Writing Xcode project file to `
#{
@sandbox
.
project_path
}
'
\n\n
"
if
config
.
verbose?
project
.
save_as
(
@sandbox
.
project_path
)
UserProjectIntegrator
.
new
(
@user_project_path
,
@podfile
).
integrate!
if
@user_project_path
...
...
@@ -134,9 +138,7 @@ module Pod
end
end
def
dependency_specifications_for_each_target_definition
@dependency_specifications_for_each_target_definition
||=
@resolver
.
resolve
end
attr_accessor
:dependency_specifications_for_each_target_definition
def
dependency_specifications
dependency_specifications_for_each_target_definition
.
values
.
flatten
...
...
@@ -157,5 +159,15 @@ module Pod
def
download_only_specifications
dependency_specifications
-
activated_specifications
end
private
def
puts_title
(
title
,
only_verbose
=
true
)
if
(
config
.
verbose?
)
puts
"
\n
"
+
title
.
yellow
elsif
(
!
config
.
silent?
&&
!
only_verbose
)
puts
title
end
end
end
end
lib/cocoapods/resolver.rb
View file @
3b83f2a6
...
...
@@ -10,20 +10,19 @@ module Pod
@sandbox
=
sandbox
@cached_sets
=
{}
@cached_sources
=
Source
::
Aggregate
.
new
@log_indent
=
1
;
@log_indent
=
0
;
end
def
resolve
@specs
=
{}
result
=
@podfile
.
target_definitions
.
values
.
inject
({})
do
|
result
,
target_definition
|
puts
"
\n
--> Finding dependencies for target `
#{
target_definition
.
name
}
'"
if
config
.
verbose?
puts
"
\n
Finding dependencies for target `
#{
target_definition
.
name
}
'"
.
green
if
config
.
verbose?
@loaded_specs
=
[]
find_dependency_sets
(
@podfile
,
target_definition
.
dependencies
)
result
[
target_definition
]
=
@specs
.
values_at
(
*
@loaded_specs
).
sort_by
(
&
:name
)
result
end
puts
if
config
.
verbose?
# Specification doesn't need to know more about the context, so we assign
# the other specification, of which this pod is a part, to the spec.
...
...
lib/cocoapods/source.rb
View file @
3b83f2a6
...
...
@@ -14,7 +14,7 @@ module Pod
def
search
(
dependency
)
all
.
map
{
|
s
|
s
.
search
(
dependency
)
}.
compact
.
first
||
raise
(
Informative
,
"Unable to find a pod named `
#{
dependency
.
name
}
'"
)
raise
(
Informative
,
"Unable to find a pod named `
#{
dependency
.
name
}
'"
.
red
)
end
def
search_by_name
(
query
,
full_text_search
)
...
...
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