2003-01-15 01:33:52 +01:00
|
|
|
<?xml version="1.0"?>
|
|
|
|
|
|
|
|
<!-- Smack Build Script ========================================== -->
|
|
|
|
<!-- Jive Software ============================================== -->
|
|
|
|
|
|
|
|
<!--
|
|
|
|
$RCSfile$
|
|
|
|
$Revision$
|
|
|
|
$Date$
|
|
|
|
-->
|
|
|
|
|
|
|
|
<project name="Smack" default="all" basedir="..">
|
2003-01-20 16:57:33 +01:00
|
|
|
|
2003-08-19 19:44:45 +02:00
|
|
|
<!-- TASKDEFS -->
|
|
|
|
<!-- ======================================================================================= -->
|
|
|
|
<!-- ======================================================================================= -->
|
|
|
|
|
|
|
|
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
|
|
|
|
<classpath>
|
|
|
|
<pathelement location="${basedir}/build/ant-contrib.jar"/>
|
|
|
|
</classpath>
|
|
|
|
</taskdef>
|
|
|
|
|
2003-01-20 16:57:33 +01:00
|
|
|
<!-- PROPERTIES -->
|
|
|
|
<!-- ======================================================================================= -->
|
|
|
|
|
2006-07-17 10:39:08 +02:00
|
|
|
<!-- Smack Version -->
|
|
|
|
<property name="version.major" value="3" />
|
|
|
|
<property name="version.minor" value="0" />
|
|
|
|
<property name="version.revision" value="0" />
|
2007-02-14 02:56:49 +01:00
|
|
|
<property name="version.extra" value="beta2" />
|
2007-02-04 22:24:51 +01:00
|
|
|
|
|
|
|
<if>
|
|
|
|
<equals arg1="${version.extra}" arg2=""/>
|
|
|
|
<then>
|
2007-02-05 19:38:37 +01:00
|
|
|
<property name="version"
|
2007-02-04 22:24:51 +01:00
|
|
|
value="${version.major}.${version.minor}.${version.revision}"/>
|
2007-02-05 19:38:37 +01:00
|
|
|
<property name="version.filename"
|
|
|
|
value="${version.major}_${version.minor}_${version.revision}"/>
|
2007-02-04 22:24:51 +01:00
|
|
|
</then>
|
|
|
|
<else>
|
2007-02-05 19:38:37 +01:00
|
|
|
<property name="version"
|
2007-02-04 22:24:51 +01:00
|
|
|
value="${version.major}.${version.minor}.${version.revision}.${version.extra}"/>
|
2007-02-05 19:38:37 +01:00
|
|
|
<property name="version.filename"
|
|
|
|
value="${version.major}_${version.minor}_${version.revision}_${version.extra}"/>
|
2007-02-04 22:24:51 +01:00
|
|
|
</else>
|
|
|
|
</if>
|
|
|
|
<tstamp>
|
|
|
|
<format property="builddate" pattern="MM/dd/yyyy"/>
|
|
|
|
</tstamp>
|
2003-08-19 19:44:45 +02:00
|
|
|
|
2006-07-17 10:39:08 +02:00
|
|
|
<property file="${basedir}/build/build.properties" />
|
2007-01-08 00:03:16 +01:00
|
|
|
<property name="compile.dir" value="${basedir}/target/classes" />
|
|
|
|
<property name="compile.test.dir" value="${basedir}/target/classes-test" />
|
|
|
|
<property name="jar.dest.dir" value="${basedir}/target" />
|
|
|
|
<property name="javadoc.dest.dir" value="${basedir}/target/javadoc" />
|
2003-01-24 03:44:25 +01:00
|
|
|
<property name="merge.lib.dir" value="${basedir}/build/merge" />
|
2005-10-22 02:51:17 +02:00
|
|
|
<property name="test.dir" value="${basedir}/test" />
|
|
|
|
<property name="resources.dir" value="${basedir}/build/resources" />
|
2007-02-20 18:50:29 +01:00
|
|
|
<property name="jingle.extension.merge.lib.dir" value="${basedir}/jingle/extension/build/merge" />
|
2003-01-20 16:57:33 +01:00
|
|
|
|
2003-08-19 19:44:45 +02:00
|
|
|
<!-- Test props - override these defaults in the properties file or in command line -->
|
|
|
|
<property name="test.host" value="localhost" />
|
|
|
|
<property name="test.port" value="5222" />
|
|
|
|
<property name="test.admin.username" value="admin" />
|
|
|
|
<property name="test.admin.password" value="admin" />
|
|
|
|
<property name="test.admin.resource" value="Test" />
|
|
|
|
<property name="test.smack.debug" value="false" />
|
|
|
|
|
|
|
|
<!-- PATHS, DEPENDIENCIES, PATTERNS -->
|
|
|
|
<!-- ======================================================================================= -->
|
|
|
|
<!-- ======================================================================================= -->
|
|
|
|
|
|
|
|
<patternset id="test.cases">
|
|
|
|
<include name="org/jivesoftware/smack/**/*Test.java" />
|
|
|
|
<exclude name="org/jivesoftware/smack/**/Messenger*Test.java" />
|
|
|
|
</patternset>
|
|
|
|
|
|
|
|
<patternset id="messenger.test.cases">
|
|
|
|
<include name="org/jivesoftware/smack/**/Messenger*Test.java" />
|
|
|
|
</patternset>
|
|
|
|
|
2003-01-15 01:33:52 +01:00
|
|
|
<!-- TARGETS -->
|
|
|
|
<!-- ======================================================================================= -->
|
|
|
|
|
|
|
|
<!-- all -->
|
|
|
|
<!-- ======================================================================================= -->
|
|
|
|
<target name="all" depends="jar" description="Calls 'jar' target by default">
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<!-- compile -->
|
|
|
|
<!-- ======================================================================================= -->
|
2003-01-20 16:57:33 +01:00
|
|
|
<target name="compile" description="Compiles all source to ${compile.dir}.">
|
2003-01-15 01:33:52 +01:00
|
|
|
<!-- make target dir -->
|
|
|
|
<mkdir dir="${compile.dir}" />
|
|
|
|
<javac
|
|
|
|
destdir="${compile.dir}"
|
|
|
|
includeAntRuntime="no"
|
|
|
|
debug="on"
|
2006-07-17 10:39:08 +02:00
|
|
|
source="1.5"
|
|
|
|
target="1.5"
|
2003-01-15 01:33:52 +01:00
|
|
|
>
|
|
|
|
<src path="${basedir}/source" />
|
|
|
|
<classpath>
|
2003-01-24 03:44:25 +01:00
|
|
|
<fileset dir="${merge.lib.dir}">
|
|
|
|
<include name="*.jar"/>
|
2003-01-15 01:33:52 +01:00
|
|
|
</fileset>
|
|
|
|
</classpath>
|
2007-02-20 18:50:29 +01:00
|
|
|
</javac>
|
|
|
|
<mkdir dir="${compile.dir}/jingle/extension" />
|
|
|
|
<javac
|
|
|
|
destdir="${compile.dir}/jingle/extension"
|
|
|
|
includeAntRuntime="no"
|
|
|
|
debug="on"
|
|
|
|
source="1.5"
|
|
|
|
target="1.5"
|
|
|
|
>
|
|
|
|
<src path="${basedir}/jingle/extension/source" />
|
|
|
|
<classpath>
|
|
|
|
<fileset dir="${merge.lib.dir}">
|
|
|
|
<include name="*.jar"/>
|
|
|
|
</fileset>
|
|
|
|
<fileset dir="${basedir}/jingle/extension/build/merge">
|
|
|
|
<include name="*.jar"/>
|
|
|
|
</fileset>
|
|
|
|
<pathelement path="${compile.dir}"/>
|
|
|
|
</classpath>
|
|
|
|
</javac>
|
|
|
|
<mkdir dir="${compile.dir}/jingle/media" />
|
|
|
|
<javac
|
|
|
|
destdir="${compile.dir}/jingle/media"
|
|
|
|
includeAntRuntime="no"
|
|
|
|
debug="on"
|
|
|
|
source="1.5"
|
|
|
|
target="1.5"
|
|
|
|
>
|
|
|
|
<src path="${basedir}/jingle/media/source" />
|
|
|
|
<classpath>
|
|
|
|
<fileset dir="${merge.lib.dir}">
|
|
|
|
<include name="*.jar"/>
|
|
|
|
</fileset>
|
|
|
|
<fileset dir="${basedir}/jingle/media/build/lib">
|
|
|
|
<include name="*.jar"/>
|
|
|
|
</fileset>
|
|
|
|
<pathelement path="${compile.dir}"/>
|
|
|
|
<pathelement path="${compile.dir}/jingle/extension"/>
|
|
|
|
</classpath>
|
|
|
|
</javac>
|
2003-01-15 01:33:52 +01:00
|
|
|
</target>
|
|
|
|
|
2003-08-02 19:32:38 +02:00
|
|
|
<!-- compile-test -->
|
|
|
|
<!-- ======================================================================================= -->
|
|
|
|
<target name="compile-test" description="Compiles all source to ${compile.dir}.">
|
|
|
|
<!-- make target dir -->
|
|
|
|
<mkdir dir="${compile.test.dir}" />
|
|
|
|
<javac
|
|
|
|
destdir="${compile.test.dir}"
|
|
|
|
includeAntRuntime="no"
|
|
|
|
debug="on"
|
2006-07-17 10:39:08 +02:00
|
|
|
source="1.5"
|
|
|
|
target="1.5"
|
2003-08-02 19:32:38 +02:00
|
|
|
>
|
2005-10-22 02:51:17 +02:00
|
|
|
<src path="${test.dir}" />
|
2003-08-02 19:32:38 +02:00
|
|
|
<classpath>
|
|
|
|
<fileset dir="${merge.lib.dir}">
|
|
|
|
<include name="*.jar"/>
|
|
|
|
</fileset>
|
|
|
|
<fileset dir="${basedir}/build">
|
|
|
|
<include name="junit.jar"/>
|
2003-09-28 20:45:09 +02:00
|
|
|
<include name="xmlunit.jar"/>
|
2003-08-02 19:32:38 +02:00
|
|
|
</fileset>
|
|
|
|
<pathelement location="${compile.dir}" />
|
|
|
|
</classpath>
|
|
|
|
</javac>
|
|
|
|
</target>
|
|
|
|
|
2003-01-15 01:33:52 +01:00
|
|
|
<!-- jar -->
|
|
|
|
<!-- ======================================================================================= -->
|
2003-08-11 15:50:31 +02:00
|
|
|
<target name="jar" depends="compile" unless="jar.uptodate" description="Produces smack.jar">
|
2004-01-02 15:08:38 +01:00
|
|
|
<copy todir="${compile.dir}/META-INF" file="${basedir}/build/resources/META-INF/smack-config.xml" />
|
2003-01-15 01:33:52 +01:00
|
|
|
<jar destfile="${jar.dest.dir}/smack.jar"
|
|
|
|
basedir="${compile.dir}"
|
2004-01-02 15:08:38 +01:00
|
|
|
includes="org/jivesoftware/smack/**/*.class, **/smack-config.xml"
|
2003-01-15 01:33:52 +01:00
|
|
|
>
|
2003-01-24 03:44:25 +01:00
|
|
|
<zipfileset src="${merge.lib.dir}/xpp.jar"/>
|
2003-08-04 23:27:12 +02:00
|
|
|
</jar>
|
2003-09-28 20:45:09 +02:00
|
|
|
<copy todir="${compile.dir}/META-INF" file="${basedir}/build/resources/META-INF/smack.providers" />
|
2003-08-02 00:13:09 +02:00
|
|
|
<jar destfile="${jar.dest.dir}/smackx.jar"
|
|
|
|
basedir="${compile.dir}"
|
2003-08-04 23:27:12 +02:00
|
|
|
includes="org/jivesoftware/smackx/**/*.class, **/*.providers"
|
2003-11-15 21:28:56 +01:00
|
|
|
excludes="org/jivesoftware/smackx/debugger/*.class"
|
|
|
|
>
|
|
|
|
<manifest>
|
|
|
|
<attribute name="Class-Path" value="smack.jar" />
|
|
|
|
</manifest>
|
2006-01-16 18:28:29 +01:00
|
|
|
<zipfileset src="${merge.lib.dir}/jzlib.jar"/>
|
2003-11-15 21:28:56 +01:00
|
|
|
</jar>
|
2004-01-02 15:08:38 +01:00
|
|
|
<copy todir="${compile.dir}/images">
|
|
|
|
<fileset dir="${basedir}/build/resources/images">
|
|
|
|
<include name="*.png"/>
|
|
|
|
</fileset>
|
|
|
|
</copy>
|
2003-11-15 21:28:56 +01:00
|
|
|
<jar destfile="${jar.dest.dir}/smackx-debug.jar"
|
|
|
|
basedir="${compile.dir}"
|
2004-01-02 15:08:38 +01:00
|
|
|
includes="org/jivesoftware/smackx/debugger/*.class, **/*.png"
|
2003-10-23 19:42:16 +02:00
|
|
|
>
|
|
|
|
<manifest>
|
|
|
|
<attribute name="Class-Path" value="smack.jar" />
|
|
|
|
</manifest>
|
2007-02-20 18:50:29 +01:00
|
|
|
</jar>
|
|
|
|
<jar destfile="${jar.dest.dir}/jingleExtension.jar"
|
|
|
|
basedir="${compile.dir}/jingle/extension"
|
|
|
|
includes="org/jivesoftware/smackx/**/*.class"
|
|
|
|
>
|
|
|
|
<manifest>
|
|
|
|
<attribute name="Class-Path" value="smack.jar, smackx.jar" />
|
|
|
|
</manifest>
|
|
|
|
<zipfileset src="${jingle.extension.merge.lib.dir}/jstun-0.6.1.jar"/>
|
|
|
|
</jar>
|
|
|
|
<jar destfile="${jar.dest.dir}/jingleMedia.jar"
|
|
|
|
basedir="${compile.dir}/jingle/media"
|
|
|
|
includes="org/jivesoftware/**/*.class"
|
|
|
|
>
|
|
|
|
<manifest>
|
|
|
|
<attribute name="Class-Path" value="smack.jar,smackx.jar,jingleExtension.jar" />
|
|
|
|
</manifest>
|
2003-10-23 19:42:16 +02:00
|
|
|
</jar>
|
2004-01-02 15:08:38 +01:00
|
|
|
<delete file="${compile.dir}/META-INF/smack-config.xml" />
|
2003-08-20 17:32:14 +02:00
|
|
|
<delete file="${compile.dir}/META-INF/smack.providers" />
|
2004-01-02 15:08:38 +01:00
|
|
|
<delete>
|
|
|
|
<fileset dir="${compile.dir}/images">
|
|
|
|
<include name="*.png"/>
|
|
|
|
</fileset>
|
|
|
|
</delete>
|
2003-01-15 01:33:52 +01:00
|
|
|
</target>
|
|
|
|
|
2003-08-02 19:32:38 +02:00
|
|
|
<!-- jar -->
|
|
|
|
<!-- ======================================================================================= -->
|
|
|
|
<target name="jar-test" depends="compile-test" description="Produces jar of test code">
|
|
|
|
<jar destfile="${jar.dest.dir}/smack-test.jar"
|
|
|
|
basedir="${compile.test.dir}"
|
|
|
|
includes="org/jivesoftware/smack/**/*.class"
|
|
|
|
/>
|
|
|
|
</target>
|
|
|
|
|
2003-01-15 01:33:52 +01:00
|
|
|
<!-- javadoc -->
|
|
|
|
<!-- ======================================================================================= -->
|
2003-08-04 23:27:12 +02:00
|
|
|
<target name="javadoc" description="JavaDocs the Smack source code">
|
2003-01-15 01:33:52 +01:00
|
|
|
|
|
|
|
<mkdir dir="${javadoc.dest.dir}" />
|
|
|
|
<javadoc
|
2003-08-11 15:50:31 +02:00
|
|
|
packagenames="org.jivesoftware.smack.*, org.jivesoftware.smackx.*"
|
2007-02-19 23:17:27 +01:00
|
|
|
excludepackagenames="org.jivesoftware.smack.util.collections"
|
2003-01-15 01:33:52 +01:00
|
|
|
sourcepath="${basedir}/source"
|
|
|
|
destdir="${javadoc.dest.dir}"
|
|
|
|
author="true"
|
2007-02-05 19:38:37 +01:00
|
|
|
windowtitle="Smack ${version} Documentation"
|
2003-03-10 00:08:17 +01:00
|
|
|
overview="${basedir}/source/overview.html"
|
2003-01-15 01:33:52 +01:00
|
|
|
>
|
|
|
|
<classpath>
|
2003-01-24 03:44:25 +01:00
|
|
|
<fileset dir="${merge.lib.dir}">
|
|
|
|
<include name="*.jar"/>
|
2003-01-15 01:33:52 +01:00
|
|
|
</fileset>
|
|
|
|
</classpath>
|
2007-02-06 21:08:19 +01:00
|
|
|
<doctitle><![CDATA[<font face="arial,helvetica">Smack ${version}</font>]]></doctitle>
|
2003-01-16 21:42:29 +01:00
|
|
|
<header><![CDATA[<b>Smack</b>]]></header>
|
2007-02-19 23:17:27 +01:00
|
|
|
<bottom><![CDATA[<i>Copyright © 2003-2007 Jive Software. </i>]]></bottom>
|
2003-01-15 01:33:52 +01:00
|
|
|
<link href="http://java.sun.com/j2se/1.3/docs/api/" />
|
|
|
|
<link href="http://java.sun.com/j2ee/sdk_1.2.1/techdocs/api/" />
|
|
|
|
</javadoc>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
|
2005-10-25 19:14:52 +02:00
|
|
|
<!-- test -->
|
|
|
|
<!-- ======================================================================================= -->
|
|
|
|
<target name="func-test" depends="compile, jar-test" unless="no.test">
|
|
|
|
<antcall target="test.messenger"/>
|
|
|
|
<antcall target="test"/>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
|
2003-08-02 19:32:38 +02:00
|
|
|
<!-- test -->
|
|
|
|
<!-- ======================================================================================= -->
|
|
|
|
<target name="test" depends="compile, jar-test" unless="no.test">
|
2003-08-19 19:44:45 +02:00
|
|
|
|
2003-09-28 20:45:09 +02:00
|
|
|
<echo>
|
|
|
|
|
|
|
|
|
|
|
|
**** no.test: ${no.test}
|
|
|
|
|
|
|
|
|
|
|
|
</echo>
|
|
|
|
|
2003-08-19 19:44:45 +02:00
|
|
|
<property name="test.messenger" value="false" />
|
|
|
|
|
|
|
|
<if>
|
|
|
|
<not><equals arg1="test.messenger" arg2="true" /></not>
|
|
|
|
<then>
|
|
|
|
<property name="test.classes" value="test.cases" />
|
|
|
|
</then>
|
|
|
|
</if>
|
|
|
|
|
2003-08-02 19:32:38 +02:00
|
|
|
<junit printsummary="on"
|
2005-10-22 02:51:17 +02:00
|
|
|
fork="true"
|
2003-08-02 19:32:38 +02:00
|
|
|
haltonfailure="false"
|
|
|
|
failureproperty="tests.failed"
|
|
|
|
showoutput="true">
|
|
|
|
|
2003-08-19 19:44:45 +02:00
|
|
|
<sysproperty key="smack.test.host" value="${test.host}" />
|
|
|
|
<sysproperty key="smack.test.port" value="${test.port}" />
|
|
|
|
<sysproperty key="smack.test.admin.username" value="${test.admin.username}" />
|
|
|
|
<sysproperty key="smack.test.admin.password" value="${test.admin.password}" />
|
|
|
|
<sysproperty key="smack.test.admin.resource" value="${test.admin.resource}" />
|
|
|
|
<sysproperty key="smack.debug" value="${test.smack.debug}" />
|
|
|
|
|
2003-08-02 19:32:38 +02:00
|
|
|
<classpath>
|
2003-09-28 20:45:09 +02:00
|
|
|
<fileset dir="${basedir}/build">
|
|
|
|
<include name="xmlunit.jar"/>
|
|
|
|
</fileset>
|
2003-08-02 19:32:38 +02:00
|
|
|
<fileset dir="${merge.lib.dir}">
|
|
|
|
<include name="*.jar"/>
|
|
|
|
</fileset>
|
|
|
|
<fileset dir="${basedir}">
|
|
|
|
<include name="smack-test.jar"/>
|
|
|
|
</fileset>
|
|
|
|
<pathelement location="${compile.dir}" />
|
2005-10-22 02:51:17 +02:00
|
|
|
<pathelement location="${test.dir}" />
|
|
|
|
<pathelement location="${resources.dir}" />
|
2003-08-02 19:32:38 +02:00
|
|
|
</classpath>
|
|
|
|
|
|
|
|
<formatter type="brief" usefile="false"/>
|
|
|
|
|
|
|
|
<batchtest>
|
|
|
|
<fileset dir="${basedir}/test">
|
2003-08-19 19:44:45 +02:00
|
|
|
<patternset refid="${test.classes}" />
|
2003-08-02 19:32:38 +02:00
|
|
|
</fileset>
|
|
|
|
</batchtest>
|
|
|
|
</junit>
|
|
|
|
|
2003-08-19 19:44:45 +02:00
|
|
|
<fail if="tests.failed" message="** Tests failed, see test log. **" />
|
|
|
|
</target>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- test -->
|
|
|
|
<!-- ======================================================================================= -->
|
|
|
|
<target name="test.messenger" depends="compile, jar-test" unless="no.test">
|
|
|
|
<antcall target="test" inheritall="true" inheritrefs="true">
|
|
|
|
<param name="test.messenger" value="true" />
|
|
|
|
<param name="test.classes" value="messenger.test.cases" />
|
|
|
|
</antcall>
|
2003-08-02 19:32:38 +02:00
|
|
|
</target>
|
|
|
|
|
|
|
|
|
2003-01-20 16:57:33 +01:00
|
|
|
<!-- release -->
|
|
|
|
<!-- ======================================================================================= -->
|
2007-02-04 07:17:15 +01:00
|
|
|
<target name="release" description="Builds a release" if="release.exists" depends="release-exists">
|
2003-08-05 04:00:25 +02:00
|
|
|
<antcall target="jar">
|
|
|
|
<param name="no.test" value="true" />
|
|
|
|
</antcall>
|
|
|
|
<antcall target="javadoc">
|
|
|
|
<param name="no.test" value="true" />
|
|
|
|
</antcall>
|
2003-01-20 16:57:33 +01:00
|
|
|
<ant antfile="${basedir}/build/release.xml" />
|
|
|
|
</target>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- release-exists -->
|
|
|
|
<!-- ======================================================================================= -->
|
|
|
|
<target name="release-exists" >
|
|
|
|
<available file="${basedir}/build/release.xml" property="release.exists"/>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
|
2003-01-15 01:33:52 +01:00
|
|
|
<!-- clean -->
|
|
|
|
<!-- ======================================================================================= -->
|
|
|
|
<target name="clean" description="Deletes all generated content.">
|
|
|
|
<delete dir="${javadoc.dest.dir}" />
|
2003-01-20 16:57:33 +01:00
|
|
|
<delete dir="${compile.dir}" />
|
2003-08-02 19:32:38 +02:00
|
|
|
<delete dir="${compile.test.dir}" />
|
2003-05-22 00:46:28 +02:00
|
|
|
<delete file="${basedir}/smack.jar" />
|
2003-08-02 19:32:38 +02:00
|
|
|
<delete file="${basedir}/smackx.jar" />
|
2003-11-15 21:28:56 +01:00
|
|
|
<delete file="${basedir}/smackx-debug.jar" />
|
2003-08-02 19:32:38 +02:00
|
|
|
<delete file="${basedir}/smack-test.jar" />
|
2007-02-20 18:50:29 +01:00
|
|
|
<delete file="${basedir}/jingleExtension.jar" />
|
|
|
|
<delete file="${basedir}/jingleMedia.jar" />
|
2007-02-06 19:01:06 +01:00
|
|
|
<delete dir="${basedir}/target" />
|
2003-01-15 01:33:52 +01:00
|
|
|
</target>
|
|
|
|
|
|
|
|
</project>
|