| OLD | NEW |
| 1 <?xml version="1.0" encoding="UTF-8"?> | 1 <?xml version="1.0" encoding="UTF-8"?> |
| 2 <!-- | 2 <!-- |
| 3 Copyright (C) 2005-2008 The Android Open Source Project | 3 Copyright (C) 2005-2008 The Android Open Source Project |
| 4 | 4 |
| 5 Licensed under the Apache License, Version 2.0 (the "License"); | 5 Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 you may not use this file except in compliance with the License. | 6 you may not use this file except in compliance with the License. |
| 7 You may obtain a copy of the License at | 7 You may obtain a copy of the License at |
| 8 | 8 |
| 9 http://www.apache.org/licenses/LICENSE-2.0 | 9 http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | 10 |
| 11 Unless required by applicable law or agreed to in writing, software | 11 Unless required by applicable law or agreed to in writing, software |
| 12 distributed under the License is distributed on an "AS IS" BASIS, | 12 distributed under the License is distributed on an "AS IS" BASIS, |
| 13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 See the License for the specific language governing permissions and | 14 See the License for the specific language governing permissions and |
| 15 limitations under the License. | 15 limitations under the License. |
| 16 --> | 16 --> |
| 17 | 17 |
| 18 <project default="-package"> | 18 <project default="-package"> |
| 19 <property name="verbose" value="false" /> | 19 <property name="verbose" value="false" /> |
| 20 <property name="out.dir" location="${OUT_DIR}" /> | 20 <property name="out.dir" location="${OUT_DIR}" /> |
| 21 <!-- Output directories --> | |
| 22 <property name="out.dir" value="bin" /> | |
| 23 <property name="out.absolute.dir" location="${out.dir}" /> | 21 <property name="out.absolute.dir" location="${out.dir}" /> |
| 24 <property name="out.res.absolute.dir" location="${out.dir}/res" /> | |
| 25 <property name="out.manifest.abs.file" location="${out.dir}/AndroidManifest.xm
l" /> | |
| 26 | 22 |
| 27 <!-- tools location --> | |
| 28 <property name="sdk.dir" location="${ANDROID_SDK_ROOT}"/> | 23 <property name="sdk.dir" location="${ANDROID_SDK_ROOT}"/> |
| 29 <property name="target" value="android-${ANDROID_SDK_VERSION}"/> | |
| 30 <property name="project.target.android.jar" location="${ANDROID_SDK_JAR}" /> | |
| 31 <property name="android.tools.dir" location="${sdk.dir}/tools" /> | |
| 32 <property name="android.platform.tools.dir" location="${sdk.dir}/platform-tool
s" /> | |
| 33 | 24 |
| 34 <!-- jar file from where the tasks are loaded --> | 25 <!-- jar file from where the tasks are loaded --> |
| 35 <path id="android.antlibs"> | 26 <path id="android.antlibs"> |
| 36 <pathelement path="${sdk.dir}/tools/lib/anttasks.jar" /> | 27 <pathelement path="${sdk.dir}/tools/lib/anttasks.jar" /> |
| 37 </path> | 28 </path> |
| 38 | 29 |
| 39 <!-- Custom tasks --> | 30 <!-- Custom tasks --> |
| 40 <taskdef resource="anttasks.properties" classpathref="android.antlibs" /> | 31 <taskdef resource="anttasks.properties" classpathref="android.antlibs" /> |
| 41 | 32 |
| 42 <condition property="build.target" value="release" else="debug"> | 33 <condition property="build.target" value="release" else="debug"> |
| 43 <equals arg1="${CONFIGURATION_NAME}" arg2="Release" /> | 34 <equals arg1="${CONFIGURATION_NAME}" arg2="Release" /> |
| 44 </condition> | 35 </condition> |
| 45 <condition property="build.is.packaging.debug" value="true" else="false"> | 36 <condition property="build.is.packaging.debug" value="true" else="false"> |
| 46 <equals arg1="build.target" arg2="debug" /> | 37 <equals arg1="build.target" arg2="debug" /> |
| 47 </condition> | 38 </condition> |
| 48 | 39 |
| 49 <!-- Disables automatic signing. --> | 40 <!-- Disables automatic signing. --> |
| 50 <property name="build.is.signing.debug" value="false"/> | 41 <property name="build.is.signing.debug" value="false"/> |
| 51 | 42 |
| 52 <!-- SDK tools assume that out.packaged.file is signed and name it "...-unalig
ned" --> | 43 <!-- SDK tools assume that out.packaged.file is signed and name it "...-unalig
ned" --> |
| 53 <property name="out.packaged.file" value="${UNSIGNED_APK_PATH}" /> | 44 <property name="out.packaged.file" value="${UNSIGNED_APK_PATH}" /> |
| 54 | 45 |
| 55 <property name="resource.dir" value="${RESOURCE_DIR}"/> | |
| 56 <property name="resource.absolute.dir" location="${resource.dir}"/> | |
| 57 | |
| 58 <property name="asset.dir" value="${ASSET_DIR}" /> | |
| 59 <property name="asset.absolute.dir" location="${asset.dir}" /> | |
| 60 | |
| 61 <property name="native.libs.absolute.dir" location="${NATIVE_LIBS_DIR}" /> | 46 <property name="native.libs.absolute.dir" location="${NATIVE_LIBS_DIR}" /> |
| 62 | 47 |
| 63 <property name="aapt" location="${android.platform.tools.dir}/aapt" /> | |
| 64 | |
| 65 <target name="-crunch"> | |
| 66 <!-- Updates the pre-processed PNG cache --> | |
| 67 <exec executable="${aapt}" taskName="crunch"> | |
| 68 <arg value="crunch" /> | |
| 69 <arg value="-v" /> | |
| 70 <arg value="-S" /> | |
| 71 <arg path="${resource.absolute.dir}" /> | |
| 72 <arg value="-C" /> | |
| 73 <arg path="${out.res.absolute.dir}" /> | |
| 74 </exec> | |
| 75 </target> | |
| 76 | |
| 77 <property name="version.code" value="${APP_MANIFEST_VERSION_CODE}"/> | |
| 78 <property name="version.name" value="${APP_MANIFEST_VERSION_NAME}"/> | |
| 79 | |
| 80 <property name="aapt.resource.filter" value="" /> | |
| 81 <!-- 'aapt.ignore.assets' is the list of file patterns to ignore under /res an
d /assets. | |
| 82 Default is "!.svn:!.git:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*.scc:*
~" | |
| 83 | |
| 84 Overall patterns syntax is: | |
| 85 [!][<dir>|<file>][*suffix-match|prefix-match*|full-match]:more:patter
ns... | |
| 86 | |
| 87 - The first character flag ! avoids printing a warning. | |
| 88 - Pattern can have the flag "<dir>" to match only directories | |
| 89 or "<file>" to match only files. Default is to match both. | |
| 90 - Match is not case-sensitive. | |
| 91 --> | |
| 92 <property name="aapt.ignore.assets" value="" /> | |
| 93 | |
| 94 <!-- | |
| 95 Include additional resource folders in the apk, e.g. content/.../res. We | |
| 96 list the res folders in project.library.res.folder.path and the | |
| 97 corresponding java packages in project.library.packages, which must be | |
| 98 semicolon-delimited while ADDITIONAL_RES_PACKAGES is space-delimited, henc
e | |
| 99 the javascript task. | |
| 100 --> | |
| 101 <path id="project.library.res.folder.path"> | |
| 102 <filelist files="${ADDITIONAL_RES_DIRS}"/> | |
| 103 </path> | |
| 104 <path id="project.library.bin.r.file.path"> | |
| 105 <filelist files="${ADDITIONAL_R_TEXT_FILES}"/> | |
| 106 </path> | |
| 107 <script language="javascript"> | |
| 108 var before = project.getProperty("ADDITIONAL_RES_PACKAGES"); | |
| 109 project.setProperty("project.library.packages", before.replaceAll(" ", ";"))
; | |
| 110 </script> | |
| 111 | |
| 112 <property name="build.packaging.nocrunch" value="true" /> | |
| 113 | |
| 114 <!-- Intermediate files --> | 48 <!-- Intermediate files --> |
| 115 <property name="resource.package.file.name" value="${APK_NAME}.ap_" /> | 49 <property name="resource.package.file.name" value="${APK_NAME}.ap_" /> |
| 116 | 50 |
| 117 <target name="-package-resources" depends="-crunch"> | |
| 118 <aapt | |
| 119 executable="${aapt}" | |
| 120 command="package" | |
| 121 versioncode="${version.code}" | |
| 122 versionname="${version.name}" | |
| 123 debug="${build.is.packaging.debug}" | |
| 124 manifest="${out.manifest.abs.file}" | |
| 125 assets="${asset.absolute.dir}" | |
| 126 androidjar="${project.target.android.jar}" | |
| 127 apkfolder="${out.absolute.dir}" | |
| 128 nocrunch="${build.packaging.nocrunch}" | |
| 129 resourcefilename="${resource.package.file.name}" | |
| 130 resourcefilter="${aapt.resource.filter}" | |
| 131 libraryResFolderPathRefid="project.library.res.folder.path" | |
| 132 libraryPackagesRefid="project.library.packages" | |
| 133 libraryRFileRefid="project.library.bin.r.file.path" | |
| 134 previousBuildType="" | |
| 135 buildType="${build.target}" | |
| 136 ignoreAssets="${aapt.ignore.assets}"> | |
| 137 <res path="${out.res.absolute.dir}" /> | |
| 138 <res path="${resource.absolute.dir}" /> | |
| 139 <!-- <nocompress /> forces no compression on any files in assets or res/ra
w --> | |
| 140 <!-- <nocompress extension="xml" /> forces no compression on specific file
extensions in assets and res/raw --> | |
| 141 </aapt> | |
| 142 </target> | |
| 143 | |
| 144 <property name="dex.file.name" value="classes.dex" /> | 51 <property name="dex.file.name" value="classes.dex" /> |
| 145 <property name="intermediate.dex.file" location="${out.absolute.dir}/${dex.fil
e.name}" /> | 52 <property name="intermediate.dex.file" location="${out.absolute.dir}/${dex.fil
e.name}" /> |
| 53 |
| 146 <property name="source.dir" value="${SOURCE_DIR}" /> | 54 <property name="source.dir" value="${SOURCE_DIR}" /> |
| 147 <property name="source.absolute.dir" location="${source.dir}" /> | 55 <property name="source.absolute.dir" location="${source.dir}" /> |
| 148 | 56 |
| 149 | |
| 150 <!-- Packages the application. --> | 57 <!-- Packages the application. --> |
| 151 <target name="-package" depends="-package-resources"> | 58 <target name="-package"> |
| 152 <apkbuilder | 59 <apkbuilder |
| 153 outfolder="${out.absolute.dir}" | 60 outfolder="${out.absolute.dir}" |
| 154 resourcefile="${resource.package.file.name}" | 61 resourcefile="${resource.package.file.name}" |
| 155 apkfilepath="${out.packaged.file}" | 62 apkfilepath="${out.packaged.file}" |
| 156 debugpackaging="${build.is.packaging.debug}" | 63 debugpackaging="${build.is.packaging.debug}" |
| 157 debugsigning="${build.is.signing.debug}" | 64 debugsigning="${build.is.signing.debug}" |
| 158 verbose="${verbose}" | 65 verbose="${verbose}" |
| 159 hascode="true" | 66 hascode="true" |
| 160 previousBuildType="/" | 67 previousBuildType="/" |
| 161 buildType="${build.is.packaging.debug}/${build.is.signing.debug}"> | 68 buildType="${build.is.packaging.debug}/${build.is.signing.debug}"> |
| 162 <dex path="${intermediate.dex.file}"/> | 69 <dex path="${intermediate.dex.file}"/> |
| 163 <sourcefolder path="${source.absolute.dir}"/> | 70 <sourcefolder path="${source.absolute.dir}"/> |
| 164 <nativefolder path="${native.libs.absolute.dir}" /> | 71 <nativefolder path="${native.libs.absolute.dir}" /> |
| 165 </apkbuilder> | 72 </apkbuilder> |
| 166 </target> | 73 </target> |
| 167 </project> | 74 </project> |
| OLD | NEW |