OLD | NEW |
1 <project name="BaseJavaTests" default="dist" basedir="."> | 1 <project name="BaseJavaTests" default="dist" basedir="."> |
2 <description> | 2 <description> |
3 building base java tests source code with ant | 3 building base java tests source code with ant |
4 </description> | 4 </description> |
5 <!-- Set global properties for this build --> | 5 <!-- Set global properties for this build --> |
6 <property environment="env"/> | |
7 <property name="sdk.dir" location="${env.ANDROID_SDK_ROOT}"/> | |
8 <!-- TODO(jrg): The apk-runner's version is hardcoded to SDK version 14. These | |
9 two should be unified. --> | |
10 <property name="sdk.version" value="${env.ANDROID_SDK_VERSION}"/> | |
11 <property name="src" location="src"/> | 6 <property name="src" location="src"/> |
12 <property name="dist" location="dist"/> | 7 <property name="dist" location="dist"/> |
13 <property name="out.dir" location="${PRODUCT_DIR}/lib.java"/> | 8 <property name="out.dir" location="${PRODUCT_DIR}/lib.java"/> |
14 <!-- TODO(jrg): establish a standard for the intermediate java | 9 <!-- TODO(jrg): establish a standard for the intermediate java |
15 directories. Settle on a standard once ant/jar build files | 10 directories. Settle on a standard once ant/jar build files |
16 like this are androidified --> | 11 like this are androidified --> |
17 <property name="dest.dir" location="${PRODUCT_DIR}/java/base_javatests"/> | 12 <property name="dest.dir" location="${PRODUCT_DIR}/java/base_javatests"/> |
18 | 13 |
19 <!-- Set path depending on the type of repository. If ANDROID_BUILD_TOP is | |
20 set then build using the provided location. Otherwise, assume the build | |
21 is using the released SDK and set the path accordingly. --> | |
22 <condition property="location.base" | |
23 value="${sdk.dir}" | |
24 else="${sdk.dir}/platforms/android-${sdk.version}"> | |
25 <isset property="env.ANDROID_BUILD_TOP"/> | |
26 </condition> | |
27 | |
28 <target name="init"> | 14 <target name="init"> |
29 <!-- Create the time stamp --> | 15 <!-- Create the time stamp --> |
30 <tstamp/> | 16 <tstamp/> |
31 <!-- Create the build directory structure used by compile --> | 17 <!-- Create the build directory structure used by compile --> |
32 <mkdir dir="${out.dir}"/> | 18 <mkdir dir="${out.dir}"/> |
33 <mkdir dir="${dest.dir}"/> | 19 <mkdir dir="${dest.dir}"/> |
34 </target> | 20 </target> |
35 | 21 |
36 <target name="compile" depends="init" | 22 <target name="compile" depends="init" |
37 description="compile the source " > | 23 description="compile the source " > |
38 <!-- Compile the java code from ${src} into ${build} --> | 24 <!-- Compile the java code from ${src} into ${build} --> |
39 <!-- TODO(jrg): adapting this to a proper android antfile will | 25 <!-- TODO(jrg): adapting this to a proper android antfile will |
40 remove warnings like this: | 26 remove warnings like this: |
41 base.xml:23: warning: 'includeantruntime' was not set, | 27 base.xml:23: warning: 'includeantruntime' was not set, |
42 defaulting to build.sysclasspath=last; | 28 defaulting to build.sysclasspath=last; |
43 set to false for repeatable builds | 29 set to false for repeatable builds |
44 --> | 30 --> |
45 <javac srcdir="${src}" destdir="${dest.dir}" debug="true" includeantruntime=
"false"> | 31 <javac srcdir="${src}" destdir="${dest.dir}" debug="true" includeantruntime=
"false"> |
46 <classpath> | 32 <classpath> |
47 <path location="${location.base}/android.jar"/> | 33 <path location="${ANDROID_SDK}/android.jar"/> |
48 </classpath> | 34 </classpath> |
49 </javac> | 35 </javac> |
50 </target> | 36 </target> |
51 | 37 |
52 <target name="dist" depends="compile" | 38 <target name="dist" depends="compile" |
53 description="generate the distribution" > | 39 description="generate the distribution" > |
54 <!-- Create the distribution directory --> | 40 <!-- Create the distribution directory --> |
55 <mkdir dir="${out.dir}"/> | 41 <mkdir dir="${out.dir}"/> |
56 | 42 |
57 <jar jarfile="${out.dir}/chromium_base_javatests.jar" basedir="${dest.dir}"/
> | 43 <jar jarfile="${out.dir}/chromium_base_javatests.jar" basedir="${dest.dir}"/
> |
58 </target> | 44 </target> |
59 | 45 |
60 <target name="clean" | 46 <target name="clean" |
61 description="clean up" > | 47 description="clean up" > |
62 <!-- Delete the appropriate directory trees --> | 48 <!-- Delete the appropriate directory trees --> |
63 <delete dir="${dest.dir}"/> | 49 <delete dir="${dest.dir}"/> |
64 <delete dir="${dist}"/> | 50 <delete dir="${dist}"/> |
65 </target> | 51 </target> |
66 </project> | 52 </project> |
OLD | NEW |