Skip to content

Commit

Permalink
Use new Identifier type in ConvertAction/Indexer
Browse files Browse the repository at this point in the history
  • Loading branch information
d-ronnqvist committed Oct 25, 2024
1 parent 61cc5e2 commit 5369b1c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ public struct ConvertAction: AsyncAction {
workingDirectory: temporaryFolder,
fileManager: fileManager)

let indexer = try Indexer(outputURL: temporaryFolder, bundleIdentifier: bundle.id.rawValue)
let indexer = try Indexer(outputURL: temporaryFolder, bundleID: bundle.id)

let context = try DocumentationContext(bundle: bundle, dataProvider: dataProvider, diagnosticEngine: diagnosticEngine, configuration: configuration)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ extension ConvertAction {
/// Creates an indexer that asynchronously indexes nodes and creates the index file on disk.
/// - Parameters:
/// - outputURL: The target directory to create the index file.
/// - bundleIdentifier: The identifier of the bundle being indexed.
init(outputURL: URL, bundleIdentifier: String) throws {
/// - bundleID: The identifier of the bundle being indexed.
init(outputURL: URL, bundleID: DocumentationBundle.Identifier) throws {
let indexURL = outputURL.appendingPathComponent("index", isDirectory: true)
indexBuilder = Synchronized<NavigatorIndex.Builder>(
NavigatorIndex.Builder(renderNodeProvider: nil,
outputURL: indexURL,
bundleIdentifier: bundleIdentifier,
bundleIdentifier: bundleID.rawValue,
sortRootChildrenByName: true,
groupByLanguage: true
)
Expand Down
4 changes: 2 additions & 2 deletions Tests/SwiftDocCUtilitiesTests/ConvertActionIndexerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class ConvertActionIndexerTests: XCTestCase {
let renderNode = try converter.convert(context.entity(with: reference))

let tempIndexURL = try createTemporaryDirectory(named: "index")
let indexer = try ConvertAction.Indexer(outputURL: tempIndexURL, bundleIdentifier: bundle.id.rawValue)
let indexer = try ConvertAction.Indexer(outputURL: tempIndexURL, bundleID: bundle.id)
indexer.index(renderNode)
XCTAssertTrue(indexer.finalize(emitJSON: false, emitLMDB: false).isEmpty)
let treeDump = try XCTUnwrap(indexer.dumpTree())
Expand All @@ -54,7 +54,7 @@ class ConvertActionIndexerTests: XCTestCase {
let renderNode2 = try converter.convert(context.entity(with: reference2))

let tempIndexURL = try createTemporaryDirectory(named: "index")
let indexer = try ConvertAction.Indexer(outputURL: tempIndexURL, bundleIdentifier: bundle.id.rawValue)
let indexer = try ConvertAction.Indexer(outputURL: tempIndexURL, bundleID: bundle.id)
indexer.index(renderNode1)
indexer.index(renderNode2)
XCTAssertTrue(indexer.finalize(emitJSON: false, emitLMDB: false).isEmpty)
Expand Down

0 comments on commit 5369b1c

Please sign in to comment.