- <target name="dex-optimized" depends="compile-release,optimize">
- <echo>Converting compiled files and external libraries into ${outdir}/${dex-file}...</echo>
- <echo>NOTE: This will fail unless you built core with build-no-debug.</echo>
- <apply executable="${dx}" failonerror="true" parallel="true">
- <arg value="--dex" />
- <arg value="--output=${intermediate-dex-ospath}" />
- <arg path="${outdir-classes-ospath}" />
- <!-- workaround to appease 'apply'. Not really the right Ant task to use here. -->
- <fileset dir="." includes="nosuchfile.jar"/>
- </apply>
- </target>
-
- <!-- Put the project's resources into the output package file. -->
- <target name="package-res-and-assets">
- <echo>Packaging resources and assets...</echo>
- <exec executable="${aapt}" failonerror="true">
- <arg value="package" />
- <arg value="-f" />
- <arg value="-M" />
- <arg value="AndroidManifest.xml" />
- <arg value="-S" />
- <arg value="${resource-dir}" />
- <arg value="-A" />
- <arg value="${asset-dir}" />
- <arg value="-I" />
- <arg value="${android-jar}" />
- <arg value="-F" />
- <arg value="${resources-package}" />
- </exec>
- </target>
-
- <!-- Same as package-res-and-assets, but without "-A ${asset-dir}" -->
- <target name="package-res-no-assets">
- <echo>Packaging resources...</echo>
- <exec executable="${aapt}" failonerror="true">
- <arg value="package" />
- <arg value="-f" />
- <arg value="-M" />
- <arg value="AndroidManifest.xml" />
- <arg value="-S" />
- <arg value="${resource-dir}" />
- <!-- No assets directory -->
- <arg value="-I" />
- <arg value="${android-jar}" />
- <arg value="-F" />
- <arg value="${resources-package}" />
- </exec>
- </target>
-
- <!-- Invoke the proper target depending on whether or not an assets directory is present. -->
- <target name="package-res">
- <available file="${asset-dir}" type="dir"
- property="res-target" value="and-assets" />
- <property name="res-target" value="no-assets" />
- <antcall target="package-res-${res-target}" />
+ <!-- Put the project's resources into the output package file
+ This actually can create multiple resource package in case
+ Some custom apk with specific configuration have been
+ declared in default.properties.
+ -->
+ <target name="package-resources">
+ <echo>Packaging resources</echo>
+ <aaptexec executable="${aapt}"
+ command="package"
+ manifest="AndroidManifest.xml"
+ resources="${resource-folder}"
+ assets="${asset-folder}"
+ androidjar="${android-jar}"
+ outfolder="${out-folder}"
+ basename="${ant.project.name}" />