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
|
<?xml version="1.0"?>
<!--
HA-JDBC: High-Availability JDBC
Copyright (c) 2004-2007 Paul Ferraro
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Contact: ferraro@users.sourceforge.net
-->
<project name="ha-jdbc" default="jar-1.6" basedir=".">
<property name="src.dir" location="${basedir}/src"></property>
<property name="build.dir" location="${basedir}/build"></property>
<property name="test.dir" location="${basedir}/test"></property>
<property name="doc.dir" location="${basedir}/doc"></property>
<property name="lib.dir" location="${basedir}/lib"></property>
<property file="${src.dir}/net/sf/hajdbc/DatabaseClusterFactory.properties"></property>
<property name="test.output.dir" location="${basedir}/test-output"></property>
<property name="doc.build.dir" location="${doc.dir}/build"></property>
<property name="doc.api.dir" location="${doc.dir}/src/content/api"></property>
<property name="lib.compile.dir" location="${lib.dir}/compile"></property>
<property name="lib.runtime.dir" location="${lib.dir}/runtime"></property>
<property name="lib.test.dir" location="${lib.dir}/test"></property>
<property name="conf.dir" location="${basedir}/conf"></property>
<property name="conf.jibx.dir" location="${conf.dir}/jibx"></property>
<property name="dist.name" value="${ant.project.name}"></property>
<property name="dist.version.name" value="${dist.name}-${version}"></property>
<property name="dist-1.6.version.name" value="${dist.version.name}-jdk1.6"></property>
<property name="jar-1.6.file" location="${basedir}/${dist-1.6.version.name}.jar"></property>
<property name="dist-1.6.bin.file" location="${basedir}/${dist-1.6.version.name}-bin.tar.gz"></property>
<property name="dist.src.file" location="${basedir}/${dist.version.name}-src.tar.gz"></property>
<path id="src.classpath">
<fileset dir="${lib.dir}" includes="*.jar"></fileset>
<fileset dir="${lib.compile.dir}" includes="*.jar"></fileset>
<fileset dir="/usr/share/java" includes="jibx-run-1.2.jar"></fileset>
<fileset dir="/usr/share/java" includes="jibx-bind-1.2.jar"></fileset>
<fileset dir="/usr/share/java" includes="servlet-api-3.1.jar"></fileset>
<fileset dir="/usr/share/java" includes="bcel.jar"></fileset>
<fileset dir="/usr/share/java" includes="jgroups.jar"></fileset>
<fileset dir="/usr/share/java" includes="quartz.jar"></fileset>
<fileset dir="/usr/share/java" includes="slf4j-jdk14.jar"></fileset>
<fileset dir="/usr/share/java" includes="slf4j-jcl.jar"></fileset>
<fileset dir="/usr/share/java" includes="slf4j-log4j12.jar"></fileset>
<fileset dir="/usr/share/java" includes="slf4j-simple.jar"></fileset>
<fileset dir="/usr/share/java" includes="slf4j-api.jar"></fileset>
</path>
<path id="build.classpath">
<path refid="src.classpath"></path>
<dirset dir="${build.dir}"></dirset>
</path>
<path id="test.classpath">
<path refid="build.classpath"></path>
<dirset dir="${src.dir}"></dirset>
<dirset dir="${test.dir}"></dirset>
<fileset dir="${lib.test.dir}" includes="*.jar"></fileset>
</path>
<path id="testng.classpath">
<fileset dir="${lib.test.dir}" includes="testng-*.jar"></fileset>
</path>
<path id="jibx.classpath">
<fileset dir="/usr/share/java" includes="jibx-run-1.2.jar"></fileset>
<fileset dir="/usr/share/java" includes="jibx-bind-1.2.jar"></fileset>
</path>
<taskdef name="bind" classname="org.jibx.binding.ant.CompileTask" classpathref="jibx.classpath"></taskdef>
<target name="clean" description="Clean build artifacts">
<delete dir="${build.dir}" quiet="true"></delete>
</target>
<target name="init">
<mkdir dir="${build.dir}"/>
</target>
<target name="compile-1.6" description="Compile for Java 1.6">
<antcall target="compile">
<param name="target" value="1.6"/>
</antcall>
</target>
<target name="compile" depends="clean, init">
<javac srcdir="${src.dir}" destdir="${build.dir}" optimize="yes" debug="on" classpathref="build.classpath" source="1.6" target="${target}"></javac>
<copy todir="${build.dir}">
<fileset dir="${src.dir}" excludes="**/*.java"></fileset>
</copy>
<bind verbose="false" load="true">
<bindingfileset dir="${conf.jibx.dir}" includes="*.xml"/>
<classpath refid="build.classpath"></classpath>
</bind>
</target>
<target name="jar-1.6" depends="compile-1.6" description="Creates JAR for Java 1.6">
<echo>CLASSPATH: ${java.classpath}</echo>
<jar jarfile="${jar-1.6.file}" index="true">
<fileset dir="${build.dir}"></fileset>
<metainf dir="${conf.dir}" includes="services/*"></metainf>
</jar>
</target>
<target name="dist-1.6" depends="jar-1.6, site" description="Creates Java 1.6 binary distribution tarball">
<tar tarfile="${dist-1.6.bin.file}" compression="gzip">
<tarfileset dir="${basedir}" prefix="${dist.version.name}">
<include name="${dist-1.6.version.name}.jar"/>
<include name="*.txt"/>
</tarfileset>
<tarfileset dir="${lib.dir}" prefix="${dist.version.name}/lib" includes="**">
<exclude name="compile/**"/>
<exclude name="test/**"/>
</tarfileset>
<tarfileset dir="${doc.build.dir}/site" prefix="${dist.version.name}/doc" includes="**"></tarfileset>
</tar>
</target>
<target name="dist-src" description="Creates source distribution tarball">
<tar tarfile="${dist.src.file}" compression="gzip">
<tarfileset dir="${basedir}" prefix="${dist.version.name}">
<include name="*.xml"/>
<include name="*.txt"/>
</tarfileset>
<tarfileset dir="${src.dir}" prefix="${dist.version.name}/src" includes="**"></tarfileset>
<tarfileset dir="${test.dir}" prefix="${dist.version.name}/test" includes="**"></tarfileset>
<tarfileset dir="${lib.dir}" prefix="${dist.version.name}/lib" includes="**"></tarfileset>
<tarfileset dir="${conf.dir}" prefix="${dist.version.name}/conf" includes="**"></tarfileset>
<tarfileset dir="${doc.dir}" prefix="${dist.version.name}/doc" includes="**">
<exclude name="build/**"/>
<exclude name="src/content/api/**"/>
</tarfileset>
</tar>
</target>
<target name="javadoc" description="Generated Java API documentation">
<delete dir="${doc.api.dir}" quiet="true"></delete>
<javadoc destdir="${doc.api.dir}" classpathref="src.classpath" windowtitle="HA-JDBC ${version} API" sourcepath="${src.dir}" linksource="yes">
<link href="http://java.sun.com/javase/6/docs/api/"/>
<link href="http://www.jgroups.org/javagroupsnew/docs/javadoc/"/>
<link href="http://www.slf4j.org/api/"/>
<link href="http://www.opensymphony.com/quartz/api/"/>
</javadoc>
</target>
<target name="site" depends="javadoc" description="Generates public web site">
<delete dir="${doc.build.dir}" quiet="true"></delete>
<!-- requires Apache Forrest 0.8 -->
<ant dir="${doc.dir}" inheritall="false"></ant>
</target>
<target name="compile-tests" depends="compile-1.6" description="Compiles TestNG test suite">
<javac srcdir="${test.dir}" destdir="${build.dir}" optimize="yes" debug="on" classpathref="test.classpath" source="1.6" target="1.6"></javac>
</target>
<target name="run-tests" depends="compile-tests" description="Runs TestNG test suite">
<testng classpathref="test.classpath" verbose="2">
<xmlfileset dir="${test.dir}" includes="testng.xml"/>
</testng>
</target>
</project>
|