generateAndRun function
Generates the build script, precompiles it if needed, and runs it.
The handleUncaughtError
function will be invoked when the build script
terminates with an uncaught error.
Will retry once on IsolateSpawnExceptions to handle SDK updates.
Returns the exit code from running the build script.
If an exit code of 75 is returned, this function should be re-ran.
Implementation
Future<int> generateAndRun(
List<String> args, {
List<String>? experiments,
Logger? logger,
Future<String> Function() generateBuildScript = generateBuildScript,
void Function(Object error, StackTrace stackTrace) handleUncaughtError =
_defaultHandleUncaughtError,
}) {
return buildLog.runWithLoggerDisplay(
logger,
() => _generateAndRun(
args,
experiments,
generateBuildScript,
handleUncaughtError,
),
);
}