为什么要删除build/目录? [英] Why would I want to delete build/ directory?

查看:95
本文介绍了为什么要删除build/目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

(Flutter/Dart/Android的新手)

在控制台中只是这样做:

  C:\ Users \ lordnull>颤振帮助清除删除build/目录. 

只是想知道为什么我们要删除项目的构建目录(使用"flutter clean")?它有助于解决一些短暂的Flutter问题吗?如果可以的话?

解决方案

出于性能方面的考虑,构建目录的内容将根据配置或源更改进行增量更新,因为每次完全重建都将花费太多时间.

依赖关系可能非常复杂,并且某些更改不会使 build/中需要在此类更改后重新构建的所有部分失效.

这可能会导致构建输出损坏.

flutter clean 清除构建输出,下一个构建操作将重新构建所有内容.

这不是Flutter独有的.大多数构建系统都提供了这样一个干净的步骤,以确保构建不受先前构建操作的工件影响.

(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?

解决方案

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.

这篇关于为什么要删除build/目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆