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

标签 android ant adt

以下是 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/

相关文章:

android - 在 FrameLayout 中移动焦点

java - 有没有办法判断 JUnit 测试是否正在从 Ant 运行?

sql - ant sql insert 语句在 '--' 字符串上失败。解决方法?

android - 在 Eclipse 的属性框中设置 (dp) 值

android - 无法在 Eclipse 中打开 android 项目

java - Android资源ID前的美元符号是什么意思

java - 在 Android 类 ID 和方法 ID 中从 C++ 调用 Java 方法

android - Cordova 地理定位插件不起作用

eclipse - 我需要 Eclipse 来部署我的 ANT 脚本构建的 WAR 文件,而不是它在内部构建的文件

android- ADT 18.0 样式