execute method
bool
execute(
- ReleasePacker releasePacker,
- Directory rootDirectory, {
- ReleaseBundle? releaseBundle,
- int expectedExitCode = 0,
override
Implementation
@override
bool execute(
ReleasePacker releasePacker,
Directory rootDirectory, {
ReleaseBundle? releaseBundle,
int expectedExitCode = 0,
}) {
var dartPath = whichExecutablePath('dart');
print(
' » Dart command> ${rootDirectory.path} -> $dartPath $command $args',
);
var result = Process.runSync(dartPath, [
command,
...args,
], workingDirectory: rootDirectory.path);
var exitCode = result.exitCode;
var ok = exitCode == expectedExitCode;
if (!ok) {
print(
' ▒ Dart command error! exitCode: $exitCode ; command: $command $args',
);
print(result.stdout);
print(result.stderr);
if ('${result.stdout}\n${result.stderr}'.contains(
'does not support build hooks',
)) {
print(
' ▒ A dependency has build hooks (native assets): '
'use `dart_build_cli` (`dart build cli`) instead of '
'`dart_compile_exe` (`dart compile exe`).',
);
}
}
return ok;
}