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