forked from Carthage/Carthage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e1fafd7
commit 9312520
Showing
4 changed files
with
32 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,26 @@ | ||
import Foundation | ||
|
||
/// Identifies a dependency, its pinned version, and versions of this dependency with which it may or may not be compatible | ||
public struct CompatibilityInfo: Equatable { | ||
public struct CompatibilityInfo { | ||
/// The dependecy | ||
public let dependency: Dependency | ||
|
||
/// The pinned version of the dependency | ||
public let pinnedVersion: PinnedVersion | ||
|
||
/// Versions of this dependency with which it may or may not be compatible | ||
public let requirements: [Dependency: VersionSpecifier] | ||
|
||
/// The versions which are not compatible with the pinned version of this dependency | ||
public var incompatibleRequirements: [Dependency: VersionSpecifier] { | ||
return requirements.filter { _, version in !version.isSatisfied(by: pinnedVersion) } | ||
} | ||
} | ||
|
||
extension CompatibilityInfo: Equatable { | ||
public static func == (_ lhs: CompatibilityInfo, _ rhs: CompatibilityInfo) -> Bool { | ||
return lhs.dependency == rhs.dependency && | ||
lhs.pinnedVersion == rhs.pinnedVersion && | ||
lhs.requirements == rhs.requirements | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters