The Android Open Source Project | 5c11852 | 2008-10-21 07:00:00 -0700 | [diff] [blame^] | 1 | <?xml version="1.0" ?> |
| 2 | <project name="ACTIVITY_NAME" default="package"> |
| 3 | |
| 4 | <!-- The build.properties file can be created by you and is never touched |
| 5 | by activitycreator. If you want to manually set properties, this is |
| 6 | the best place to set them. --> |
| 7 | <property file="build.properties"/> |
| 8 | |
| 9 | <!-- The default.properties file is created and updated by activitycreator. |
| 10 | It will set any properties not already defined by build.properties. --> |
| 11 | <property file="default.properties"/> |
| 12 | |
| 13 | <!-- ************************************************************************************* --> |
| 14 | <!-- No user servicable parts below. --> |
| 15 | |
| 16 | <!-- Input directories --> |
| 17 | <property name="resource-dir" value="res" /> |
| 18 | |
| 19 | <!-- The final package file to generate --> |
| 20 | <property name="out-package" value="${ant.project.name}.apk" /> |
| 21 | |
| 22 | <!-- Tools --> |
| 23 | <condition property="aapt" value="${android-tools}/aapt.exe" else="${android-tools}/aapt" > |
| 24 | <os family="windows"/> |
| 25 | </condition> |
| 26 | <condition property="adb" value="${android-tools}/adb.exe" else="${android-tools}/adb" > |
| 27 | <os family="windows"/> |
| 28 | </condition> |
| 29 | <property name="android-jar" value="${sdk-folder}/android.jar" /> |
| 30 | |
| 31 | <!-- Rules --> |
| 32 | |
| 33 | <!-- Packages the manifest and the resource files --> |
| 34 | <target name="package-res"> |
| 35 | <echo>Packaging resources...</echo> |
| 36 | <exec executable="${aapt}" failonerror="true"> |
| 37 | <arg value="package" /> |
| 38 | <arg value="-f" /> |
| 39 | <arg value="-M" /> |
| 40 | <arg value="AndroidManifest.xml" /> |
| 41 | <arg value="-S" /> |
| 42 | <arg value="${resource-dir}" /> |
| 43 | <arg value="-I" /> |
| 44 | <arg value="${android-jar}" /> |
| 45 | <arg value="-F" /> |
| 46 | <arg value="${out-package}" /> |
| 47 | </exec> |
| 48 | </target> |
| 49 | |
| 50 | <!-- Create the package file for this project from the sources. --> |
| 51 | <target name="package" depends="package-res" /> |
| 52 | |
| 53 | <!-- Create the package and install package on the default emulator --> |
| 54 | <target name="install" depends="package"> |
| 55 | <echo>Sending package to default emulator...</echo> |
| 56 | <exec executable="${adb}" failonerror="true"> |
| 57 | <arg value="install" /> |
| 58 | <arg value="${out-package}" /> |
| 59 | </exec> |
| 60 | </target> |
| 61 | |
| 62 | </project> |