aboutsummaryrefslogtreecommitdiffstats
path: root/files
diff options
context:
space:
mode:
authorXavier Ducrohet <xav@android.com>2012-07-03 14:45:17 -0700
committerXavier Ducrohet <xav@android.com>2012-07-03 14:48:22 -0700
commit1c6e494f48261efe74278568c4aa81394502d802 (patch)
tree36a53e6e8903e0a89a0b8af978d5378ca6703755 /files
parent33352d827e5bc3a91442ebee80931fc1f77b052b (diff)
downloadsdk-1c6e494f48261efe74278568c4aa81394502d802.zip
sdk-1c6e494f48261efe74278568c4aa81394502d802.tar.gz
sdk-1c6e494f48261efe74278568c4aa81394502d802.tar.bz2
Fix detecting previous build states.
The checks were done before reading the properties. Bug: http://code.google.com/p/android/issues/detail?id=34127 Change-Id: I954d1e2c585ec57ed3c1f5fc371b0af7dfa3c369
Diffstat (limited to 'files')
-rw-r--r--files/ant/build.xml71
1 files changed, 35 insertions, 36 deletions
diff --git a/files/ant/build.xml b/files/ant/build.xml
index aa17a36..8edba16 100644
--- a/files/ant/build.xml
+++ b/files/ant/build.xml
@@ -406,42 +406,6 @@
</then>
</if>
- <!-- If the "debug" build type changed, clear out the compiled code.
- This is to make sure the new BuildConfig.DEBUG value is picked up
- as javac can't deal with this type of change in its dependency computation. -->
- <if>
- <condition>
- <and>
- <length string="${build.last.is.packaging.debug}" trim="true" when="greater" length="0" />
- <not><equals
- arg1="${build.is.packaging.debug}"
- arg2="${build.last.is.packaging.debug}" /></not>
- </and>
- </condition>
- <then>
- <echo level="info">Switching between debug and non debug build: Deleting previous compilation output...</echo>
- <delete dir="${out.classes.absolute.dir}" verbose="${verbose}" />
- </then>
- <else>
- <!-- Else, we may still need to clean the code, for another reason.
- special case for instrumented: if the previous build was
- instrumented but not this one, clear out the compiled code -->
- <if>
- <condition>
- <and>
- <istrue value="${build.last.is.instrumented}" />
- <isfalse value="${build.is.instrumented}" />
- </and>
- </condition>
- <then>
- <echo level="info">Switching from instrumented to non-instrumented build: Deleting previous compilation output...</echo>
- <delete dir="${out.classes.absolute.dir}" verbose="${verbose}" />
- </then>
- </if>
- </else>
- </if>
-
-
<!-- get the project manifest package -->
<xpath input="${manifest.abs.file}"
expression="/manifest/@package" output="project.app.package" />
@@ -506,6 +470,41 @@
<property name="build.last.is.packaging.debug" value="" />
<property name="build.last.is.signing.debug" value="" />
+ <!-- If the "debug" build type changed, clear out the compiled code.
+ This is to make sure the new BuildConfig.DEBUG value is picked up
+ as javac can't deal with this type of change in its dependency computation. -->
+ <if>
+ <condition>
+ <and>
+ <length string="${build.last.is.packaging.debug}" trim="true" when="greater" length="0" />
+ <not><equals
+ arg1="${build.is.packaging.debug}"
+ arg2="${build.last.is.packaging.debug}" /></not>
+ </and>
+ </condition>
+ <then>
+ <echo level="info">Switching between debug and non debug build: Deleting previous compilation output...</echo>
+ <delete dir="${out.classes.absolute.dir}" verbose="${verbose}" />
+ </then>
+ <else>
+ <!-- Else, we may still need to clean the code, for another reason.
+ special case for instrumented: if the previous build was
+ instrumented but not this one, clear out the compiled code -->
+ <if>
+ <condition>
+ <and>
+ <istrue value="${build.last.is.instrumented}" />
+ <isfalse value="${build.is.instrumented}" />
+ </and>
+ </condition>
+ <then>
+ <echo level="info">Switching from instrumented to non-instrumented build: Deleting previous compilation output...</echo>
+ <delete dir="${out.classes.absolute.dir}" verbose="${verbose}" />
+ </then>
+ </if>
+ </else>
+ </if>
+
<echo level="info">Resolving Build Target for ${ant.project.name}...</echo>
<!-- load project properties, resolve Android target, library dependencies
and set some properties with the results.