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