Skip to content

Commit 27d4f68

Browse files
committed
Minor cleanups
1 parent 086d0f9 commit 27d4f68

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

Sources/PackageGraph/PackageGraph+Loading.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,7 @@ private func createResolvedPackages(
381381
targetBuilder.dependencies += try targetBuilder.target.dependencies.compactMap { dependency in
382382
switch dependency {
383383
case .target(let target, let conditions):
384+
try targetBuilder.target.validateDependency(target: target)
384385
guard let targetBuilder = targetMap[target] else {
385386
throw InternalError("unknown target \(target.name)")
386387
}
@@ -908,7 +909,6 @@ private final class ResolvedTargetBuilder: ResolvedBuilder<ResolvedTarget> {
908909
let dependencies = try self.dependencies.map { dependency -> ResolvedTarget.Dependency in
909910
switch dependency {
910911
case .target(let targetBuilder, let conditions):
911-
try self.target.validateDependency(target: targetBuilder.target)
912912
return .target(try targetBuilder.construct(), conditions: conditions)
913913
case .product(let productBuilder, let conditions):
914914
try self.target.validateDependency(
@@ -948,7 +948,6 @@ extension Target {
948948
}
949949
/// Builder for resolved package.
950950
private final class ResolvedPackageBuilder: ResolvedBuilder<ResolvedPackage> {
951-
952951
/// The package reference.
953952
let package: Package
954953

Sources/PackageGraph/Resolution/ResolvedTarget.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import PackageModel
1414

1515
import func TSCBasic.topologicalSort
1616

17-
/// Represents a fully resolved target. All the dependencies for the target are resolved.
17+
/// Represents a fully resolved target. All the dependencies for this target are also stored as resolved.
1818
public struct ResolvedTarget: Hashable {
1919
/// Represents dependency of a resolved target.
2020
public enum Dependency: Hashable {

Sources/PackageModel/PlatformRegistry.swift

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
/// A registry for available platforms.
14-
public final class PlatformRegistry {
15-
14+
public struct PlatformRegistry {
1615
/// The current registry is hardcoded and static so we can just use
1716
/// a singleton for now.
1817
public static let `default`: PlatformRegistry = .init()
@@ -31,6 +30,19 @@ public final class PlatformRegistry {
3130

3231
/// The static list of known platforms.
3332
private static var _knownPlatforms: [Platform] {
34-
return [.macOS, .macCatalyst, .iOS, .tvOS, .watchOS, .visionOS, .linux, .windows, .android, .wasi, .driverKit, .openbsd]
33+
[
34+
.macOS,
35+
.macCatalyst,
36+
.iOS,
37+
.tvOS,
38+
.watchOS,
39+
.visionOS,
40+
.linux,
41+
.windows,
42+
.android,
43+
.wasi,
44+
.driverKit,
45+
.openbsd
46+
]
3547
}
3648
}

0 commit comments

Comments
 (0)