|
1 | 1 | /*
|
2 | 2 | This source file is part of the Swift.org open source project
|
3 | 3 |
|
4 |
| - Copyright (c) 2020-2021 Apple Inc. and the Swift project authors |
| 4 | + Copyright (c) 2020-2022 Apple Inc. and the Swift project authors |
5 | 5 | Licensed under Apache License v2.0 with Runtime Library Exception
|
6 | 6 |
|
7 | 7 | See http://swift.org/LICENSE.txt for license information
|
@@ -80,7 +80,7 @@ extension PackageCollectionModel.V1 {
|
80 | 80 |
|
81 | 81 | // TODO: validate package url?
|
82 | 82 | private func validate(package: Collection.Package, messages: inout [ValidationMessage]) {
|
83 |
| - let packageID = PackageIdentity(url: package.url).description |
| 83 | + let packageID = "\(PackageIdentity(url: package.url).description) (\(package.url.absoluteString))" |
84 | 84 |
|
85 | 85 | guard !package.versions.isEmpty else {
|
86 | 86 | messages.append(.error("Package \(packageID) does not have any versions.", property: "package.versions"))
|
@@ -145,7 +145,7 @@ extension PackageCollectionModel.V1 {
|
145 | 145 |
|
146 | 146 | version.manifests.forEach { toolsVersion, manifest in
|
147 | 147 | if toolsVersion != manifest.toolsVersion {
|
148 |
| - messages.append(.error("Manifest tools version \(manifest.toolsVersion) does not match \(toolsVersion)", property: "version.manifest")) |
| 148 | + messages.append(.error("Package \(packageID) manifest tools version \(manifest.toolsVersion) does not match \(toolsVersion)", property: "version.manifest")) |
149 | 149 | }
|
150 | 150 |
|
151 | 151 | if manifest.products.isEmpty {
|
@@ -231,6 +231,15 @@ extension Array where Element == ValidationMessage {
|
231 | 231 | public enum ValidationError: Error, Equatable, CustomStringConvertible {
|
232 | 232 | case property(name: String, message: String)
|
233 | 233 | case other(message: String)
|
| 234 | + |
| 235 | + public var message: String { |
| 236 | + switch self { |
| 237 | + case .property(_, let message): |
| 238 | + return message |
| 239 | + case .other(let message): |
| 240 | + return message |
| 241 | + } |
| 242 | + } |
234 | 243 |
|
235 | 244 | public var description: String {
|
236 | 245 | switch self {
|
|
0 commit comments