使用 ADT 的“构建性能改进”对于蚂蚁

发布于 2024-12-10 20:12:52 字数 392 浏览 2 评论 0原文

以下是 ADT 最新变更日志的摘录:

构建性能改进。

除了支持新类型的库项目以及上面提到的构建改进(aapt 和 png crunch 缓存)之外,Ant 中的重大变化是新的 Ant 构建最终在执行任何操作之前正确支持依赖项检查。这意味着,虽然某些步骤(aapt、dex)仍然不是增量的,但如果不需要,它们至少不会运行。在r13及之前,aidl编译、资源ID生成、dex'ing、打包等即使没有文件更改,也会一直发生。

然而,在更新了所有内容之后,在使用 ant 编译我的项目时,我没有看到任何性能提升。每次 ant 调试安装时,仍会从头开始构建未修改的项目。

我应该在某处激活这些优化吗?或者我没有使用正确的 ant 命令?

Here's an exerpt from the ADT's latest changelog:

Build performance improvements.

The big changes in Ant, besides supporting the new type of library projects, and the build improvements mentioned above (aapt and png crunch cache) is that the new Ant build finally properly supports dependency check before doing any actions. This means that, while some steps (aapt, dex) are still not incremental, they, at least, won’t run if they don’t need to. In r13 and before, aidl compilation, resources ID generation, dex’ing, packaging, etc.. would happen all the time even if no file changed.

However after having updated everything I don't see any performance boost when compiling my projects with ant. Unmodified projects are still built from scratch every ant debug install.

Should I activate these optimizations somewhere? or am I not using the right ant command?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

究竟谁懂我的在乎 2024-12-17 20:12:52

除了使用类似更新后的内容更新 build.xml 之外,不需要激活,

android update project -p . --target 2

您应该会在构建日志中看到这些行

 [echo] 处理aidl 文件...
 [aidl] 没有要编译的 AIDL 文件。
 [回声] ----------
 [echo] 处理 RenderScript 文件... 
 [renderscript] 没有要编译的 RenderScript 文件。
 [回声] ----------
 [echo] 处理资源...
 [aapt] 没有改变资源。 R.java 和 Manifest.java 未受影响。
 [回声] ----------
 [dex] 没有新的编译代码。无需将字节码转换为dalvik格式。
 [crunch] 已处理 0 个 PNG 文件以更新缓存
 [aapt] 资源或资产没有变化。
 [apkbuilder] 没有变化。无需创建 apk。

...等等...

如果您看到它,那么您正在使用最新 sdk-tools 中提到的优化。

No activation is needed other than updating your build.xml with something like

android update project -p . --target 2

After updating you should see the lines in your build log

 [echo] Handling aidl files...
 [aidl] No AIDL files to compile.
 [echo] ----------
 [echo] Handling RenderScript files... 
 [renderscript] No RenderScript files to compile.
 [echo] ----------
 [echo] Handling Resources...
 [aapt] No changed resources. R.java and Manifest.java untouched.
 [echo] ----------
 [dex] No new compiled code. No need to convert bytecode to dalvik format.
 [crunch] Crunched 0 PNG files to update cache
 [aapt] No changed resources or assets.
 [apkbuilder] No changes. No need to create apk.

...etc...

If you see it, then you are using mentioned optimizations from latest sdk-tools.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文