我正在构建一个使用 Protocol Buffer 的 flutter 应用程序,我想编译 .proto
构建过程中的文件。如何在 flutter 构建的 dart 编译之前运行自定义 shell 命令?
最佳答案
我相信你可以在 Android Studio 中做到这一点。
1.转至Run > Edit Configurations
2. 从 (+) Add New Configuration > Shell Script
添加新的 Shell 脚本配置
3. 设置您的 shell 脚本执行。请务必点击 Apply
完成后。但不要关闭它。
4. 选择 Flutter > Run/main.dart > Before Launch > (+)Add > Run Another Configuration
5. 选择您的 Shell 脚本配置
6. 点击Apply
然后点击 OK
.您配置的 Shell 脚本现在将运行。
关于flutter - 在 flutter 构建之前运行自定义命令?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57022034/