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
|
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="compile" name="jtds">
<path id="libs">
<fileset dir="lib" includes="*.jar"/>
</path>
<target name="init">
<tstamp/>
<property name="build" value="build"/>
<property name="compiler" value="/jdk1.4/bin/javac"/>
<property name="build.compiler" value="modern"/>
<property name="javac.debug" value="on"/>
<property name="javac.optimize" value="on"/>
<property name="src" value="src"/>
<property name="dist" value="dist"/>
<property name="test" value="test"/>
<property name="version" value="1.2.5"/>
</target>
<target name="clean" depends="init">
<delete dir="${build}"/>
<delete dir="${dist}"/>
</target>
<target name="prepare" depends="init">
<mkdir dir="${build}"/>
<mkdir dir="${build}/classes"/>
<mkdir dir="${build}/src"/>
<copy todir="${build}/src">
<fileset dir="${src}/main" includes="**/*.java">
<exclude name="**/SocketFactories.java"/>
</fileset>
<filterchain>
<!-- only SUN SSL implementation available -->
<replaceregex byline="on" pattern="SocketFactories.getSocketFactory" replace="SocketFactoriesSUN.getSocketFactory"/>
<!-- cut off JDBC 4 stuff -->
<replaceregex byline="off" flags="s" pattern=" *//* JDBC4.*" replace="}"/>
</filterchain>
</copy>
<copy todir="${build}/src">
<fileset dir="${src}/test" includes="**/*.java">
<exclude name="**/GenKeyTest.java"/>
<exclude name="**/JDBC3Test.java"/>
<exclude name="**/LargeLOBTest.java"/>
<exclude name="**/LOBTest.java"/>
<exclude name="**/SavepointTest.java"/>
<exclude name="**/CallableStatementJDBC3Test.java"/>
<exclude name="**/DatabaseMetaDataJDBC3Test.java"/>
<exclude name="**/ConnectionJDBC3Test.java"/>
</fileset>
</copy>
<copy todir="${build}/classes">
<fileset dir="${src}/main" includes="**/*.properties"/>
</copy>
</target>
<target name="compile" depends="init,prepare">
<javac fork="on" executable="${compiler}" includeantruntime="no" includejavaruntime="no" destdir="${build}/classes" srcdir="${build}/src" classpathref="libs" debug="${javac.debug}" optimize="${javac.optimize}" source="1.3" target="1.3" encoding="latin1"/>
</target>
<target name="javadoc" depends="prepare">
<mkdir dir="${build}/doc"/>
<javadoc sourcepath="${build}/src" destdir="${build}/doc" packagenames="net.sourceforge.jtds.*" Author="true"
Doctitle="jTDS API Documentation" Use="true" Version="true" bottom="Generated on ${TODAY}"
Windowtitle="jTDS API" Private="true" classpathref="libs" encoding="latin1">
<tag name="todo" description="To do:"/>
<tag name="created" description="Created:"/>
</javadoc>
</target>
<target name="test" depends="compile">
<taskdef name="junit" classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask"/>
<junit fork="no" haltonfailure="no" printsummary="yes">
<classpath>
<pathelement location="build/classes"/>
<path refid="libs"/>
</classpath>
<formatter type="plain"/>
<batchtest>
<fileset dir="${build}/src">
<include name="**/*Test.java"/>
<exclude name="**/AllTests.java"/>
</fileset>
</batchtest>
</junit>
</target>
<target name="dist" depends="clean,compile,javadoc">
<mkdir dir="${dist}"/>
<!-- Runtime jar -->
<jar basedir="${build}/classes"
excludes="net/sourceforge/jtds/test/*.class"
includes="**/*"
jarfile="${build}/${ant.project.name}-${version}.jar">
<manifest>
<attribute name="Implementation-Title" value="jTDS JDBC Driver"/>
<attribute name="Implementation-Version" value="${version}"/>
<attribute name="Implementation-URL" value="http://jtds.sourceforge.net"/>
<attribute name="Specification-Title" value="JDBC"/>
<attribute name="Specification-Version" value="3.0"/>
<attribute name="Class-Path" value="jcifs.jar"/>
<attribute name="Main-Class" value="net.sourceforge.jtds.jdbc.Driver"/>
</manifest>
</jar>
<!-- Source package -->
<copy todir="${dist}/tmp/doc">
<fileset dir="${build}/doc" includes="**/*"/>
</copy>
<mkdir dir="${dist}/tmp"/>
<copy todir="${dist}/tmp">
<fileset dir="." includes="README,README.SSL,README.XA,README.SSO,CHANGELOG,LICENSE,*.bat,*.sh,*.xml,src/**/*,lib/**/*,html/**/*,conf/**/*.xml,conf/**/*.tmpl"/>
</copy>
<zip basedir="${dist}/tmp" includes="**/*" zipfile="${dist}/${ant.project.name}-${version}-src.zip"/>
<delete dir="${dist}/tmp"/>
<!-- Binary package -->
<mkdir dir="${dist}/tmp"/>
<copy todir="${dist}/tmp">
<fileset dir="." includes="README,README.SSL,README.XA,README.SSO,CHANGELOG,LICENSE,conf/**/*.xml,conf/**/*.tmpl,html/**/*"/>
<fileset dir="${build}" includes="*.jar"/>
</copy>
<mkdir dir="${dist}/tmp/x86/XA"/>
<copy todir="${dist}/tmp/x86/XA">
<fileset dir="lib/x86/XA" includes="JtdsXA.dll"/>
<fileset dir="src/XA" includes="*.sql"/>
</copy>
<mkdir dir="${dist}/tmp/x86/SSO"/>
<copy todir="${dist}/tmp/x86/SSO">
<fileset dir="lib/x86/SSO" includes="ntlmauth.dll"/>
</copy>
<mkdir dir="${dist}/tmp/x64/SSO"/>
<copy todir="${dist}/tmp/x64/SSO">
<fileset dir="lib/x64/SSO" includes="ntlmauth.dll"/>
</copy>
<mkdir dir="${dist}/tmp/IA64/SSO"/>
<copy todir="${dist}/tmp/IA64/SSO">
<fileset dir="lib/IA64/SSO" includes="ntlmauth.dll"/>
</copy>
<zip basedir="${dist}/tmp" includes="**/*" zipfile="${dist}/${ant.project.name}-${version}-dist.zip"/>
<delete dir="${dist}/tmp"/>
</target>
</project>
|