Added README file
[metux-java.git] / build.xml
blob9dd2f1044a86e838ce2767f28cf32db93729ec50
1 <project name="metux-java" default="all" basedir=".">
2     <property environment="env" />
3     <property name="src"             value="."              />
4     <property name="build"           value=".build"         />
5     <property name="build-lib"       value="${build}/lib"   />
6     <property name="build-tests"     value="${build}/tests" />
7     <property name="jarfile"         value="${build}/metux-java.jar" />
8     <property name="jar_install_dir" value="${env.HOME}/.jar"   />
10     <target name="compile-lib-util">
11         <mkdir dir="${build-lib}" />
12         <javac destdir="${build-lib}" srcdir="${src}/util" debug="on" classpath=".">
13             <include name="CachedDatasource.java"/>
14             <include name="CmdLineSplitter.java"/>
15             <include name="Depend.java"/>
16             <include name="Environment.java"/>
17             <include name="Exec.java"/>
18             <include name="Filename.java"/>
19             <include name="FileOps.java"/>
20             <include name="FileStock.java"/>
21             <include name="HTMLEntities.java"/>
22             <include name="LoadFile.java"/>
23             <include name="PathNormalize.java"/>
24             <include name="PathNormalizer.java"/>
25             <include name="ShellEscape.java"/>
26             <include name="ShellVariableDef.java"/>
27             <include name="SimpleSMTPClient.java"/> 
28             <include name="StoreFile.java"/>
29             <include name="StrReplace.java"/>
30             <include name="StrSplit.java"/>
31             <include name="StrUtil.java"/>
32             <include name="Stringtable.java"/>
33             <include name="Terminal.java"/>
34             <include name="TextDB.java"/>
35             <include name="TextTable.java"/>
36             <include name="URLDownloader.java"/>
37             <include name="URLEncode.java"/>
38             <include name="UniqueNameList.java"/>
39             <include name="UniqueValues.java"/>
40             <include name="VFile.java"/>
41             <include name="Version.java"/>
42             <include name="VersionStack.java"/>
43             <include name="mkdir.java"/>
44             <include name="rm.java"/>
45             <include name="SQL_Encode.java"/>
46         </javac>
47     </target>
49     <target name="compile-lib-log" depends="compile-lib-util">
50         <mkdir dir="${build-lib}" />
51         <javac destdir="${build-lib}" srcdir="${src}/log" debug="on" classpath="${build-lib}">
52             <include name="LoggerDummy.java"/>
53             <include name="ILogger.java"/>
54             <include name="LoggerASCII.java"/>
55             <include name="LoglevelID.java"/>
56             <include name="LoggerTerm.java"/>
57         </javac>
58     </target>
60     <target name="compile-lib-propertylist" depends="compile-lib-util">
61         <mkdir dir="${build-lib}" />
62         <javac destdir="${build-lib}" srcdir="${src}/propertylist" debug="on" classpath="${build-lib}">
63             <include name="EProcessingError.java"/>
64             <include name="FallbackPropertylist.java"/>
65             <include name="EVariableParseError.java"/>
66             <include name="EVariableNull.java"/>
67             <include name="EVariableEmpty.java"/>
68             <include name="IPropertylist.java"/>
69             <include name="Propertylist.java"/>
70             <include name="EBrokenBoolRepresentation.java"/>
71             <include name="IPostprocessor.java"/>
72             <include name="EInfiniteRecursion.java"/>
73             <include name="EIllegalValue.java"/>
74         </javac>
75     </target>
77     <target name="compile-lib-datasource" depends="compile-lib-util">
78         <mkdir dir="${build-lib}" />
79         <javac destdir="${build-lib}" srcdir="${src}/datasource" debug="on" classpath="${build-lib}">
80             <include name="TextTable.java"/>
81             <include name="TextTable_List.java" />
82             <include name="Cached_TextTable_Loader.java"/>
83         </javac>
84     </target>
86     <target name="compile-tests" depends="link-lib,compile-lib-util,compile-lib-log,compile-lib-propertylist">
87         <mkdir dir="${build-tests}" />
88         <javac destdir="${build-tests}" srcdir="${src}/tests" debug="on" classpath="${jarfile}">
89             <include name="_test_util.java"/>
90             <include name="_test_log.java"/>
91         </javac>
92     </target>
94     <target name="link-lib" depends="compile-lib">
95         <jar jarfile="${jarfile}" basedir="${build-lib}"/>
96     </target>
98     <target name="run-tests" depends="compile-tests">
99         <java classname="_test_util" classpath="${jarfile}:${build-tests}" /> 
100         <java classname="_test_log" classpath="${jarfile}:${build-tests}" />
101     </target>
103     <target name="compile-lib" depends="compile-lib-util,compile-lib-datasource,compile-lib-log,compile-lib-propertylist" />
105     <target name="compile" depends="compile-lib" />
106     <target name="all"     depends="compile,run-tests" />
108     <target name="clean">
109         <delete dir="${build-tests}" />
110         <delete dir="${build-lib}"   />
111         <delete dir="${build}"       />
112         <delete file="${jarfile}"    />
113     </target>
115     <target name="install" depends="compile,run-tests">
116         <mkdir dir="${jar_install_dir}" />
117         <copy file="${jarfile}" todir="${jar_install_dir}" />
118     </target>
119 </project>