Skip to content

Commit e275b94

Browse files
committed
Make Target subclasses final
1 parent b58782f commit e275b94

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

Sources/PackageModel/Target.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,13 @@ public class Target: ObjectIdentifierProtocol, PolymorphicCodableProtocol {
192192
}
193193
}
194194

195-
public class SwiftTarget: Target {
195+
extension Target: CustomStringConvertible {
196+
public var description: String {
197+
return "<\(Swift.type(of: self)): \(name)>"
198+
}
199+
}
200+
201+
public final class SwiftTarget: Target {
196202

197203
/// The file name of linux main file.
198204
public static let linuxMainBasename = "LinuxMain.swift"
@@ -258,7 +264,7 @@ public class SwiftTarget: Target {
258264
}
259265
}
260266

261-
public class SystemLibraryTarget: Target {
267+
public final class SystemLibraryTarget: Target {
262268

263269
/// The name of pkgConfig file, if any.
264270
public let pkgConfig: String?
@@ -319,7 +325,7 @@ public class SystemLibraryTarget: Target {
319325
}
320326
}
321327

322-
public class ClangTarget: Target {
328+
public final class ClangTarget: Target {
323329

324330
/// The default public include directory component.
325331
public static let defaultPublicHeadersComponent = "include"
@@ -408,7 +414,7 @@ public class ClangTarget: Target {
408414
}
409415
}
410416

411-
public class BinaryTarget: Target {
417+
public final class BinaryTarget: Target {
412418

413419
/// The original source of the binary artifact.
414420
public enum ArtifactSource: Equatable, Codable {
@@ -539,12 +545,6 @@ public enum ModuleMapType: Equatable, Codable {
539545
}
540546
}
541547

542-
extension Target: CustomStringConvertible {
543-
public var description: String {
544-
return "<\(Swift.type(of: self)): \(name)>"
545-
}
546-
}
547-
548548
extension Sources {
549549
/// Determine target type based on the sources.
550550
fileprivate func computeTargetType() -> Target.Kind {

0 commit comments

Comments
 (0)