exec method
Run command.
The contents of katana.yaml and the arguments of the command are passed to context.
コマンドを実行します。
contextにkatana.yamlの内容やコマンドの引数が渡されます。
Implementation
@override
Future<void> exec(ExecContext context) async {
final bin = context.yaml.getAsMap("bin");
final flutter = bin.get("flutter", "flutter");
final prodEnvFile = File("${Directory.current.path}/dart_defines/prod.env");
if (prodEnvFile.existsSync()) {
await prodEnvFile
.copy("${Directory.current.path}/ios/Flutter/DartDefine.xcconfig");
await prodEnvFile
.copy("${Directory.current.path}/android/env.properties");
}
await command(
"Build for appbunle.",
[
flutter,
"build",
"appbundle",
"--release",
"--dart-define-from-file=dart_defines/prod.env",
],
);
}