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
e46ed11d
Commit
e46ed11d
authored
Jun 25, 2012
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[TargetInstaller] Integrate with Xcodeproj f0d455bcd8.
parent
c74fc01a
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
21 deletions
+21
-21
Gemfile.lock
Gemfile.lock
+6
-6
target_installer.rb
lib/cocoapods/installer/target_installer.rb
+3
-3
local_pod.rb
lib/cocoapods/local_pod.rb
+3
-5
target_installer_spec.rb
spec/unit/installer/target_installer_spec.rb
+1
-1
local_pod_spec.rb
spec/unit/local_pod_spec.rb
+8
-6
No files found.
Gemfile.lock
View file @
e46ed11d
GIT
GIT
remote: git://github.com/CocoaPods/Xcodeproj.git
remote: git://github.com/CocoaPods/Xcodeproj.git
revision:
c651b216acd6db18128f5b2df77ed04d183e7a3f
revision:
f0d455bcd839e8fdada2e117681ac93b296659b1
branch: develop
branch: develop
specs:
specs:
xcodeproj (0.2.0.rc2)
xcodeproj (0.2.0.rc2)
...
@@ -11,13 +11,13 @@ GEM
...
@@ -11,13 +11,13 @@ GEM
addressable (2.2.8)
addressable (2.2.8)
awesome_print (1.0.2)
awesome_print (1.0.2)
bacon (1.1.0)
bacon (1.1.0)
coderay (1.0.
6
)
coderay (1.0.
7
)
colored (1.2)
colored (1.2)
crack (0.3.1)
crack (0.3.1)
escape (0.0.4)
escape (0.0.4)
faraday (0.8.1)
faraday (0.8.1)
multipart-post (~> 1.1)
multipart-post (~> 1.1)
faraday_middleware (0.8.
7
)
faraday_middleware (0.8.
8
)
faraday (>= 0.7.4, < 0.9)
faraday (>= 0.7.4, < 0.9)
github-markup (0.7.2)
github-markup (0.7.2)
hashie (1.2.0)
hashie (1.2.0)
...
@@ -32,7 +32,7 @@ GEM
...
@@ -32,7 +32,7 @@ GEM
mocha (>= 0.9.8)
mocha (>= 0.9.8)
multi_json (1.3.6)
multi_json (1.3.6)
multipart-post (1.1.5)
multipart-post (1.1.5)
octokit (1.
4
.0)
octokit (1.
7
.0)
addressable (~> 2.2)
addressable (~> 2.2)
faraday (~> 0.8)
faraday (~> 0.8)
faraday_middleware (~> 0.8)
faraday_middleware (~> 0.8)
...
@@ -47,11 +47,11 @@ GEM
...
@@ -47,11 +47,11 @@ GEM
rb-fsevent (0.9.1)
rb-fsevent (0.9.1)
redcarpet (2.1.1)
redcarpet (2.1.1)
slop (2.4.4)
slop (2.4.4)
vcr (2.2.
0
)
vcr (2.2.
2
)
webmock (1.8.7)
webmock (1.8.7)
addressable (>= 2.2.7)
addressable (>= 2.2.7)
crack (>= 0.1.7)
crack (>= 0.1.7)
yard (0.8.2)
yard (0.8.2
.1
)
PLATFORMS
PLATFORMS
ruby
ruby
...
...
lib/cocoapods/installer/target_installer.rb
View file @
e46ed11d
...
@@ -62,15 +62,15 @@ module Pod
...
@@ -62,15 +62,15 @@ module Pod
@target
=
@project
.
add_pod_target
(
@target_definition
.
label
,
@target_definition
.
platform
)
@target
=
@project
.
add_pod_target
(
@target_definition
.
label
,
@target_definition
.
platform
)
source_file
s_description
=
[]
source_file
_descriptions
=
[]
pods
.
each
do
|
pod
|
pods
.
each
do
|
pod
|
xcconfig
.
merge!
(
pod
.
xcconfig
)
xcconfig
.
merge!
(
pod
.
xcconfig
)
source_file
s_description
+=
pod
.
source_files_description
source_file
_descriptions
+=
pod
.
source_file_descriptions
# TODO: this doesn't need to be done here, it has nothing to do with the target
# TODO: this doesn't need to be done here, it has nothing to do with the target
pod
.
link_headers
pod
.
link_headers
end
end
@target
.
add_source_files
(
source_file
s_description
)
@target
.
add_source_files
(
source_file
_descriptions
)
xcconfig
.
merge!
(
'HEADER_SEARCH_PATHS'
=>
quoted
(
sandbox
.
header_search_paths
).
join
(
" "
))
xcconfig
.
merge!
(
'HEADER_SEARCH_PATHS'
=>
quoted
(
sandbox
.
header_search_paths
).
join
(
" "
))
...
...
lib/cocoapods/local_pod.rb
View file @
e46ed11d
...
@@ -328,16 +328,14 @@ module Pod
...
@@ -328,16 +328,14 @@ module Pod
#
#
# @return [void] Adds the pods source files to a given target.
# @return [void] Adds the pods source files to a given target.
#
#
def
source_file
s_description
def
source_file
_descriptions
result
=
[]
result
=
[]
source_files_by_spec
.
each
do
|
spec
,
files
|
source_files_by_spec
.
each
do
|
spec
,
files
|
compiler_flags
=
spec
.
compiler_flags
.
strip
compiler_flags
=
spec
.
compiler_flags
.
strip
files
.
each
do
|
file
|
files
.
each
do
|
file
|
file
=
file
.
relative_path_from
(
@sandbox
.
root
)
file
=
file
.
relative_path_from
(
@sandbox
.
root
)
description
=
{}
desc
=
Xcodeproj
::
Project
::
PBXNativeTarget
::
SourceFileDescription
.
new
(
file
,
compiler_flags
,
nil
)
description
[
:path
]
=
file
result
<<
desc
description
[
:compiler_flags
]
=
compiler_flags
unless
compiler_flags
.
empty?
result
<<
description
end
end
end
end
result
result
...
...
spec/unit/installer/target_installer_spec.rb
View file @
e46ed11d
...
@@ -40,7 +40,7 @@ describe Pod::Installer::TargetInstaller do
...
@@ -40,7 +40,7 @@ describe Pod::Installer::TargetInstaller do
end
end
it
'adds each pod to the static library target'
do
it
'adds each pod to the static library target'
do
@pods
[
0
].
expects
(
:source_file
s_description
).
returns
([])
@pods
[
0
].
expects
(
:source_file
_descriptions
).
returns
([])
do_install!
do_install!
end
end
...
...
spec/unit/local_pod_spec.rb
View file @
e46ed11d
...
@@ -75,16 +75,18 @@ describe Pod::LocalPod do
...
@@ -75,16 +75,18 @@ describe Pod::LocalPod do
end
end
it
"can add it's source files to an Xcode project target"
do
it
"can add it's source files to an Xcode project target"
do
@pod
.
source_files_description
.
should
==
[
@pod
.
source_file_descriptions
.
should
==
[
{
:path
=>
Pathname
.
new
(
"BananaLib/Classes/Banana.h"
)},
Xcodeproj
::
Project
::
PBXNativeTarget
::
SourceFileDescription
.
new
(
Pathname
.
new
(
"BananaLib/Classes/Banana.h"
),
""
,
nil
),
{
:path
=>
Pathname
.
new
(
"BananaLib/Classes/Banana.m"
)}]
Xcodeproj
::
Project
::
PBXNativeTarget
::
SourceFileDescription
.
new
(
Pathname
.
new
(
"BananaLib/Classes/Banana.m"
),
""
,
nil
)
]
end
end
it
"can add it's source files to a target with any specially configured compiler flags"
do
it
"can add it's source files to a target with any specially configured compiler flags"
do
@pod
.
top_specification
.
compiler_flags
=
'-d some_flag'
@pod
.
top_specification
.
compiler_flags
=
'-d some_flag'
@pod
.
source_files_description
.
should
==
[
@pod
.
source_file_descriptions
.
should
==
[
{
:path
=>
Pathname
.
new
(
"BananaLib/Classes/Banana.h"
),
:compiler_flags
=>
'-d some_flag'
},
Xcodeproj
::
Project
::
PBXNativeTarget
::
SourceFileDescription
.
new
(
Pathname
.
new
(
"BananaLib/Classes/Banana.h"
),
'-d some_flag'
,
nil
),
{
:path
=>
Pathname
.
new
(
"BananaLib/Classes/Banana.m"
),
:compiler_flags
=>
'-d some_flag'
}]
Xcodeproj
::
Project
::
PBXNativeTarget
::
SourceFileDescription
.
new
(
Pathname
.
new
(
"BananaLib/Classes/Banana.m"
),
'-d some_flag'
,
nil
)
]
end
end
it
"returns the platform"
do
it
"returns the platform"
do
...
...
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