简体   繁体   English

重建颤振工具的替代方法?

[英]Alternative methods for rebuilding flutter tools?

I recently asked this question about Flutter. 我最近问了关于Flutter的问题。 Currently, the answer now gives a different error and, as the answer states, I might want to look at this segment of the code . 当前,答案现在给出了一个不同的错误,并且如答案所述,我可能要看一下这段代码 So, I decide to fork the repo and begin my investigation. 因此,我决定分叉该仓库并开始调查。 I currently just want to print out a couple of values in the section to figure out what is going on. 我目前只想在本节中打印出几个值以了解发生了什么。 To see what the program thinks I have, and what it doesn't think I have. 看看程序认为我有什么,认为我没有什么。 I added a couple of printTrace statements and now I want to rebuild the project. 我添加了几个printTrace语句,现在我想重建项目。

I went to CONTRIBUTING.md and found this: 我去了CONTRIBUTING.md ,发现了这个:

The flutter tools itself is built when you run flutter for the first time and each time you run flutter upgrade . 首次运行flutter时以及每次运行flutter upgrade时,都会构建Flutter工具本身。 If you want to alter and re-test the tool's behavior itself, locally commit your tool changes in git and the tool will be rebuilt from Dart sources in packages/flutter_tools the next time you run flutter . 如果您想更改并重新测试工具本身的行为,请在git中本地提交对工具packages/flutter_tools ,下次您运行flutter时,将从packages/flutter_tools的Dart源中重建该工具。

I don't want to exactly "change" anything at the moment, just print out some values and figure out what is going on. 我现在不想完全“更改”任何内容,只需打印一些值并弄清楚发生了什么。 The issue is, doing these debugging changes forces me to do a commit. 问题是,进行这些调试更改会迫使我进行提交。 Is there a way to rebuild flutter tools without making a commit? 有没有不用提交就可以重建flutter工具的方法吗?

You can force the Flutter tools to rebuild by removing the build stamp. 您可以通过删除构建标记来强制Flutter工具进行重建。 For example, if your Flutter install is in ~/.flutter-sdk , you can run 例如,如果您的Flutter安装在~/.flutter-sdk ,则可以运行

rm ~/.flutter-sdk/bin/cache/flutter_tools.stamp

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM