aboutsummaryrefslogtreecommitdiffstats
path: root/files/ant
diff options
context:
space:
mode:
Diffstat (limited to 'files/ant')
-rw-r--r--files/ant/build.xml41
1 files changed, 23 insertions, 18 deletions
diff --git a/files/ant/build.xml b/files/ant/build.xml
index f1c46ef..c49fc5a 100644
--- a/files/ant/build.xml
+++ b/files/ant/build.xml
@@ -108,6 +108,10 @@
classname="com.android.ant.IfElseTask"
classpathref="android.antlibs" />
+ <taskdef name="propertybyreplace"
+ classname="com.android.ant.PropertyByReplaceTask"
+ classpathref="android.antlibs" />
+
<!-- Emma configuration -->
<property name="emma.dir" value="${sdk.dir}/tools/lib" />
<path id="emma.lib">
@@ -263,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>
@@ -303,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/>
@@ -417,13 +421,14 @@
<if>
<condition>
<isreference refid="project.libraries" />
+ <not><isset property="dont.do.deps" /></not>
</condition>
<then>
<subant
buildpathref="project.libraries"
antfile="build.xml"
failonerror="true">
- <target name="all" />
+ <target name="nodeps" />
<target name="clean" />
</subant>
</then>
@@ -437,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
@@ -455,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
@@ -535,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. -->
@@ -577,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}" />
@@ -670,7 +670,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}" />
@@ -692,8 +692,13 @@
<echo>Custom jar packaging exclusion: ${android.package.excludes}</echo>
</then>
</if>
+
+ <propertybyreplace name="manifest.package.path" input="${manifest.package}" replace="." with="/" />
+
<jar destfile="${out.library.jar.file}">
- <fileset dir="${out.classes.absolute.dir}" excludes="**/R.class **/R$*.class"/>
+ <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>
</then>
@@ -767,7 +772,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.