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
cd931998
Commit
cd931998
authored
Mar 09, 2012
by
Ben Scheirman
Committed by
Eloy Duran
Apr 13, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Raise an informative error if xcodeproj is not present in Podfile, for now.
parent
ff71c745
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
55 additions
and
10 deletions
+55
-10
.gitignore
.gitignore
+1
-0
TODO
TODO
+2
-0
install.rb
lib/cocoapods/command/install.rb
+23
-9
installer.rb
lib/cocoapods/installer.rb
+1
-1
install_command_spec.rb
spec/unit/install_command_spec.rb
+28
-0
No files found.
.gitignore
View file @
cd931998
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
*.rbo
*.rbo
*.gem
*.gem
.DS_Store
.DS_Store
.rbenv-version
xcuserdata
xcuserdata
project.xcworkspace
project.xcworkspace
DerivedData
DerivedData
...
...
TODO
View file @
cd931998
* No need to pass the project path and podfile separately to UserProjectIntegrator.
* Move Platform#xcodeproj to TargetDefinition#link_with.
* Add multiple-platforms section to changelog.
* Add multiple-platforms section to changelog.
* Validate platforms for each target definition.
* Validate platforms for each target definition.
* Validate that there are dependencies in a Podfile.
* Validate that there are dependencies in a Podfile.
...
...
lib/cocoapods/command/install.rb
View file @
cd931998
...
@@ -4,16 +4,22 @@ module Pod
...
@@ -4,16 +4,22 @@ module Pod
def
self
.
banner
def
self
.
banner
%{Installing dependencies of a project:
%{Installing dependencies of a project:
$ pod install
[PROJECT]
$ pod install
Downloads all dependencies defined in `Podfile' and creates an Xcode
Downloads all dependencies defined in `Podfile' and creates an Xcode
Pods library project in `./Pods'.
Pods library project in `./Pods'.
In case `PROJECT' is given, it configures it to use the specified Pods
The Xcode project file should be specified in your `Podfile` like this:
and generates a workspace with the Pods project and `PROJECT'. (It is
important that once you have run this you open the workspace instead of
xcodeproj "path/to/project.xcodeproj"
`PROJECT'.) You usually specify `PROJECT' only the first time that you
run `pod install'.
If no xcodeproj is specified, then a search for an Xcode project will
be made. If more than one Xcode project is found, the command will
raise an error.
This will configure the project to reference the Pods static library,
add a build configuration file, and add a post build script to copy
Pod resources.
}
}
end
end
...
@@ -30,7 +36,6 @@ module Pod
...
@@ -30,7 +36,6 @@ module Pod
config
.
doc
=
!
argv
.
option
(
'--no-doc'
)
config
.
doc
=
!
argv
.
option
(
'--no-doc'
)
config
.
force_doc
=
argv
.
option
(
'--force-doc'
)
config
.
force_doc
=
argv
.
option
(
'--force-doc'
)
@update_repo
=
!
argv
.
option
(
'--no-update'
)
@update_repo
=
!
argv
.
option
(
'--no-update'
)
@projpath
=
argv
.
shift_argument
super
unless
argv
.
empty?
super
unless
argv
.
empty?
end
end
...
@@ -38,13 +43,22 @@ module Pod
...
@@ -38,13 +43,22 @@ module Pod
unless
podfile
=
config
.
podfile
unless
podfile
=
config
.
podfile
raise
Informative
,
"No `Podfile' found in the current working directory."
raise
Informative
,
"No `Podfile' found in the current working directory."
end
end
if
@projpath
&&
!
File
.
exist?
(
@projpath
)
raise
Informative
,
"The specified project `
#{
@projpath
}
' does not exist."
if
podfile
.
xcodeproj
.
nil?
raise
Informative
,
"Please specify a valid xcodeproj path in your Podfile.
\n\n
"
+
"Usage:
\n\t
"
+
"xcodeproj 'path/to/project.xcodeproj'"
end
unless
File
.
exist?
(
podfile
.
xcodeproj
)
raise
Informative
,
"The specified project `
#{
podfile
.
xcodeproj
}
' does not exist."
end
end
if
@update_repo
if
@update_repo
puts
"
\n
Updating Spec Repositories
\n
"
.
yellow
if
config
.
verbose?
puts
"
\n
Updating Spec Repositories
\n
"
.
yellow
if
config
.
verbose?
Repo
.
new
(
ARGV
.
new
([
"update"
])).
run
Repo
.
new
(
ARGV
.
new
([
"update"
])).
run
end
end
Installer
.
new
(
podfile
,
@projpath
).
install!
Installer
.
new
(
podfile
,
@projpath
).
install!
end
end
end
end
...
...
lib/cocoapods/installer.rb
View file @
cd931998
...
@@ -91,7 +91,7 @@ module Pod
...
@@ -91,7 +91,7 @@ module Pod
puts
"* Writing Xcode project file to `
#{
@sandbox
.
project_path
}
'
\n\n
"
if
config
.
verbose?
puts
"* Writing Xcode project file to `
#{
@sandbox
.
project_path
}
'
\n\n
"
if
config
.
verbose?
project
.
save_as
(
@sandbox
.
project_path
)
project
.
save_as
(
@sandbox
.
project_path
)
UserProjectIntegrator
.
new
(
@
user_project_path
,
@podfile
).
integrate!
if
@user_project_path
UserProjectIntegrator
.
new
(
@
podfile
.
xcodeproj
,
@podfile
).
integrate!
end
end
def
run_post_install_hooks
def
run_post_install_hooks
...
...
spec/unit/install_command_spec.rb
0 → 100644
View file @
cd931998
require
File
.
expand_path
(
'../../spec_helper'
,
__FILE__
)
describe
"Pod::Command::Install"
do
it
"should include instructions on how to reference the xcode project"
do
Pod
::
Command
::
Install
.
banner
.
should
.
match
/xcodeproj path\/to\/project.xcodeproj/
end
before
do
@config_before
=
config
Pod
::
Config
.
instance
=
nil
config
.
silent
=
true
end
after
do
Pod
::
Config
.
instance
=
@config_before
end
describe
"When the Podfile does not specify the xcodeproject"
do
before
do
config
.
stubs
(
:rootspec
).
returns
(
Pod
::
Podfile
.
new
{
platform
:ios
;
dependency
'AFNetworking'
})
end
it
"raises an informative error if the xcodproj is not specified in the podfile"
do
installer
=
Pod
::
Command
::
Install
.
new
(
Pod
::
Command
::
ARGV
.
new
)
should
.
raise
(
Pod
::
Informative
)
{
installer
.
run
}
end
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