diff options
author | Xavier Ducrohet <xav@android.com> | 2011-08-25 18:36:48 -0700 |
---|---|---|
committer | Xavier Ducrohet <xav@android.com> | 2011-09-01 14:11:31 -0700 |
commit | 891cbf7552f98af2f0baaed069b5eb64de50c556 (patch) | |
tree | a73ffbfbad6dffd5f98c864fde04fae221c34612 /files/ant | |
parent | 50b3e57fa887dc7182facfb178ef842103aeeaf3 (diff) | |
download | sdk-891cbf7552f98af2f0baaed069b5eb64de50c556.zip sdk-891cbf7552f98af2f0baaed069b5eb64de50c556.tar.gz sdk-891cbf7552f98af2f0baaed069b5eb64de50c556.tar.bz2 |
Add proper dependency support in the dex step of the Ant-based build.
The dex step now generates a dependency file that is reused during
following builds to check whether dex should occur.
Also optimized the part that figures out if any dependencies have
been modified/have gone missing.
Change-Id: I7f6e915fc7b571ad973260daa506badced3a9c2a
Diffstat (limited to 'files/ant')
-rw-r--r-- | files/ant/build.xml | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/files/ant/build.xml b/files/ant/build.xml index e379d95..6092e5a 100644 --- a/files/ant/build.xml +++ b/files/ant/build.xml @@ -77,6 +77,10 @@ classname="com.android.ant.RenderScriptTask" classpathref="android.antlibs" /> + <taskdef name="dex" + classname="com.android.ant.DexExecTask" + classpathref="android.antlibs" /> + <taskdef name="apkbuilder" classname="com.android.ant.ApkBuilderTask" classpathref="android.antlibs" /> @@ -152,10 +156,6 @@ <condition property="v.option" value="-v" else=""> <istrue value="${verbose}" /> </condition> - <!-- This is needed to switch verbosity of dx. Depends exclusively on 'verbose' --> - <condition property="verbose.option" value="--verbose" else=""> - <istrue value="${verbose}" /> - </condition> <!-- properties for signing in release mode --> <condition property="has.keystore"> @@ -229,7 +229,7 @@ output dex filename and external libraries to dex (optional) --> <macrodef name="dex-helper"> <element name="external-libs" optional="yes" /> - <element name="extra-parameters" optional="yes" /> + <attribute name="nolocals" default="false" /> <sequential> <!-- sets the primary input for dex. If a pre-dex task sets it to something else this has no effect --> @@ -248,17 +248,16 @@ </else> </if> - <echo>Converting compiled files and external libraries into ${intermediate.dex.file}...</echo> - <apply executable="${dx}" failonerror="true" parallel="true"> - <arg value="--dex" /> - <arg value="--output" /> - <arg path="${intermediate.dex.file}" /> - <extra-parameters /> - <arg line="${verbose.option}" /> - <arg path="${out.dex.input.absolute.dir}" /> + <dex executable="${dx}" + output="${intermediate.dex.file}" + nolocals="@{nolocals}" + verbose="${verbose}" + previousBuildType="${build.last.target}" + buildType="${build.target}"> + <path path="${out.dex.input.absolute.dir}"/> <path refid="out.dex.jar.input.ref" /> <external-libs /> - </apply> + </dex> </sequential> </macrodef> @@ -730,10 +729,7 @@ to pass in the emma jar. --> <if condition="${build.is.instrumented}"> <then> - <dex-helper> - <extra-parameters> - <arg value="--no-locals" /> - </extra-parameters> + <dex-helper nolocals="true"> <external-libs> <fileset file="${emma.dir}/emma_device.jar" /> </external-libs> |