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
e6505274
Commit
e6505274
authored
Aug 21, 2012
by
Eloy Durán
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #466 from CocoaPods/subspec_groups
[Project] Namespace subspecs in groups.
parents
e8d6f12e
647a397a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
7 deletions
+35
-7
installer.rb
lib/cocoapods/installer.rb
+5
-3
local_pod.rb
lib/cocoapods/local_pod.rb
+9
-0
project.rb
lib/cocoapods/project.rb
+9
-3
project_spec.rb
spec/unit/project_spec.rb
+12
-1
No files found.
lib/cocoapods/installer.rb
View file @
e6505274
...
@@ -28,9 +28,11 @@ module Pod
...
@@ -28,9 +28,11 @@ module Pod
@project
.
user_build_configurations
=
@podfile
.
user_build_configurations
@project
.
user_build_configurations
=
@podfile
.
user_build_configurations
pods
.
each
do
|
pod
|
pods
.
each
do
|
pod
|
# Add all source files to the project grouped by pod
# Add all source files to the project grouped by pod
group
=
@project
.
add_pod_group
(
pod
.
name
)
pod
.
relative_source_files_by_spec
.
each
do
|
spec
,
paths
|
pod
.
relative_source_files
.
each
do
|
path
|
group
=
@project
.
add_spec_group
(
spec
.
name
)
group
.
files
.
new
(
'path'
=>
path
.
to_s
)
paths
.
each
do
|
path
|
group
.
files
.
new
(
'path'
=>
path
.
to_s
)
end
end
end
end
end
# Add a group to hold all the target support files
# Add a group to hold all the target support files
...
...
lib/cocoapods/local_pod.rb
View file @
e6505274
...
@@ -192,6 +192,15 @@ module Pod
...
@@ -192,6 +192,15 @@ module Pod
source_files
.
map
{
|
p
|
p
.
relative_path_from
(
@sandbox
.
root
)
}
source_files
.
map
{
|
p
|
p
.
relative_path_from
(
@sandbox
.
root
)
}
end
end
def
relative_source_files_by_spec
result
=
{}
source_files_by_spec
.
each
do
|
spec
,
paths
|
result
[
spec
]
=
paths
.
map
{
|
p
|
p
.
relative_path_from
(
@sandbox
.
root
)
}
end
result
end
# Finds the source files that every activated {Specification} requires.
# Finds the source files that every activated {Specification} requires.
#
#
# @note If the same file is required by two specifications the one at the
# @note If the same file is required by two specifications the one at the
...
...
lib/cocoapods/project.rb
View file @
e6505274
...
@@ -34,9 +34,15 @@ module Pod
...
@@ -34,9 +34,15 @@ module Pod
groups
.
find
{
|
g
|
g
.
name
==
'Pods'
}
||
groups
.
new
({
'name'
=>
'Pods'
})
groups
.
find
{
|
g
|
g
.
name
==
'Pods'
}
||
groups
.
new
({
'name'
=>
'Pods'
})
end
end
# Adds a group as child to the `Pods' group.
# Adds a group as child to the `Pods' group namespacing subspecs.
def
add_pod_group
(
name
)
def
add_spec_group
(
name
)
pods
.
groups
.
new
(
'name'
=>
name
)
groups
=
pods
.
groups
group
=
nil
name
.
split
(
'/'
).
each
do
|
name
|
group
=
groups
.
find
{
|
g
|
g
.
name
==
name
}
||
groups
.
new
({
'name'
=>
name
})
groups
=
group
.
groups
end
group
end
end
def
add_pod_target
(
name
,
platform
)
def
add_pod_target
(
name
,
platform
)
...
...
spec/unit/project_spec.rb
View file @
e6505274
...
@@ -12,7 +12,7 @@ describe 'Pod::Project' do
...
@@ -12,7 +12,7 @@ describe 'Pod::Project' do
end
end
it
"adds a group to the `Pods' group"
do
it
"adds a group to the `Pods' group"
do
group
=
@project
.
add_
pod
_group
(
'JSONKit'
)
group
=
@project
.
add_
spec
_group
(
'JSONKit'
)
@project
.
pods
.
child_references
.
should
.
include
group
.
uuid
@project
.
pods
.
child_references
.
should
.
include
group
.
uuid
find_object
({
find_object
({
'isa'
=>
'PBXGroup'
,
'isa'
=>
'PBXGroup'
,
...
@@ -22,6 +22,17 @@ describe 'Pod::Project' do
...
@@ -22,6 +22,17 @@ describe 'Pod::Project' do
}).
should
.
not
==
nil
}).
should
.
not
==
nil
end
end
it
"namespaces subspecs in groups"
do
group
=
@project
.
add_spec_group
(
'JSONKit/Subspec'
)
@project
.
pods
.
groups
.
find
{
|
g
|
g
.
name
==
'JSONKit'
}.
child_references
.
should
.
include
group
.
uuid
find_object
({
'isa'
=>
'PBXGroup'
,
'name'
=>
'Subspec'
,
'sourceTree'
=>
'<group>'
,
'children'
=>
[]
}).
should
.
not
==
nil
end
it
"creates a copy build header phase which will copy headers to a specified path"
do
it
"creates a copy build header phase which will copy headers to a specified path"
do
@project
.
targets
.
new
@project
.
targets
.
new
phase
=
@project
.
targets
.
first
.
copy_files_build_phases
.
new_pod_dir
(
"SomePod"
,
"Path/To/Source"
)
phase
=
@project
.
targets
.
first
.
copy_files_build_phases
.
new_pod_dir
(
"SomePod"
,
"Path/To/Source"
)
...
...
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