doRun method

  1. @override
Future<int> doRun()
override

Implementation

@override
Future<int> doRun() async {
  printInfo('Start code generation...');
  printVerbose('Search for pubspec with $_buildRunner dependency');

  final pubspecFile = await _findPubspec();
  if (pubspecFile != null) {
    setCurrentDir(pubspecFile.parent.path);
  }

  await flutter.runPubOrFail(
    'build_runner',
    [
      'build',
      '--delete-conflicting-outputs',
    ],
    prependWithPubGet: true,
  );

  return success(message: 'Code generation complete!');
}