1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200
|
<?xml version="1.0" encoding="UTF-8"?>
<!-- =====================================================================
Build file for CsvJdbc. Built using Ant 1.6.1
Authors: Jonathan Ackerman, Michael Maraya
CsvJdbc - a JDBC driver for CSV files
Copyright (C) 2001 Jonathan Ackerman
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
====================================================================== -->
<project name="CsvJdbc" default="main">
<description>
Jakarta-Ant build file for CSVJDBC
</description>
<!-- =================================================================== -->
<!-- Project-wide properties and paths -->
<!-- =================================================================== -->
<property name="TALK" value="false" />
<property name="name" value="csvjdbc"/>
<property name="rel" value="1.0-36"/>
<property name="rel.name" value="${name}-${rel}"/>
<property name="build.dir" value="../build"/>
<property name="src.dir" value="../src"/>
<property name="java.dir" value="${src.dir}/main/java"/>
<property name="javacc.dir" value="${src.dir}/main/javacc"/>
<property name="javacc.home" value="/opt/javacc"/>
<property name="resources.dir" value="${src.dir}/main/resources"/>
<property name="test.java.dir" value="${src.dir}/test/java"/>
<property name="doc.dir" value="${src.dir}/doc"/>
<property name="lib.dir" value="../lib"/>
<property name="class.dir" value="../target/classes"/>
<property name="test.class.dir" value="../target/test-classes"/>
<property name="javadoc.dir" value="../javadoc"/>
<property name="rel.dir" value="../target"/>
<property name="junit.dir" value="/usr/share/java"/>
<property name="jar.file" value="${rel.dir}/${rel.name}.jar"/>
<property name="test.reports" value="../reports" />
<path id="classpath">
<pathelement path="."/>
<pathelement path="${class.dir}"/>
<fileset dir="${lib.dir}">
<include name="**/*.jar"/>
</fileset>
</path>
<path id="test.classpath">
<path refid="classpath"/>
<fileset dir="${junit.dir}" erroronmissingdir="false">
<include name="junit*.jar"/>
</fileset>
<pathelement path="${class.dir}"/>
<pathelement path="${test.class.dir}"/>
</path>
<!-- =================================================================== -->
<!-- Initialization target -->
<!-- =================================================================== -->
<target name="init">
<mkdir dir="${test.class.dir}"/>
<mkdir dir="${class.dir}"/>
<mkdir dir="${javadoc.dir}"/>
<mkdir dir="${rel.dir}"/>
</target>
<!-- =================================================================== -->
<!-- Main target -->
<!-- =================================================================== -->
<target name="main" depends="init">
<echo message="Build File for ${name} Release ${rel}"/>
<echo message=""/>
<echo message="Targets are:"/>
<echo message=""/>
<echo message=" clean - Cleans project for fresh build"/>
<echo message=" compile - Compiles all code"/>
<echo message=" jar - Creates the jar file for the system"/>
<echo message=" javadoc - Builds the javadoc for the system"/>
<echo message=" release - Builds a release of the system"/>
<echo message=" test - Creates and runs the test programs. See lib\readme.txt"/>
</target>
<!-- =================================================================== -->
<!-- Compile target -->
<!-- =================================================================== -->
<target name="compile" depends="init" description="Compiles all code">
<javacc target="${javacc.dir}/org/relique/jdbc/csv/where.jj" javacchome="${javacc.home}"/>
<javac srcdir="${java.dir}${path.separator}${javacc.dir}" destdir="${class.dir}">
<classpath refid="classpath"/>
<include name="org/**/*.java"/>
</javac>
<copy todir="${class.dir}">
<fileset dir="${resources.dir}" includes="org/**/*.properties"/>
</copy>
</target>
<!-- =================================================================== -->
<!-- Jar target -->
<!-- =================================================================== -->
<target name="jar" depends="compile"
description="Creates the jar file for the system">
<manifest file="manifest">
<!-- For running CsvJdbc as a utility program -->
<attribute name="Main-Class" value="org.relique.jdbc.csv.CsvMain"/>
</manifest>
<jar jarfile="${jar.file}" manifest="manifest">
<fileset dir="${class.dir}" includes="org/**/*.class"/>
<!-- For java.sql.DriverManager Service Provider mechanism -->
<service type="java.sql.Driver" provider="org.relique.jdbc.csv.CsvDriver"/>
<fileset dir="${resources.dir}" includes="org/**/*.properties"/>
</jar>
</target>
<!-- =================================================================== -->
<!-- Javadoc target -->
<!-- =================================================================== -->
<target name="javadoc" depends="init"
description="Builds the javadoc for the system">
<javadoc packagenames="org.*"
sourcepath="${java.dir}"
destdir="${javadoc.dir}"
author="true"
version="true"
private="true"
doctitle="${name} java documentation (release ${rel})"
windowtitle="${name} java documentation (release ${rel})"
bottom="Check out <a href="http://csvjdbc.sourceforge.net">http://csvjdbc.sourceforge.net</a> for more info.">
<classpath refid="classpath"/>
</javadoc>
</target>
<!-- =================================================================== -->
<!-- Clean target -->
<!-- =================================================================== -->
<target name="clean" description="Cleans project for fresh build">
<delete dir="${test.class.dir}"/>
<delete dir="${class.dir}"/>
<delete dir="${javadoc.dir}"/>
<delete dir="${rel.dir}"/>
<delete dir="${javacc.dir}" includes="org/**/*.java"/>
<delete file="manifest"/>
</target>
<!-- =================================================================== -->
<!-- Test target -->
<!-- =================================================================== -->
<target name="test" depends="compile"
description="Creates and runs the test programs. See lib\readme.txt">
<mkdir dir="${test.reports}"/>
<javac srcdir="${test.java.dir}" destdir="${test.class.dir}">
<classpath refid="test.classpath" />
<include name="**/*.java" />
</javac>
<junit fork="yes" printsummary="no" haltonfailure="no">
<formatter type="xml" />
<classpath refid="test.classpath" />
<batchtest fork="yes" todir="${test.reports}" >
<fileset dir="${test.class.dir}">
<include name="**/Test*.class" />
</fileset>
</batchtest>
</junit>
</target>
<!-- =================================================================== -->
<!-- Release target -->
<!-- =================================================================== -->
<target name="release" depends="clean,test,jar,javadoc"
description="Builds a release of the system">
<zip zipfile="${rel.dir}/${rel.name}.zip">
<zipfileset dir="${javadoc.dir}" includes="**/*"
prefix="${rel.name}/javadoc"/>
<zipfileset dir="${src.dir}" includes="**/*"
prefix="${rel.name}/src/src"/>
<zipfileset dir="${build.dir}" includes="build.xml"
prefix="${rel.name}/src/build"/>
<zipfileset dir="${lib.dir}" includes="readme.txt"
prefix="${rel.name}/src/lib"/>
<zipfileset dir="${rel.dir}" includes="*.jar" prefix="${rel.name}"/>
<zipfileset dir="${doc.dir}" includes="**" excludes="*.gif" prefix="${rel.name}"/>
</zip>
</target>
</project>
|