Skip to content

Commit

Permalink
Support older versions of Xcode/Swift
Browse files Browse the repository at this point in the history
  • Loading branch information
mdiep committed Dec 25, 2018
1 parent 7baa4b9 commit 46474fd
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 31 deletions.
4 changes: 1 addition & 3 deletions Source/CarthageKit/BinaryProject.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Foundation
import Result

/// Represents a binary dependency
public struct BinaryProject {
public struct BinaryProject: Equatable {
private static let jsonDecoder = JSONDecoder()

public var versions: [PinnedVersion: URL]
Expand Down Expand Up @@ -36,5 +36,3 @@ public struct BinaryProject {
}
}
}

extension BinaryProject: Equatable {}
4 changes: 1 addition & 3 deletions Source/CarthageKit/CompatibilityInfo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Foundation
import Result

/// Identifies a dependency, its pinned version, and its compatible and incompatible requirements
public struct CompatibilityInfo {
public struct CompatibilityInfo: Equatable {
public typealias Requirements = [Dependency: [Dependency: VersionSpecifier]]

/// The dependency
Expand Down Expand Up @@ -65,5 +65,3 @@ public struct CompatibilityInfo {
}
}
}

extension CompatibilityInfo: Equatable {}
6 changes: 1 addition & 5 deletions Source/CarthageKit/Dependency.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public struct BinaryURL: CustomStringConvertible {
}

/// Uniquely identifies a project that can be used as a dependency.
public enum Dependency {
public enum Dependency: Hashable {
/// A repository hosted on GitHub.com or GitHub Enterprise.
case gitHub(Server, Repository)

Expand Down Expand Up @@ -87,16 +87,12 @@ extension Dependency {
}
}

extension Dependency: Equatable {}

extension Dependency: Comparable {
public static func < (_ lhs: Dependency, _ rhs: Dependency) -> Bool {
return lhs.name.caseInsensitiveCompare(rhs.name) == .orderedAscending
}
}

extension Dependency: Hashable {}

extension Dependency: Scannable {
/// Attempts to parse a Dependency.
public static func from(_ scanner: Scanner) -> Result<Dependency, ScannableError> {
Expand Down
4 changes: 1 addition & 3 deletions Source/CarthageKit/DuplicateDependency.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// A duplicate dependency, used in CarthageError.duplicateDependencies.
public struct DuplicateDependency {
public struct DuplicateDependency: Equatable {
/// The duplicate dependency
public let dependency: Dependency

Expand Down Expand Up @@ -32,8 +32,6 @@ extension DuplicateDependency: CustomStringConvertible {
}
}

extension DuplicateDependency: Equatable {}

extension DuplicateDependency: Comparable {
public static func < (_ lhs: DuplicateDependency, _ rhs: DuplicateDependency) -> Bool {
if lhs.description < rhs.description {
Expand Down
4 changes: 1 addition & 3 deletions Source/CarthageKit/ScannableError.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// Error parsing strings into types, used in Scannable protocol
public struct ScannableError: Error {
public struct ScannableError: Error, Equatable {
let message: String
let currentLine: String?

Expand All @@ -14,5 +14,3 @@ extension ScannableError: CustomStringConvertible {
return currentLine.map { "\(message) in line: \($0)" } ?? message
}
}

extension ScannableError: Equatable {}
4 changes: 1 addition & 3 deletions Source/CarthageKit/Submodule.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// A Git submodule.
public struct Submodule {
public struct Submodule: Hashable {
/// The name of the submodule. Usually (but not always) the same as the
/// path.
public let name: String
Expand All @@ -21,8 +21,6 @@ public struct Submodule {
}
}

extension Submodule: Hashable {}

extension Submodule: CustomStringConvertible {
public var description: String {
return "\(name) @ \(sha)"
Expand Down
4 changes: 1 addition & 3 deletions Source/CarthageKit/SwiftVersionError.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation

internal enum SwiftVersionError: Error {
internal enum SwiftVersionError: Error, Equatable {
/// An error in determining the local Swift version
case unknownLocalSwiftVersion

Expand All @@ -26,5 +26,3 @@ extension SwiftVersionError: CustomStringConvertible {
}
}
}

extension SwiftVersionError: Equatable {}
6 changes: 1 addition & 5 deletions Source/CarthageKit/Version.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import ReactiveSwift

/// A semantic version.
/// - Note: See <http://semver.org/>
public struct SemanticVersion {
public struct SemanticVersion: Hashable {
/// The major version.
///
/// Increments to this component represent incompatible API changes.
Expand Down Expand Up @@ -243,8 +243,6 @@ extension Scanner {
}
}

extension SemanticVersion: Equatable {}

extension SemanticVersion: Comparable {
public static func < (_ lhs: SemanticVersion, _ rhs: SemanticVersion) -> Bool {
if lhs.components == rhs.components {
Expand All @@ -254,8 +252,6 @@ extension SemanticVersion: Comparable {
}
}

extension SemanticVersion: Hashable {}

extension SemanticVersion: CustomStringConvertible {
public var description: String {
var description = components.map { $0.description }.joined(separator: ".")
Expand Down
4 changes: 1 addition & 3 deletions Source/carthage/Build.swift
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ public struct BuildCommand: CommandProtocol {
}

/// Represents the user's chosen platform to build for.
public enum BuildPlatform {
public enum BuildPlatform: Equatable {
/// Build for all available platforms.
case all

Expand Down Expand Up @@ -259,8 +259,6 @@ public enum BuildPlatform {
}
}

extension BuildPlatform: Equatable {}

extension BuildPlatform: CustomStringConvertible {
public var description: String {
switch self {
Expand Down

0 comments on commit 46474fd

Please sign in to comment.