-- putting auto-commit to 'update' command as well
[bkell-clj.git] / build.xml
blob683a13b3f99f813058e048ea9619368639794e25
2 <project name="bkell-clj" default="usage" basedir=".">
3         
4         
5     <property name="ant.build.javac.target" value="1.5" />
6         
7     
8         <path id="bookkeeping.classpath">
9                 <pathelement path="${dir.build}/gen" />
10                 <pathelement path="${dir.build}/src" />
11                 <pathelement path="${dir.build}/test" />
12                 <pathelement path="lib/" />
13                 <pathelement path="xml/" />
14                 <pathelement path="xml/http/" />
15                 <pathelement path="test/xml/" />
16                 <pathelement path="test/xml/http/" />
17                 <pathelement path="." />
18                 <fileset dir="lib">
19                     <include name="**/*.jar" />
20                     <include name="**/*.properties"/>
21                 </fileset>
22                 <fileset dir="${java.home}/lib" >
23                     <include name="**/*.jar"/>
24                 </fileset>
25         </path>
26         
27         
28     
29     <!-- =============================== -->
30     <!-- TASK DEFINITIONS               -->
31     <!-- =============================== -->
32     <taskdef name="if" classpathref="bookkeeping.classpath" classname="ise.antelope.tasks.IfTask"/>
33     <taskdef name="sablecc" classpathref="bookkeeping.classpath" classname="org.sablecc.ant.taskdef.Sablecc"/>
36     <!-- =============================== -->
37     <!-- INITIALIZE THE BUILD PROCESS    -->
38     <!-- =============================== -->
39     <target name="init" >
40                 <loadproperties srcFile="build.properties" />
41     </target>
44     
45     
46     <!-- =============================== -->
47     <!-- COMPILE targets                 -->
48     <!-- =============================== -->
49     <target name="compile-all" depends="init,compile-src"/>
50         
51     <target name="compile-src" depends="init,compile-gen">
52                 
53                 <echo message="COMPILING JAVA SOURCE"/>
54                 <mkdir dir="${dir.build}/src"/>
55                 
56                 <javac srcdir="${dir.src}" destdir="${dir.build}/src" debug="true" fork="yes" >
57                         
58                         <classpath>
59                                 <pathelement path="${dir.build}/test" />
60                                 <pathelement path="${dir.build}/gen" />
61                                 <pathelement path="${dir.build}/src" />
62                                 <pathelement path="xml" />
63                                 <fileset dir="${java.home}/lib" >
64                                         <include name="**/*.jar"/>
65                                 </fileset>
66                                 <fileset dir="lib">
67                                         <include name="**/*.jar" />
68                                         <include name="**/*.properties"/>
69                                 </fileset>
70                         </classpath>
71                 </javac>
72                 
73     </target>
74         
75     <target name="compile-gen" depends="init,run-cc">
76                 
77         
78                 <!-- copy over Token with a toString() that doesn't add extra stuff 
79                 <copy todir="gen/com/interrupt/bookkeeping/cc/node/" overwrite="true"> 
80                         <fileset file="src/com/interrupt/bookkeeping/cc/node/Token.java" /> 
81                 </copy> 
82                -->
83                 
84                 <echo message="COMPILING GEN SOURCE"/>
85                 <mkdir dir="${dir.build}/gen"/>
86                 <javac srcdir="gen" destdir="${dir.build}/gen" fork="yes" debug="true" deprecation="on" >
87                         
88                         <classpath>
89                                 <pathelement path="${dir.build}/src" />
90                                 <pathelement path="${dir.build}/test" />
91                                 <fileset dir="${java.home}/lib" >
92                                     <include name="**/*.jar"/>
93                                 </fileset>
94                                 <fileset dir="lib">
95                                     <include name="**/*.jar" />
96                                     <include name="**/*.properties"/>
97                                 </fileset>
98                     </classpath>
99                 </javac>
100                 
101                 
102                 <!-- copy over SableCC dat files -->
103                 <copy todir="${dir.build}/gen" > 
104                         <fileset dir="gen" includes="**/*.dat" />
105                 </copy> 
106                 
107     </target>
108     
109         
110         <target name="run-cc" depends="init"> 
111                 
112                <available file="gen/com/interrupt/bookkeeping/cc/analysis" property="ccExists" />
113                 <if name="ccExists">
114                         
115                     <else>
116                         <mkdir dir="gen" />
117                         <sablecc src="etc/cc" outputdirectory="gen" includes="*.cc" />
118                         
119                         <!-- need to hack the lexer code and there's no easy way to sub-type -->
120                         <copy todir="gen/com/interrupt/bookkeeping/cc/lexer/" overwrite="true"> 
121                                 <fileset file="gen/Lexer.java" /> 
122                         </copy> 
123                                 
124                     </else>
125                 </if>
126         </target>
127         
128         
129 </project>