Why would I want to delete build/ directory?

橙三吉。 提交于 2021-02-16 19:01:28

问题


(New to Flutter/Dart/Android)

In console just did:

C:\Users\lordnull>flutter help clean
Delete the build/ directory.

Just wondering why we would want to delete a project's build directory (using "flutter clean")? Does it help cure some transient Flutter problem? If so what?


回答1:


The content of the build directory is updated incrementally depending on configuration or source changes for performance reasons because a full rebuild every time would take way too much time.

The dependencies can be quite complex and some changes don't invalidate all parts in build/ that need to be rebuilt after such changes.

This can lead to a corrupt build output.

flutter clean purges the build output and the next build action will rebuild everything from scratch.

That's not unique to Flutter. Most build systems offer such a clean step to ensure a build is not influenced by artifacts from previous build actions.



来源:https://stackoverflow.com/questions/53612454/why-would-i-want-to-delete-build-directory

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!