gpt4 book ai didi

android - Ant 使用ADT的 "build performance improvements"

转载 作者:太空狗 更新时间:2023-10-29 13:39:08 25 4
gpt4 key购买 nike

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

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.

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

我应该在某个地方激活这些优化吗?还是我没有使用正确的 ant 命令?

最佳答案

除了用类似的东西更新你的 build.xml 之外不需要激活

android update project -p . --target 2

更新后,您应该会在构建日志中看到这些行

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

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

关于android - Ant 使用ADT的 "build performance improvements",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7844111/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com