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
eae99b2a
Commit
eae99b2a
authored
Mar 27, 2012
by
Eloy Duran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename Pod::Project::Integrator to Pod::Installer::UserProjectIntegrator.
parent
f9e97e7e
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
51 additions
and
50 deletions
+51
-50
installer.rb
lib/cocoapods/installer.rb
+3
-2
user_project_integrator.rb
lib/cocoapods/installer/user_project_integrator.rb
+2
-2
project.rb
lib/cocoapods/project.rb
+0
-1
user_project_integrator_spec.rb
spec/functional/user_project_integrator_spec.rb
+3
-44
target_installer_spec.rb
spec/unit/installer/target_installer_spec.rb
+1
-1
user_project_integrator_spec.rb
spec/unit/installer/user_project_integrator_spec.rb
+42
-0
No files found.
lib/cocoapods/installer.rb
View file @
eae99b2a
module
Pod
module
Pod
class
Installer
class
Installer
autoload
:TargetInstaller
,
'cocoapods/installer/target_installer'
autoload
:TargetInstaller
,
'cocoapods/installer/target_installer'
autoload
:UserProjectIntegrator
,
'cocoapods/installer/user_project_integrator'
include
Config
::
Mixin
include
Config
::
Mixin
...
@@ -88,7 +89,7 @@ module Pod
...
@@ -88,7 +89,7 @@ module Pod
puts
"* Writing Xcode project file to `
#{
@sandbox
.
project_path
}
'"
if
config
.
verbose?
puts
"* Writing Xcode project file to `
#{
@sandbox
.
project_path
}
'"
if
config
.
verbose?
project
.
save_as
(
@sandbox
.
project_path
)
project
.
save_as
(
@sandbox
.
project_path
)
Project
::
Integrator
.
new
(
@user_project_path
,
@podfile
).
integrate!
if
@user_project_path
UserProject
Integrator
.
new
(
@user_project_path
,
@podfile
).
integrate!
if
@user_project_path
end
end
def
run_post_install_hooks
def
run_post_install_hooks
...
...
lib/cocoapods/
project/
integrator.rb
→
lib/cocoapods/
installer/user_project_
integrator.rb
View file @
eae99b2a
...
@@ -2,9 +2,9 @@ require 'xcodeproj/workspace'
...
@@ -2,9 +2,9 @@ require 'xcodeproj/workspace'
require
'xcodeproj/project'
require
'xcodeproj/project'
module
Pod
module
Pod
class
Project
class
Installer
class
Integrator
class
UserProject
Integrator
include
Pod
::
Config
::
Mixin
include
Pod
::
Config
::
Mixin
attr_reader
:user_project_path
,
:user_project
attr_reader
:user_project_path
,
:user_project
...
...
lib/cocoapods/project.rb
View file @
eae99b2a
...
@@ -12,7 +12,6 @@ end
...
@@ -12,7 +12,6 @@ end
module
Pod
module
Pod
class
Project
<
Xcodeproj
::
Project
class
Project
<
Xcodeproj
::
Project
autoload
:Integrator
,
'cocoapods/project/integrator'
# Shortcut access to the `Pods' PBXGroup.
# Shortcut access to the `Pods' PBXGroup.
def
pods
def
pods
...
...
spec/functional/
project/
integrator_spec.rb
→
spec/functional/
user_project_
integrator_spec.rb
View file @
eae99b2a
require
File
.
expand_path
(
'../../
../
spec_helper'
,
__FILE__
)
require
File
.
expand_path
(
'../../spec_helper'
,
__FILE__
)
describe
Pod
::
Project
::
Integrator
,
'TODO UNIT SPECS!'
do
describe
Pod
::
Installer
::
UserProjectIntegrator
do
extend
SpecHelper
::
TemporaryDirectory
before
do
@podfile
=
Pod
::
Podfile
.
new
do
platform
:ios
dependency
'JSONKit'
target
:test_runner
,
:exclusive
=>
true
,
:link_with
=>
'TestRunner'
do
dependency
'Kiwi'
end
end
@sample_project_path
=
SpecHelper
.
create_sample_app_copy_from_fixture
(
'SampleProject'
)
config
.
project_root
=
@sample_project_path
.
dirname
@integrator
=
Pod
::
Project
::
Integrator
.
new
(
@sample_project_path
,
@podfile
)
end
after
do
config
.
project_root
=
nil
end
it
"returns the path to the workspace in the project's root"
do
@integrator
.
workspace_path
.
should
==
config
.
project_root
+
'SampleProject.xcworkspace'
end
it
"returns the path to the Pods.xcodeproj document"
do
@integrator
.
pods_project_path
.
should
==
config
.
project_root
+
'Pods/Pods.xcodeproj'
end
it
"returns a Pod::Project::Integrator::Target for each target definition in the Podfile"
do
@integrator
.
targets
.
map
(
&
:target_definition
).
should
==
@podfile
.
target_definitions
.
values
end
it
"uses the first target in the user's project if no explicit target is specified"
do
target_integrator
=
@integrator
.
targets
.
first
target_integrator
.
target_definition
.
stubs
(
:link_with
).
returns
(
nil
)
target_integrator
.
targets
.
should
==
[
Xcodeproj
::
Project
.
new
(
@sample_project_path
).
targets
.
first
]
end
end
describe
Pod
::
Project
::
Integrator
do
extend
SpecHelper
::
TemporaryDirectory
extend
SpecHelper
::
TemporaryDirectory
before
do
before
do
...
@@ -59,7 +18,7 @@ describe Pod::Project::Integrator do
...
@@ -59,7 +18,7 @@ describe Pod::Project::Integrator do
@sample_project_path
=
SpecHelper
.
create_sample_app_copy_from_fixture
(
'SampleProject'
)
@sample_project_path
=
SpecHelper
.
create_sample_app_copy_from_fixture
(
'SampleProject'
)
config
.
project_root
=
@sample_project_path
.
dirname
config
.
project_root
=
@sample_project_path
.
dirname
@integrator
=
Pod
::
Project
::
Integrator
.
new
(
@sample_project_path
,
@podfile
)
@integrator
=
Pod
::
Installer
::
UserProject
Integrator
.
new
(
@sample_project_path
,
@podfile
)
@integrator
.
integrate!
@integrator
.
integrate!
@sample_project
=
Xcodeproj
::
Project
.
new
(
@sample_project_path
)
@sample_project
=
Xcodeproj
::
Project
.
new
(
@sample_project_path
)
end
end
...
...
spec/unit/target_installer_spec.rb
→
spec/unit/
installer/
target_installer_spec.rb
View file @
eae99b2a
require
File
.
expand_path
(
'../../spec_helper'
,
__FILE__
)
require
File
.
expand_path
(
'../../
../
spec_helper'
,
__FILE__
)
TMP_POD_ROOT
=
ROOT
+
"tmp"
+
"podroot"
TMP_POD_ROOT
=
ROOT
+
"tmp"
+
"podroot"
...
...
spec/unit/installer/user_project_integrator_spec.rb
0 → 100644
View file @
eae99b2a
require
File
.
expand_path
(
'../../../spec_helper'
,
__FILE__
)
describe
Pod
::
Installer
::
UserProjectIntegrator
do
extend
SpecHelper
::
TemporaryDirectory
before
do
@podfile
=
Pod
::
Podfile
.
new
do
platform
:ios
dependency
'JSONKit'
target
:test_runner
,
:exclusive
=>
true
,
:link_with
=>
'TestRunner'
do
dependency
'Kiwi'
end
end
@sample_project_path
=
SpecHelper
.
create_sample_app_copy_from_fixture
(
'SampleProject'
)
config
.
project_root
=
@sample_project_path
.
dirname
@integrator
=
Pod
::
Installer
::
UserProjectIntegrator
.
new
(
@sample_project_path
,
@podfile
)
end
after
do
config
.
project_root
=
nil
end
it
"returns the path to the workspace in the project's root"
do
@integrator
.
workspace_path
.
should
==
config
.
project_root
+
'SampleProject.xcworkspace'
end
it
"returns the path to the Pods.xcodeproj document"
do
@integrator
.
pods_project_path
.
should
==
config
.
project_root
+
'Pods/Pods.xcodeproj'
end
it
"returns a Pod::Installer::UserProjectIntegrator::Target for each target definition in the Podfile"
do
@integrator
.
targets
.
map
(
&
:target_definition
).
should
==
@podfile
.
target_definitions
.
values
end
it
"uses the first target in the user's project if no explicit target is specified"
do
target_integrator
=
@integrator
.
targets
.
first
target_integrator
.
target_definition
.
stubs
(
:link_with
).
returns
(
nil
)
target_integrator
.
targets
.
should
==
[
Xcodeproj
::
Project
.
new
(
@sample_project_path
).
targets
.
first
]
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