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
299737fc
Commit
299737fc
authored
Aug 25, 2012
by
Eloy Durán
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'duplicated_files'
parents
e85feb56
2b62203e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
56 additions
and
7 deletions
+56
-7
installer.rb
lib/cocoapods/installer.rb
+2
-2
project.rb
lib/cocoapods/project.rb
+2
-2
Reachability
spec/fixtures/integration/Reachability
+1
-1
installer_spec.rb
spec/unit/installer_spec.rb
+49
-0
project_spec.rb
spec/unit/project_spec.rb
+2
-2
No files found.
lib/cocoapods/installer.rb
View file @
299737fc
...
...
@@ -23,7 +23,7 @@ module Pod
# Add all source files to the project grouped by pod
pod
.
relative_source_files_by_spec
.
each
do
|
spec
,
paths
|
parent_group
=
pod
.
local?
?
@project
.
local_pods
:
@project
.
pods
group
=
@project
.
add_spec_
to_
group
(
pod
.
name
,
parent_group
)
group
=
@project
.
add_spec_group
(
pod
.
name
,
parent_group
)
paths
.
each
do
|
path
|
group
.
files
.
new
(
'path'
=>
path
.
to_s
)
end
...
...
@@ -186,7 +186,7 @@ module Pod
# @return [Array<LocalPod>] A list of LocalPod instances for each
# dependency that is not a download-only one.
def
pods
pods_by_target
.
values
.
flatten
pods_by_target
.
values
.
flatten
.
uniq
end
def
pods_by_target
...
...
lib/cocoapods/project.rb
View file @
299737fc
...
...
@@ -40,11 +40,11 @@ module Pod
end
# Adds a group as child to the `Pods' group namespacing subspecs.
def
add_spec_
to_
group
(
name
,
parent_group
)
def
add_spec_group
(
name
,
parent_group
)
groups
=
parent_group
.
groups
group
=
nil
name
.
split
(
'/'
).
each
do
|
name
|
group
=
groups
.
find
{
|
g
|
g
.
name
==
name
}
||
groups
.
new
(
{
'name'
=>
name
}
)
group
=
groups
.
find
{
|
g
|
g
.
name
==
name
}
||
groups
.
new
(
'name'
=>
name
)
groups
=
group
.
groups
end
group
...
...
Reachability
@
4ec575e4
Subproject commit
c8a3e521ee57ce2e6fa73c55a3e2f0042cc2033
a
Subproject commit
4ec575e4b074dcc87c44018cce656672a979b34
a
spec/unit/installer_spec.rb
View file @
299737fc
...
...
@@ -33,6 +33,55 @@ module Pod
end
end
describe
"concerning multiple pods originating form the same spec"
do
extend
SpecHelper
::
Fixture
before
do
sandbox
=
temporary_sandbox
Pod
::
Config
.
instance
.
project_pods_root
=
sandbox
.
root
Pod
::
Config
.
instance
.
integrate_targets
=
false
podspec_path
=
fixture
(
'integration/Reachability/Reachability.podspec'
)
podfile
=
Podfile
.
new
do
platform
:osx
pod
'Reachability'
,
:podspec
=>
podspec_path
.
to_s
target
:debug
do
pod
'Reachability'
end
end
resolver
=
Resolver
.
new
(
podfile
,
nil
,
sandbox
)
@installer
=
Installer
.
new
(
resolver
)
end
# The double installation leads to a bug when different subspecs are
# activated for the same pod. We need a way to install a pod only
# once while keeping all the files of the actived subspecs.
#
# LocalPodSet?
#
it
"installs the pods only once"
do
LocalPod
.
any_instance
.
stubs
(
:downloaded?
).
returns
(
false
)
Downloader
::
GitHub
.
any_instance
.
expects
(
:download
).
once
@installer
.
install!
end
it
"cleans a pod only once"
do
LocalPod
.
any_instance
.
expects
(
:clean!
).
once
@installer
.
install!
end
it
"adds the files of the pod to the Pods project only once"
do
@installer
.
install!
group
=
@installer
.
project
.
pods
.
groups
.
find
{
|
g
|
g
.
name
==
'Reachability'
}
group
.
files
.
map
(
&
:name
).
should
==
[
"Reachability.h"
,
"Reachability.m"
]
end
it
"lists a pod only once"
do
reachability_pods
=
@installer
.
pods
.
map
(
&
:to_s
).
select
{
|
s
|
s
.
include?
(
'Reachability'
)
}
reachability_pods
.
count
.
should
==
1
end
end
it
"generates a BridgeSupport metadata file from all the pod headers"
do
podfile
=
Podfile
.
new
do
platform
:osx
...
...
spec/unit/project_spec.rb
View file @
299737fc
...
...
@@ -12,7 +12,7 @@ describe 'Pod::Project' do
end
it
"adds a group to the `Pods' group"
do
group
=
@project
.
add_spec_
to_
group
(
'JSONKit'
,
@project
.
pods
)
group
=
@project
.
add_spec_group
(
'JSONKit'
,
@project
.
pods
)
@project
.
pods
.
child_references
.
should
.
include
group
.
uuid
find_object
({
'isa'
=>
'PBXGroup'
,
...
...
@@ -23,7 +23,7 @@ describe 'Pod::Project' do
end
it
"namespaces subspecs in groups"
do
group
=
@project
.
add_spec_
to_
group
(
'JSONKit/Subspec'
,
@project
.
pods
)
group
=
@project
.
add_spec_group
(
'JSONKit/Subspec'
,
@project
.
pods
)
@project
.
pods
.
groups
.
find
{
|
g
|
g
.
name
==
'JSONKit'
}.
child_references
.
should
.
include
group
.
uuid
find_object
({
'isa'
=>
'PBXGroup'
,
...
...
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