Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Sources/DocCGen/DocCGen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ internal struct DocCGenCommand: AsyncParsableCommand
internal var catalog : String?

@Option(help: "Where the documentation is written. Defaults to <module>.doccarchive, or docs for a static site.")
internal var output : String?
internal var outputPath : String?

@Option(
name: .customLong("output-mode"),
Expand Down Expand Up @@ -270,14 +270,14 @@ extension DocCGenCommand

return PartialConfiguration(
module: module,
version: bundleVersion,
bundleVersion: bundleVersion,
bundleIdentifier: bundleIdentifier,
headerRoot: headerRoot,
include: nilIfEmpty(include),
exclude: nilIfEmpty(exclude),
catalog: catalog,
outputMode: outputMode,
outputPath: output,
outputPath: outputPath,
clangFlags: nilIfEmpty(clangFlags),
doccFlags: nilIfEmpty(doccFlags),
allowNonSelfContained: allowNonSelfContained
Expand Down
22 changes: 11 additions & 11 deletions Sources/DocCGenCore/Configuration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ package struct PartialConfiguration: Equatable, Sendable, Decodable
package let module : String?

/// The bundle version, used as DocC's `--fallback-bundle-version`.
package let version : String?
package let bundleVersion : String?

/// The bundle identifier, used as DocC's `--fallback-bundle-identifier`.
package let bundleIdentifier : String?
Expand Down Expand Up @@ -141,7 +141,7 @@ package struct PartialConfiguration: Equatable, Sendable, Decodable
/// user supplied; the file side goes through ``init(from:)`` instead.
package init(
module : String? = nil,
version : String? = nil,
bundleVersion : String? = nil,
bundleIdentifier : String? = nil,
headerRoot : String? = nil,
include : [String]? = nil,
Expand All @@ -155,7 +155,7 @@ package struct PartialConfiguration: Equatable, Sendable, Decodable
)
{
self.module = module
self.version = version
self.bundleVersion = bundleVersion
self.bundleIdentifier = bundleIdentifier
self.headerRoot = headerRoot
self.include = include
Expand Down Expand Up @@ -213,7 +213,7 @@ package struct PartialConfiguration: Equatable, Sendable, Decodable
do
{
self.module = try container.decodeIfPresent(String.self, forKey: .module)
self.version = try container.decodeIfPresent(String.self, forKey: .version)
self.bundleVersion = try container.decodeIfPresent(String.self, forKey: .bundleVersion)
self.bundleIdentifier = try container.decodeIfPresent(String.self, forKey: .bundleIdentifier)
self.headerRoot = try container.decodeIfPresent(String.self, forKey: .headerRoot)
self.include = try container.decodeIfPresent([String].self, forKey: .include)
Expand Down Expand Up @@ -325,7 +325,7 @@ package struct PartialConfiguration: Equatable, Sendable, Decodable
private enum CodingKeys: String, CodingKey, CaseIterable
{
case module
case version
case bundleVersion
case bundleIdentifier
case headerRoot
case include
Expand Down Expand Up @@ -407,7 +407,7 @@ extension PartialConfiguration
{
return PartialConfiguration(
module: module ?? base.module,
version: version ?? base.version,
bundleVersion: bundleVersion ?? base.bundleVersion,
bundleIdentifier: bundleIdentifier ?? base.bundleIdentifier,
headerRoot: headerRoot ?? base.headerRoot,
include: include ?? base.include,
Expand Down Expand Up @@ -459,7 +459,7 @@ extension PartialConfiguration

return PartialConfiguration(
module: module,
version: version,
bundleVersion: bundleVersion,
bundleIdentifier: bundleIdentifier,
headerRoot: headerRoot.map(absolute),
include: include,
Expand Down Expand Up @@ -545,7 +545,7 @@ package struct ResolvedConfiguration: Equatable, Sendable
/// The bundle version (DocC's `--fallback-bundle-version`).
///
/// The default value is `1.0.0`.
package let version : String
package let bundleVersion : String

/// The bundle identifier (DocC's `--fallback-bundle-identifier`).
///
Expand Down Expand Up @@ -606,7 +606,7 @@ package struct ResolvedConfiguration: Equatable, Sendable
/// values from a stack of ``PartialConfiguration`` layers.
package init(
module : String,
version : String,
bundleVersion : String,
bundleIdentifier : String,
headerRoot : URL,
include : [String],
Expand All @@ -620,7 +620,7 @@ package struct ResolvedConfiguration: Equatable, Sendable
)
{
self.module = module
self.version = version
self.bundleVersion = bundleVersion
self.bundleIdentifier = bundleIdentifier
self.headerRoot = headerRoot
self.include = include
Expand Down Expand Up @@ -687,7 +687,7 @@ package struct ResolvedConfiguration: Equatable, Sendable

return ResolvedConfiguration(
module: module,
version: merged.version ?? "1.0.0",
bundleVersion: merged.bundleVersion ?? "1.0.0",
bundleIdentifier: merged.bundleIdentifier ?? module,
headerRoot: URL(fileURLWithPath: headerRootString),
include: merged.include ?? ["**/*.h"],
Expand Down
2 changes: 1 addition & 1 deletion Sources/DocCGenCore/DocumentationPipeline.swift
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ package enum DocumentationPipeline
catalog: configuration.catalog,
outputMode: configuration.outputMode,
fallbackBundleID: configuration.bundleIdentifier,
fallbackBundleVersion: configuration.version,
fallbackBundleVersion: configuration.bundleVersion,
passthrough: configuration.doccFlags,
symbolGraphDirectory: graphDirectory,
outputPath: configuration.outputPath
Expand Down
20 changes: 10 additions & 10 deletions Tests/DocCGenTests/ConfigurationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ internal struct ConfigurationTests
#"""
{
"module": "SomeLib",
"version": "1.2.0",
"bundleVersion": "1.2.0",
"bundleIdentifier": "com.example.SomeLib",
"headerRoot": "include",
"include": ["**/*.h"],
Expand All @@ -41,7 +41,7 @@ internal struct ConfigurationTests
)

#expect(config.module == "SomeLib")
#expect(config.version == "1.2.0")
#expect(config.bundleVersion == "1.2.0")
#expect(config.bundleIdentifier == "com.example.SomeLib")
#expect(config.headerRoot == "include")
#expect(config.include == ["**/*.h"])
Expand Down Expand Up @@ -235,12 +235,12 @@ internal struct ConfigurationTests
module: "Higher"
)
.layered(over: PartialConfiguration(
module: "Lower",
version: "9.9.9"
module: "Lower",
bundleVersion: "9.9.9"
))

#expect(merged.module == "Higher")
#expect(merged.version == "9.9.9")
#expect(merged.module == "Higher")
#expect(merged.bundleVersion == "9.9.9")
}


Expand Down Expand Up @@ -374,7 +374,7 @@ internal struct ConfigurationTests
)

#expect(resolved.module == "Def")
#expect(resolved.version == "1.0.0")
#expect(resolved.bundleVersion == "1.0.0")
#expect(resolved.bundleIdentifier == "Def")
#expect(resolved.headerRoot.lastPathComponent == "include")
#expect(resolved.include == ["**/*.h"])
Expand Down Expand Up @@ -506,13 +506,13 @@ internal struct ConfigurationTests
),
PartialConfiguration(
module: "Low",
version: "9.9.9"
bundleVersion: "9.9.9"
)
]
)

#expect(resolved.module == "High")
#expect(resolved.version == "9.9.9")
#expect(resolved.module == "High")
#expect(resolved.bundleVersion == "9.9.9")
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ extension ResolvedConfiguration
{
return ResolvedConfiguration(
module: module,
version: "0.1.0",
bundleVersion: "0.1.0",
bundleIdentifier: "com.example.\(module)",
headerRoot: headerRoot,
include: ["**/*.h"],
Expand Down