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
0d580d52
Commit
0d580d52
authored
Sep 25, 2011
by
Eloy Duran
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote branch 'origin/dependency-groups'
parents
e2130261
70eb43dd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
9 deletions
+28
-9
installer.rb
lib/cocoapods/installer.rb
+13
-4
project.rb
lib/cocoapods/xcode/project.rb
+15
-5
No files found.
lib/cocoapods/installer.rb
View file @
0d580d52
...
@@ -17,16 +17,18 @@ module Pod
...
@@ -17,16 +17,18 @@ module Pod
end
end
def
source_files
def
source_files
source_files
=
[]
source_files
=
Hash
.
new
build_specification_sets
.
each
do
|
set
|
build_specification_sets
.
each
do
|
set
|
spec
=
set
.
specification
spec
=
set
.
specification
spec_files
=
[]
spec
.
source_files
.
each
do
|
pattern
|
spec
.
source_files
.
each
do
|
pattern
|
pattern
=
spec
.
pod_destroot
+
pattern
pattern
=
spec
.
pod_destroot
+
pattern
pattern
=
pattern
+
'*.{h,m,mm,c,cpp}'
if
pattern
.
directory?
pattern
=
pattern
+
'*.{h,m,mm,c,cpp}'
if
pattern
.
directory?
pattern
.
glob
.
each
do
|
file
|
pattern
.
glob
.
each
do
|
file
|
s
ource
_files
<<
file
.
relative_path_from
(
config
.
project_pods_root
)
s
pec
_files
<<
file
.
relative_path_from
(
config
.
project_pods_root
)
end
end
end
end
source_files
[
spec
.
name
]
=
spec_files
end
end
source_files
source_files
end
end
...
@@ -46,7 +48,12 @@ module Pod
...
@@ -46,7 +48,12 @@ module Pod
end
end
def
generate_project
def
generate_project
source_files
.
each
{
|
file
|
xcodeproj
.
add_source_file
(
file
)
}
source_files
.
each
do
|
group
,
files
|
xcodeproj
.
add_group
(
group
)
files
.
each
do
|
file
|
xcodeproj
.
add_source_file
(
file
,
group
)
end
end
build_specification_sets
.
each
do
|
set
|
build_specification_sets
.
each
do
|
set
|
xcconfig
<<
set
.
specification
.
xcconfig
xcconfig
<<
set
.
specification
.
xcconfig
end
end
...
@@ -56,7 +63,9 @@ module Pod
...
@@ -56,7 +63,9 @@ module Pod
# before #generate_project is called!
# before #generate_project is called!
def
install!
def
install!
puts
"Installing dependencies of:
#{
@specification
.
defined_in_file
}
"
unless
config
.
silent?
puts
"Installing dependencies of:
#{
@specification
.
defined_in_file
}
"
unless
config
.
silent?
build_specification_sets
.
each
{
|
set
|
set
.
specification
.
install!
}
build_specification_sets
.
each
do
|
set
|
set
.
specification
.
install!
end
generate_project
generate_project
xcodeproj
.
create_in
(
config
.
project_pods_root
)
xcodeproj
.
create_in
(
config
.
project_pods_root
)
xcconfig
.
create_in
(
config
.
project_pods_root
)
xcconfig
.
create_in
(
config
.
project_pods_root
)
...
...
lib/cocoapods/xcode/project.rb
View file @
0d580d52
...
@@ -50,9 +50,9 @@ module Pod
...
@@ -50,9 +50,9 @@ module Pod
end
.
compact
end
.
compact
end
end
def
add_source_file
(
file
,
compiler_flags
=
nil
)
def
add_source_file
(
file
,
group
=
'Pods'
,
compiler_flags
=
nil
)
file_ref_uuid
=
add_file_reference
(
file
,
'SOURCE_ROOT'
)
file_ref_uuid
=
add_file_reference
(
file
,
'SOURCE_ROOT'
)
add_
file_to_group
(
file_ref_uuid
,
'Pods'
)
add_
object_to_group
(
file_ref_uuid
,
group
)
if
file
.
extname
==
'.h'
if
file
.
extname
==
'.h'
build_file_uuid
=
add_build_file
(
file_ref_uuid
,
"settings"
=>
{
"ATTRIBUTES"
=>
[
"Public"
]
})
build_file_uuid
=
add_build_file
(
file_ref_uuid
,
"settings"
=>
{
"ATTRIBUTES"
=>
[
"Public"
]
})
# Working around a bug in Xcode 4.2 betas, remove this once the Xcode bug is fixed:
# Working around a bug in Xcode 4.2 betas, remove this once the Xcode bug is fixed:
...
@@ -66,6 +66,16 @@ module Pod
...
@@ -66,6 +66,16 @@ module Pod
end
end
file_ref_uuid
file_ref_uuid
end
end
def
add_group
(
name
)
group_uuid
=
add_object
({
"name"
=>
name
,
"isa"
=>
"PBXGroup"
,
"sourceTree"
=>
"<group>"
,
"children"
=>
[]
})
add_object_to_group
(
group_uuid
,
'Pods'
)
end
def
create_in
(
pods_root
)
def
create_in
(
pods_root
)
puts
" * Copying contents of template directory `
#{
@template_dir
}
' to `
#{
pods_root
}
'"
if
config
.
verbose?
puts
" * Copying contents of template directory `
#{
@template_dir
}
' to `
#{
pods_root
}
'"
if
config
.
verbose?
...
@@ -91,7 +101,7 @@ module Pod
...
@@ -91,7 +101,7 @@ module Pod
"path"
=>
path
.
to_s
,
"path"
=>
path
.
to_s
,
})
})
end
end
def
add_build_file
(
file_ref_uuid
,
extra
=
{})
def
add_build_file
(
file_ref_uuid
,
extra
=
{})
add_object
(
extra
.
merge
({
add_object
(
extra
.
merge
({
"isa"
=>
"PBXBuildFile"
,
"isa"
=>
"PBXBuildFile"
,
...
@@ -104,11 +114,11 @@ module Pod
...
@@ -104,11 +114,11 @@ module Pod
object
[
'files'
]
<<
build_file_uuid
object
[
'files'
]
<<
build_file_uuid
end
end
def
add_
file_to_group
(
file
_ref_uuid
,
name
)
def
add_
object_to_group
(
object
_ref_uuid
,
name
)
object_uuid
,
object
=
objects
.
find
do
|
_
,
object
|
object_uuid
,
object
=
objects
.
find
do
|
_
,
object
|
object
[
'isa'
]
==
'PBXGroup'
&&
object
[
'name'
]
==
name
object
[
'isa'
]
==
'PBXGroup'
&&
object
[
'name'
]
==
name
end
end
object
[
'children'
]
<<
file
_ref_uuid
object
[
'children'
]
<<
object
_ref_uuid
end
end
def
objects
def
objects
...
...
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