aboutsummaryrefslogtreecommitdiffstats
path: root/files/ant
diff options
context:
space:
mode:
authorXavier Ducrohet <xav@android.com>2012-03-07 19:56:17 -0800
committerXavier Ducrohet <xav@android.com>2012-03-07 20:25:29 -0800
commita08befd52438d523cb2cd41b53f961785d3872fd (patch)
tree782b1febe0eb57200ef9af545380848ade67da4a /files/ant
parent7d2737e54866f33553ee85c546dcea197bffd130 (diff)
downloadsdk-a08befd52438d523cb2cd41b53f961785d3872fd.zip
sdk-a08befd52438d523cb2cd41b53f961785d3872fd.tar.gz
sdk-a08befd52438d523cb2cd41b53f961785d3872fd.tar.bz2
Ant build now sanitize jar files in setup task.
Previously the list of jar files was sanitized (to remove duplicates) in the dex task, but this meant the full list (with duplicates) was passed to proguard when building in release mode. This changeset move the sanitization of the jar files in the Setup Task so that the script later only deals with a sanitized list. The means the content of libs/*.jar for the current project must be looked at in the task instead of later in the XML script. Change-Id: Ib5253b80ee7c1ded004bcdad6184e0900b7a7543
Diffstat (limited to 'files/ant')
-rw-r--r--files/ant/build.xml28
1 files changed, 12 insertions, 16 deletions
diff --git a/files/ant/build.xml b/files/ant/build.xml
index d68b56b..77f9a16 100644
--- a/files/ant/build.xml
+++ b/files/ant/build.xml
@@ -267,7 +267,7 @@
</condition>
<else>
<path id="out.dex.jar.input.ref">
- <path refid="jar.libs.ref" />
+ <path refid="project.libraries.jars" />
</path>
</else>
</if>
@@ -307,7 +307,7 @@
buildType="${build.is.packaging.debug}/${build.is.signing.debug}">
<dex path="${intermediate.dex.file}"/>
<sourcefolder path="${source.absolute.dir}"/>
- <jarfile refid="jar.libs.ref" />
+ <jarfile refid="project.libraries.jars" />
<nativefolder path="${native.libs.absolute.dir}" />
<nativefolder refid="project.libraries.libs" />
<extra-jars/>
@@ -442,6 +442,12 @@
<not><isset property="setup.done" /></not>
</condition>
<then>
+ <echo>Creating output directories if needed...</echo>
+ <mkdir dir="${resource.absolute.dir}" />
+ <mkdir dir="${jar.libs.absolute.dir}" />
+ <mkdir dir="${out.absolute.dir}" />
+ <mkdir dir="${out.res.absolute.dir}" />
+
<property name="setup.done" value="true" />
<echo>Gathering info for ${ant.project.name}...</echo>
<!-- load project properties, resolve Android target, library dependencies
@@ -460,6 +466,7 @@
projectLibrariesPackageOut="project.libraries.package"
projectLibrariesLibsOut="project.libraries.libs"
targetApiOut="target.api"
+ verbose="${verbose}"
/>
<!-- sets a few boolean based on android.project.type
@@ -540,13 +547,6 @@
<xpath input="AndroidManifest.xml" expression="/manifest/application/@android:hasCode"
output="manifest.hasCode" default="true"/>
- <!-- create a path with all the jar files, from the main project and the
- libraries -->
- <path id="jar.libs.ref">
- <fileset dir="${jar.libs.absolute.dir}" includes="*.jar" />
- <path refid="project.libraries.jars" />
- </path>
-
<!-- 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. -->
@@ -582,11 +582,6 @@
</else>
</if>
- <echo>Creating output directories if needed...</echo>
- <mkdir dir="${resource.absolute.dir}" />
- <mkdir dir="${jar.libs.absolute.dir}" />
- <mkdir dir="${out.absolute.dir}" />
- <mkdir dir="${out.res.absolute.dir}" />
<do-only-if-manifest-hasCode>
<mkdir dir="${gen.absolute.dir}" />
<mkdir dir="${out.classes.absolute.dir}" />
@@ -673,7 +668,7 @@
bootclasspathref="android.target.classpath"
verbose="${verbose}"
classpath="${extensible.classpath}"
- classpathref="jar.libs.ref"
+ classpathref="project.libraries.jars"
fork="${need.javac.fork}">
<src path="${source.absolute.dir}" />
<src path="${gen.absolute.dir}" />
@@ -700,6 +695,7 @@
<jar destfile="${out.library.jar.file}">
<fileset dir="${out.classes.absolute.dir}"
+ includes="**/*.class"
excludes="${manifest.package.path}/R.class ${manifest.package.path}/R$*.class ${manifest.package.path}/Manifest.class ${manifest.package.path}/Manifest$*.class ${manifest.package.path}/BuildConfig.class"/>
<fileset dir="${source.absolute.dir}" excludes="**/*.java ${android.package.excludes}" />
</jar>
@@ -774,7 +770,7 @@
files. -->
<path id="project.jars.ref">
<pathelement location="${preobfuscate.jar.file}" />
- <path refid="jar.libs.ref" />
+ <path refid="project.libraries.jars" />
</path>
<!-- Set the project jar files Path object into a single property. It'll be
all the jar files separated by a platform path-separator.