Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(418)

Side by Side Diff: build/android/ant/chromium-jars.xml

Issue 10914080: Make jar targets remove .class files before compile (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 for chromium_*.jars.
9 For creating a new chromium_*.jar : 9 For creating a new chromium_*.jar :
10 1. Use build/java.gypi action. 10 1. Use build/java.gypi action.
11 The jar will be created as chromium_${PACKAGE_NAME} in 11 The jar will be created as chromium_${PACKAGE_NAME} in
12 ${PRODUCT_DIR}/lib.java. 12 ${PRODUCT_DIR}/lib.java.
13 --> 13 -->
14 <description> 14 <description>
15 Building ${PROJECT_NAME}/ java source code with ant. 15 Building ${PROJECT_NAME}/ java source code with ant.
16 </description> 16 </description>
17 17
18 <import file="common.xml"/> 18 <import file="common.xml"/>
19 19
20 <path id="javac.custom.classpath"> 20 <path id="javac.custom.classpath">
21 <filelist files="${INPUT_JARS_PATHS}"/> 21 <filelist files="${INPUT_JARS_PATHS}"/>
22 <pathelement location="${ANDROID_SDK}/android.jar" /> 22 <pathelement location="${ANDROID_SDK}/android.jar" />
23 </path> 23 </path>
24 24
25 <path id="javac.srcdirs.additional"> 25 <path id="javac.srcdirs.additional">
26 <filelist files="${ADDITIONAL_SRC_DIRS}" /> 26 <filelist files="${ADDITIONAL_SRC_DIRS}" />
27 </path> 27 </path>
28 28
29 <property-value name="javac.srcdir" value="src:${toString:javac.srcdirs.additi onal}"/> 29 <property-value
30 name="javac.srcdir"
31 value="src:${toString:javac.srcdirs.additional}"
32 />
30 33
31 <property-location name="lib.dir" location="${PRODUCT_DIR}/lib.java" 34 <property-location
32 check-exists="false"/> 35 name="lib.dir"
33 <property-location name="dest.dir" location="${PRODUCT_DIR}/java/${PACKAGE_NAM E}" 36 location="${PRODUCT_DIR}/lib.java"
34 check-exists="false"/> 37 check-exists="false"
38 />
39
40 <property-location
41 name="dest.dir"
42 location="${PRODUCT_DIR}/java/${PACKAGE_NAME}"
43 check-exists="false"
44 />
35 45
36 <target name="init"> 46 <target name="init">
37 <!-- Create the time stamp --> 47 <!-- Create the time stamp -->
38 <tstamp/> 48 <tstamp/>
39 <!-- Create the build directory structure used by compile --> 49 <!-- Create the build directory structure used by compile -->
40 <mkdir dir="${lib.dir}"/> 50 <mkdir dir="${lib.dir}"/>
41 <mkdir dir="${dest.dir}"/> 51 <mkdir dir="${dest.dir}"/>
52
53 <!-- Remove all .class files from dest.dir. This prevents inclusion of
54 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
56 .java from previous builds.
57 -->
58 <delete>
59 <fileset dir="${dest.dir}" includes="**/*.class"/>
60 </delete>
42 </target> 61 </target>
43 62
44 <target name="compile" depends="init" description="Compiles source." > 63 <target name="compile" depends="init" description="Compiles source." >
45 <fail message="Error: javac.custom.classpath is not set. Please set it to 64 <fail message="Error: javac.custom.classpath is not set. Please set it to
46 classpath for javac."> 65 classpath for javac.">
47 <condition> 66 <condition>
48 <not><isreference refid="javac.custom.classpath"/></not> 67 <not><isreference refid="javac.custom.classpath"/></not>
49 </condition> 68 </condition>
50 </fail> 69 </fail>
51 70
52 <echo>Compiling ${javac.srcdir}, classpath: ${toString:javac.custom.classpat h}</echo> 71 <echo>
72 Compiling ${javac.srcdir}, classpath: ${toString:javac.custom.classpath}
73 </echo>
53 74
54 <javac 75 <javac
55 srcdir="${javac.srcdir}" 76 srcdir="${javac.srcdir}"
56 destdir="${dest.dir}" 77 destdir="${dest.dir}"
57 classpathref="javac.custom.classpath" 78 classpathref="javac.custom.classpath"
58 debug="true" 79 debug="true"
59 includeantruntime="false" 80 includeantruntime="false"
60 /> 81 />
61 </target> 82 </target>
62 83
63 <target name="dist" depends="compile" 84 <target name="dist" depends="compile"
64 description="Generate chromium_${PACKAGE_NAME}.jar."> 85 description="Generate chromium_${PACKAGE_NAME}.jar.">
65 <!-- Create the distribution directory --> 86 <!-- Create the distribution directory -->
66 <mkdir dir="${lib.dir}" /> 87 <jar
67 <jar jarfile="${lib.dir}/chromium_${PACKAGE_NAME}.jar" basedir="${dest.dir}" /> 88 jarfile="${lib.dir}/chromium_${PACKAGE_NAME}.jar"
89 basedir="${dest.dir}"
90 />
68 91
69 <!-- If Gyp thinks this output is stale but Ant doesn't, the modification 92 <!-- If Gyp thinks this output is stale but Ant doesn't, the modification
70 time should still be updated. Otherwise, this target will continue to 93 time should still be updated. Otherwise, this target will continue to
71 be rebuilt in future builds. 94 be rebuilt in future builds.
72 --> 95 -->
73 <touch file="${lib.dir}/chromium_${PACKAGE_NAME}.jar"/> 96 <touch file="${lib.dir}/chromium_${PACKAGE_NAME}.jar"/>
74 </target> 97 </target>
75 98
76 <target name="clean" description="clean up"> 99 <target name="clean" description="clean up">
77 <!-- Delete the appropriate directory trees --> 100 <!-- Delete the appropriate directory trees -->
78 <delete dir="${dest.dir}" /> 101 <delete dir="${dest.dir}" />
79 </target> 102 </target>
80 </project> 103 </project>
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698