[英]Can the Flutter build number be maintained outside of the pubspec.yaml file
I often flip back and forward between VC branches. 我经常在VC分支之间来回切换。 I also increase the build number fairly often but not on every run / hot restart / hot reload. 我还经常增加内部版本号,但不会在每次运行/热重启/热重载时都增加。
Is there a way have the build number kept out of the pubspec.yaml file and have the IDE manage it so that I don't need to keep on either reverting the pubspec changes or else be forced to commit it, since going backwards cause the app to lose it's internal storage and Local Preferences. 有没有一种方法可以将内部版本号排除在pubspec.yaml文件之外,并由IDE管理它,因此我不需要继续恢复pubspec更改或被迫提交,因为向后移动会导致应用程序丢失它的内部存储和本地首选项。
I'm have seen that one can use flutter run --build-number=123
but this requires me to manually check what is in pubspec.yaml, plus I can't just press the "play" button to flip between emulators, flavors, etc, and the console output in the terminal is not as convenient to parse / etc as that in the run-output screen. 我已经看到有人可以使用flutter run --build-number=123
但这需要我手动检查pubspec.yaml中的内容,而且我不能只按“播放”按钮在模拟器之间进行切换等等,并且终端中的控制台输出不如运行输出屏幕中的解析/ etc那样方便。
Maintaining the build number and version in the pubspec.yaml file is in any case painful, but I'm not ready to take my quick-and-dirty project to an external build process like Jenkins yet. 无论如何,维护pubspec.yaml文件中的内部版本号和版本都是很痛苦的,但是我还不准备将我的快捷项目带到Jenkins这样的外部构建过程。 I in any case think that won't solve the same problem (hot-reload / restart in the IDE) 无论如何,我认为这不会解决相同的问题(在IDE中热重载/重启)
I haven't used it in my current projects, but there's a fairly new package that helps with maintaining the pubspec version: https://pub.dev/packages/pubspec_version/ 我在当前项目中没有使用过它,但是有一个相当新的软件包可以帮助维护pubspec版本: https ://pub.dev/packages/pubspec_version/
Maybe this is what you are looking for. 也许这就是您想要的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.