Skip to content

Commit 308dd13

Browse files
authored
Merge pull request #253 from owenv/gardening
Update doc comments and mark additional Driver APIs as @_spi(Testing)
2 parents 7094310 + 39293a6 commit 308dd13

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

Sources/SwiftDriver/Driver/Driver.swift

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,10 @@ public struct Driver {
258258
/// at the beginning.
259259
/// - Parameter env: The environment variables to use. This is a hook for testing;
260260
/// in production, you should use the default argument, which copies the current environment.
261-
/// - Parameter diagnosticsHandler: A callback executed when a diagnostic is
262-
/// emitted. The default argument prints diagnostics to stderr.
261+
/// - Parameter diagnosticsEngine: The diagnotic engine used by the driver to emit errors
262+
/// and warnings.
263+
/// - Parameter fileSystem: The filesystem used by the driver to find resources/SDKs,
264+
/// expand response files, etc. By default this is the local filesystem.
263265
/// - Parameter executor: Used by the driver to execute jobs. The default argument
264266
/// is present to streamline testing, it shouldn't be used in production.
265267
/// - Parameter externalModuleDependencies: A collection of external modules that the main module
@@ -509,7 +511,7 @@ extension Driver {
509511
/// Determines whether the given arguments constitute a normal invocation,
510512
/// or whether they invoke a subcommand.
511513
///
512-
/// Returns the invocation mode along with the arguments modified for that mode.
514+
/// - Returns: the invocation mode along with the arguments modified for that mode.
513515
public static func invocationRunMode(
514516
forArgs args: [String]
515517
) throws -> (mode: InvocationRunMode, args: [String]) {
@@ -664,7 +666,7 @@ extension Driver {
664666
}
665667

666668
/// Expand response files in the input arguments and return a new argument list.
667-
public static func expandResponseFiles(
669+
@_spi(Testing) public static func expandResponseFiles(
668670
_ args: [String],
669671
fileSystem: FileSystem,
670672
diagnosticsEngine: DiagnosticsEngine
@@ -683,7 +685,7 @@ extension Diagnostic.Message {
683685
extension Driver {
684686
/// Determine the driver kind based on the command-line arguments, consuming the arguments
685687
/// conveying this information.
686-
public static func determineDriverKind(
688+
@_spi(Testing) public static func determineDriverKind(
687689
args: inout [String]
688690
) throws -> DriverKind {
689691
// Get the basename of the driver executable.
@@ -770,7 +772,7 @@ extension Driver {
770772
}
771773
}
772774

773-
public mutating func createToolExecutionDelegate() -> ToolExecutionDelegate {
775+
mutating func createToolExecutionDelegate() -> ToolExecutionDelegate {
774776
var mode: ToolExecutionDelegate.Mode = .regular
775777

776778
// FIXME: Old driver does _something_ if both are passed. Not sure if we want to support that.

Tests/SwiftDriverTests/SwiftDriverTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212
import Foundation
13-
import SwiftDriver
13+
@_spi(Testing) import SwiftDriver
1414
import SwiftOptions
1515
import TSCBasic
1616
import XCTest

0 commit comments

Comments
 (0)