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 Java libraries. For building new libraries, see bu
ild/java.gypi. |
9 For creating a new chromium_*.jar : | |
10 1. Use build/java.gypi action. | |
11 The jar will be created as chromium_${PACKAGE_NAME} in | |
12 ${PRODUCT_DIR}/lib.java. | |
13 --> | 9 --> |
14 <description> | 10 <description> |
15 Building ${PROJECT_NAME}/ java source code with ant. | 11 Building ${PROJECT_NAME}/ java source code with ant. |
16 </description> | 12 </description> |
17 | 13 |
18 <import file="common.xml"/> | 14 <import file="common.xml"/> |
19 | 15 |
20 <path id="javac.custom.classpath"> | 16 <path id="javac.custom.classpath"> |
21 <filelist files="${INPUT_JARS_PATHS}"/> | 17 <filelist files="${INPUT_JARS_PATHS}"/> |
22 <pathelement location="${ANDROID_SDK}/android.jar"/> | 18 <pathelement location="${ANDROID_SDK}/android.jar"/> |
23 </path> | 19 </path> |
24 | 20 |
25 <path id="javac.srcdirs.additional"> | 21 <path id="javac.srcdirs.additional"> |
26 <filelist files="${ADDITIONAL_SRC_DIRS}"/> | 22 <filelist files="${ADDITIONAL_SRC_DIRS}"/> |
27 <filelist files="${GENERATED_SRC_DIRS}"/> | 23 <filelist files="${GENERATED_SRC_DIRS}"/> |
28 </path> | 24 </path> |
29 | 25 |
30 <property-value | 26 <property-value |
31 name="javac.srcdir" | 27 name="javac.srcdir" |
32 value="src:${toString:javac.srcdirs.additional}" | 28 value="src:${toString:javac.srcdirs.additional}" |
33 /> | 29 /> |
34 | 30 |
35 <property-location | 31 <property-location name="out.dir" location="${OUT_DIR}" check-exists="false" /
> |
36 name="dest.dir" | |
37 location="${PRODUCT_DIR}/java/${PACKAGE_NAME}" | |
38 check-exists="false" | |
39 /> | |
40 | 32 |
41 <condition property="javac_includes_message" | 33 <condition property="javac_includes_message" |
42 value="" | 34 value="" |
43 else="Include filter: ${JAVAC_INCLUDES}"> | 35 else="Include filter: ${JAVAC_INCLUDES}"> |
44 <equals arg1="${JAVAC_INCLUDES}" arg2=""/> | 36 <equals arg1="${JAVAC_INCLUDES}" arg2=""/> |
45 </condition> | 37 </condition> |
46 | 38 |
47 <target name="init"> | 39 <target name="init"> |
48 <!-- Create the time stamp --> | 40 <!-- Create the time stamp --> |
49 <tstamp/> | 41 <tstamp/> |
50 <!-- Create the build directory structure used by compile --> | 42 <!-- Create the build directory structure used by compile --> |
51 <mkdir dir="${dest.dir}"/> | 43 <mkdir dir="${out.dir}"/> |
52 | 44 |
53 <!-- Remove all .class files from dest.dir. This prevents inclusion of | 45 <!-- Remove all .class files from out.dir. This prevents inclusion of |
54 incorrect .class files in the final .jar. For example, if a .java file | 46 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 | 47 was deleted, the .jar should not contain the .class files for that |
56 .java from previous builds. | 48 .java from previous builds. |
57 --> | 49 --> |
58 <delete> | 50 <delete> |
59 <fileset dir="${dest.dir}" includes="**/*.class"/> | 51 <fileset dir="${out.dir}" includes="**/*.class"/> |
60 </delete> | 52 </delete> |
61 </target> | 53 </target> |
62 | 54 |
63 <target name="compile" depends="init" description="Compiles source."> | 55 <target name="compile" depends="init" description="Compiles source."> |
64 <fail message="Error: javac.custom.classpath is not set. Please set it to | 56 <fail message="Error: javac.custom.classpath is not set. Please set it to |
65 classpath for javac."> | 57 classpath for javac."> |
66 <condition> | 58 <condition> |
67 <not><isreference refid="javac.custom.classpath"/></not> | 59 <not><isreference refid="javac.custom.classpath"/></not> |
68 </condition> | 60 </condition> |
69 </fail> | 61 </fail> |
70 | 62 |
71 <javac | 63 <javac |
72 srcdir="${javac.srcdir}" | 64 srcdir="${javac.srcdir}" |
73 destdir="${dest.dir}" | 65 destdir="${out.dir}" |
74 classpathref="javac.custom.classpath" | 66 classpathref="javac.custom.classpath" |
75 debug="true" | 67 debug="true" |
76 includeantruntime="false" | 68 includeantruntime="false" |
77 includes="${JAVAC_INCLUDES}"> | 69 includes="${JAVAC_INCLUDES}"> |
78 <compilerarg value="-Xlint:unchecked"/> | 70 <compilerarg value="-Xlint:unchecked"/> |
79 </javac> | 71 </javac> |
80 </target> | 72 </target> |
81 | 73 |
82 <target name="dist" depends="compile" | 74 <target name="dist" depends="compile" |
83 description="Generate chromium_${PACKAGE_NAME}.jar."> | 75 description="Generate ${JAR_NAME}."> |
84 <!-- Create the distribution directory. We exclude R.class and R$*.class | 76 <!-- Create the distribution directory. We exclude R.class and R$*.class |
85 files since new versions of these files with the correct resource -> ID | 77 files since new versions of these files with the correct resource -> ID |
86 mapping will be provided when we build each individual apk. --> | 78 mapping will be provided when we build each individual apk. --> |
87 <jar | 79 <jar |
88 jarfile="${lib.java.dir}/chromium_${PACKAGE_NAME}.jar" | 80 jarfile="${lib.java.dir}/${JAR_NAME}" |
89 excludes="**/R.class **/R$*.class" | 81 excludes="**/R.class **/R$*.class" |
90 basedir="${dest.dir}" | 82 basedir="${out.dir}" |
91 /> | 83 /> |
92 | 84 |
93 <!-- 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 |
94 time should still be updated. Otherwise, this target will continue to | 86 time should still be updated. Otherwise, this target will continue to |
95 be rebuilt in future builds. | 87 be rebuilt in future builds. |
96 --> | 88 --> |
97 <touch file="${lib.java.dir}/chromium_${PACKAGE_NAME}.jar"/> | 89 <touch file="${lib.java.dir}/${JAR_NAME}"/> |
98 </target> | 90 </target> |
99 | 91 |
100 <target name="clean" description="clean up"> | 92 <target name="clean" description="clean up"> |
101 <!-- Delete the appropriate directory trees --> | 93 <!-- Delete the appropriate directory trees --> |
102 <delete dir="${dest.dir}"/> | 94 <delete dir="${out.dir}"/> |
103 </target> | 95 </target> |
104 </project> | 96 </project> |
OLD | NEW |