INNER CODE UNIT · Swift
clone
skiptools/skip · Sources/SkipDrive/GradleDriver.swift:88
public func clone() -> GradleDriver {
GradleDriver(gradlePath: gradlePath, gradleInfo: gradleInfo, gradleVersion: gradleVersion, kotlinVersion: kotlinVersion, gradleArgs: gradleArgs)
}
/// Executes `gradle` with the current default arguments and the additional args and returns an async stream of the lines from the combined standard err and standard out.
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.
///