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
335f4a20
Commit
335f4a20
authored
May 10, 2015
by
Marius Rackwitz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PodTarget] Require target_definitions on init
parent
6b697111
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
10 deletions
+10
-10
pod_target.rb
lib/cocoapods/target/pod_target.rb
+1
-0
file_references_installer_spec.rb
spec/unit/installer/file_references_installer_spec.rb
+3
-3
installer_spec.rb
spec/unit/installer_spec.rb
+6
-7
No files found.
lib/cocoapods/target/pod_target.rb
View file @
335f4a20
...
...
@@ -40,6 +40,7 @@ module Pod
#
def
initialize
(
specs
,
target_definitions
,
sandbox
,
scoped
=
false
)
raise
"Can't initialize a PodTarget without specs!"
if
specs
.
nil?
||
specs
.
empty?
raise
"Can't initialize a PodTarget without TargetDefinition!"
if
target_definitions
.
nil?
||
target_definitions
.
empty?
@specs
=
specs
@target_definitions
=
target_definitions
@sandbox
=
sandbox
...
...
spec/unit/installer/file_references_installer_spec.rb
View file @
335f4a20
...
...
@@ -77,9 +77,9 @@ module Pod
describe
'Private Helpers'
do
describe
'#file_accessors'
do
it
'returns the file accessors'
do
pod_target_1
=
PodTarget
.
new
([
],
nil
,
config
.
sandbox
)
pod_target_1
=
PodTarget
.
new
([
stub
(
'Spec'
)],
[
stub
(
'TargetDefinition'
)]
,
config
.
sandbox
)
pod_target_1
.
file_accessors
=
[
fixture_file_accessor
(
'banana-lib/BananaLib.podspec'
)]
pod_target_2
=
PodTarget
.
new
([
],
nil
,
config
.
sandbox
)
pod_target_2
=
PodTarget
.
new
([
stub
(
'Spec'
)],
[
stub
(
'TargetDefinition'
)]
,
config
.
sandbox
)
pod_target_2
.
file_accessors
=
[
fixture_file_accessor
(
'banana-lib/BananaLib.podspec'
)]
installer
=
Installer
::
FileReferencesInstaller
.
new
(
config
.
sandbox
,
[
pod_target_1
,
pod_target_2
],
@project
)
roots
=
installer
.
send
(
:file_accessors
).
map
{
|
fa
|
fa
.
path_list
.
root
}
...
...
@@ -87,7 +87,7 @@ module Pod
end
it
'handles libraries empty libraries without file accessors'
do
pod_target_1
=
PodTarget
.
new
([
],
nil
,
config
.
sandbox
)
pod_target_1
=
PodTarget
.
new
([
stub
(
'Spec'
)],
[
stub
(
'TargetDefinition'
)]
,
config
.
sandbox
)
pod_target_1
.
file_accessors
=
[]
installer
=
Installer
::
FileReferencesInstaller
.
new
(
config
.
sandbox
,
[
pod_target_1
],
@project
)
installer
.
send
(
:file_accessors
).
should
==
[]
...
...
spec/unit/installer_spec.rb
View file @
335f4a20
...
...
@@ -306,7 +306,7 @@ module Pod
@analysis_result
=
Installer
::
Analyzer
::
AnalysisResult
.
new
@analysis_result
.
specifications
=
[]
@analysis_result
.
sandbox_state
=
Installer
::
Analyzer
::
SpecsState
.
new
@pod_targets
=
[
PodTarget
.
new
([
],
nil
,
config
.
sandbox
)]
@pod_targets
=
[
PodTarget
.
new
([
stub
(
'Spec'
)],
[
stub
(
'TargetDefinition'
)]
,
config
.
sandbox
)]
@installer
.
stubs
(
:analysis_result
).
returns
(
@analysis_result
)
@installer
.
stubs
(
:pod_targets
).
returns
(
@pod_targets
)
end
...
...
@@ -364,7 +364,7 @@ module Pod
it
'correctly configures the Pod source installer'
do
spec
=
fixture_spec
(
'banana-lib/BananaLib.podspec'
)
pod_target
=
PodTarget
.
new
([
spec
],
nil
,
config
.
sandbox
)
pod_target
=
PodTarget
.
new
([
spec
],
[
stub
(
'TargetDefinition'
)]
,
config
.
sandbox
)
pod_target
.
stubs
(
:platform
).
returns
(
:ios
)
@installer
.
stubs
(
:pod_targets
).
returns
([
pod_target
])
@installer
.
instance_variable_set
(
:@installed_specs
,
[])
...
...
@@ -374,7 +374,7 @@ module Pod
it
'maintains the list of the installed specs'
do
spec
=
fixture_spec
(
'banana-lib/BananaLib.podspec'
)
pod_target
=
PodTarget
.
new
([
spec
],
nil
,
config
.
sandbox
)
pod_target
=
PodTarget
.
new
([
spec
],
[
stub
(
'TargetDefinition'
)]
,
config
.
sandbox
)
pod_target
.
stubs
(
:platform
).
returns
(
:ios
)
@installer
.
stubs
(
:pod_targets
).
returns
([
pod_target
,
pod_target
])
@installer
.
instance_variable_set
(
:@installed_specs
,
[])
...
...
@@ -463,9 +463,8 @@ module Pod
end
it
'sets the deployment target for the whole project'
do
spec
=
fixture_spec
(
'banana-lib/BananaLib.podspec'
)
pod_target_ios
=
PodTarget
.
new
([
spec
],
nil
,
config
.
sandbox
)
pod_target_osx
=
PodTarget
.
new
([
spec
],
nil
,
config
.
sandbox
)
pod_target_ios
=
PodTarget
.
new
([
stub
(
'Spec'
)],
[
stub
(
'TargetDefinition'
)],
config
.
sandbox
)
pod_target_osx
=
PodTarget
.
new
([
stub
(
'Spec'
)],
[
stub
(
'TargetDefinition'
)],
config
.
sandbox
)
pod_target_ios
.
stubs
(
:platform
).
returns
(
Platform
.
new
(
:ios
,
'6.0'
))
pod_target_osx
.
stubs
(
:platform
).
returns
(
Platform
.
new
(
:osx
,
'10.8'
))
aggregate_target_ios
=
AggregateTarget
.
new
(
nil
,
config
.
sandbox
)
...
...
@@ -621,7 +620,7 @@ module Pod
it
'shares schemes of development pods'
do
spec
=
fixture_spec
(
'banana-lib/BananaLib.podspec'
)
target_definition
=
Podfile
::
TargetDefinition
.
new
(
:default
,
@installer
.
podfile
)
pod_target
=
PodTarget
.
new
([
spec
],
target_definition
,
config
.
sandbox
)
pod_target
=
PodTarget
.
new
([
spec
],
[
target_definition
]
,
config
.
sandbox
)
@installer
.
pods_project
.
stubs
(
:targets
).
returns
([
pod_target
])
@installer
.
sandbox
.
stubs
(
:development_pods
).
returns
(
'BananaLib'
=>
nil
)
...
...
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