Added a line to remove the Jar file in the cleanall target.
[people/mcb30/edk2.git] / edk2 / Tools / Source / Cpptasks / build.xml
1 <?xml version="1.0"?>\r
2 <!--\r
3 Copyright (c) 2006, Intel Corporation\r
4 All rights reserved. This program and the accompanying materials\r
5 are licensed and made available under the terms and conditions of the BSD License\r
6 which accompanies this distribution.  The full text of the license may be found at\r
7 http://opensource.org/licenses/bsd-license.php\r
8 \r
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
11 -->\r
12 <project name="CppTasks" default="all" basedir=".">\r
13   <taskdef resource="net/sf/antcontrib/antlib.xml"/>\r
14   <property environment="env"/>\r
15   <property name="workspace" value="${env.WORKSPACE}"/>\r
16   <property name="buildDir" value="build"/>\r
17   <property name="installLocation" value="${workspace}/Tools/Jars"/>\r
18   <target name="all" depends="install"/>\r
19   <target name="init">\r
20     <uptodate property="jar.newer" targetfile="${installLocation}/cpptasks.jar">\r
21       <srcfiles dir="net" includes="**"/>\r
22     </uptodate>\r
23   </target>\r
24   <target name="source" depends="init" unless="jar.newer">\r
25     <mkdir dir="${buildDir}"/>\r
26     <javac srcdir="net" destdir="${buildDir}">\r
27       <classpath>\r
28         <fileset dir="${workspace}/Tools/Jars">\r
29           <include name="*.jar"/>\r
30         </fileset>\r
31       </classpath>\r
32     </javac>\r
33   </target>\r
34   <target name="clean">\r
35     <delete dir="${buildDir}"/>\r
36   </target>\r
37   <target name="cleanall">\r
38     <delete dir="${buildDir}"/>\r
39     <delete file="${installLocation}/cpptasks.jar"/>\r
40     <if>\r
41       <available file="${installLocation}/cpptasks.jar"/>\r
42       <then>\r
43         <echo message="You must manually remove the file: ${installLocation}/cpptasks.jar"/>\r
44         <echo message="Java has already loaded the file, and cannot remove it within ANT!"/>\r
45       </then>\r
46     </if>\r
47   </target>\r
48   <target name="install" depends="source" unless="jar.newer">\r
49     <copy file="cpptasks.tasks" toDir="${buildDir}"/>\r
50     <copy file="cpptasks.types" toDir="${buildDir}"/>\r
51     <jar destfile="${installLocation}/cpptasks.jar"\r
52       basedir="${buildDir}"\r
53       includes="**"\r
54     />\r
55   </target>\r
56 </project>\r