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
e7d736e4
Commit
e7d736e4
authored
Mar 11, 2013
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Installer] Present an informative if a hook raises.
parent
d09a7bea
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
79 additions
and
4 deletions
+79
-4
installer.rb
lib/cocoapods/installer.rb
+79
-4
No files found.
lib/cocoapods/installer.rb
View file @
e7d736e4
...
...
@@ -367,16 +367,53 @@ module Pod
installed_specs
.
each
do
|
spec
|
executed
=
false
libraries_using_spec
(
spec
).
each
do
|
lib
|
executed
||=
spec
.
pre_install!
(
pod_rep
(
spec
.
root
.
name
),
library_rep
(
lib
))
lib_representation
=
library_rep
(
lib
)
executed
||=
run_spec_pre_install_hook
(
spec
,
lib_representation
)
end
UI
.
message
"-
#{
spec
.
name
}
"
if
executed
end
executed
=
@podfile
.
pre_install!
(
installer_rep
)
executed
=
run_podfile_pre_install_hook
UI
.
message
"- Podfile"
if
executed
end
end
# Runs the pre install hook of the given specification with the given
# library representation.
#
# @param [Specification] spec
# The spec for which the pre install hook should be run.
#
# @param [Hooks::LibraryRepresentation] lib_representation
# The library representation to be passed as an argument to the
# hook.
#
# @raise Raises an informative if the hooks raises.
#
# @return [Bool] Whether the hook was run.
#
def
run_spec_pre_install_hook
(
spec
,
lib_representation
)
spec
.
pre_install!
(
pod_rep
(
spec
.
root
.
name
),
lib_representation
)
rescue
=>
e
raise
Informative
,
"The pre install hook of
#{
spec
}
is not "
\
"compatible with this version of CocoaPods."
\
"
\n\n
#{
e
.
message
}
\n\n
#{
e
.
backtrace
*
"
\n
"
}
"
end
# Runs the pre install hook of the Podfile
#
# @raise Raises an informative if the hooks raises.
#
# @return [Bool] Whether the hook was run.
#
def
run_podfile_pre_install_hook
podfile
.
pre_install!
(
installer_rep
)
rescue
=>
e
raise
Informative
,
"The pre install hook of the Podfile is not "
\
"compatible with this version of CocoaPods."
\
"
\n\n
#{
e
.
message
}
\n\n
#{
e
.
backtrace
*
"
\n
"
}
"
end
# Runs the post install hooks of the installed specs and of the Podfile.
#
# @note Post install hooks run _before_ saving of project, so that they
...
...
@@ -389,15 +426,53 @@ module Pod
installed_specs
.
each
do
|
spec
|
executed
=
false
libraries_using_spec
(
spec
).
each
do
|
lib
|
executed
||=
spec
.
post_install!
(
library_rep
(
lib
))
lib_representation
=
library_rep
(
lib
)
executed
||=
run_spec_post_install_hook
(
spec
,
lib_representation
)
end
UI
.
message
"-
#{
spec
.
name
}
"
if
executed
end
executed
=
@podfile
.
post_install!
(
installer_rep
)
executed
=
run_podfile_post_install_hook
UI
.
message
"- Podfile"
if
executed
end
end
# Runs the post install hook of the given specification with the given
# library representation.
#
# @param [Specification] spec
# The spec for which the post install hook should be run.
#
# @param [Hooks::LibraryRepresentation] lib_representation
# The library representation to be passed as an argument to the
# hook.
#
# @raise Raises an informative if the hooks raises.
#
# @return [Bool] Whether the hook was run.
#
def
run_spec_post_install_hook
(
spec
,
lib_representation
)
spec
.
post_install!
(
lib_representation
)
rescue
=>
e
raise
Informative
,
"The post install hook of
#{
spec
}
is not "
\
"compatible with this version of CocoaPods."
\
"
\n\n
#{
e
.
message
}
\n\n
#{
e
.
backtrace
*
"
\n
"
}
"
end
# Runs the post install hook of the Podfile
#
# @raise Raises an informative if the hooks raises.
#
# @return [Bool] Whether the hook was run.
#
def
run_podfile_post_install_hook
podfile
.
post_install!
(
installer_rep
)
rescue
=>
e
raise
Informative
,
"The post install hook of the Podfile is not "
\
"compatible with this version of CocoaPods."
\
"
\n\n
#{
e
.
message
}
\n\n
#{
e
.
backtrace
*
"
\n
"
}
"
end
#-------------------------------------------------------------------------#
public
...
...
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