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
838376a2
Commit
838376a2
authored
Aug 31, 2012
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[UserInterface] Improvements to path presentation.
parent
1eb4ed92
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
12 deletions
+29
-12
installer.rb
lib/cocoapods/installer.rb
+7
-5
target_installer.rb
lib/cocoapods/installer/target_installer.rb
+4
-4
resolver.rb
lib/cocoapods/resolver.rb
+2
-2
user_interface.rb
lib/cocoapods/user_interface.rb
+16
-1
No files found.
lib/cocoapods/installer.rb
View file @
838376a2
...
@@ -108,7 +108,7 @@ module Pod
...
@@ -108,7 +108,7 @@ module Pod
def
install!
def
install!
@sandbox
.
prepare_for_install
@sandbox
.
prepare_for_install
ui_title
"Resolving dependencies of
`
#{
@podfile
.
defined_in_file
}
'
"
do
ui_title
"Resolving dependencies of
#{
ui_path
@podfile
.
defined_in_file
}
"
do
specs_by_target
specs_by_target
end
end
...
@@ -116,23 +116,26 @@ module Pod
...
@@ -116,23 +116,26 @@ module Pod
remove_deleted_dependencies!
remove_deleted_dependencies!
end
unless
resolver
.
removed_pods
.
empty?
end
unless
resolver
.
removed_pods
.
empty?
ui_title
"
Install
ing dependencies"
do
ui_title
"
Download
ing dependencies"
do
install_dependencies!
install_dependencies!
end
end
ui_title
(
"Generating support files"
,
''
,
2
)
do
ui_title
(
"Generating support files"
,
''
,
2
)
do
ui_message
(
"- Installing targets"
,
''
,
2
)
do
generate_target_support_files
generate_target_support_files
end
ui_message
"- Running post install hooks"
do
ui_message
"- Running post install hooks"
do
# Post install hooks run _before_ saving of project, so that they can alter it before saving.
# Post install hooks run _before_ saving of project, so that they can alter it before saving.
run_post_install_hooks
run_post_install_hooks
end
end
ui_message
"- Writing Xcode project file to
`
#{
@sandbox
.
project_path
}
'
"
do
ui_message
"- Writing Xcode project file to
#{
ui_path
@sandbox
.
project_path
}
"
do
project
.
save_as
(
@sandbox
.
project_path
)
project
.
save_as
(
@sandbox
.
project_path
)
end
end
ui_message
"- Writing lockfile in
`
#{
config
.
project_lockfile
}
'
"
do
ui_message
"- Writing lockfile in
#{
ui_path
config
.
project_lockfile
}
"
do
@lockfile
=
Lockfile
.
generate
(
@podfile
,
specs_by_target
.
values
.
flatten
)
@lockfile
=
Lockfile
.
generate
(
@podfile
,
specs_by_target
.
values
.
flatten
)
@lockfile
.
write_to_disk
(
config
.
project_lockfile
)
@lockfile
.
write_to_disk
(
config
.
project_lockfile
)
end
end
...
@@ -149,7 +152,6 @@ module Pod
...
@@ -149,7 +152,6 @@ module Pod
spec
.
post_install
(
target_installer
)
spec
.
post_install
(
target_installer
)
end
end
end
end
@podfile
.
post_install!
(
self
)
@podfile
.
post_install!
(
self
)
end
end
...
...
lib/cocoapods/installer/target_installer.rb
View file @
838376a2
...
@@ -99,21 +99,21 @@ module Pod
...
@@ -99,21 +99,21 @@ module Pod
def
create_files
(
pods
,
sandbox
)
def
create_files
(
pods
,
sandbox
)
bridge_support_metadata_path
=
sandbox
.
root
+
@target_definition
.
bridge_support_name
bridge_support_metadata_path
=
sandbox
.
root
+
@target_definition
.
bridge_support_name
ui_message
"- Generating BridgeSupport metadata file at
`
#{
bridge_support_metadata_path
}
'
"
do
ui_message
"- Generating BridgeSupport metadata file at
#{
ui_path
bridge_support_metadata_path
}
"
do
bridge_support_generator_for
(
pods
,
sandbox
).
save_as
(
bridge_support_metadata_path
)
bridge_support_generator_for
(
pods
,
sandbox
).
save_as
(
bridge_support_metadata_path
)
copy_resources_script_for
(
pods
).
resources
<<
@target_definition
.
bridge_support_name
copy_resources_script_for
(
pods
).
resources
<<
@target_definition
.
bridge_support_name
end
if
@podfile
.
generate_bridge_support?
end
if
@podfile
.
generate_bridge_support?
ui_message
"- Generating xcconfig file at
`
#{
sandbox
.
root
+
@target_definition
.
xcconfig_name
}
'
"
do
ui_message
"- Generating xcconfig file at
#{
ui_path
(
sandbox
.
root
+
@target_definition
.
xcconfig_name
)
}
"
do
xcconfig
.
save_as
(
sandbox
.
root
+
@target_definition
.
xcconfig_name
)
xcconfig
.
save_as
(
sandbox
.
root
+
@target_definition
.
xcconfig_name
)
@target_definition
.
xcconfig
=
xcconfig
@target_definition
.
xcconfig
=
xcconfig
end
end
ui_message
"- Generating prefix header at
`
#{
sandbox
.
root
+
@target_definition
.
prefix_header_name
}
'
"
do
ui_message
"- Generating prefix header at
#{
ui_path
(
sandbox
.
root
+
@target_definition
.
prefix_header_name
)
}
"
do
save_prefix_header_as
(
sandbox
.
root
+
@target_definition
.
prefix_header_name
,
pods
)
save_prefix_header_as
(
sandbox
.
root
+
@target_definition
.
prefix_header_name
,
pods
)
end
end
ui_message
"- Generating copy resources script at
`
#{
sandbox
.
root
+
@target_definition
.
copy_resources_script_name
}
'
"
do
ui_message
"- Generating copy resources script at
#{
ui_path
(
sandbox
.
root
+
@target_definition
.
copy_resources_script_name
)
}
"
do
copy_resources_script_for
(
pods
).
save_as
(
sandbox
.
root
+
@target_definition
.
copy_resources_script_name
)
copy_resources_script_for
(
pods
).
save_as
(
sandbox
.
root
+
@target_definition
.
copy_resources_script_name
)
end
end
end
end
...
...
lib/cocoapods/resolver.rb
View file @
838376a2
...
@@ -70,7 +70,7 @@ module Pod
...
@@ -70,7 +70,7 @@ module Pod
if
@lockfile
if
@lockfile
@pods_by_state
=
@lockfile
.
detect_changes_with_podfile
(
podfile
)
@pods_by_state
=
@lockfile
.
detect_changes_with_podfile
(
podfile
)
ui_title
"Finding added, modified or removed dependencies:"
do
ui_title
(
"Finding added, modified or removed dependencies:"
,
''
,
2
)
do
marks
=
{
:added
=>
"A"
.
green
,
:changed
=>
"M"
.
yellow
,
:removed
=>
"R"
.
red
,
:unchanged
=>
"-"
}
marks
=
{
:added
=>
"A"
.
green
,
:changed
=>
"M"
.
yellow
,
:removed
=>
"R"
.
red
,
:unchanged
=>
"-"
}
@pods_by_state
.
each
do
|
symbol
,
pod_names
|
@pods_by_state
.
each
do
|
symbol
,
pod_names
|
pod_names
.
each
do
|
pod_name
|
pod_names
.
each
do
|
pod_name
|
...
@@ -82,7 +82,7 @@ module Pod
...
@@ -82,7 +82,7 @@ module Pod
end
end
@podfile
.
target_definitions
.
values
.
each
do
|
target_definition
|
@podfile
.
target_definitions
.
values
.
each
do
|
target_definition
|
ui_title
"Resolving dependencies for target `
#{
target_definition
.
name
}
' (
#{
target_definition
.
platform
}
):"
do
ui_title
(
"Resolving dependencies for target `
#{
target_definition
.
name
}
' (
#{
target_definition
.
platform
}
):"
,
''
,
2
)
do
@loaded_specs
=
[]
@loaded_specs
=
[]
find_dependency_specs
(
@podfile
,
target_definition
.
dependencies
,
target_definition
)
find_dependency_specs
(
@podfile
,
target_definition
.
dependencies
,
target_definition
)
@specs_by_target
[
target_definition
]
=
@cached_specs
.
values_at
(
*
@loaded_specs
).
sort_by
(
&
:name
)
@specs_by_target
[
target_definition
]
=
@cached_specs
.
values_at
(
*
@loaded_specs
).
sort_by
(
&
:name
)
...
...
lib/cocoapods/user_interface.rb
View file @
838376a2
...
@@ -41,6 +41,14 @@ module Pod
...
@@ -41,6 +41,14 @@ module Pod
puts
(
indented
)
puts
(
indented
)
end
end
def
ui_path
(
pathname
)
if
pathname
"`./
#{
pathname
.
relative_path_from
(
config
.
project_podfile
.
dirname
||
Pathname
.
pwd
)
}
'"
else
''
end
end
# adapted from http://blog.macromates.com/2006/wrapping-text-with-regular-expressions/
# adapted from http://blog.macromates.com/2006/wrapping-text-with-regular-expressions/
def
wrap_string
(
txt
,
indent
)
def
wrap_string
(
txt
,
indent
)
width
=
`stty size`
.
split
(
' '
)[
1
].
to_i
-
indent
.
length
width
=
`stty size`
.
split
(
' '
)[
1
].
to_i
-
indent
.
length
...
@@ -58,8 +66,8 @@ module Pod
...
@@ -58,8 +66,8 @@ module Pod
end
end
def
ui_message
(
message
,
verbose_prefix
=
''
,
relative_indentation
=
0
)
def
ui_message
(
message
,
verbose_prefix
=
''
,
relative_indentation
=
0
)
UserInterface
.
instance
.
indentation_level
+=
relative_indentation
UserInterface
.
instance
.
message
(
message
)
UserInterface
.
instance
.
message
(
message
)
UserInterface
.
instance
.
indentation_level
+=
relative_indentation
yield
if
block_given?
yield
if
block_given?
UserInterface
.
instance
.
indentation_level
-=
relative_indentation
UserInterface
.
instance
.
indentation_level
-=
relative_indentation
end
end
...
@@ -68,6 +76,13 @@ module Pod
...
@@ -68,6 +76,13 @@ module Pod
UserInterface
.
instance
.
puts
(
message
)
UserInterface
.
instance
.
puts
(
message
)
end
end
def
ui_path
(
pathname
)
UserInterface
.
instance
.
ui_path
(
pathname
)
end
# def ui_spec(spec)
# end
# def ui_progress_start(count)
# def ui_progress_start(count)
# 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