report method

void report({
  1. LineAction output = print,
})

Reports the final locations of the executable and every bundled file.

Implementation

void report({LineAction output = print}) {
  output('Outputs:');
  final label = hasBundle
      ? 'Launcher'
      : isPacked
      ? 'Packed executable'
      : 'Executable';
  output('  $label: ${absolute(pathToExe)}');
  if (!hasBundle) {
    return;
  }
  final bundle = absolute(pathToBundle!);
  output('  Bundle: $bundle');
  final files =
      Directory(bundle).listSync(recursive: true).whereType<File>().toList()
        ..sort((a, b) => a.path.compareTo(b.path));
  for (final file in files) {
    final directory = split(relative(file.path, from: bundle)).first;
    final label = switch (directory) {
      'bin' => 'Executable',
      'lib' => 'Library',
      _ => 'Asset',
    };
    output('  $label: ${file.path}');
  }
}