@@ -22,6 +22,7 @@ extension DocumentationBundle {
2222 public var identifier : String
2323
2424 /// The version of the bundle.
25+ @available ( * , deprecated, message: " This deprecated API will be removed after 6.2 is released " )
2526 public var version : String ?
2627
2728 /// The default language identifier for code listings in the bundle.
@@ -42,7 +43,6 @@ extension DocumentationBundle {
4243 enum CodingKeys : String , CodingKey , CaseIterable {
4344 case displayName = " CFBundleDisplayName "
4445 case identifier = " CFBundleIdentifier "
45- case version = " CFBundleVersion "
4646 case defaultCodeListingLanguage = " CDDefaultCodeListingLanguage "
4747 case defaultAvailability = " CDAppleDefaultAvailability "
4848 case defaultModuleKind = " CDDefaultModuleKind "
@@ -54,8 +54,6 @@ extension DocumentationBundle {
5454 return " --fallback-display-name "
5555 case . identifier:
5656 return " --fallback-bundle-identifier "
57- case . version:
58- return " --fallback-bundle-version "
5957 case . defaultCodeListingLanguage:
6058 return " --default-code-listing-language "
6159 case . defaultModuleKind:
@@ -82,26 +80,22 @@ extension DocumentationBundle {
8280 }
8381 }
8482
85-
8683 /// Creates a new documentation bundle information value.
8784 /// - Parameters:
8885 /// - displayName: The display name of the bundle.
8986 /// - identifier: The unique identifier of the bundle.
90- /// - version: The version of the bundle.
9187 /// - defaultCodeListingLanguage: The default language identifier for code listings in the bundle.
9288 /// - defaultAvailability: The default availability for the various modules in the bundle.
9389 /// - defaultModuleKind: The default kind for the various modules in the bundle.
9490 public init (
9591 displayName: String ,
9692 identifier: String ,
97- version: String ? ,
9893 defaultCodeListingLanguage: String ? ,
9994 defaultAvailability: DefaultAvailability ? ,
10095 defaultModuleKind: String ?
10196 ) {
10297 self . displayName = displayName
10398 self . identifier = identifier
104- self . version = version
10599 self . defaultCodeListingLanguage = defaultCodeListingLanguage
106100 self . defaultAvailability = defaultAvailability
107101 self . defaultModuleKind = defaultModuleKind
@@ -228,7 +222,6 @@ extension DocumentationBundle {
228222 // contain a display name. If they do but that value fails to decode, that error would be raised before accessing `derivedDisplayName`.
229223 self . displayName = try decodeOrFallbackIfPresent ( String . self, with: . displayName) ?? derivedDisplayName!
230224 self . identifier = try decodeOrFallbackIfPresent ( String . self, with: . identifier) ?? self . displayName
231- self . version = try decodeOrFallbackIfPresent ( String . self, with: . version)
232225
233226 // Finally, decode the optional keys if they're present.
234227
@@ -237,19 +230,17 @@ extension DocumentationBundle {
237230 self . defaultAvailability = try decodeOrFallbackIfPresent ( DefaultAvailability . self, with: . defaultAvailability)
238231 self . featureFlags = try decodeOrFallbackIfPresent ( BundleFeatureFlags . self, with: . featureFlags)
239232 }
240-
233+
241234 init (
242235 displayName: String ,
243236 identifier: String ,
244- version: String ? = nil ,
245237 defaultCodeListingLanguage: String ? = nil ,
246238 defaultModuleKind: String ? = nil ,
247239 defaultAvailability: DefaultAvailability ? = nil ,
248240 featureFlags: BundleFeatureFlags ? = nil
249241 ) {
250242 self . displayName = displayName
251243 self . identifier = identifier
252- self . version = version
253244 self . defaultCodeListingLanguage = defaultCodeListingLanguage
254245 self . defaultModuleKind = defaultModuleKind
255246 self . defaultAvailability = defaultAvailability
@@ -267,15 +258,13 @@ extension BundleDiscoveryOptions {
267258 /// - Parameters:
268259 /// - fallbackDisplayName: A fallback display name for the bundle.
269260 /// - fallbackIdentifier: A fallback identifier for the bundle.
270- /// - fallbackVersion: A fallback version for the bundle.
271261 /// - fallbackDefaultCodeListingLanguage: A fallback default code listing language for the bundle.
272262 /// - fallbackDefaultModuleKind: A fallback default module kind for the bundle.
273263 /// - fallbackDefaultAvailability: A fallback default availability for the bundle.
274264 /// - additionalSymbolGraphFiles: Additional symbol graph files to augment any discovered bundles.
275265 public init (
276266 fallbackDisplayName: String ? = nil ,
277267 fallbackIdentifier: String ? = nil ,
278- fallbackVersion: String ? = nil ,
279268 fallbackDefaultCodeListingLanguage: String ? = nil ,
280269 fallbackDefaultModuleKind: String ? = nil ,
281270 fallbackDefaultAvailability: DefaultAvailability ? = nil ,
@@ -294,8 +283,6 @@ extension BundleDiscoveryOptions {
294283 value = fallbackDisplayName
295284 case . identifier:
296285 value = fallbackIdentifier
297- case . version:
298- value = fallbackVersion
299286 case . defaultCodeListingLanguage:
300287 value = fallbackDefaultCodeListingLanguage
301288 case . defaultAvailability:
@@ -318,6 +305,26 @@ extension BundleDiscoveryOptions {
318305 additionalSymbolGraphFiles: additionalSymbolGraphFiles
319306 )
320307 }
308+
309+ @available ( * , deprecated, renamed: " init(fallbackDisplayName:fallbackIdentifier:fallbackDefaultCodeListingLanguage:fallbackDefaultModuleKind:fallbackDefaultAvailability:additionalSymbolGraphFiles:) " , message: " Use 'init(fallbackDisplayName:fallbackIdentifier:fallbackDefaultCodeListingLanguage:fallbackDefaultModuleKind:fallbackDefaultAvailability:additionalSymbolGraphFiles:)' instead. This deprecated API will be removed after 6.2 is released " )
310+ public init (
311+ fallbackDisplayName: String ? = nil ,
312+ fallbackIdentifier: String ? = nil ,
313+ fallbackVersion: String ? ,
314+ fallbackDefaultCodeListingLanguage: String ? = nil ,
315+ fallbackDefaultModuleKind: String ? = nil ,
316+ fallbackDefaultAvailability: DefaultAvailability ? = nil ,
317+ additionalSymbolGraphFiles: [ URL ] = [ ]
318+ ) {
319+ self . init (
320+ fallbackDisplayName: fallbackDisplayName,
321+ fallbackIdentifier: fallbackIdentifier,
322+ fallbackDefaultCodeListingLanguage: fallbackDefaultCodeListingLanguage,
323+ fallbackDefaultModuleKind: fallbackDefaultModuleKind,
324+ fallbackDefaultAvailability: fallbackDefaultAvailability,
325+ additionalSymbolGraphFiles: additionalSymbolGraphFiles
326+ )
327+ }
321328}
322329
323330private extension CodingUserInfoKey {
@@ -326,3 +333,23 @@ private extension CodingUserInfoKey {
326333 /// A user info key to store derived display name in the decoder.
327334 static let derivedDisplayName = CodingUserInfoKey ( rawValue: " derivedDisplayName " ) !
328335}
336+
337+ extension DocumentationBundle . Info {
338+ @available ( * , deprecated, renamed: " init(displayName:identifier:defaultCodeListingLanguage:defaultAvailability:defaultModuleKind:) " , message: " Use 'init(displayName:identifier:defaultCodeListingLanguage:defaultAvailability:defaultModuleKind:)' instead. This deprecated API will be removed after 6.2 is released " )
339+ public init (
340+ displayName: String ,
341+ identifier: String ,
342+ version: String ? ,
343+ defaultCodeListingLanguage: String ? ,
344+ defaultAvailability: DefaultAvailability ? ,
345+ defaultModuleKind: String ?
346+ ) {
347+ self . init (
348+ displayName: displayName,
349+ identifier: identifier,
350+ defaultCodeListingLanguage: defaultCodeListingLanguage,
351+ defaultAvailability: defaultAvailability,
352+ defaultModuleKind: defaultModuleKind
353+ )
354+ }
355+ }
0 commit comments