Page 109

92

Android: A Programmer’s Guide

<property name="zip"

value="zip" />

<!-- Rules --> <!-- Create the output directories if they don't exist yet. --> <target name="dirs"> <mkdir dir="${outdir}" /> <mkdir dir="${outdir-classes}" /> </target> <!-- Generate the R.java file for this project's resources. --> <target name="resource-src" depends="dirs"> <echo>Generating R.java...</echo> <exec executable="${aapt}" failonerror="true"> <arg value="compile" /> <arg value="-m" /> <arg value="-J" /> <arg value="${outdir-r}" /> <arg value="-M" /> <arg value="AndroidManifest.xml" /> <arg value="-S" /> <arg value="${resource-dir}" /> <arg value="-I" /> <arg value="${android-jar}" /> </exec> </target> <!-- Generate java classes from .aidl files. --> <target name="aidl" depends="dirs"> <apply executable="${aidl}" failonerror="true"> <arg value="-p${android-framework}" /> <arg value="-I${srcdir}" /> <fileset dir="${srcdir}"> <include name="**/*.aidl"/> </fileset> </apply> </target> <!-- Compile this project's .java files into .class files. --> <target name="compile" depends="dirs, resource-src, aidl"> <javac encoding="ascii" target="1.5" debug="true" extdirs="" srcdir="." destdir="${outdir-classes}" bootclasspath="${android-jar}" /> </target> <!-- Convert this project's .class files into .dex files. -->

McGraw.Hill.Android.A.Programmers.Guide.Jul.2008  

Android ™ A Programmer’s Guide This page intentionally left blank A Programmer’s Guide J.F. DiMarzio New York Chicago San Francisco Lisbon L...

McGraw.Hill.Android.A.Programmers.Guide.Jul.2008  

Android ™ A Programmer’s Guide This page intentionally left blank A Programmer’s Guide J.F. DiMarzio New York Chicago San Francisco Lisbon L...

Advertisement