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
ac11caf6
Commit
ac11caf6
authored
May 10, 2015
by
Marius Rackwitz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PodTarget] Add #target_definitions
parent
d8297f70
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
15 additions
and
10 deletions
+15
-10
pod_target.rb
lib/cocoapods/target/pod_target.rb
+6
-1
spec_helper.rb
spec/spec_helper.rb
+1
-1
aggregate_xcconfig_spec.rb
spec/unit/generator/xcconfig/aggregate_xcconfig_spec.rb
+1
-1
pod_target_installer_spec.rb
...t/installer/target_installer/pod_target_installer_spec.rb
+3
-3
aggregate_target_spec.rb
spec/unit/target/aggregate_target_spec.rb
+2
-2
pod_target_spec.rb
spec/unit/target/pod_target_spec.rb
+2
-2
No files found.
lib/cocoapods/target/pod_target.rb
View file @
ac11caf6
...
...
@@ -7,6 +7,11 @@ module Pod
#
attr_reader
:specs
# @return [Array<PBXNativeTarget>] the target definitions of the Podfile
# that generated this target.
#
attr_reader
:target_definitions
# @return [HeadersStore] the header directory for the target.
#
attr_reader
:build_headers
...
...
@@ -42,7 +47,7 @@ module Pod
#
def
label
if
scoped?
"
#{
target_definition
.
label
}
-
#{
root_spec
.
name
}
"
"
#{
target_definition
s
.
first
.
label
}
-
#{
root_spec
.
name
}
"
else
root_spec
.
name
end
...
...
spec/spec_helper.rb
View file @
ac11caf6
...
...
@@ -134,7 +134,7 @@ def fixture_pod_target(spec_or_name, platform = :ios, target_definition = nil)
end
def
fixture_aggregate_target
(
pod_targets
=
[],
platform
=
:ios
,
target_definition
=
nil
)
target_definition
||=
pod_targets
.
map
(
&
:target_definition
).
first
||
fixture_target_definition
target_definition
||=
pod_targets
.
flat_map
(
&
:target_definitions
).
first
||
fixture_target_definition
target
=
Pod
::
AggregateTarget
.
new
(
target_definition
,
config
.
sandbox
)
target
.
client_root
=
config
.
sandbox
.
root
.
dirname
version
||=
(
platform
==
:ios
?
'4.3'
:
'10.6'
)
...
...
spec/unit/generator/xcconfig/aggregate_xcconfig_spec.rb
View file @
ac11caf6
...
...
@@ -17,7 +17,7 @@ module Pod
@pod_target
=
pod_target
(
@spec
)
@consumer
=
@pod_target
.
spec_consumers
.
last
@target
=
fixture_aggregate_target
([
@pod_target
])
@target
.
target_definition
.
should
==
@pod_target
.
target_definition
@target
.
target_definition
.
should
==
@pod_target
.
target_definition
s
.
first
@target
.
target_definition
.
whitelist_pod_for_configuration
(
@spec
.
name
,
'Release'
)
@podfile
=
@target
.
target_definition
.
podfile
@generator
=
AggregateXCConfig
.
new
(
@target
,
'Release'
)
...
...
spec/unit/installer/target_installer/pod_target_installer_spec.rb
View file @
ac11caf6
...
...
@@ -226,7 +226,7 @@ module Pod
end
it
'flags should not be added to dtrace files'
do
@installer
.
target
.
target_definition
.
stubs
(
:inhibits_warnings_for_pod?
).
returns
(
true
)
@installer
.
target
.
target_definition
s
.
first
.
stubs
(
:inhibits_warnings_for_pod?
).
returns
(
true
)
@installer
.
install!
dtrace_files
=
@installer
.
target
.
native_target
.
source_build_phase
.
files
.
select
do
|
sf
|
...
...
@@ -238,7 +238,7 @@ module Pod
end
it
'adds -w per pod if target definition inhibits warnings for that pod'
do
@installer
.
target
.
target_definition
.
stubs
(
:inhibits_warnings_for_pod?
).
returns
(
true
)
@installer
.
target
.
target_definition
s
.
first
.
stubs
(
:inhibits_warnings_for_pod?
).
returns
(
true
)
flags
=
@installer
.
send
(
:compiler_flags_for_consumer
,
@spec
.
consumer
(
:ios
),
true
)
flags
.
should
.
include?
(
'-w'
)
...
...
@@ -250,7 +250,7 @@ module Pod
end
it
'adds -Xanalyzer -analyzer-disable-checker per pod'
do
@installer
.
target
.
target_definition
.
stubs
(
:inhibits_warnings_for_pod?
).
returns
(
true
)
@installer
.
target
.
target_definition
s
.
first
.
stubs
(
:inhibits_warnings_for_pod?
).
returns
(
true
)
flags
=
@installer
.
send
(
:compiler_flags_for_consumer
,
@spec
.
consumer
(
:ios
),
true
)
flags
.
should
.
include?
(
'-Xanalyzer -analyzer-disable-all-checks'
)
...
...
spec/unit/target/aggregate_target_spec.rb
View file @
ac11caf6
...
...
@@ -137,7 +137,7 @@ module Pod
describe
'With libraries'
do
before
do
@pod_target
=
fixture_pod_target
(
'banana-lib/BananaLib.podspec'
)
@target
=
AggregateTarget
.
new
(
@pod_target
.
target_definition
,
config
.
sandbox
)
@target
=
AggregateTarget
.
new
(
@pod_target
.
target_definition
s
.
first
,
config
.
sandbox
)
@target
.
pod_targets
=
[
@pod_target
]
end
...
...
@@ -197,7 +197,7 @@ module Pod
describe
'With frameworks'
do
before
do
@pod_target
=
fixture_pod_target
(
'orange-framework/OrangeFramework.podspec'
,
:ios
,
Podfile
::
TargetDefinition
.
new
(
'iOS Example'
,
nil
))
@target
=
AggregateTarget
.
new
(
@pod_target
.
target_definition
,
config
.
sandbox
)
@target
=
AggregateTarget
.
new
(
@pod_target
.
target_definition
s
.
first
,
config
.
sandbox
)
@target
.
stubs
(
:requires_frameworks?
).
returns
(
true
)
@target
.
pod_targets
=
[
@pod_target
]
end
...
...
spec/unit/target/pod_target_spec.rb
View file @
ac11caf6
...
...
@@ -20,8 +20,8 @@ module Pod
end
describe
'In general'
do
it
'returns the target
_definition that generated it
'
do
@pod_target
.
target_definition
.
should
==
@target_definition
it
'returns the target
definitions
'
do
@pod_target
.
target_definition
s
.
should
==
[
@target_definition
]
end
it
'returns its name'
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