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
74eda202
Unverified
Commit
74eda202
authored
Oct 01, 2016
by
Danielle Tomlinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PodVariant] Remove swift_version
parent
d6523d56
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
58 deletions
+45
-58
analyzer.rb
lib/cocoapods/installer/analyzer.rb
+1
-1
pod_variant.rb
lib/cocoapods/installer/analyzer/pod_variant.rb
+3
-9
pod_variant_spec.rb
spec/unit/installer/analyzer/pod_variant_spec.rb
+41
-48
No files found.
lib/cocoapods/installer/analyzer.rb
View file @
74eda202
...
...
@@ -452,7 +452,7 @@ module Pod
distinct_targets
=
specs_by_target
.
each_with_object
({})
do
|
dependency
,
hash
|
target_definition
,
dependent_specs
=
*
dependency
dependent_specs
.
group_by
(
&
:root
).
each
do
|
root_spec
,
specs
|
pod_variant
=
PodVariant
.
new
(
specs
,
target_definition
.
platform
,
target_definition
.
uses_frameworks?
,
target_definition
.
swift_version
)
pod_variant
=
PodVariant
.
new
(
specs
,
target_definition
.
platform
,
target_definition
.
uses_frameworks?
)
hash
[
root_spec
]
||=
{}
(
hash
[
root_spec
][
pod_variant
]
||=
[])
<<
target_definition
end
...
...
lib/cocoapods/installer/analyzer/pod_variant.rb
View file @
74eda202
...
...
@@ -16,10 +16,6 @@ module Pod
attr_accessor
:requires_frameworks
alias_method
:requires_frameworks?
,
:requires_frameworks
# @return [String] the Swift version
#
attr_accessor
:swift_version
# @return [Specification] the root specification
#
def
root_spec
...
...
@@ -32,11 +28,10 @@ module Pod
# @param [Platform] platform @see #platform
# @param [Bool] requires_frameworks @see #requires_frameworks?
#
def
initialize
(
specs
,
platform
,
requires_frameworks
=
false
,
swift_version
=
nil
)
def
initialize
(
specs
,
platform
,
requires_frameworks
=
false
)
self
.
specs
=
specs
self
.
platform
=
platform
self
.
requires_frameworks
=
requires_frameworks
self
.
swift_version
=
swift_version
end
# @return [Bool] whether the {PodVariant} is equal to another taking all
...
...
@@ -46,8 +41,7 @@ module Pod
self
.
class
==
other
.
class
&&
specs
==
other
.
specs
&&
platform
==
other
.
platform
&&
requires_frameworks
==
other
.
requires_frameworks
&&
swift_version
==
other
.
swift_version
requires_frameworks
==
other
.
requires_frameworks
end
alias_method
:eql?
,
:==
...
...
@@ -57,7 +51,7 @@ module Pod
#
# @!visibility private
def
hash
[
specs
,
platform
,
requires_frameworks
,
swift_version
].
hash
[
specs
,
platform
,
requires_frameworks
].
hash
end
end
end
...
...
spec/unit/installer/analyzer/pod_variant_spec.rb
View file @
74eda202
require
File
.
expand_path
(
'../../../../spec_helper'
,
__FILE__
)
module
Pod
describe
PodVariant
=
Installer
::
Analyzer
::
PodVariant
do
before
do
@specs
=
[
stub
(
'Spec'
),
stub
(
'Spec/Foo'
)]
@platform
=
Platform
.
ios
end
class
Installer
class
Analyzer
describe
PodVariant
do
before
do
@specs
=
[
stub
(
'Spec'
),
stub
(
'Spec/Foo'
)]
@platform
=
Platform
.
ios
end
it
'can be initialized with specs and platform'
do
variant
=
PodVariant
.
new
(
@specs
,
@platform
)
variant
.
specs
.
should
==
@specs
variant
.
platform
.
should
==
@platform
variant
.
requires_frameworks
.
should
==
false
variant
.
swift_version
.
should
.
nil?
end
it
'can be initialized with specs and platform'
do
variant
=
PodVariant
.
new
(
@specs
,
@platform
)
variant
.
specs
.
should
==
@specs
variant
.
platform
.
should
==
@platform
variant
.
requires_frameworks
.
should
==
false
end
it
'can be initialized with specs, platform and whether it requires frameworks'
do
variant
=
PodVariant
.
new
(
@specs
,
@platform
,
true
)
variant
.
specs
.
should
==
@specs
variant
.
platform
.
should
==
@platform
variant
.
requires_frameworks
.
should
==
true
variant
.
swift_version
.
should
.
nil?
end
it
'can be initialized with specs, platform and whether it requires frameworks'
do
variant
=
PodVariant
.
new
(
@specs
,
@platform
,
true
)
variant
.
specs
.
should
==
@specs
variant
.
platform
.
should
==
@platform
variant
.
requires_frameworks
.
should
==
true
end
it
'can be initialized with specs, platform, whether it requires frameworks, and a Swift version'
do
variant
=
PodVariant
.
new
(
@specs
,
@platform
,
true
,
'2.3'
)
variant
.
specs
.
should
==
@specs
variant
.
platform
.
should
==
@platform
variant
.
requires_frameworks
.
should
==
true
variant
.
swift_version
.
should
==
'2.3'
end
it
'can return the root spec'
do
spec
=
fixture_spec
(
'banana-lib/BananaLib.podspec'
)
variant
=
PodVariant
.
new
([
spec
],
Platform
.
ios
)
variant
.
root_spec
.
should
==
spec
end
it
'can return the root spec'
do
spec
=
fixture_spec
(
'banana-lib/BananaLib.podspec'
)
variant
=
PodVariant
.
new
([
spec
],
Platform
.
ios
)
variant
.
root_spec
.
should
==
spec
end
it
'can be compared for equality with another variant with the same specs, platform, value for whether it requires frameworks and Swift version'
do
spec
=
PodVariant
.
new
(
@specs
,
@platform
,
false
,
'2.3'
)
spec
.
should
==
PodVariant
.
new
(
@specs
,
@platform
,
false
,
'2.3'
)
spec
.
should
.
not
==
PodVariant
.
new
(
@specs
,
@platform
,
false
,
'3.0'
)
spec
.
should
.
not
==
PodVariant
.
new
([
@specs
.
first
],
@platform
,
false
)
spec
.
should
.
not
==
PodVariant
.
new
(
@specs
,
Platform
.
osx
,
false
,
'2.3'
)
spec
.
should
.
not
==
PodVariant
.
new
(
@specs
,
@platform
,
true
)
end
it
'can be compared for equality with another variant with the same specs, platform, and whether it requires frameworks'
do
spec
=
PodVariant
.
new
(
@specs
,
@platform
,
false
)
spec
.
should
==
PodVariant
.
new
(
@specs
,
@platform
,
false
)
spec
.
should
.
not
==
PodVariant
.
new
([
@specs
.
first
],
@platform
)
spec
.
should
.
not
==
PodVariant
.
new
(
@specs
,
Platform
.
osx
,
false
)
spec
.
should
.
not
==
PodVariant
.
new
(
@specs
,
@platform
,
true
)
end
it
'can be used as hash keys'
do
k0
=
PodVariant
.
new
(
@specs
,
@platform
,
false
)
v0
=
stub
(
'Value at index 0'
)
k1
=
PodVariant
.
new
(
@specs
,
@platform
,
true
)
v1
=
stub
(
'Value at index 1'
)
hash
=
{
k0
=>
v0
,
k1
=>
v1
}
hash
[
k0
].
should
==
v0
hash
[
k1
].
should
==
v1
it
'can be used as hash keys'
do
k0
=
PodVariant
.
new
(
@specs
,
@platform
,
false
)
v0
=
stub
(
'Value at index 0'
)
k1
=
PodVariant
.
new
(
@specs
,
@platform
,
true
)
v1
=
stub
(
'Value at index 1'
)
hash
=
{
k0
=>
v0
,
k1
=>
v1
}
hash
[
k0
].
should
==
v0
hash
[
k1
].
should
==
v1
end
end
end
end
end
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