OLD | NEW |
1 <!-- | 1 <!-- |
2 Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 Use of this source code is governed by a BSD-style license that can be | 3 Use of this source code is governed by a BSD-style license that can be |
4 found in the LICENSE file. | 4 found in the LICENSE file. |
5 --> | 5 --> |
6 <project name="chromium-jars" default="dist"> | 6 <project name="chromium-jars" default="dist"> |
7 <!-- | 7 <!-- |
8 Common ant build file for for chromium_*.jars. | 8 Common ant build file for for chromium_*.jars. |
9 For creating a new chromium_*.jar : | 9 For creating a new chromium_*.jar : |
10 1. Use build/java.gypi action. | 10 1. Use build/java.gypi action. |
11 The jar will be created as chromium_${PACKAGE_NAME} in | 11 The jar will be created as chromium_${PACKAGE_NAME} in |
12 ${PRODUCT_DIR}/lib.java. | 12 ${PRODUCT_DIR}/lib.java. |
13 --> | 13 --> |
14 <description> | 14 <description> |
15 Building ${PROJECT_NAME}/ java source code with ant. | 15 Building ${PROJECT_NAME}/ java source code with ant. |
16 </description> | 16 </description> |
17 | 17 |
18 <import file="common.xml"/> | 18 <import file="common.xml"/> |
19 | 19 |
20 <path id="javac.custom.classpath"> | 20 <path id="javac.custom.classpath"> |
21 <filelist files="${INPUT_JARS_PATHS}"/> | 21 <filelist files="${INPUT_JARS_PATHS}"/> |
22 <pathelement location="${ANDROID_SDK}/android.jar" /> | 22 <pathelement location="${ANDROID_SDK}/android.jar"/> |
23 </path> | 23 </path> |
24 | 24 |
25 <path id="javac.srcdirs.additional"> | 25 <path id="javac.srcdirs.additional"> |
26 <filelist files="${ADDITIONAL_SRC_DIRS}" /> | 26 <filelist files="${ADDITIONAL_SRC_DIRS}"/> |
27 </path> | 27 </path> |
28 | 28 |
29 <property-value | 29 <property-value |
30 name="javac.srcdir" | 30 name="javac.srcdir" |
31 value="src:${toString:javac.srcdirs.additional}" | 31 value="src:${toString:javac.srcdirs.additional}" |
32 /> | 32 /> |
33 | 33 |
34 <property-location | 34 <property-location |
35 name="lib.dir" | |
36 location="${PRODUCT_DIR}/lib.java" | |
37 check-exists="false" | |
38 /> | |
39 | |
40 <property-location | |
41 name="dest.dir" | 35 name="dest.dir" |
42 location="${PRODUCT_DIR}/java/${PACKAGE_NAME}" | 36 location="${PRODUCT_DIR}/java/${PACKAGE_NAME}" |
43 check-exists="false" | 37 check-exists="false" |
44 /> | 38 /> |
45 | 39 |
46 <target name="init"> | 40 <target name="init"> |
47 <!-- Create the time stamp --> | 41 <!-- Create the time stamp --> |
48 <tstamp/> | 42 <tstamp/> |
49 <!-- Create the build directory structure used by compile --> | 43 <!-- Create the build directory structure used by compile --> |
50 <mkdir dir="${lib.dir}"/> | |
51 <mkdir dir="${dest.dir}"/> | 44 <mkdir dir="${dest.dir}"/> |
52 | 45 |
53 <!-- Remove all .class files from dest.dir. This prevents inclusion of | 46 <!-- Remove all .class files from dest.dir. This prevents inclusion of |
54 incorrect .class files in the final .jar. For example, if a .java file | 47 incorrect .class files in the final .jar. For example, if a .java file |
55 was deleted, the .jar should not contain the .class files for that | 48 was deleted, the .jar should not contain the .class files for that |
56 .java from previous builds. | 49 .java from previous builds. |
57 --> | 50 --> |
58 <delete> | 51 <delete> |
59 <fileset dir="${dest.dir}" includes="**/*.class"/> | 52 <fileset dir="${dest.dir}" includes="**/*.class"/> |
60 </delete> | 53 </delete> |
61 </target> | 54 </target> |
62 | 55 |
63 <target name="compile" depends="init" description="Compiles source." > | 56 <target name="compile" depends="init" description="Compiles source."> |
64 <fail message="Error: javac.custom.classpath is not set. Please set it to | 57 <fail message="Error: javac.custom.classpath is not set. Please set it to |
65 classpath for javac."> | 58 classpath for javac."> |
66 <condition> | 59 <condition> |
67 <not><isreference refid="javac.custom.classpath"/></not> | 60 <not><isreference refid="javac.custom.classpath"/></not> |
68 </condition> | 61 </condition> |
69 </fail> | 62 </fail> |
70 | 63 |
71 <echo> | 64 <echo> |
72 Compiling ${javac.srcdir}, classpath: ${toString:javac.custom.classpath} | 65 Compiling ${javac.srcdir}, classpath: ${toString:javac.custom.classpath} |
73 </echo> | 66 </echo> |
74 | 67 |
75 <javac | 68 <javac |
76 srcdir="${javac.srcdir}" | 69 srcdir="${javac.srcdir}" |
77 destdir="${dest.dir}" | 70 destdir="${dest.dir}" |
78 classpathref="javac.custom.classpath" | 71 classpathref="javac.custom.classpath" |
79 debug="true" | 72 debug="true" |
80 includeantruntime="false" | 73 includeantruntime="false" |
81 /> | 74 /> |
82 </target> | 75 </target> |
83 | 76 |
84 <target name="dist" depends="compile" | 77 <target name="dist" depends="compile" |
85 description="Generate chromium_${PACKAGE_NAME}.jar."> | 78 description="Generate chromium_${PACKAGE_NAME}.jar."> |
86 <!-- Create the distribution directory --> | 79 <!-- Create the distribution directory --> |
87 <jar | 80 <jar |
88 jarfile="${lib.dir}/chromium_${PACKAGE_NAME}.jar" | 81 jarfile="${lib.java.dir}/chromium_${PACKAGE_NAME}.jar" |
89 basedir="${dest.dir}" | 82 basedir="${dest.dir}" |
90 /> | 83 /> |
91 | 84 |
92 <!-- If Gyp thinks this output is stale but Ant doesn't, the modification | 85 <!-- If Gyp thinks this output is stale but Ant doesn't, the modification |
93 time should still be updated. Otherwise, this target will continue to | 86 time should still be updated. Otherwise, this target will continue to |
94 be rebuilt in future builds. | 87 be rebuilt in future builds. |
95 --> | 88 --> |
96 <touch file="${lib.dir}/chromium_${PACKAGE_NAME}.jar"/> | 89 <touch file="${lib.java.dir}/chromium_${PACKAGE_NAME}.jar"/> |
97 </target> | 90 </target> |
98 | 91 |
99 <target name="clean" description="clean up"> | 92 <target name="clean" description="clean up"> |
100 <!-- Delete the appropriate directory trees --> | 93 <!-- Delete the appropriate directory trees --> |
101 <delete dir="${dest.dir}" /> | 94 <delete dir="${dest.dir}"/> |
102 </target> | 95 </target> |
103 </project> | 96 </project> |
OLD | NEW |