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 for chromium_*.jars. |
| 9 For creating a new chromium_*.jar : |
| 10 1. Use build/java.gyp action. This action will set PACKAGE_NAME. |
| 11 The jar will be created as chromium_${PACKAGE_NAME} in |
| 12 ${PRODUCT_DIR}/lib.java. |
| 13 2. Set javac.custom.classpath to classpath to use for javac. |
| 14 3. Override javac.srcdir for providing custom source directory for javac. |
| 15 --> |
| 16 |
| 17 <import file="common.xml"/> |
| 18 <property-location name="src" location="src"/> |
| 19 <property-location name="lib.dir" location="${PRODUCT_DIR}/lib.java" |
| 20 check-exists="false"/> |
| 21 <property-location name="dest.dir" location="${PRODUCT_DIR}/java/${PACKAGE_NAM
E}" |
| 22 check-exists="false"/> |
| 23 |
| 24 <target name="init"> |
| 25 <!-- Create the time stamp --> |
| 26 <tstamp/> |
| 27 <!-- Create the build directory structure used by compile --> |
| 28 <mkdir dir="${lib.dir}"/> |
| 29 <mkdir dir="${dest.dir}"/> |
| 30 </target> |
| 31 |
| 32 <!-- |
| 33 Compile target for jars. Requires javac.custom.classpath to be set. |
| 34 Optionally javac.srcdir can be overridden to custom path for src |
| 35 directories. |
| 36 --> |
| 37 <target name="compile" depends="init" description="Compiles source." > |
| 38 <fail message="Error: javac.custom.classpath is not set. Please set it to |
| 39 classpath for javac."> |
| 40 <condition> |
| 41 <not><isreference refid="javac.custom.classpath"/></not> |
| 42 </condition> |
| 43 </fail> |
| 44 <property-value name="javac.srcdir" value ="${src}"/> |
| 45 <echo>Compiling ${javac.srcdir}, classpath: ${toString:javac.custom.classpat
h}</echo> |
| 46 <javac srcdir="${javac.srcdir}" destdir="${dest.dir}" debug="true" includean
truntime="false"> |
| 47 <classpath> |
| 48 <path refid="javac.custom.classpath" /> |
| 49 </classpath> |
| 50 </javac> |
| 51 </target> |
| 52 |
| 53 <target name="dist" depends="compile" |
| 54 description="Generate chromium_${PACKAGE_NAME}.jar."> |
| 55 <!-- Create the distribution directory --> |
| 56 <mkdir dir="${lib.dir}" /> |
| 57 <jar jarfile="${lib.dir}/chromium_${PACKAGE_NAME}.jar" basedir="${dest.dir}"
/> |
| 58 </target> |
| 59 |
| 60 <target name="clean" description="clean up"> |
| 61 <!-- Delete the appropriate directory trees --> |
| 62 <delete dir="${dest.dir}" /> |
| 63 </target> |
| 64 </project> |
OLD | NEW |