build.xml revision 530a10a76564724578a42c8e164d6bf645faee85
<!--
! CDDL HEADER START
!
! The contents of this file are subject to the terms of the
! Common Development and Distribution License, Version 1.0 only
! (the "License"). You may not use this file except in compliance
! with the License.
!
! You can obtain a copy of the license at
! trunk/opends/resource/legal-notices/OpenDS.LICENSE
! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
! See the License for the specific language governing permissions
! and limitations under the License.
!
! When distributing Covered Code, include this CDDL HEADER in each
! file and include the License file at
! trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
! add the following below this CDDL HEADER, with the fields enclosed
! by brackets "[]" replaced with your own identifying * information:
! Portions Copyright [yyyy] [name of copyright owner]
!
! CDDL HEADER END
!
!
! Portions Copyright 2006 Sun Microsystems, Inc.
! -->
<project name="Directory Server" basedir="." default="package">
<description>
This is the build script for the OpenDS Directory Server. See the BUILDING
file in this directory for build instructions.
</description>
<!-- General server-wide properties -->
<property name="src.dir" location="src/server" />
<property name="build.dir" location="build" />
<property name="classes.dir" location="${build.dir}/classes" />
<property name="lib.dir" location="lib" />
<property name="ext.dir" location="ext" />
<property name="package.dir" location="${build.dir}/package" />
<property name="javadoc.dir" location="${build.dir}/javadoc" />
<property name="resource.dir" location="resource" />
<property name="scripts.dir" location="${resource.dir}/bin" />
<property name="config.dir" location="${resource.dir}/config" />
<!-- Properties for build tools -->
<property name="buildtools.dir" location="build-tools" />
<property name="buildtools.src.dir" location="${buildtools.dir}/src" />
<property name="buildtools.classes.dir" location="${build.dir}/build-tools/classes" />
<!-- Properties for use in unit testing. -->
<property name="unittest.testng.dir" location="tests/unit-tests-testng"/>
<property name="unittest.testng.src.dir"
location="${unittest.testng.dir}/src"/>
<property name="unittest.classes.dir"
location="${build.dir}/unit-tests/classes" />
<property name="unittest.report.dir"
location="${build.dir}/unit-tests/report"/>
<property name="unittest.resource.dir"
location="${build.dir}/unit-tests/resource"/>
<!-- Properties for use in functional/integration testing. -->
<property name="functest.testng.dir"
location="tests/integration-tests-testng" />
<property name="functest.testng.src.dir"
location="${functest.testng.dir}/src"/>
<!-- Properties for use with the DSML component. -->
<property name="dsml.dir" location="resource/dsml" />
<property name="dsml.src.dir" location="src/dsml" />
<property name="dsml.lib.dir" location="${dsml.dir}/lib" />
<property name="dsml.gen.dir" location="${build.dir}/dsml/gen" />
<property name="dsml.classes.dir" location="${build.dir}/dsml/classes" />
<!-- Properties for use with the Quick Setup. -->
<property name="quicksetup.src.dir" location="src/quicksetup" />
<property name="quicksetup.classes.dir" location="${build.dir}/quicksetup/classes" />
<!-- Properties for code coverage testing. -->
<property name="coverage.dir" location="build/coverage" />
<property name="coverage.report.dir"
location="${coverage.dir}/reports/unit" />
<property name="coverage.instr.dir"
location="${coverage.dir}/instrumentedcode" />
<property name="coverage.data.dir"
location="${coverage.dir}/gathereddata" />
<!-- Properties for the EMMA code coverage tool. -->
<property name="emma.dir" location="${ext.dir}/emma/lib" />
<!-- Properties for the TestNG unit testing tool. -->
<property name="testng.dir" location="${ext.dir}/testng" />
<property name="testng.lib.dir" location="${testng.dir}/lib" />
<!-- Properties for the ANT build tool. -->
<property name="ant.dir" location="${ext.dir}/ant" />
<property name="ant.lib.dir" location="${ant.dir}/lib" />
<!-- Properties for the checkstyle tool. -->
<property name="checkstyle.dir" location="${ext.dir}/checkstyle" />
<!-- Properties for Directory Server version information. -->
<property name="dynconstants.file"
location="${src.dir}/org/opends/server/util/DynamicConstants.java" />
<property name="dynconstants.stubfile"
location="${resource.dir}/DynamicConstants.java.stubs" />
<property file="PRODUCT" />
<!-- Create a package bundle containing the DSML library. -->
<target name="dsml" depends="predsml,package"
description="Build a Directory Server package bundle with DSML.">
</target>
<!-- The build target that should be used before committing code. -->
<target name="precommit" depends="checkstyle,dsml,javadoc,clean,test"
description="Perform all processing needed before committing code." />
<!-- The build target that should be used for nightly builds. -->
<target name="nightly"
depends="checkstyle,dsml,javadoc,coverage,testall"
description="Perform all processing needed for nightly builds." />
<!-- The build target that should be used for weekly builds. -->
<target name="weekly" depends="nightly"
description="Perform all processing needed for weekly builds." />
<!-- The build target that should be used to build everything. -->
<target name="all"
depends="checkstyle,dsml,javadoc,coverage,testall"
description="Build using all defined targets." />
<!-- Remove all dynamically-generated build files. -->
<target name="clean"
description="Clean up any files generated during the build process">
<delete dir="${build.dir}" />
<delete file="${dynconstants.file}" /> <fileset dir="${lib.dir}">
<include name="*.jar" />
</fileset>
</target>
<!-- Perform common initialization common to several targets after cleaning out the previous build environment. -->
<target name="cleaninit" depends="clean,init"/>
<!-- Perform common initialization common to several targets. -->
<target name="init">
<tstamp>
<format property="timestamp" pattern="yyyyMMddHHmmss" />
</tstamp>
<condition property="DEBUG_BUILD" value="false">
<not>
<isset property="DEBUG_BUILD" />
</not>
</condition>
<condition property="MEM" value="128M">
<not>
<isset property="MEM" />
</not>
</condition>
<!--
! For some reason, some Apple VMs put quotes around the value of the
! java.vm.vendor property, which wreaks havoc with DynamicConstants. This
! pair of conditions attempts to work around that by detecting the quote
! and surrounding the value with backslashes.
! -->
<condition property="JVM_VENDOR" value="Apple Computer">
<contains string="${java.vm.vendor}" substring="Apple Computer"
casesensitive="false" />
</condition>
<condition property="JVM_VENDOR" value="${java.vm.vendor}">
<not>
<isset property="JVM_VENDOR" />
</not>
</condition>
<!-- Generate the DynamicConstants.java file.
Be warned that the .stubs file references the following properties
PRODUCT_NAME, SHORT_NAME, MAJOR_VERSION, MINOR_VERSION, POINT_VERSION,
VERSION_QUALIFIER, FIX_IDS, timestamp, user.name, java.version,
java.vendor, java.vm.version, JVM_VENDOR, DEBUG_BUILD
If you change the name of any of those properties in this build.xml
you'll need to relfect the same change in the .stubs file
-->
<copy file="${dynconstants.stubfile}"
tofile="${dynconstants.file}"
overwrite="true" >
<filterchain>
<expandproperties/>
</filterchain>
</copy>
</target>
<!-- Ensure that the source code meets basic style requirements. -->
<target name="checkstyle" description="Perform basic source style checks">
<taskdef resource="checkstyletask.properties"
classpath="${checkstyle.dir}/checkstyle-all-4.1.jar" />
<checkstyle config="${checkstyle.dir}/opends-checkstyle.xml"
failOnViolation="true">
<fileset dir="${src.dir}" includes="**/*.java" />
<formatter type="plain" />
</checkstyle>
<checkstyle config="${checkstyle.dir}/opends-checkstyle.xml"
failOnViolation="true">
<fileset dir="${quicksetup.src.dir}" includes="**/*.java" />
<formatter type="plain" />
</checkstyle>
<checkstyle config="${checkstyle.dir}/opends-doctarget-checkstyle.xml"
failOnViolation="true">
<fileset dir="${src.dir}/org/opends/server/api" includes="**/*.java" />
<fileset dir="${src.dir}/org/opends/server/protocols/internal"
includes="**/*.java" />
<fileset dir="${src.dir}/org/opends/server/types"
includes="**/*.java" />
<formatter type="plain" />
</checkstyle>
<checkstyle config="${checkstyle.dir}/opends-unittest-checkstyle.xml"
failOnViolation="true">
<fileset dir="${unittest.testng.src.dir}" includes="**/*.java" />
<formatter type="plain" />
</checkstyle>
<checkstyle config="${checkstyle.dir}/opends-functest-checkstyle.xml"
failOnViolation="true">
<fileset dir="${functest.testng.src.dir}" includes="**/*.java" />
<formatter type="plain" />
</checkstyle>
</target>
<!-- Compile the Directory Server source files. -->
<target name="cleancompile" depends="cleaninit,compile,compilequicksetup"
description="Recompile the Directory Server source files.">
</target>
<!-- Compile the Directory Server source files. -->
<target name="compile"
depends="init"
description="Compile the Directory Server source files.">
<mkdir dir="${classes.dir}" />
<javac srcdir="${src.dir}" destdir="${classes.dir}" optimize="true"
debug="on" debuglevel="lines,source" source="1.5" target="1.5"
deprecation="true" fork="true" memoryInitialSize="${MEM}"
memoryMaximumSize="${MEM}">
<compilerarg value="-Xlint:all" />
<classpath>
<fileset dir="${lib.dir}">
<include name="*.jar" />
</fileset>
</classpath>
</javac>
</target>
<!-- Compile the Quick Setup source files. -->
<target name="compilequicksetup"
depends="buildtools,compile"
description="Compile the Quick Setup source files.">
<mkdir dir="${quicksetup.classes.dir}" />
<javac srcdir="${quicksetup.src.dir}" destdir="${quicksetup.classes.dir}" optimize="true"
debug="on" debuglevel="lines,source" source="1.5" target="1.5"
deprecation="true" fork="true" memoryInitialSize="${MEM}"
memoryMaximumSize="${MEM}">
<compilerarg value="-Xlint:all" />
<classpath>
<fileset dir="${build.dir}/build-tools">
<include name="build-tools.jar" />
</fileset>
<pathelement path="${classes.dir}"/>
</classpath>
</javac>
<copy todir="${quicksetup.classes.dir}">
<fileset dir="${quicksetup.src.dir}" includes="**/*.properties, **/*.gif, **/*.png" />
</copy>
<copy todir="${quicksetup.classes.dir}">
<fileset dir="${classes.dir}"
includes="**/DynamicConstants.class"/>
</copy>
</target>
<!--
! Rebuild the Directory Server without destroying any existing configuration
! or data. It will only overwrite the libraries, classes, and scripts, and
! it will not re-package. It will also not do a complete initialization, so
! DynamicConstants.java won't be regenerated.
! -->
<target name="rebuild"
description="Rebuild the server without destroying config or data.">
<!-- Set the amount of memory to use for the build -->
<condition property="MEM" value="128M">
<not>
<isset property="MEM" />
</not>
</condition>
<!-- Set properties needed to find the packaged files -->
<property name="pkgversion"
value="${MAJOR_VERSION}.${MINOR_VERSION}${VERSION_QUALIFIER}" />
<property name="pdir"
location="${package.dir}/OpenDS-${pkgversion}" />
<!-- Clean up a minimal set of files/directories for the rebuild. -->
<delete dir="${classes.dir}" />
<delete file="${package.dir}/lib/OpenDS.jar" />
<delete file="${pdir}.zip" />
<delete dir="${quicksetup.classes.dir}" />
<delete file="${package.dir}/lib/quicksetup.jar" />
<!-- Recreate the classes directory and recompile into it. -->
<mkdir dir="${classes.dir}" />
<javac srcdir="${src.dir}" destdir="${classes.dir}" optimize="true"
debug="on" debuglevel="lines,source" source="1.5" target="1.5"
deprecation="true" fork="true" memoryInitialSize="${MEM}"
memoryMaximumSize="${MEM}">
<compilerarg value="-Xlint:all" />
<classpath>
<fileset dir="${lib.dir}">
<include name="*.jar" />
</fileset>
</classpath>
</javac>
<!-- Generate the OpenDS.jar file -->
<jar jarfile="${pdir}/lib/OpenDS.jar"
basedir="${classes.dir}" compress="true" index="true" />
<!-- Recreate the quicksetup classes directory and recompile into it. -->
<mkdir dir="${quicksetup.classes.dir}" />
<javac srcdir="${quicksetup.src.dir}" destdir="${quicksetup.classes.dir}" optimize="true"
debug="on" debuglevel="lines,source" source="1.5" target="1.5"
deprecation="true" fork="true" memoryInitialSize="${MEM}"
memoryMaximumSize="${MEM}">
<compilerarg value="-Xlint:all" />
<classpath>
<fileset dir="${build.dir}/build-tools">
<include name="build-tools.jar" />
</fileset>
<fileset dir="${pdir}/lib">
<include name="OpenDS.jar" />
</fileset>
</classpath>
</javac>
<copy todir="${quicksetup.classes.dir}">
<fileset dir="${quicksetup.src.dir}"
includes="**/*.properties, **/*.gif, **/*.png"/>
</copy>
<copy todir="${quicksetup.classes.dir}">
<fileset dir="${classes.dir}"
includes="**/DynamicConstants.class"/>
</copy>
<!-- Generate the quicksetup.jar file -->
<jar jarfile="${pdir}/lib/quicksetup.jar"
basedir="${quicksetup.classes.dir}" compress="true" index="true" />
</target>
<!-- Populate the Directory Server package, but don't zip it up. -->
<target name="prepackage" depends="cleancompile"
description="Prepare the Directory Server package structure.">
<property name="pkgversion"
value="${MAJOR_VERSION}.${MINOR_VERSION}${VERSION_QUALIFIER}" />
<property name="pdir"
location="${package.dir}/OpenDS-${pkgversion}" />
<mkdir dir="${pdir}" />
<mkdir dir="${pdir}/bak" />
<mkdir dir="${pdir}/bin" />
<mkdir dir="${pdir}/classes" />
<mkdir dir="${pdir}/config" />
<mkdir dir="${pdir}/config/schema" />
<mkdir dir="${pdir}/config/messages" />
<mkdir dir="${pdir}/config/MakeLDIF" />
<mkdir dir="${pdir}/db" />
<mkdir dir="${pdir}/changelogDb" />
<mkdir dir="${pdir}/ldif" />
<mkdir dir="${pdir}/legal-notices" />
<mkdir dir="${pdir}/lib" />
<mkdir dir="${pdir}/locks" />
<mkdir dir="${pdir}/logs" />
<mkdir dir="${pdir}/war" />
<jar jarfile="${pdir}/lib/OpenDS.jar"
basedir="${classes.dir}" compress="true" index="true" />
<jar jarfile="${pdir}/lib/quicksetup.jar"
basedir="${quicksetup.classes.dir}" compress="true" index="true" />
<copy todir="${pdir}/lib">
<fileset file="${lib.dir}/*.jar" />
</copy>
<fixcrlf srcDir="${scripts.dir}" destDir="${pdir}/bin" excludes="*.bat"
eol="lf" />
<fixcrlf srcDir="${scripts.dir}" destDir="${pdir}/bin" includes="*.bat"
eol="crlf" />
<copy todir="${pdir}/config">
<fileset file="${config.dir}/*" />
</copy>
<copy todir="${pdir}/config/schema">
<fileset dir="${resource.dir}/schema" />
</copy>
<copy todir="${pdir}/config/messages">
<fileset dir="${resource.dir}/messages" />
</copy>
<copy todir="${pdir}/config/MakeLDIF">
<fileset dir="${resource.dir}/MakeLDIF" />
</copy>
<copy todir="${pdir}/legal-notices">
<fileset dir="${resource.dir}/legal-notices" />
</copy>
<copy todir="${pdir}">
<fileset file="${resource.dir}/README" />
</copy>
<fixcrlf srcDir="${resource.dir}" destDir="${pdir}" includes="setup"
eol="lf" />
<fixcrlf srcDir="${resource.dir}" destDir="${pdir}" includes="setup.bat"
eol="crlf" />
<chmod file="${pdir}/setup" perm="755" />
<chmod perm="755">
<fileset dir="${pdir}/bin">
<exclude name="*.bat"/>
</fileset>
</chmod>
</target>
<!-- Package the Directory Server for distribution. -->
<target name="package" depends="prepackage"
description="Package the Directory Server for distribution.">
<zip destfile="${package.dir}/OpenDS-${pkgversion}.zip">
<zipfileset dir="${package.dir}" includes="**/*"
excludes="OpenDS-${pkgversion}/bin/*,OpenDS-${pkgversion}/setup"
filemode="644" dirmode="755" />
<zipfileset dir="${package.dir}"
includes="OpenDS-${pkgversion}/bin/*.bat"
filemode="644" dirmode="755" />
<zipfileset dir="${package.dir}" includes="OpenDS-${pkgversion}/bin/*"
excludes="OpenDS-${pkgversion}/bin/*.bat"
filemode="755" dirmode="755" />
<zipfileset dir="${package.dir}" includes="OpenDS-${pkgversion}/setup"
filemode="755" dirmode="755" />
</zip>
</target>
<!-- Prepare the Directory Server DSML library. -->
<target name="predsml" depends="prepackage"
description="Prepare the Directory Server DSML library.">
<taskdef name="xjc" classname="com.sun.tools.xjc.XJCTask">
<classpath>
<fileset dir="${dsml.lib.dir}">
<include name="**/*.jar" />
</fileset>
</classpath>
</taskdef>
<mkdir dir="${dsml.gen.dir}/org/opends/dsml/protocol" />
<xjc target="${dsml.gen.dir}" schema="${dsml.dir}/schema/DSMLv2.xsd"
removeOldOutput="yes" package="org.opends.dsml.protocol">
<produces dir="${dsml.gen.dir}/org/opends/dsml/protocol"
includes="* impl/*" />
</xjc>
<mkdir dir="${dsml.classes.dir}" />
<javac srcdir="${dsml.gen.dir}" destdir="${dsml.classes.dir}"
optimize="true" debug="on" debuglevel="lines,source" source="1.5"
target="1.5" deprecation="true" fork="true" memoryInitialSize="${MEM}"
memoryMaximumSize="${MEM}">
<compilerarg value="-Xlint:all" />
<classpath>
<fileset dir="${dsml.lib.dir}">
<include name="*.jar" />
</fileset>
</classpath>
</javac>
<javac srcdir="${dsml.src.dir}" destdir="${dsml.classes.dir}"
optimize="true" debug="on" debuglevel="lines,source" source="1.5"
target="1.5" deprecation="true" fork="true" memoryInitialSize="${MEM}"
memoryMaximumSize="${MEM}">
<compilerarg value="-Xlint:all" />
<classpath>
<fileset dir="${dsml.lib.dir}">
<include name="*.jar" />
</fileset>
<dirset dir="${classes.dir}" />
</classpath>
</javac>
<war destfile="${classes.dir}/dsml.war"
webxml="${dsml.dir}/webapp/web.xml">
<fileset file="${dsml.dir}/webapp/server.properties" />
<webinf dir="${dsml.dir}/webapp" includes="**/*"
excludes="web.xml, **/*.jar, **/*.properties" />
<classes dir="${dsml.classes.dir}" />
<lib dir="${dsml.lib.dir}">
<exclude name="j2ee.jar" />
</lib>
<lib dir="${pdir}/lib">
<exclude name="activation.jar" />
<exclude name="je.jar" />
</lib>
</war>
<copy todir="${pdir}/war">
<fileset file="${classes.dir}/*.war" />
</copy>
</target>
<!-- Generate JavaDoc documentation from the source files -->
<target name="javadoc" depends="dsml"
description="Generate JavaDoc documentation.">
<mkdir dir="${javadoc.dir}" />
<javadoc destdir="${javadoc.dir}" source="1.5" additionalparam="-quiet"
linksource="yes" windowtitle="${PRODUCT_NAME} API Documentation"
maxmemory="${MEM}">
<classpath>
<fileset dir="${lib.dir}">
<include name="*.jar" />
</fileset>
<fileset dir="${dsml.lib.dir}">
<include name="*.jar" />
</fileset>
<dirset dir="${classes.dir}" />
<dirset dir="${dsml.classes.dir}" />
</classpath>
<packageset dir="${src.dir}" />
<packageset dir="${dsml.src.dir}" />
</javadoc>
</target>
<!-- Internal target to prepare to generate a code coverage report. -->
<target name="coverage">
<property name="coverage.enabled" value="true" />
<mkdir dir="${coverage.dir}" />
<mkdir dir="${coverage.data.dir}" />
<mkdir dir="${coverage.instr.dir}" />
<mkdir dir="${coverage.report.dir}" />
<path id="run.classpath">
<pathelement location="${classes.dir}" />
</path>
</target>
<!-- Prepare to execute the Directory Server TestNG unit tests. -->
<target name="testinit" depends="buildtools,compile"
description="Prepare to execute the Directory Server TestNG unit tests.">
<!-- If we are to perform coverage tests, then set that up. -->
<path id="emma.lib">
<pathelement location="${emma.dir}/emma.jar" />
<pathelement location="${emma.dir}/emma_ant.jar" />
</path>
<taskdef resource="emma_ant.properties" classpathref="emma.lib" />
<emma enabled="${coverage.enabled}">
<instr instrpathref="run.classpath" destdir="${coverage.instr.dir}"
metadatafile="${coverage.data.dir}/metadata.emma" merge="true" />
</emma>
<!-- Compile the test cases -->
<mkdir dir="${unittest.classes.dir}" />
<javac srcdir="${unittest.testng.src.dir}" destdir="${unittest.classes.dir}"
optimize="true" debug="on" debuglevel="lines,source" source="1.5"
target="1.5" deprecation="true" fork="true" memoryInitialSize="${MEM}"
memoryMaximumSize="${MEM}">
<compilerarg value="-Xlint:all" />
<classpath>
<fileset dir="${lib.dir}">
<include name="*.jar" />
</fileset>
<fileset dir="${testng.lib.dir}">
<include name="*.jar" />
</fileset>
<path refid="run.classpath" />
</classpath>
</javac>
<!-- Prep the TestNG XML file -->
<mkdir dir="${unittest.resource.dir}" />
<typedef name="preptestng" classname="org.opends.build.tools.PrepTestNG"
classpath="${build.dir}/build-tools/build-tools.jar" />
<preptestng file="${testng.dir}/testng.xml"
tofile="${unittest.resource.dir}/testng.xml"
grouplist="${test.groups}"
packagelist="${test.packages}"
classList="${test.classes}"
methodList="${test.methods}" />
</target>
<!-- Execute the Directory Server TestNG unit tests in text mode. -->
<target name="enableTestNGAssertions">
<property name="TESTASSERT" value="true"/>
</target>
<!-- Execute Directory Server TestNG unit tests specified from CLI -->
<target name="testcustom"
depends="testinit,runtests"
description="Execute the Directory Server TestNG unit tests specified from CLI.">
</target>
<!-- Execute all of the Directory Server TestNG unit tests in text mode. -->
<target name="testall"
depends="enableTestNGAssertions,prepdefaultalltest,testinit,runtests"
description="Run all of the TestNG tests.">
</target>
<!-- Execute the Directory Server TestNG unit tests in text mode. -->
<target name="test"
depends="prepdefaulttest,testinit,runtests"
description="Execute the Directory Server TestNG unit tests in text mode.">
</target>
<!-- Execute the Directory Server TestNG unit tests in text mode with a coverage report. -->
<target name="testwithcoverage"
depends="coverage,test"
description="Execute the Directory Server TestNG unit tests in text mode with a coverage report.">
</target>
<!-- Execute the Directory Server TestNG unit tests in text mode with a coverage report and slow tests. -->
<target name="testallwithcoverage"
depends="coverage,testall"
description="Execute the Directory Server TestNG unit tests in text mode with a coverage report.">
</target>
<!-- Execute the Directory Server TestNG unit tests specified from CLI in text mode with a coverage report. -->
<target name="testcustomwithcoverage"
depends="coverage,testcustom"
description="Execute the Directory Server TestNG unit tests specified from CLI in text mode with a coverage report.">
</target>
<!-- Internal target to execute the Directory Server TestNG unit tests in text mode after everything has been initialized. -->
<target name="runtests">
<mkdir dir="${unittest.report.dir}" />
<taskdef resource="testngtasks">
<classpath>
<fileset dir="${testng.lib.dir}">
<include name="*.jar" />
</fileset>
</classpath>
</taskdef>
<!-- This sets TESTASSERT to false if and only if it's not already set. -->
<condition property="TESTASSERT" value="false">
<not>
<isset property="TESTASSERT" />
</not>
</condition>
<!-- This sets org.opends.test.suppressOutput if and only if it's not
already set. -->
<condition property="org.opends.test.suppressOutput" value="false">
<not>
<isset property="org.opends.test.suppressOutput" />
</not>
</condition>
<testng outputdir="${unittest.report.dir}" haltonfailure="true"
enableAssert="${TESTASSERT}">
<classpath>
<pathelement location="${coverage.instr.dir}" />
<pathelement location="${classes.dir}" />
<pathelement location="${unittest.classes.dir}" />
<path refid="run.classpath" />
<path refid="emma.lib" />
<fileset dir="${lib.dir}">
<include name="*.jar" />
</fileset>
<fileset dir="${testng.lib.dir}">
<include name="*.jar" />
</fileset>
</classpath>
<jvmarg value="-Demma.coverage.out.file=${coverage.data.dir}/unit.emma" />
<jvmarg value="-Demma.coverage.out.merge=false" />
<jvmarg value="-Dorg.opends.server.BuildRoot=${basedir}" />
<jvmarg value="-Dorg.opends.test.suppressOutput=${org.opends.test.suppressOutput}" />
<jvmarg value="-Xmx${MEM}" />
<jvmarg value="-Xms${MEM}" />
<xmlfileset dir="${unittest.resource.dir}" includes="testng.xml" />
</testng>
<echo message="Generating unit tests coverage report..."/>
<emma enabled="${coverage.enabled}" >
<report sourcepath="${src.dir}" >
<!-- <property name="verbosity.level" value="verbose" /> -->
<fileset dir="${coverage.data.dir}" >
<include name="unit.emma" />
<include name="metadata.emma" />
</fileset>
<txt outfile="${coverage.report.dir}/coverage.txt" />
<html outfile="${coverage.report.dir}/index.html" />
</report>
</emma>
</target>
<!-- Internal target used to set the properties for the preptestng task -->
<target name="prepdefaulttest">
<property name="test.groups" value="exclude=slow" />
<property name="test.packages" value="org.opends.server.*" />
<property name="test.classes" value="" />
<property name="test.methods" value="" />
</target>
<target name="prepdefaultalltest">
<property name="test.groups" value="" />
<property name="test.packages" value="org.opends.server.*" />
<property name="test.classes" value="" />
<property name="test.methods" value="" />
</target>
<target name="testreport"
depends="test"
description="Takes testng results and convert them into JUnit compatible xml">
<junitreport todir="${unittest.report.dir}">
<fileset dir="${unittest.report.dir}">
<include name="*.xml"/>
</fileset>
<report format="noframes" todir="${unittest.report.dir}"/>
</junitreport>
</target>
<target name="integration-tests"
description="Builds the integration tests"
>
<ant dir="${functest.testng.dir}" inheritall="false"/>
</target>
<target name="buildtools"
description="Builds the build tools">
<!-- Set the amount of memory to use for the build -->
<condition property="MEM" value="128M">
<not>
<isset property="MEM" />
</not>
</condition>
<mkdir dir="${buildtools.classes.dir}" />
<javac srcdir="${buildtools.src.dir}" destdir="${buildtools.classes.dir}"
optimize="true" debug="on" debuglevel="lines,source" source="1.5"
target="1.5" deprecation="true" fork="true" memoryInitialSize="${MEM}"
memoryMaximumSize="${MEM}">
<compilerarg value="-Xlint:all" />
<classpath>
<fileset dir="${ant.lib.dir}">
<include name="*.jar" />
</fileset>
<path refid="run.classpath" />
</classpath>
</javac>
<jar jarfile="${build.dir}/build-tools/build-tools.jar"
basedir="${buildtools.classes.dir}" compress="true" index="true" />
</target>
</project>