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
2ee4c844
Commit
2ee4c844
authored
Sep 21, 2012
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Installer] Restore subspecs namespaces.
Closes #541
parent
01a487cf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
78 additions
and
50 deletions
+78
-50
installer.rb
lib/cocoapods/installer.rb
+1
-1
installer_spec.rb
spec/unit/installer_spec.rb
+77
-49
No files found.
lib/cocoapods/installer.rb
View file @
2ee4c844
...
@@ -23,7 +23,7 @@ module Pod
...
@@ -23,7 +23,7 @@ module Pod
# Add all source files to the project grouped by pod
# Add all source files to the project grouped by pod
pod
.
relative_source_files_by_spec
.
each
do
|
spec
,
paths
|
pod
.
relative_source_files_by_spec
.
each
do
|
spec
,
paths
|
parent_group
=
pod
.
local?
?
@project
.
local_pods
:
@project
.
pods
parent_group
=
pod
.
local?
?
@project
.
local_pods
:
@project
.
pods
group
=
@project
.
add_spec_group
(
pod
.
name
,
parent_group
)
group
=
@project
.
add_spec_group
(
spec
.
name
,
parent_group
)
paths
.
each
do
|
path
|
paths
.
each
do
|
path
|
group
.
files
.
new
(
'path'
=>
path
.
to_s
)
group
.
files
.
new
(
'path'
=>
path
.
to_s
)
end
end
...
...
spec/unit/installer_spec.rb
View file @
2ee4c844
...
@@ -31,10 +31,66 @@ module Pod
...
@@ -31,10 +31,66 @@ module Pod
it
"sets the PODS_ROOT build variable"
do
it
"sets the PODS_ROOT build variable"
do
@xcconfig
[
'PODS_ROOT'
].
should
.
not
==
nil
@xcconfig
[
'PODS_ROOT'
].
should
.
not
==
nil
end
end
it
"generates a BridgeSupport metadata file from all the pod headers"
do
podfile
=
Podfile
.
new
do
platform
:osx
pod
'ASIHTTPRequest'
end
sandbox
=
Sandbox
.
new
(
fixture
(
'integration'
))
resolver
=
Resolver
.
new
(
podfile
,
nil
,
sandbox
)
installer
=
Installer
.
new
(
resolver
)
pods
=
installer
.
specifications
.
map
do
|
spec
|
LocalPod
.
new
(
spec
,
installer
.
sandbox
,
podfile
.
target_definitions
[
:default
].
platform
)
end
expected
=
pods
.
map
{
|
pod
|
pod
.
header_files
}.
flatten
.
map
{
|
header
|
config
.
project_pods_root
+
header
}
expected
.
size
.
should
>
0
installer
.
target_installers
.
first
.
bridge_support_generator_for
(
pods
,
installer
.
sandbox
).
headers
.
should
==
expected
end
it
"omits empty target definitions"
do
podfile
=
Podfile
.
new
do
platform
:ios
target
:not_empty
do
pod
'JSONKit'
end
end
resolver
=
Resolver
.
new
(
podfile
,
nil
,
Sandbox
.
new
(
fixture
(
'integration'
)))
installer
=
Installer
.
new
(
resolver
)
installer
.
target_installers
.
map
(
&
:target_definition
).
map
(
&
:name
).
should
==
[
:not_empty
]
end
it
"adds the user's build configurations"
do
path
=
fixture
(
'SampleProject/SampleProject.xcodeproj'
)
podfile
=
Podfile
.
new
do
platform
:ios
xcodeproj
path
,
'App Store'
=>
:release
end
resolver
=
Resolver
.
new
(
podfile
,
nil
,
Sandbox
.
new
(
fixture
(
'integration'
)))
installer
=
Installer
.
new
(
resolver
)
installer
.
project
.
build_configurations
.
map
(
&
:name
).
sort
.
should
==
[
'App Store'
,
'Debug'
,
'Release'
,
'Test'
]
end
it
"forces downloading of the `bleeding edge' version of a pod"
do
podfile
=
Podfile
.
new
do
platform
:ios
pod
'JSONKit'
,
:head
end
resolver
=
Resolver
.
new
(
podfile
,
nil
,
Sandbox
.
new
(
fixture
(
'integration'
)))
installer
=
Installer
.
new
(
resolver
)
pod
=
installer
.
pods
.
first
downloader
=
stub
(
'Downloader'
)
Downloader
.
stubs
(
:for_pod
).
returns
(
downloader
)
downloader
.
expects
(
:download_head
)
installer
.
download_pod
(
pod
)
end
end
end
describe
"concerning multiple pods originating form the same spec"
do
describe
"concerning multiple pods originating form the same spec"
do
extend
SpecHelper
::
Fixture
extend
SpecHelper
::
Fixture
before
do
before
do
sandbox
=
temporary_sandbox
sandbox
=
temporary_sandbox
...
@@ -79,63 +135,35 @@ module Pod
...
@@ -79,63 +135,35 @@ module Pod
reachability_pods
=
@installer
.
pods
.
map
(
&
:to_s
).
select
{
|
s
|
s
.
include?
(
'Reachability'
)
}
reachability_pods
=
@installer
.
pods
.
map
(
&
:to_s
).
select
{
|
s
|
s
.
include?
(
'Reachability'
)
}
reachability_pods
.
count
.
should
==
1
reachability_pods
.
count
.
should
==
1
end
end
end
end
it
"generates a BridgeSupport metadata file from all the pod headers"
do
describe
"concerning namespacing"
do
podfile
=
Podfile
.
new
do
extend
SpecHelper
::
Fixture
platform
:osx
pod
'ASIHTTPRequest'
end
sandbox
=
Sandbox
.
new
(
fixture
(
'integration'
))
resolver
=
Resolver
.
new
(
podfile
,
nil
,
sandbox
)
installer
=
Installer
.
new
(
resolver
)
pods
=
installer
.
specifications
.
map
do
|
spec
|
LocalPod
.
new
(
spec
,
installer
.
sandbox
,
podfile
.
target_definitions
[
:default
].
platform
)
end
expected
=
pods
.
map
{
|
pod
|
pod
.
header_files
}.
flatten
.
map
{
|
header
|
config
.
project_pods_root
+
header
}
expected
.
size
.
should
>
0
installer
.
target_installers
.
first
.
bridge_support_generator_for
(
pods
,
installer
.
sandbox
).
headers
.
should
==
expected
end
it
"omits empty target definitions"
do
before
do
podfile
=
Podfile
.
new
do
sandbox
=
temporary_sandbox
platform
:ios
Pod
::
Config
.
instance
.
project_pods_root
=
sandbox
.
root
target
:not_empty
do
Pod
::
Config
.
instance
.
integrate_targets
=
false
pod
'JSONKit'
podspec_path
=
fixture
(
'chameleon'
)
podfile
=
Podfile
.
new
do
platform
:osx
pod
'Chameleon'
,
:local
=>
podspec_path
end
end
resolver
=
Resolver
.
new
(
podfile
,
nil
,
sandbox
)
@installer
=
Installer
.
new
(
resolver
)
end
end
resolver
=
Resolver
.
new
(
podfile
,
nil
,
Sandbox
.
new
(
fixture
(
'integration'
)))
installer
=
Installer
.
new
(
resolver
)
installer
.
target_installers
.
map
(
&
:target_definition
).
map
(
&
:name
).
should
==
[
:not_empty
]
end
it
"adds the user's build configurations"
do
it
"namespaces local pods"
do
path
=
fixture
(
'SampleProject/SampleProject.xcodeproj'
)
@installer
.
install!
podfile
=
Podfile
.
new
do
group
=
@installer
.
project
.
groups
.
where
(
:name
=>
'Local Pods'
)
platform
:ios
group
.
groups
.
map
(
&
:name
).
sort
.
should
==
%w| Chameleon |
xcodeproj
path
,
'App Store'
=>
:release
end
end
resolver
=
Resolver
.
new
(
podfile
,
nil
,
Sandbox
.
new
(
fixture
(
'integration'
)))
installer
=
Installer
.
new
(
resolver
)
installer
.
project
.
build_configurations
.
map
(
&
:name
).
sort
.
should
==
[
'App Store'
,
'Debug'
,
'Release'
,
'Test'
]
end
it
"forces downloading of the `bleeding edge' version of a pod
"
do
it
"namespaces subspecs
"
do
podfile
=
Podfile
.
new
do
@installer
.
install!
platform
:ios
group
=
@installer
.
project
.
groups
.
where
(
:name
=>
'Chameleon'
)
pod
'JSONKit'
,
:head
group
.
groups
.
map
(
&
:name
).
sort
.
should
==
%w| AVFoundation AssetsLibrary MediaPlayer MessageUI StoreKit UIKit |
end
end
resolver
=
Resolver
.
new
(
podfile
,
nil
,
Sandbox
.
new
(
fixture
(
'integration'
)))
installer
=
Installer
.
new
(
resolver
)
pod
=
installer
.
pods
.
first
downloader
=
stub
(
'Downloader'
)
Downloader
.
stubs
(
:for_pod
).
returns
(
downloader
)
downloader
.
expects
(
:download_head
)
installer
.
download_pod
(
pod
)
end
end
end
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