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
3ca4bf3d
Commit
3ca4bf3d
authored
Sep 11, 2011
by
Eloy Duran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor
parent
419af929
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
25 deletions
+18
-25
install.rb
lib/cocoa_pods/command/install.rb
+1
-2
specification.rb
lib/cocoa_pods/specification.rb
+14
-16
xcode_project.rb
lib/cocoa_pods/xcode_project.rb
+3
-7
No files found.
lib/cocoa_pods/command/install.rb
View file @
3ca4bf3d
...
@@ -3,9 +3,8 @@ module Pod
...
@@ -3,9 +3,8 @@ module Pod
class
Install
<
Command
class
Install
<
Command
def
run
def
run
if
spec
=
Specification
.
from_podfile
(
podfile
)
if
spec
=
Specification
.
from_podfile
(
podfile
)
#config.clean = false
spec
.
install_dependent_specifications!
spec
.
install_dependent_specifications!
spec
.
create_static_library!
spec
.
create_static_library
_project
!
else
else
$stderr
.
puts
"No Podfile found in current working directory."
$stderr
.
puts
"No Podfile found in current working directory."
end
end
...
...
lib/cocoa_pods/specification.rb
View file @
3ca4bf3d
...
@@ -119,35 +119,33 @@ module Pod
...
@@ -119,35 +119,33 @@ module Pod
end
end
end
end
def
create_static_library!
def
create_static_library
_project
!
puts
"==> Creating static library"
puts
"==> Creating static library
project
"
source_files
,
frameworks
,
header_search_paths
=
[],
[],
[]
project
=
XcodeProject
.
static_library
resolved_dependent_specification_sets
.
each
do
|
set
|
resolved_dependent_specification_sets
.
each
do
|
set
|
# In case the set is only part of other pods we don't need to build
# In case the set is only part of other pods we don't need to build
# the pod itself.
# the pod itself.
next
if
set
.
only_part_of_other_pod?
next
if
set
.
only_part_of_other_pod?
spec
=
set
.
podspec
spec
=
set
.
podspec
spec
.
read
(
:source_files
).
each
do
|
pattern
|
spec
.
read
(
: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?
source_files
.
concat
(
Dir
.
glob
(
pattern
.
to_s
).
map
{
|
f
|
Pathname
.
new
(
f
)
})
Dir
.
glob
(
pattern
.
to_s
).
each
do
|
file
|
end
file
=
Pathname
.
new
(
file
)
if
f
=
spec
.
read
(
:frameworks
)
file
=
file
.
relative_path_from
(
config
.
project_pods_root
)
frameworks
.
concat
(
f
)
project
.
add_source_file
(
file
)
end
end
if
s
=
spec
.
read
(
:header_search_paths
)
header_search_paths
.
concat
(
s
)
end
end
if
frameworks
=
spec
.
read
(
:frameworks
)
frameworks
.
each
{
|
framework
|
project
.
add_framework
(
framework
)
}
end
end
project
=
XcodeProject
.
static_library
if
search_paths
=
spec
.
read
(
:header_search_paths
)
source_files
.
each
do
|
file
|
search_paths
.
each
{
|
path
|
project
.
add_header_search_path
(
path
)
}
file
=
file
.
relative_path_from
(
config
.
project_pods_root
)
end
project
.
add_source_file
(
file
)
end
end
frameworks
.
each
{
|
framework
|
project
.
add_framework
(
framework
)
}
project
.
add_header_search_paths
(
header_search_paths
)
project
.
create_in
(
config
.
project_pods_root
)
project
.
create_in
(
config
.
project_pods_root
)
end
end
...
...
lib/cocoa_pods/xcode_project.rb
View file @
3ca4bf3d
...
@@ -69,11 +69,9 @@ module Pod
...
@@ -69,11 +69,9 @@ module Pod
add_file_to_list
(
'PBXFrameworksBuildPhase'
,
build_file_uuid
)
add_file_to_list
(
'PBXFrameworksBuildPhase'
,
build_file_uuid
)
end
end
def
add_header_search_paths
(
paths
)
def
add_header_search_path
(
path
)
objects_by_isa
(
'XCBuildConfiguration'
).
each
do
|
uuid
,
object
|
objects_by_isa
(
'XCBuildConfiguration'
).
each
do
|
_
,
object
|
existing_paths
=
object
[
'buildSettings'
][
'HEADER_SEARCH_PATHS'
]
||=
[]
(
object
[
'buildSettings'
][
'HEADER_SEARCH_PATHS'
]
||=
[])
<<
path
p
paths
existing_paths
.
concat
(
paths
)
end
end
end
end
...
@@ -94,7 +92,6 @@ module Pod
...
@@ -94,7 +92,6 @@ module Pod
def
add_file_to_list
(
isa
,
build_file_uuid
)
def
add_file_to_list
(
isa
,
build_file_uuid
)
object_uuid
,
object
=
objects_by_isa
(
isa
).
first
object_uuid
,
object
=
objects_by_isa
(
isa
).
first
object
[
'files'
]
<<
build_file_uuid
object
[
'files'
]
<<
build_file_uuid
#objects[object_uuid] = object
end
end
def
add_file_to_group
(
file_ref_uuid
,
name
)
def
add_file_to_group
(
file_ref_uuid
,
name
)
...
@@ -102,7 +99,6 @@ module Pod
...
@@ -102,7 +99,6 @@ module Pod
object
[
'isa'
]
==
'PBXGroup'
&&
object
[
'name'
]
==
name
object
[
'isa'
]
==
'PBXGroup'
&&
object
[
'name'
]
==
name
end
end
object
[
'children'
]
<<
file_ref_uuid
object
[
'children'
]
<<
file_ref_uuid
#objects[object_uuid] = object
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