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
c74fc01a
Commit
c74fc01a
authored
Jun 21, 2012
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[TargetInstaller] Add source files in batch.
parent
f4326c73
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
11 deletions
+18
-11
target_installer.rb
lib/cocoapods/installer/target_installer.rb
+3
-1
local_pod.rb
lib/cocoapods/local_pod.rb
+8
-2
target_installer_spec.rb
spec/unit/installer/target_installer_spec.rb
+1
-1
local_pod_spec.rb
spec/unit/local_pod_spec.rb
+6
-7
No files found.
lib/cocoapods/installer/target_installer.rb
View file @
c74fc01a
...
...
@@ -62,13 +62,15 @@ module Pod
@target
=
@project
.
add_pod_target
(
@target_definition
.
label
,
@target_definition
.
platform
)
source_files_description
=
[]
pods
.
each
do
|
pod
|
xcconfig
.
merge!
(
pod
.
xcconfig
)
pod
.
add_to_target
(
@target
)
source_files_description
+=
pod
.
source_files_description
# TODO: this doesn't need to be done here, it has nothing to do with the target
pod
.
link_headers
end
@target
.
add_source_files
(
source_files_description
)
xcconfig
.
merge!
(
'HEADER_SEARCH_PATHS'
=>
quoted
(
sandbox
.
header_search_paths
).
join
(
" "
))
...
...
lib/cocoapods/local_pod.rb
View file @
c74fc01a
...
...
@@ -328,13 +328,19 @@ module Pod
#
# @return [void] Adds the pods source files to a given target.
#
def
add_to_target
(
target
)
def
source_files_description
result
=
[]
source_files_by_spec
.
each
do
|
spec
,
files
|
compiler_flags
=
spec
.
compiler_flags
.
strip
files
.
each
do
|
file
|
file
=
file
.
relative_path_from
(
@sandbox
.
root
)
target
.
add_source_file
(
file
,
nil
,
spec
.
compiler_flags
.
strip
)
description
=
{}
description
[
:path
]
=
file
description
[
:compiler_flags
]
=
compiler_flags
unless
compiler_flags
.
empty?
result
<<
description
end
end
result
end
# @return Whether the pod requires ARC.
...
...
spec/unit/installer/target_installer_spec.rb
View file @
c74fc01a
...
...
@@ -40,7 +40,7 @@ describe Pod::Installer::TargetInstaller do
end
it
'adds each pod to the static library target'
do
@pods
[
0
].
expects
(
:
add_to_target
).
with
(
instance_of
(
Xcodeproj
::
Project
::
Object
::
PBXNativeTarget
)
)
@pods
[
0
].
expects
(
:
source_files_description
).
returns
([]
)
do_install!
end
...
...
spec/unit/local_pod_spec.rb
View file @
c74fc01a
...
...
@@ -75,17 +75,16 @@ describe Pod::LocalPod do
end
it
"can add it's source files to an Xcode project target"
do
target
=
mock
(
'target'
)
target
.
expects
(
:add_source_file
).
with
(
Pathname
.
new
(
"BananaLib/Classes/Banana.h"
),
anything
,
anything
)
target
.
expects
(
:add_source_file
).
with
(
Pathname
.
new
(
"BananaLib/Classes/Banana.m"
),
anything
,
anything
)
@pod
.
add_to_target
(
target
)
@pod
.
source_files_description
.
should
==
[
{
:path
=>
Pathname
.
new
(
"BananaLib/Classes/Banana.h"
)},
{
:path
=>
Pathname
.
new
(
"BananaLib/Classes/Banana.m"
)}]
end
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'
target
=
mock
(
'target'
)
target
.
expects
(
:add_source_file
).
twice
.
with
(
anything
,
anything
,
"-d some_flag"
)
@pod
.
add_to_target
(
target
)
@pod
.
source_files_description
.
should
==
[
{
:path
=>
Pathname
.
new
(
"BananaLib/Classes/Banana.h"
),
:compiler_flags
=>
'-d some_flag'
},
{
:path
=>
Pathname
.
new
(
"BananaLib/Classes/Banana.m"
),
:compiler_flags
=>
'-d some_flag'
}]
end
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