runBuildRunner static method

Future<void> runBuildRunner({
  1. bool showResult = true,
})

Implementation

static Future<void> runBuildRunner({bool showResult = true}) async {
  final dart = resolveExecutable("dart");

  final result = await Process.run(dart, [
    'run',
    'build_runner',
    'build',
    '--delete-conflicting-outputs',
  ]);

  if (result.exitCode == 0) {
    if (showResult) {
      print("🏗️ build_runner completed");
      print(result.stdout);
    }
  } else {
    print("❌ build_runner failed: ${result.stderr}");
  }
}