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