Ant构建需要比eclipse构建更长的时间(通过ADT)

时间:2012-05-29 06:47:11

标签: android performance ant build

我有时使用eclipse来构建我的android项目(使用ADT 19)。如果我只修改了1个文件,那么构建将很快从Eclipse(使用Ctr + B)发生。但是,如果我使用ant脚本(我使用“ant debug”)命令来构建它需要更长的时间。我相信这是因为它正在重新构建所有文件。

基本上,ant构建与干净构建的构建时间相同。有没有办法加速蚂蚁的构建?

这是蚂蚁脚本的输出......

    set-mode-check:

-set-debug-files:

-set-debug-mode:

-debug-obfuscation-check:

-setup:
     [echo] Creating output directories if needed...
     [echo] Gathering info for Astro...
    [setup] Android SDK Tools Revision 19
    [setup] Project Target: Android 2.3.3
    [setup] API level: 10
    [setup] 
    [setup] ------------------
    [setup] Resolving library dependencies:
    [setup] No library dependencies.
    [setup] 
    [setup] ------------------
    [setup] API<=15: Adding annotations.jar to the classpath.
    [setup] 
    [setup] ------------------

-build-setup:

-pre-build:

-code-gen:
     [echo] ----------
     [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] Found Deleted Target File
     [aapt] Generating resource IDs...
     [echo] ----------
     [echo] Handling BuildConfig class...
[buildconfig] No need to generate new BuildConfig.

-pre-compile:

-compile:
    [javac] Compiling 3 source files to C:\Sample\bin\classes

-post-compile:

-obfuscate:

-dex:
      [dex] Found Deleted Target File

1 个答案:

答案 0 :(得分:3)

我自己修好了。我的IDE设置为清理项目并每次都构建它。它有蚂蚁清洁调试。删除“干净”,它的工作原理......