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
072db240
Commit
072db240
authored
Oct 23, 2011
by
Eloy Duran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make exclusive targets work and add some documentation.
parent
a9ccd659
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
2 deletions
+35
-2
podfile.rb
lib/cocoapods/podfile.rb
+29
-2
podfile_spec.rb
spec/unit/podfile_spec.rb
+6
-0
No files found.
lib/cocoapods/podfile.rb
View file @
072db240
...
@@ -94,11 +94,38 @@ module Pod
...
@@ -94,11 +94,38 @@ module Pod
attr_reader
:targets
attr_reader
:targets
# Defines a new static library target and scopes dependencies defined from
# the given block. The target will by default include the dependencies
# defined outside of the block, unless the `:exclusive => true` option is
# given.
#
# Consider the following Podfile:
#
# dependency 'ASIHTTPRequest'
#
# target :debug do
# dependency 'SSZipArchive'
# end
#
# target :test, :exclusive => true do
# dependency 'JSONKit'
# end
#
# This Podfile defines three targets. The first one is the `:default` target,
# which produces the `libPods.a` file. The second and third are the `:debug`
# and `:test` ones, which produce the `libPods-debug.a` and `libPods-test.a`
# files.
#
# The `:default` target has only one dependency (ASIHTTPRequest), whereas the
# `:debug` target has two (ASIHTTPRequest, SSZipArchive). The `:test` target,
# however, is an exclusive target which means it will only have one
# dependency (JSONKit).
def
target
(
name
,
options
=
{})
def
target
(
name
,
options
=
{})
@targets
[
name
]
=
@target
=
Target
.
new
(
name
,
@target
)
parent
=
@target
@targets
[
name
]
=
@target
=
Target
.
new
(
name
,
options
[
:exclusive
]
?
nil
:
parent
)
yield
yield
ensure
ensure
@target
=
@target
.
parent
@target
=
parent
end
end
# This is to be compatible with a Specification for use in the Installer and
# This is to be compatible with a Specification for use in the Installer and
...
...
spec/unit/podfile_spec.rb
View file @
072db240
...
@@ -56,6 +56,12 @@ describe "Pod::Podfile" do
...
@@ -56,6 +56,12 @@ describe "Pod::Podfile" do
Pod
::
Dependency
.
new
(
'SSZipArchive'
)
Pod
::
Dependency
.
new
(
'SSZipArchive'
)
]
]
end
end
it
"does not add dependencies of the outer target to exclusive targets"
do
target
=
@podfile
.
targets
[
:test
]
target
.
lib_name
.
should
==
'libPods-test'
target
.
dependencies
.
should
==
[
Pod
::
Dependency
.
new
(
'JSONKit'
)]
end
end
end
describe
"concerning validations"
do
describe
"concerning validations"
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