run method
Runs this command.
The return value is wrapped in a Future
if necessary and returned by
CommandRunner.runCommand.
Implementation
@override
void run() async {
CucumberHelper.removeNdjsonGherkin();
final argTarget = argResults.getOptionTarget();
final argFlavor = argResults.getOptionFlavor(defaultTo: Constants.dev);
final argMorphemeYaml = argResults.getOptionMorphemeYaml();
final argGenerateL10n = argResults.getFlagGenerateL10n();
final deviceId = argResults.getDeviceId();
YamlHelper.validateMorphemeYaml(argMorphemeYaml);
if (argGenerateL10n) {
await 'morpheme l10n --morpheme-yaml "$argMorphemeYaml"'.run;
}
final flavor = FlavorHelper.byFlavor(argFlavor, argMorphemeYaml);
FirebaseHelper.run(argFlavor, argMorphemeYaml);
List<String> dartDefines = [];
flavor.forEach((key, value) {
dartDefines.add('${Constants.dartDefine} "$key=$value"');
});
String mode = argResults.getMode();
await FlutterHelper.run(
'run -t $argTarget ${dartDefines.join(' ')} $mode $deviceId',
showLog: true,
);
StatusHelper.success('run');
}