Skip to content

Commit 267c481

Browse files
authored
Add back --fallback-bundle-version argument for backwards compatibility (#1042)
rdar://136837581
1 parent 3dbde14 commit 267c481

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

Sources/SwiftDocCUtilities/ArgumentParsing/Subcommands/Convert.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,13 @@ extension Docc {
340340
""")
341341
)
342342
var fallbackDefaultModuleKind: String?
343+
344+
@Option(
345+
name: [.customLong("fallback-bundle-version"), .customLong("bundle-version")],
346+
help: .hidden
347+
)
348+
@available(*, deprecated, message: "The bundle version isn't used for anything.")
349+
var _unusedVersionForBackwardsCompatibility: String?
343350

344351
func validate() throws {
345352
for deprecatedOptionName in ["display-name", "bundle-identifier", "bundle-version"] {

Tests/SwiftDocCUtilitiesTests/ArgumentParsing/ConvertSubcommandTests.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,4 +580,15 @@ class ConvertSubcommandTests: XCTestCase {
580580
let disabledFlagConvert = try Docc.Convert.parse(["--disable-parameters-and-returns-validation"])
581581
XCTAssertEqual(disabledFlagConvert.enableParametersAndReturnsValidation, false)
582582
}
583+
584+
// This test calls ``ConvertOptions.infoPlistFallbacks._unusedVersionForBackwardsCompatibility`` which is deprecated.
585+
// Deprecating the test silences the deprecation warning when running the tests. It doesn't skip the test.
586+
@available(*, deprecated)
587+
func testVersionFlag() throws {
588+
let noFlagConvert = try Docc.Convert.parse([])
589+
XCTAssertEqual(noFlagConvert.infoPlistFallbacks._unusedVersionForBackwardsCompatibility, nil)
590+
591+
let enabledFlagConvert = try Docc.Convert.parse(["--fallback-bundle-version", "1.2.3"])
592+
XCTAssertEqual(enabledFlagConvert.infoPlistFallbacks._unusedVersionForBackwardsCompatibility, "1.2.3")
593+
}
583594
}

0 commit comments

Comments
 (0)