buildAsync static method
Run pub build
on the current project.
The valid values for mode
are release
and debug
.
Implementation
static Future buildAsync(
{String? mode,
List<String>? directories,
RunOptions? runOptions,
String? outputDirectory,
String? workingDirectory}) {
runOptions = mergeWorkingDirectory(workingDirectory, runOptions);
final args = ['pub', 'build'];
if (mode != null) args.add('--mode=$mode');
if (outputDirectory != null) args.add('--output=$outputDirectory');
if (directories != null && directories.isNotEmpty) args.addAll(directories);
return runlib
.runAsync(sdkBin('dart'), arguments: args, runOptions: runOptions)
.then((_) => null);
}