OLD | NEW |
1 <?xml version="1.0" encoding="UTF-8"?> | 1 <?xml version="1.0" encoding="UTF-8"?> |
2 <!-- | 2 <!-- |
3 Copyright (c) 2012 The Chromium Authors. All rights reserved. | 3 Copyright (c) 2012 The Chromium Authors. All rights reserved. |
4 Use of this source code is governed by a BSD-style license that can be | 4 Use of this source code is governed by a BSD-style license that can be |
5 found in the LICENSE file. | 5 found in the LICENSE file. |
6 --> | 6 --> |
7 <project name="ContentShellTest" default="debug" basedir="."> | 7 <project name="ContentShellTest" default="debug" basedir="."> |
8 | 8 |
9 <description> | 9 <description> |
10 Building ContentShellTest.apk | 10 Building ContentShellTest.apk |
11 </description> | 11 </description> |
12 | 12 |
13 <import file="../../../../build/android/ant/common.xml"/> | 13 <import file="../../../../build/android/ant/common.xml"/> |
14 <import file="../../../../build/android/ant/sdk-targets.xml"/> | 14 <import file="../../../../build/android/ant/sdk-targets.xml"/> |
15 <property name="target.abi" value="${APP_ABI}"/> | 15 <property-value name="target.abi" value="${APP_ABI}"/> |
16 <property name="out.dir" location="${PRODUCT_DIR}/content_shell_test"/> | 16 <property-location name="out.dir" location="${PRODUCT_DIR}/content_shell_test" |
| 17 check-exists="false"/> |
17 <property name="resource.absolute.dir" value="../res"/> | 18 <property name="resource.absolute.dir" value="../res"/> |
18 <property name="gen.absolute.dir" value="${out.dir}/gen"/> | 19 <property-value name="gen.absolute.dir" value="${out.dir}/gen"/> |
19 <path id="native.libs.gdbserver"> | 20 <property-location name="native.libs.absolute.dir" location="${out.dir}/libs" |
20 <fileset file="${android.gdbserver}"/> | 21 check-exists="false"/> |
21 </path> | 22 <property-location name="asset.absolute.dir" location="${out.dir}/assets" |
22 <property name="native.libs.absolute.dir" location="${out.dir}/libs" /> | 23 check-exists="false"/> |
23 <property name="asset.absolute.dir" location="${out.dir}/assets" /> | 24 <!-- Set the output directory for the final apk to the ${apks.dir}. --> |
24 | 25 <property-location name="out.final.file" location="${apks.dir}/${ant.project.n
ame}-debug.apk" |
25 <path id="out.dex.jar.input.ref"> | 26 check-exists="false"/> |
26 <pathelement location="${PRODUCT_DIR}/lib.java/chromium_base.jar"/> | 27 <property name="generate.test.jar" value="true"/> |
27 <pathelement location="${PRODUCT_DIR}/lib.java/chromium_base_javatests.jar"/
> | |
28 <pathelement location="${PRODUCT_DIR}/lib.java/chromium_content.jar"/> | |
29 <pathelement location="${PRODUCT_DIR}/lib.java/chromium_content_javatests.ja
r"/> | |
30 <pathelement location="${PRODUCT_DIR}/lib.java/chromium_media.jar"/> | |
31 <pathelement location="${PRODUCT_DIR}/lib.java/chromium_net.jar"/> | |
32 <pathelement location="${PRODUCT_DIR}/lib.java/chromium_net_javatests.jar"/> | |
33 <pathelement location="${PRODUCT_DIR}/content_shell/classes"/> | |
34 </path> | |
35 <property name="java.compilerargs" value="-classpath ${toString:out.dex.jar.in
put.ref}"/> | |
36 | |
37 <!-- We expect PRODUCT_DIR to be set like the gyp var | |
38 (e.g. $ROOT/out/Debug) --> | |
39 <fail message="PRODUCT_DIR env var not set?"> | |
40 <condition> | |
41 <not> | |
42 <isset property="PRODUCT_DIR"/> | |
43 </not> | |
44 </condition> | |
45 </fail> | |
46 | |
47 <target name="-post-compile"> | |
48 <!-- copy gdbserver to main libs directory if building debug. | |
49 TODO(jrg): for now, Chrome on Android always builds native code | |
50 as Release and java/ant as Debug, which means we always install | |
51 gdbserver. Resolve this discrepancy, possibly by making this | |
52 Release Official build java/ant as Release. --> | |
53 <if> | |
54 <condition> | |
55 <equals arg1="${build.target}" arg2="debug" /> | |
56 </condition> | |
57 <then> | |
58 <echo message="Copying gdbserver to the apk to enable native debugging"/
> | |
59 <copy todir="${out.dir}/libs/${target.abi}"> | |
60 <path refid="native.libs.gdbserver"/> | |
61 </copy> | |
62 </then> | |
63 </if> | |
64 | |
65 <!-- We also want a .jar as well as an .apk for ContentShellTest-debug | |
66 so that proguard can be used to list the tests by annotation. --> | |
67 <jar destfile="${out.dir}/${ant.project.name}-debug.jar"> | |
68 <fileset dir="${out.dir}/classes" includes="**/*.class"/> | |
69 <zipfileset | |
70 includes="**/*.class" | |
71 src="${PRODUCT_DIR}/lib.java/chromium_content_javatests.jar"/> | |
72 <zipfileset | |
73 includes="**/*.class" | |
74 src="${PRODUCT_DIR}/lib.java/chromium_net_javatests.jar"/> | |
75 </jar> | |
76 | |
77 </target> | |
78 | 28 |
79 <!-- Classpath for javac --> | 29 <!-- Classpath for javac --> |
80 <path id="javac.custom.classpath"> | 30 <path id="javac.custom.classpath"> |
81 <path refid="out.dex.jar.input.ref"/> | 31 <pathelement location="${lib.java.dir}/chromium_base_javatests.jar"/> |
| 32 <pathelement location="${lib.java.dir}/chromium_content_javatests.jar"/> |
| 33 <pathelement location="${lib.java.dir}/chromium_net_javatests.jar"/> |
| 34 <pathelement location="${test.lib.java.dir}/ContentShell-debug.jar"/> |
82 </path> | 35 </path> |
83 <import file="${sdk.dir}/tools/ant/build.xml" /> | |
84 | 36 |
| 37 <!-- Use the output jar for dex, this jar contains all the compiled |
| 38 classes as well as classes from included jars. |
| 39 --> |
| 40 <path id="out.dex.jar.input.ref"> |
| 41 <pathelement location="${test.lib.java.dir}/ContentShellTest-debug.jar"/> |
| 42 </path> |
| 43 <!-- Set the classes directory to null, to avoid including compiled |
| 44 classes, the compiled classes are already included in generated |
| 45 {ant.project.name)-debug.jar file. |
| 46 --> |
| 47 <property name="out.dex.input.absolute.dir" value=""/> |
| 48 |
| 49 <import file="${sdk.dir}/tools/ant/build.xml"/> |
85 </project> | 50 </project> |
OLD | NEW |