@@ -22,6 +22,7 @@ extension DocumentationBundle {
22
22
public var identifier : String
23
23
24
24
/// The version of the bundle.
25
+ @available ( * , deprecated, message: " This deprecated API will be removed after 6.2 is released " )
25
26
public var version : String ?
26
27
27
28
/// The default language identifier for code listings in the bundle.
@@ -42,7 +43,6 @@ extension DocumentationBundle {
42
43
enum CodingKeys : String , CodingKey , CaseIterable {
43
44
case displayName = " CFBundleDisplayName "
44
45
case identifier = " CFBundleIdentifier "
45
- case version = " CFBundleVersion "
46
46
case defaultCodeListingLanguage = " CDDefaultCodeListingLanguage "
47
47
case defaultAvailability = " CDAppleDefaultAvailability "
48
48
case defaultModuleKind = " CDDefaultModuleKind "
@@ -54,8 +54,6 @@ extension DocumentationBundle {
54
54
return " --fallback-display-name "
55
55
case . identifier:
56
56
return " --fallback-bundle-identifier "
57
- case . version:
58
- return " --fallback-bundle-version "
59
57
case . defaultCodeListingLanguage:
60
58
return " --default-code-listing-language "
61
59
case . defaultModuleKind:
@@ -82,26 +80,22 @@ extension DocumentationBundle {
82
80
}
83
81
}
84
82
85
-
86
83
/// Creates a new documentation bundle information value.
87
84
/// - Parameters:
88
85
/// - displayName: The display name of the bundle.
89
86
/// - identifier: The unique identifier of the bundle.
90
- /// - version: The version of the bundle.
91
87
/// - defaultCodeListingLanguage: The default language identifier for code listings in the bundle.
92
88
/// - defaultAvailability: The default availability for the various modules in the bundle.
93
89
/// - defaultModuleKind: The default kind for the various modules in the bundle.
94
90
public init (
95
91
displayName: String ,
96
92
identifier: String ,
97
- version: String ? ,
98
93
defaultCodeListingLanguage: String ? ,
99
94
defaultAvailability: DefaultAvailability ? ,
100
95
defaultModuleKind: String ?
101
96
) {
102
97
self . displayName = displayName
103
98
self . identifier = identifier
104
- self . version = version
105
99
self . defaultCodeListingLanguage = defaultCodeListingLanguage
106
100
self . defaultAvailability = defaultAvailability
107
101
self . defaultModuleKind = defaultModuleKind
@@ -228,7 +222,6 @@ extension DocumentationBundle {
228
222
// contain a display name. If they do but that value fails to decode, that error would be raised before accessing `derivedDisplayName`.
229
223
self . displayName = try decodeOrFallbackIfPresent ( String . self, with: . displayName) ?? derivedDisplayName!
230
224
self . identifier = try decodeOrFallbackIfPresent ( String . self, with: . identifier) ?? self . displayName
231
- self . version = try decodeOrFallbackIfPresent ( String . self, with: . version)
232
225
233
226
// Finally, decode the optional keys if they're present.
234
227
@@ -237,19 +230,17 @@ extension DocumentationBundle {
237
230
self . defaultAvailability = try decodeOrFallbackIfPresent ( DefaultAvailability . self, with: . defaultAvailability)
238
231
self . featureFlags = try decodeOrFallbackIfPresent ( BundleFeatureFlags . self, with: . featureFlags)
239
232
}
240
-
233
+
241
234
init (
242
235
displayName: String ,
243
236
identifier: String ,
244
- version: String ? = nil ,
245
237
defaultCodeListingLanguage: String ? = nil ,
246
238
defaultModuleKind: String ? = nil ,
247
239
defaultAvailability: DefaultAvailability ? = nil ,
248
240
featureFlags: BundleFeatureFlags ? = nil
249
241
) {
250
242
self . displayName = displayName
251
243
self . identifier = identifier
252
- self . version = version
253
244
self . defaultCodeListingLanguage = defaultCodeListingLanguage
254
245
self . defaultModuleKind = defaultModuleKind
255
246
self . defaultAvailability = defaultAvailability
@@ -267,15 +258,13 @@ extension BundleDiscoveryOptions {
267
258
/// - Parameters:
268
259
/// - fallbackDisplayName: A fallback display name for the bundle.
269
260
/// - fallbackIdentifier: A fallback identifier for the bundle.
270
- /// - fallbackVersion: A fallback version for the bundle.
271
261
/// - fallbackDefaultCodeListingLanguage: A fallback default code listing language for the bundle.
272
262
/// - fallbackDefaultModuleKind: A fallback default module kind for the bundle.
273
263
/// - fallbackDefaultAvailability: A fallback default availability for the bundle.
274
264
/// - additionalSymbolGraphFiles: Additional symbol graph files to augment any discovered bundles.
275
265
public init (
276
266
fallbackDisplayName: String ? = nil ,
277
267
fallbackIdentifier: String ? = nil ,
278
- fallbackVersion: String ? = nil ,
279
268
fallbackDefaultCodeListingLanguage: String ? = nil ,
280
269
fallbackDefaultModuleKind: String ? = nil ,
281
270
fallbackDefaultAvailability: DefaultAvailability ? = nil ,
@@ -294,8 +283,6 @@ extension BundleDiscoveryOptions {
294
283
value = fallbackDisplayName
295
284
case . identifier:
296
285
value = fallbackIdentifier
297
- case . version:
298
- value = fallbackVersion
299
286
case . defaultCodeListingLanguage:
300
287
value = fallbackDefaultCodeListingLanguage
301
288
case . defaultAvailability:
@@ -318,6 +305,26 @@ extension BundleDiscoveryOptions {
318
305
additionalSymbolGraphFiles: additionalSymbolGraphFiles
319
306
)
320
307
}
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
+ }
321
328
}
322
329
323
330
private extension CodingUserInfoKey {
@@ -326,3 +333,23 @@ private extension CodingUserInfoKey {
326
333
/// A user info key to store derived display name in the decoder.
327
334
static let derivedDisplayName = CodingUserInfoKey ( rawValue: " derivedDisplayName " ) !
328
335
}
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