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
a212f19c
Commit
a212f19c
authored
Mar 31, 2012
by
Eloy Duran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A target is exclusive if the plaform doesn't match that of the parent.
parent
9dd91b59
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
2 deletions
+20
-2
podfile.rb
lib/cocoapods/podfile.rb
+13
-2
podfile_spec.rb
spec/unit/podfile_spec.rb
+7
-0
No files found.
lib/cocoapods/podfile.rb
View file @
a212f19c
...
...
@@ -10,9 +10,20 @@ module Pod
options
.
each
{
|
k
,
v
|
send
(
"
#{
k
}
="
,
v
)
}
end
def
exclusive?
@exclusive
# A target is automatically `exclusive` if the `platform` does not match
# the parent's `platform`.
def
exclusive
if
@exclusive
.
nil?
if
@platform
.
nil?
false
else
@parent
.
platform
!=
@platform
end
else
@exclusive
end
end
alias_method
:exclusive?
,
:exclusive
def
link_with
=
(
targets
)
@link_with
=
targets
.
is_a?
(
Array
)
?
targets
:
[
targets
]
...
...
spec/unit/podfile_spec.rb
View file @
a212f19c
...
...
@@ -89,6 +89,8 @@ describe "Pod::Podfile" do
target
:osx_target
,
:platform
=>
:osx
,
:link_with
=>
'OSXTarget'
do
dependency
'ASIHTTPRequest'
target
:nested_osx_target
do
end
end
dependency
'ASIHTTPRequest'
...
...
@@ -166,6 +168,11 @@ describe "Pod::Podfile" do
@podfile
.
target_definitions
[
:test
].
platform
.
should
==
:ios
@podfile
.
target_definitions
[
:osx_target
].
platform
.
should
==
:osx
end
it
"autmatically marks a target as exclusive if the parent platform doesn't match"
do
@podfile
.
target_definitions
[
:osx_target
].
should
.
be
.
exclusive
@podfile
.
target_definitions
[
:nested_osx_target
].
should
.
not
.
be
.
exclusive
end
end
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