简体   繁体   English

Flutter内部版本号能否在pubspec.yaml文件之外维护

[英]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.

相关问题 flutter pubspec.yaml 更新后删除 - flutter pubspec.yaml deleted after updating 更新/安装最新的 Flutter 包 (pubspec.yaml) - Update to/install latest Flutter packages (pubspec.yaml) Flutter `pubspec.lock` 在 `flutter pub get` 之后没有按照 `pubspec.yaml` 中的版本进行更新 - Flutter `pubspec.lock` Is Not Updating As Per Versions In `pubspec.yaml` After `flutter pub get` Android Studio 中的 Pubspec.yaml - Pubspec.yaml in Android Studio 在 windows 上找不到配置文件 (pubspec.yaml) - Could not find configuration file (pubspec.yaml) on windows “pubspec.yaml”文件在哪里? 如果不添加路径,Pub.dev 示例将无法在带有 Flutter 插件的 Android Studio 中编译,但它在哪里? - Where is the 'pubspec.yaml' file? Pub.dev examples won't compile in Android Studio with Flutter Plugin without adding a path, but where is it? 无法在 android 工作室上创建新的 flutter 项目出现错误 => 在项目位置驱动器中找不到名为“pubspec.yaml”的文件 - unable to create new flutter project on android studio getting error => Could not find a file named “pubspec.yaml” at project location drive 编辑 pubspec.yaml 太慢了 - Editing pubspec.yaml being so slow 为什么 Android Studio - Flutter 在 pubspec.yaml 在 Z1D41C850AF58D3ADACEZ5 中进行任何更改后一直卡住 - Why does Android Studio - Flutter keep getting stuck after making any change in pubspec.yaml in ubuntu 无法从 pubspec.yaml 导入“包” - Unable to import 'packages' from pubspec.yaml
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM