-
Notifications
You must be signed in to change notification settings - Fork 163
Create new target for common code #1331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
17a2037
b413e1d
294c79d
72254fa
50e20de
04d9cc1
f40ce48
04a7964
9dd4757
6614f2f
275bb42
20a6252
544f1d0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,15 @@ | ||
| /* | ||
| This source file is part of the Swift.org open source project | ||
|
|
||
| Copyright (c) 2021-2023 Apple Inc. and the Swift project authors | ||
| Copyright (c) 2021-2025 Apple Inc. and the Swift project authors | ||
| Licensed under Apache License v2.0 with Runtime Library Exception | ||
|
|
||
| See https://swift.org/LICENSE.txt for license information | ||
| See https://swift.org/CONTRIBUTORS.txt for Swift project authors | ||
| */ | ||
|
|
||
| /// A programming language. | ||
| public struct SourceLanguage: Hashable, Codable, Comparable { | ||
| public struct SourceLanguage: Hashable, Codable, Comparable, Sendable { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like you added
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, you can see that that was made in 04a7964 after moving the code. Conforming to
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I renamed the SourceLanguage file that was in SwiftDocC to CommonTypeExports so that git would produce a better diff for these changes. |
||
| /// The display name of the programming language. | ||
| public var name: String | ||
| /// A globally unique identifier for the language. | ||
|
|
@@ -132,7 +132,7 @@ public struct SourceLanguage: Hashable, Codable, Comparable { | |
| public static let metal = SourceLanguage(name: "Metal", id: "metal") | ||
|
|
||
| /// The list of programming languages that are known to DocC. | ||
| public static var knownLanguages: [SourceLanguage] = [.swift, .objectiveC, .javaScript, .data, .metal] | ||
| public static let knownLanguages: [SourceLanguage] = [.swift, .objectiveC, .javaScript, .data, .metal] | ||
|
|
||
| enum CodingKeys: CodingKey { | ||
| case name | ||
|
|
@@ -157,7 +157,9 @@ public struct SourceLanguage: Hashable, Codable, Comparable { | |
|
|
||
| try container.encode(self.name, forKey: SourceLanguage.CodingKeys.name) | ||
| try container.encode(self.id, forKey: SourceLanguage.CodingKeys.id) | ||
| try container.encodeIfNotEmpty(self.idAliases, forKey: SourceLanguage.CodingKeys.idAliases) | ||
| if !self.idAliases.isEmpty { | ||
| try container.encode(self.idAliases, forKey: SourceLanguage.CodingKeys.idAliases) | ||
| } | ||
| try container.encode(self.linkDisambiguationID, forKey: SourceLanguage.CodingKeys.linkDisambiguationID) | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| /* | ||
| This source file is part of the Swift.org open source project | ||
|
|
||
| Copyright (c) 2025 Apple Inc. and the Swift project authors | ||
| Licensed under Apache License v2.0 with Runtime Library Exception | ||
|
|
||
| See https://swift.org/LICENSE.txt for license information | ||
| See https://swift.org/CONTRIBUTORS.txt for Swift project authors | ||
| */ | ||
|
|
||
| public import DocCCommon | ||
|
|
||
| public typealias SourceLanguage = DocCCommon.SourceLanguage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to #1345 I added a "DocC" prefix to this target so as to not conflict with any other target in the toolchain.