INNER CODE UNIT · Swift
execGradle
skiptools/skip · Sources/SkipDrive/GradleDriver.swift:93
public func execGradle(in workingDirectory: URL?, args: [String], env: [String: String] = ProcessInfo.processInfo.environmentWithDefaultToolPaths, onExit: @escaping (ProcessResult) throws -> ()) async throws -> AsyncLineOutput {
// the resulting command will be something like:
// java -Xmx64m -Xms64m -Dorg.gradle.appname=gradle -classpath /opt/homebrew/Cellar/gradle/8.0.2/libexec/lib/gradle-launcher-8.0.2.jar org.gradle.launcher.GradleMain info
#if DEBUG
// output the launch message in a format that makes it easy to copy and paste the result into the terminal
print("execGradle:", (gradleArgs + args).joined(separator: " "))
#endif
return Process.streamLines(command: gradleArgs + args, environment: env, workingDirectory: workingDirectory, includeStdErr: true, onExit: onExit)
}
/// Invokes the given target for a gradle project.
///
/// - Parameters:
/// - workingDirectory: the directory in which to fork the gradle process
/// - buildFolder: the directory in which the build contents are output (`--build-path SWIFTBUILD`)
/// - module: the name of the module to test
/// - actions: the gradle actions to run, such as `["test"]`