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
12a91103
Commit
12a91103
authored
Apr 03, 2012
by
Eloy Duran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more stashing
parent
5df26a6f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
11 deletions
+22
-11
user_project_integrator.rb
lib/cocoapods/installer/user_project_integrator.rb
+12
-4
user_project_integrator_spec.rb
spec/functional/user_project_integrator_spec.rb
+10
-7
No files found.
lib/cocoapods/installer/user_project_integrator.rb
View file @
12a91103
...
...
@@ -33,14 +33,18 @@ module Pod
end
def
target_integrators
@podfile
.
target_definitions
.
values
.
map
do
|
definition
|
TargetIntegrator
.
new
(
definition
)
end
@target_integrators
||=
@podfile
.
target_definitions
.
values
.
map
do
|
definition
|
TargetIntegrator
.
new
(
definition
)
unless
definition
.
empty?
end
.
compact
end
def
user_projects
@podfile
.
target_definitions
.
values
.
map
(
&
:xcodeproj
)
end
def
create_workspace!
workspace
=
Xcodeproj
::
Workspace
.
new_from_xcworkspace
(
workspace_path
)
[
user_project_path
,
pods_project_path
].
each
do
|
project_path
|
[
pods_project_path
,
*
user_projects
].
each
do
|
project_path
|
project_path
=
project_path
.
relative_path_from
(
config
.
project_root
).
to_s
workspace
<<
project_path
unless
workspace
.
include?
(
project_path
)
end
...
...
@@ -54,6 +58,10 @@ module Pod
@target_definition
=
target_definition
end
def
inspect
"#<
#{
self
.
class
}
for target `
#{
@target_definition
.
label
}
'>"
end
def
integrate!
return
if
targets
.
empty?
add_xcconfig_base_configuration
...
...
spec/functional/user_project_integrator_spec.rb
View file @
12a91103
...
...
@@ -83,19 +83,22 @@ describe Pod::Installer::UserProjectIntegrator do
end
it
"only tries to integrate Pods libraries into user targets that haven't been integrated yet"
do
app
,
test_runner
=
@integrator
.
user_project
.
targets
.
to_a
app
,
test_runner
=
@integrator
.
target_integrators
.
first
.
user_project
.
targets
.
to_a
p
app
.
frameworks_build_phases
.
first
.
files
test_runner
.
frameworks_build_phases
.
first
.
build_files
.
last
.
destroy
#p app, test_runner
targets
=
@integrator
.
targets
.
sort_by
{
|
target
|
target
.
target_definition
.
label
}
@integrator
.
stubs
(
:targets
).
returns
(
targets
)
target_integrators
=
@integrator
.
target_integrators
.
sort_by
{
|
target
|
target
.
target_definition
.
label
}
@integrator
.
stubs
(
:target_integrators
).
returns
(
target_integrators
)
#p target_integrators
targets
.
first
.
expects
(
:add_pods_library
).
never
targets
.
last
.
expects
(
:add_pods_library
)
target
_integrator
s
.
first
.
expects
(
:add_pods_library
).
never
target
_integrator
s
.
last
.
expects
(
:add_pods_library
)
@integrator
.
integrate!
end
it
"does not even try to save the project if none of the target integrators had any work to do"
do
@integrator
.
user_project
.
expects
(
:save_as
).
never
x
it
"does not even try to save the project if none of the target integrators had any work to do"
do
@integrator
.
target_integrators
.
first
.
user_project
.
expects
(
:save_as
).
never
@integrator
.
integrate!
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