2024-11-10 17:51:53 +11:00
|
|
|
/*
|
|
|
|
* darwin-apk © 2024 Gay Pizza Specifications
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
2024-11-10 03:30:55 +11:00
|
|
|
|
|
|
|
import Foundation
|
|
|
|
|
|
|
|
struct ApkIndexDependency: ApkIndexRequirementRef {
|
|
|
|
let name: String
|
|
|
|
let versionSpec: ApkVersionSpecification
|
|
|
|
|
2024-11-10 21:00:07 +11:00
|
|
|
init(name: String, version spec: ApkVersionSpecification) {
|
|
|
|
self.name = name
|
|
|
|
self.versionSpec = spec
|
2024-11-10 03:30:55 +11:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
extension ApkIndexDependency: CustomStringConvertible {
|
|
|
|
var description: String {
|
|
|
|
switch self.versionSpec {
|
|
|
|
case .any: self.name
|
|
|
|
case .conflict: "!\(self.name)"
|
|
|
|
case .constraint(let op, let version): "\(self.name)\(op)\(version)"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|