build.xml revision 984
0N/A<!--
0N/A ! CDDL HEADER START
0N/A !
0N/A ! The contents of this file are subject to the terms of the
0N/A ! Common Development and Distribution License, Version 1.0 only
0N/A ! (the "License"). You may not use this file except in compliance
0N/A ! with the License.
0N/A !
0N/A ! You can obtain a copy of the license at
0N/A ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
0N/A ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
0N/A ! See the License for the specific language governing permissions
0N/A ! and limitations under the License.
0N/A !
0N/A ! When distributing Covered Code, include this CDDL HEADER in each
0N/A ! file and include the License file at
0N/A ! trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
0N/A ! add the following below this CDDL HEADER, with the fields enclosed
873N/A ! by brackets "[]" replaced with your own identifying information:
0N/A ! Portions Copyright [yyyy] [name of copyright owner]
0N/A !
0N/A ! CDDL HEADER END
0N/A !
0N/A !
729N/A ! Portions Copyright 2006-2007 Sun Microsystems, Inc.
0N/A ! -->
0N/A
0N/A<project name="Directory Server" basedir="." default="package">
0N/A <description>
0N/A This is the build script for the OpenDS Directory Server. See the BUILDING
0N/A file in this directory for build instructions.
0N/A </description>
0N/A
233N/A <!-- General server-wide properties -->
233N/A <property name="src.dir" location="src/server" />
233N/A <property name="build.dir" location="build" />
233N/A <property name="classes.dir" location="${build.dir}/classes" />
233N/A <property name="lib.dir" location="lib" />
233N/A <property name="ext.dir" location="ext" />
233N/A <property name="package.dir" location="${build.dir}/package" />
233N/A <property name="javadoc.dir" location="${build.dir}/javadoc" />
233N/A <property name="resource.dir" location="resource" />
233N/A <property name="scripts.dir" location="${resource.dir}/bin" />
233N/A <property name="config.dir" location="${resource.dir}/config" />
233N/A
712N/A <!-- Properties for build tools -->
233N/A <property name="buildtools.dir" location="build-tools" />
233N/A <property name="buildtools.src.dir" location="${buildtools.dir}/src" />
564N/A <property name="buildtools.classes.dir" location="${build.dir}/build-tools/classes" />
0N/A
0N/A <!-- Properties for use in unit testing. -->
0N/A <property name="unittest.testng.dir" location="tests/unit-tests-testng"/>
0N/A <property name="unittest.testng.src.dir"
712N/A location="${unittest.testng.dir}/src/server"/>
0N/A
0N/A <property name="unittest.classes.dir"
0N/A location="${build.dir}/unit-tests/classes" />
0N/A <property name="unittest.report.dir"
0N/A location="${build.dir}/unit-tests/report"/>
233N/A <property name="unittest.resource.dir"
233N/A location="${build.dir}/unit-tests/resource"/>
0N/A
114N/A <!-- Properties for use in functional/integration testing. -->
114N/A <property name="functest.testng.dir"
114N/A location="tests/integration-tests-testng" />
114N/A <property name="functest.testng.src.dir"
114N/A location="${functest.testng.dir}/src"/>
114N/A
0N/A <!-- Properties for use with the DSML component. -->
0N/A <property name="dsml.dir" location="resource/dsml" />
0N/A <property name="dsml.src.dir" location="src/dsml" />
0N/A <property name="dsml.lib.dir" location="${dsml.dir}/lib" />
0N/A <property name="dsml.gen.dir" location="${build.dir}/dsml/gen" />
0N/A <property name="dsml.classes.dir" location="${build.dir}/dsml/classes" />
0N/A
567N/A <!-- Properties for use with the Quick Setup. -->
567N/A <property name="quicksetup.src.dir" location="src/quicksetup" />
567N/A <property name="quicksetup.classes.dir"
567N/A location="${build.dir}/quicksetup/classes" />
712N/A
712N/A <!-- Properties for use with the Status Panel. -->
712N/A <property name="statuspanel.src.dir" location="src/statuspanel" />
712N/A <property name="statuspanel.classes.dir"
712N/A location="${build.dir}/statuspanel/classes" />
712N/A
675N/A <!-- Properties for coverage diff reports -->
675N/A <property name="cvgdiff.dir" location="build/diff" />
712N/A <property name="cvgdiff.report.dir"
675N/A location="${cvgdiff.dir}/report" />
567N/A
0N/A <!-- Properties for code coverage testing. -->
422N/A <property name="coverage.dir" location="build/coverage" />
712N/A <property name="coverage.report.dir"
422N/A location="${coverage.dir}/reports/unit" />
0N/A <property name="coverage.instr.dir"
422N/A location="${coverage.dir}/instrumentedcode" />
0N/A <property name="coverage.data.dir"
422N/A location="${coverage.dir}/gathereddata" />
0N/A
0N/A <!-- Properties for the EMMA code coverage tool. -->
0N/A <property name="emma.dir" location="${ext.dir}/emma/lib" />
0N/A
902N/A <!-- Properties for the AspectJ tools -->
902N/A <property name="aj.dir" location="${ext.dir}/aspectj" />
902N/A <property name="aj.lib.dir" location="${aj.dir}/lib" />
902N/A
0N/A <!-- Properties for the TestNG unit testing tool. -->
0N/A <property name="testng.dir" location="${ext.dir}/testng" />
0N/A <property name="testng.lib.dir" location="${testng.dir}/lib" />
0N/A
233N/A <!-- Properties for the ANT build tool. -->
233N/A <property name="ant.dir" location="${ext.dir}/ant" />
233N/A <property name="ant.lib.dir" location="${ant.dir}/lib" />
233N/A
730N/A <!-- Properties for the checkstyle tool. -->
730N/A <property name="checkstyle.dir" location="${ext.dir}/checkstyle" />
730N/A <property name="checkstyle.cache.dir" location=".checkstyle-cache" />
0N/A
729N/A <!-- Properties for the SVNKit tool. -->
729N/A <property name="svnkit.dir" location="${ext.dir}/svnkit" />
729N/A
0N/A <!-- Properties for Directory Server version information. -->
0N/A <property name="dynconstants.file"
0N/A location="${src.dir}/org/opends/server/util/DynamicConstants.java" />
110N/A <property name="dynconstants.stubfile"
110N/A location="${resource.dir}/DynamicConstants.java.stubs" />
121N/A
699N/A
0N/A <property file="PRODUCT" />
0N/A
0N/A <!-- Create a package bundle containing the DSML library. -->
0N/A <target name="dsml" depends="predsml,package"
0N/A description="Build a Directory Server package bundle with DSML.">
0N/A </target>
0N/A
0N/A
0N/A
0N/A
0N/A <!-- The build target that should be used before committing code. -->
735N/A <target name="precommit" depends="checkstyle,clean,copyrightdates,eolstyle,dsml,javadoc,testwithcoverage"
0N/A description="Perform all processing needed before committing code." />
0N/A
0N/A
0N/A
0N/A
0N/A <!-- The build target that should be used for nightly builds. -->
0N/A <target name="nightly"
511N/A depends="checkstyle,dsml,javadoc,coverage,testall"
0N/A description="Perform all processing needed for nightly builds." />
0N/A
0N/A
0N/A
0N/A
0N/A <!-- The build target that should be used for weekly builds. -->
0N/A <target name="weekly" depends="nightly"
0N/A description="Perform all processing needed for weekly builds." />
0N/A
0N/A
0N/A
0N/A
0N/A <!-- The build target that should be used to build everything. -->
0N/A <target name="all"
735N/A depends="checkstyle,clean,copyrightdates,eolstyle,dsml,javadoc,testallwithcoverage"
0N/A description="Build using all defined targets." />
0N/A
0N/A
0N/A
0N/A
0N/A <!-- Remove all dynamically-generated build files. -->
0N/A <target name="clean"
0N/A description="Clean up any files generated during the build process">
0N/A
0N/A <delete dir="${build.dir}" />
233N/A <delete file="${dynconstants.file}" /> <fileset dir="${lib.dir}">
712N/A <include name="*.jar" />
712N/A </fileset>
0N/A </target>
0N/A
0N/A
121N/A <!-- Perform common initialization common to several targets after cleaning out the previous build environment. -->
121N/A <target name="cleaninit" depends="clean,init"/>
0N/A
0N/A
0N/A <!-- Perform common initialization common to several targets. -->
121N/A <target name="init">
0N/A <tstamp>
0N/A <format property="timestamp" pattern="yyyyMMddHHmmss" />
0N/A </tstamp>
0N/A
984N/A <condition property="DEBUG_BUILD" value="false">
0N/A <not>
0N/A <isset property="DEBUG_BUILD" />
0N/A </not>
0N/A </condition>
0N/A
984N/A <condition property="WEAVE_ENABLED" value="false">
984N/A <not>
984N/A <isset property="WEAVE_ENABLED" />
984N/A </not>
902N/A </condition>
902N/A
0N/A <condition property="MEM" value="128M">
0N/A <not>
0N/A <isset property="MEM" />
0N/A </not>
0N/A </condition>
0N/A
0N/A
0N/A <!--
0N/A ! For some reason, some Apple VMs put quotes around the value of the
0N/A ! java.vm.vendor property, which wreaks havoc with DynamicConstants. This
0N/A ! pair of conditions attempts to work around that by detecting the quote
0N/A ! and surrounding the value with backslashes.
0N/A ! -->
0N/A <condition property="JVM_VENDOR" value="Apple Computer">
0N/A <contains string="${java.vm.vendor}" substring="Apple Computer"
0N/A casesensitive="false" />
0N/A </condition>
0N/A
0N/A <condition property="JVM_VENDOR" value="${java.vm.vendor}">
0N/A <not>
0N/A <isset property="JVM_VENDOR" />
0N/A </not>
0N/A </condition>
729N/A </target>
729N/A
729N/A
729N/A
729N/A
729N/A <!-- Build the DynamicConstants.java file and any of its dependencies. -->
729N/A <target name="dynamicconstants" depends="init,buildtools">
729N/A <!-- Get the revision number of the current Subversion workspace -->
729N/A <taskdef name="getsvnrevision"
729N/A classname="org.opends.build.tools.GetSubversionRevision">
729N/A <classpath>
729N/A <fileset dir="${build.dir}/build-tools">
729N/A <include name="*.jar" />
729N/A </fileset>
729N/A <fileset dir="${svnkit.dir}">
729N/A <include name="*.jar" />
729N/A </fileset>
729N/A </classpath>
729N/A </taskdef>
729N/A
729N/A <getsvnrevision property="REVISION_NUMBER" />
0N/A
0N/A
109N/A <!-- Generate the DynamicConstants.java file.
109N/A Be warned that the .stubs file references the following properties
109N/A PRODUCT_NAME, SHORT_NAME, MAJOR_VERSION, MINOR_VERSION, POINT_VERSION,
109N/A VERSION_QUALIFIER, FIX_IDS, timestamp, user.name, java.version,
984N/A java.vendor, java.vm.version, JVM_VENDOR, DEBUG_BUILD, REVISION_NUMBER,
984N/A WEAVE_ENABLED
109N/A If you change the name of any of those properties in this build.xml
109N/A you'll need to relfect the same change in the .stubs file
109N/A -->
110N/A <copy file="${dynconstants.stubfile}"
109N/A tofile="${dynconstants.file}"
109N/A overwrite="true" >
109N/A <filterchain>
109N/A <expandproperties/>
109N/A </filterchain>
109N/A </copy>
0N/A </target>
0N/A
0N/A
0N/A
0N/A
735N/A <!-- Check modified files to see if any copyright updates are needed. -->
729N/A <target name="copyrightdates" depends="buildtools"
729N/A description="Ensure updated files have the correct copyright year" >
729N/A <taskdef name="checkcopyrightdates"
729N/A classname="org.opends.build.tools.CheckCopyrightDates">
729N/A <classpath>
729N/A <fileset dir="${build.dir}/build-tools">
729N/A <include name="*.jar" />
729N/A </fileset>
729N/A <fileset dir="${svnkit.dir}">
729N/A <include name="*.jar" />
729N/A </fileset>
729N/A </classpath>
729N/A </taskdef>
729N/A
729N/A <checkcopyrightdates>
735N/A <fileset dir="${basedir}" includes="**/*.java" excludes="build/**/*" />
729N/A <fileset dir="${basedir}" includes="**/*.xml" excludes="build/**/*" />
735N/A <fileset dir="${basedir}" includes="**/*.html" excludes="build/**/*" />
729N/A <fileset dir="${basedir}" includes="**/*.sh" excludes="build/**/*" />
729N/A <fileset dir="${basedir}" includes="**/*.bat" excludes="build/**/* " />
729N/A <fileset dir="${basedir}" includes="**/*.ldif" excludes="build/**/*" />
735N/A <fileset dir="${basedir}" includes="**/*.txt" excludes="build/**/*" />
961N/A <fileset dir="${basedir}" includes="**/*.c" excludes="build/**/*" />
961N/A <fileset dir="${basedir}" includes="**/*.h" excludes="build/**/*" />
961N/A <fileset dir="${basedir}" includes="**/*.mc" excludes="build/**/*" />
961N/A <fileset dir="${basedir}" includes="**/Makefile" excludes="build/**/*" />
750N/A <fileset dir="${scripts.dir}" includes="**/*" />
729N/A </checkcopyrightdates>
729N/A </target>
729N/A
729N/A
729N/A
729N/A
735N/A <!-- Check added files to see if any svn:eol-style updates are needed. -->
735N/A <target name="eolstyle" depends="buildtools"
735N/A description="Ensure added files have the correct svn:eol-style" >
735N/A <taskdef name="checkeolstyle"
735N/A classname="org.opends.build.tools.CheckEOLStyle">
735N/A <classpath>
735N/A <fileset dir="${build.dir}/build-tools">
735N/A <include name="*.jar" />
735N/A </fileset>
735N/A <fileset dir="${svnkit.dir}">
735N/A <include name="*.jar" />
735N/A </fileset>
735N/A </classpath>
735N/A </taskdef>
735N/A
735N/A <checkeolstyle>
735N/A <fileset dir="${basedir}" includes="**/*.java" excludes="build/**/*" />
735N/A <fileset dir="${basedir}" includes="**/*.xml" excludes="build/**/*" />
735N/A <fileset dir="${basedir}" includes="**/*.html" excludes="build/**/*" />
735N/A <fileset dir="${basedir}" includes="**/*.sh" excludes="build/**/*" />
735N/A <fileset dir="${basedir}" includes="**/*.bat" excludes="build/**/* " />
735N/A <fileset dir="${basedir}" includes="**/*.ldif" excludes="build/**/*" />
735N/A <fileset dir="${basedir}" includes="**/*.txt" excludes="build/**/*" />
961N/A <fileset dir="${basedir}" includes="**/*.c" excludes="build/**/*" />
961N/A <fileset dir="${basedir}" includes="**/*.h" excludes="build/**/*" />
961N/A <fileset dir="${basedir}" includes="**/*.mc" excludes="build/**/*" />
961N/A <fileset dir="${basedir}" includes="**/Makefile" excludes="build/**/*" />
750N/A <fileset dir="${scripts.dir}" includes="**/*" />
735N/A </checkeolstyle>
735N/A </target>
735N/A
735N/A
735N/A
735N/A
0N/A <!-- Ensure that the source code meets basic style requirements. -->
0N/A <target name="checkstyle" description="Perform basic source style checks">
730N/A <mkdir dir="${checkstyle.cache.dir}" />
0N/A
0N/A <taskdef resource="checkstyletask.properties"
0N/A classpath="${checkstyle.dir}/checkstyle-all-4.1.jar" />
567N/A
662N/A <checkstyle config="${checkstyle.dir}/opends-checkstyle.xml"
0N/A failOnViolation="true">
0N/A <fileset dir="${src.dir}" includes="**/*.java" />
0N/A <formatter type="plain" />
0N/A </checkstyle>
662N/A
567N/A <checkstyle config="${checkstyle.dir}/opends-checkstyle.xml"
567N/A failOnViolation="true">
567N/A <fileset dir="${quicksetup.src.dir}" includes="**/*.java" />
563N/A <formatter type="plain" />
567N/A </checkstyle>
712N/A
712N/A <checkstyle config="${checkstyle.dir}/opends-checkstyle.xml"
730N/A failOnViolation="true">
712N/A <fileset dir="${statuspanel.src.dir}" includes="**/*.java" />
712N/A <formatter type="plain" />
712N/A </checkstyle>
0N/A
0N/A <checkstyle config="${checkstyle.dir}/opends-doctarget-checkstyle.xml"
0N/A failOnViolation="true">
0N/A <fileset dir="${src.dir}/org/opends/server/api" includes="**/*.java" />
0N/A <fileset dir="${src.dir}/org/opends/server/protocols/internal"
0N/A includes="**/*.java" />
0N/A <fileset dir="${src.dir}/org/opends/server/types"
0N/A includes="**/*.java" />
0N/A <formatter type="plain" />
0N/A </checkstyle>
114N/A
114N/A <checkstyle config="${checkstyle.dir}/opends-unittest-checkstyle.xml"
114N/A failOnViolation="true">
114N/A <fileset dir="${unittest.testng.src.dir}" includes="**/*.java" />
114N/A <formatter type="plain" />
114N/A </checkstyle>
114N/A
114N/A <checkstyle config="${checkstyle.dir}/opends-functest-checkstyle.xml"
114N/A failOnViolation="true">
114N/A <fileset dir="${functest.testng.src.dir}" includes="**/*.java" />
114N/A <formatter type="plain" />
114N/A </checkstyle>
0N/A </target>
0N/A
0N/A
0N/A
121N/A <!-- Compile the Directory Server source files. -->
729N/A <target name="cleancompile"
984N/A depends="cleaninit,compilequicksetup,compile,compilestatuspanel"
121N/A description="Recompile the Directory Server source files.">
121N/A </target>
0N/A
0N/A <!-- Compile the Directory Server source files. -->
121N/A <target name="compile"
729N/A depends="init,dynamicconstants"
0N/A description="Compile the Directory Server source files.">
0N/A
0N/A <mkdir dir="${classes.dir}" />
0N/A
0N/A <javac srcdir="${src.dir}" destdir="${classes.dir}" optimize="true"
712N/A excludes="**/package-info.java"
902N/A debug="on" debuglevel="lines,vars,source" source="1.5" target="1.5"
0N/A deprecation="true" fork="true" memoryInitialSize="${MEM}"
0N/A memoryMaximumSize="${MEM}">
0N/A <compilerarg value="-Xlint:all" />
0N/A
0N/A <classpath>
0N/A <fileset dir="${lib.dir}">
0N/A <include name="*.jar" />
0N/A </fileset>
0N/A </classpath>
0N/A </javac>
0N/A </target>
0N/A
984N/A <target name="prepweave">
984N/A <condition property="weave.enabled" value="true">
984N/A <and>
984N/A <equals arg1="${WEAVE_ENABLED}" arg2="true" />
984N/A </and>
984N/A </condition>
984N/A </target>
984N/A
984N/A <target name="weave" if="weave.enabled" depends="compile, prepweave">
902N/A <taskdef resource="org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties">
902N/A <classpath>
902N/A <pathelement location="${aj.lib.dir}/aspectjtools.jar" />
902N/A </classpath>
902N/A </taskdef>
902N/A
902N/A <iajc inpath="${classes.dir}" destdir="${classes.dir}"
902N/A debug="true" debuglevel="lines,source" source="1.5" target="1.5"
902N/A deprecation="true" fork="true" maxmem="${MEM}">
902N/A <classpath>
902N/A <fileset dir="${lib.dir}">
902N/A <include name="*.jar" />
902N/A </fileset>
902N/A </classpath>
902N/A </iajc>
902N/A </target>
902N/A
902N/A
567N/A <!-- Compile the Quick Setup source files. -->
960N/A <target name="compilequicksetup" depends="buildtools,compile"
567N/A description="Compile the Quick Setup source files.">
567N/A
567N/A <mkdir dir="${quicksetup.classes.dir}" />
960N/A <javac srcdir="${src.dir}" destdir="${quicksetup.classes.dir}"
960N/A optimize="true" debug="on" debuglevel="lines,source" source="1.5"
960N/A target="1.5" deprecation="true" fork="true" memoryInitialSize="${MEM}"
960N/A memoryMaximumSize="${MEM}">
960N/A <include name="**/org/opends/server/util/SetupUtils.java"/>
960N/A <include name="**/org/opends/server/util/DynamicConstants.java"/>
960N/A <include name="**/org/opends/server/types/OperatingSystem.java"/>
960N/A <compilerarg value="-Xlint:all" />
960N/A </javac>
960N/A <javac srcdir="${quicksetup.src.dir}" destdir="${quicksetup.classes.dir}"
567N/A optimize="true" debug="on" debuglevel="lines,source" source="1.5"
567N/A target="1.5" deprecation="true" fork="true" memoryInitialSize="${MEM}"
567N/A memoryMaximumSize="${MEM}">
567N/A <compilerarg value="-Xlint:all" />
0N/A
567N/A <classpath>
567N/A <fileset dir="${build.dir}/build-tools">
567N/A <include name="build-tools.jar" />
567N/A </fileset>
567N/A <pathelement path="${classes.dir}"/>
567N/A </classpath>
567N/A </javac>
567N/A <copy todir="${quicksetup.classes.dir}">
567N/A <fileset dir="${quicksetup.src.dir}"
567N/A includes="**/*.properties, **/*.gif, **/*.png" />
567N/A </copy>
563N/A </target>
712N/A
712N/A <!-- Compile the Status Panel source files. -->
712N/A <target name="compilestatuspanel" depends="compilequicksetup"
712N/A description="Compile the Status Panel source files.">
662N/A
712N/A <mkdir dir="${statuspanel.classes.dir}" />
712N/A <javac srcdir="${statuspanel.src.dir}" destdir="${statuspanel.classes.dir}"
712N/A optimize="true" debug="on" debuglevel="lines,source" source="1.5"
712N/A target="1.5" deprecation="true" fork="true" memoryInitialSize="${MEM}"
712N/A memoryMaximumSize="${MEM}">
712N/A <compilerarg value="-Xlint:all" />
662N/A
712N/A <classpath>
712N/A <pathelement path="${classes.dir}"/>
712N/A <pathelement path="${quicksetup.classes.dir}"/>
712N/A </classpath>
712N/A </javac>
712N/A <copy todir="${statuspanel.classes.dir}">
712N/A <fileset dir="${statuspanel.src.dir}"
712N/A includes="**/*.properties, **/*.gif, **/*.png" />
712N/A </copy>
712N/A </target>
567N/A
0N/A <!--
563N/A ! Rebuild the Directory Server without destroying any existing configuration
0N/A ! or data. It will only overwrite the libraries, classes, and scripts, and
0N/A ! it will not re-package. It will also not do a complete initialization, so
0N/A ! DynamicConstants.java won't be regenerated.
0N/A ! -->
0N/A <target name="rebuild"
0N/A description="Rebuild the server without destroying config or data.">
0N/A
0N/A <!-- Set the amount of memory to use for the build -->
0N/A <condition property="MEM" value="128M">
0N/A <not>
0N/A <isset property="MEM" />
0N/A </not>
0N/A </condition>
0N/A
0N/A <!-- Set properties needed to find the packaged files -->
0N/A <property name="pkgversion"
0N/A value="${MAJOR_VERSION}.${MINOR_VERSION}${VERSION_QUALIFIER}" />
0N/A <property name="pdir"
0N/A location="${package.dir}/OpenDS-${pkgversion}" />
0N/A
0N/A <!-- Clean up a minimal set of files/directories for the rebuild. -->
0N/A <delete dir="${classes.dir}" />
0N/A <delete file="${package.dir}/lib/OpenDS.jar" />
0N/A <delete file="${pdir}.zip" />
563N/A <delete dir="${quicksetup.classes.dir}" />
563N/A <delete file="${package.dir}/lib/quicksetup.jar" />
712N/A <delete file="${package.dir}/lib/statuspanel.jar" />
712N/A
0N/A <!-- Recreate the classes directory and recompile into it. -->
0N/A <mkdir dir="${classes.dir}" />
0N/A <javac srcdir="${src.dir}" destdir="${classes.dir}" optimize="true"
0N/A debug="on" debuglevel="lines,source" source="1.5" target="1.5"
0N/A deprecation="true" fork="true" memoryInitialSize="${MEM}"
0N/A memoryMaximumSize="${MEM}">
0N/A <compilerarg value="-Xlint:all" />
0N/A
0N/A <classpath>
0N/A <fileset dir="${lib.dir}">
0N/A <include name="*.jar" />
0N/A </fileset>
0N/A </classpath>
0N/A </javac>
0N/A
0N/A <!-- Generate the OpenDS.jar file -->
0N/A <jar jarfile="${pdir}/lib/OpenDS.jar"
0N/A basedir="${classes.dir}" compress="true" index="true" />
712N/A
563N/A <!-- Recreate the quicksetup classes directory and recompile into it. -->
563N/A <mkdir dir="${quicksetup.classes.dir}" />
960N/A <javac srcdir="${src.dir}" destdir="${quicksetup.classes.dir}"
960N/A optimize="true" debug="on" debuglevel="lines,source" source="1.5"
960N/A target="1.5" deprecation="true" fork="true" memoryInitialSize="${MEM}"
960N/A memoryMaximumSize="${MEM}">
960N/A <include name="**/org/opends/server/util/SetupUtils.java"/>
960N/A <include name="**/org/opends/server/util/DynamicConstants.java"/>
960N/A <include name="**/org/opends/server/types/OperatingSystem.java"/>
960N/A <compilerarg value="-Xlint:all" />
960N/A </javac>
563N/A <javac srcdir="${quicksetup.src.dir}" destdir="${quicksetup.classes.dir}" optimize="true"
563N/A debug="on" debuglevel="lines,source" source="1.5" target="1.5"
563N/A deprecation="true" fork="true" memoryInitialSize="${MEM}"
563N/A memoryMaximumSize="${MEM}">
563N/A <compilerarg value="-Xlint:all" />
563N/A <classpath>
564N/A <fileset dir="${build.dir}/build-tools">
563N/A <include name="build-tools.jar" />
563N/A </fileset>
563N/A <fileset dir="${pdir}/lib">
563N/A <include name="OpenDS.jar" />
563N/A </fileset>
563N/A </classpath>
563N/A </javac>
563N/A
563N/A <copy todir="${quicksetup.classes.dir}">
563N/A <fileset dir="${quicksetup.src.dir}"
563N/A includes="**/*.properties, **/*.gif, **/*.png"/>
563N/A </copy>
563N/A
563N/A <!-- Generate the quicksetup.jar file -->
563N/A <jar jarfile="${pdir}/lib/quicksetup.jar"
563N/A basedir="${quicksetup.classes.dir}" compress="true" index="true" />
712N/A
678N/A <!-- Recreate the statuspanel classes directory and recompile into it. -->
678N/A <mkdir dir="${statuspanel.classes.dir}" />
678N/A <javac srcdir="${statuspanel.src.dir}" destdir="${statuspanel.classes.dir}" optimize="true"
662N/A debug="on" debuglevel="lines,source" source="1.5" target="1.5"
662N/A deprecation="true" fork="true" memoryInitialSize="${MEM}"
662N/A memoryMaximumSize="${MEM}">
662N/A <compilerarg value="-Xlint:all" />
662N/A <classpath>
662N/A <fileset dir="${pdir}/lib">
662N/A <include name="OpenDS.jar" />
662N/A </fileset>
662N/A </classpath>
662N/A </javac>
662N/A
678N/A <copy todir="${statuspanel.classes.dir}">
678N/A <fileset dir="${statuspanel.src.dir}"
662N/A includes="**/*.properties, **/*.gif, **/*.png"/>
662N/A </copy>
712N/A
712N/A <!-- Generate the statuspanel.jar file -->
712N/A <jar jarfile="${pdir}/lib/statuspanel.jar"
712N/A basedir="${statuspanel.classes.dir}" compress="true" index="true" />
0N/A </target>
0N/A
0N/A
0N/A
0N/A
0N/A <!-- Populate the Directory Server package, but don't zip it up. -->
121N/A <target name="prepackage" depends="cleancompile"
0N/A description="Prepare the Directory Server package structure.">
0N/A
0N/A <property name="pkgversion"
0N/A value="${MAJOR_VERSION}.${MINOR_VERSION}${VERSION_QUALIFIER}" />
0N/A <property name="pdir"
0N/A location="${package.dir}/OpenDS-${pkgversion}" />
0N/A
0N/A <mkdir dir="${pdir}" />
0N/A <mkdir dir="${pdir}/bak" />
968N/A <mkdir dir="${pdir}/bat" />
968N/A <mkdir dir="${pdir}/bin" />
0N/A <mkdir dir="${pdir}/classes" />
0N/A <mkdir dir="${pdir}/config" />
920N/A <mkdir dir="${pdir}/config/upgrade" />
0N/A <mkdir dir="${pdir}/config/schema" />
0N/A <mkdir dir="${pdir}/config/messages" />
107N/A <mkdir dir="${pdir}/config/MakeLDIF" />
0N/A <mkdir dir="${pdir}/db" />
0N/A <mkdir dir="${pdir}/changelogDb" />
0N/A <mkdir dir="${pdir}/ldif" />
29N/A <mkdir dir="${pdir}/legal-notices" />
0N/A <mkdir dir="${pdir}/lib" />
0N/A <mkdir dir="${pdir}/locks" />
0N/A <mkdir dir="${pdir}/logs" />
0N/A
0N/A <jar jarfile="${pdir}/lib/OpenDS.jar"
0N/A basedir="${classes.dir}" compress="true" index="true" />
712N/A
563N/A <jar jarfile="${pdir}/lib/quicksetup.jar"
563N/A basedir="${quicksetup.classes.dir}" compress="true" index="true" />
712N/A
712N/A <jar jarfile="${pdir}/lib/statuspanel.jar"
712N/A basedir="${statuspanel.classes.dir}" compress="true" index="true" />
712N/A
0N/A <copy todir="${pdir}/lib">
0N/A <fileset file="${lib.dir}/*.jar" />
0N/A </copy>
827N/A
827N/A <copy todir="${pdir}/lib">
827N/A <fileset file="${lib.dir}/*.exe" />
827N/A </copy>
0N/A
547N/A <fixcrlf srcDir="${scripts.dir}" destDir="${pdir}/bin" excludes="*.bat"
712N/A eol="lf" />
968N/A <fixcrlf srcDir="${scripts.dir}" destDir="${pdir}/bin" includes="*.bat,README_WINDOWS.txt"
712N/A eol="crlf" />
968N/A <fixcrlf srcDir="${scripts.dir}" destDir="${pdir}/bat" includes="*.bat"
968N/A eol="crlf" />
968N/A
0N/A <copy todir="${pdir}/config">
0N/A <fileset file="${config.dir}/*" />
0N/A </copy>
0N/A
920N/A <copy file="${pdir}/config/config.ldif"
920N/A tofile="${pdir}/config/upgrade/config.ldif.${REVISION_NUMBER}" />
920N/A
920N/A <taskdef name="concatschema"
920N/A classname="org.opends.build.tools.ConcatSchema">
920N/A <classpath>
920N/A <fileset dir="${build.dir}/build-tools">
920N/A <include name="*.jar" />
920N/A </fileset>
920N/A </classpath>
920N/A </taskdef>
920N/A
920N/A <concatschema schemaDirectory="${resource.dir}/schema"
920N/A toFile="${pdir}/config/upgrade/schema.ldif.${REVISION_NUMBER}" />
920N/A
0N/A <copy todir="${pdir}/config/schema">
0N/A <fileset dir="${resource.dir}/schema" />
0N/A </copy>
0N/A
0N/A <copy todir="${pdir}/config/messages">
0N/A <fileset dir="${resource.dir}/messages" />
0N/A </copy>
0N/A
107N/A <copy todir="${pdir}/config/MakeLDIF">
107N/A <fileset dir="${resource.dir}/MakeLDIF" />
107N/A </copy>
107N/A
29N/A <copy todir="${pdir}/legal-notices">
29N/A <fileset dir="${resource.dir}/legal-notices" />
29N/A </copy>
29N/A
29N/A <copy todir="${pdir}">
29N/A <fileset file="${resource.dir}/README" />
29N/A </copy>
29N/A
623N/A <fixcrlf srcDir="${resource.dir}" destDir="${pdir}" includes="setup,uninstall"
547N/A eol="lf" />
623N/A <fixcrlf srcDir="${resource.dir}" destDir="${pdir}" includes="setup.bat,uninstall.bat"
547N/A eol="crlf" />
84N/A
565N/A <chmod file="${pdir}/setup" perm="755" />
712N/A <chmod file="${pdir}/uninstall" perm="755" />
485N/A <chmod perm="755">
485N/A <fileset dir="${pdir}/bin">
485N/A <exclude name="*.bat"/>
485N/A </fileset>
485N/A </chmod>
0N/A </target>
0N/A
0N/A
0N/A
0N/A
0N/A <!-- Package the Directory Server for distribution. -->
0N/A <target name="package" depends="prepackage"
0N/A description="Package the Directory Server for distribution.">
0N/A
0N/A <zip destfile="${package.dir}/OpenDS-${pkgversion}.zip">
605N/A <zipfileset dir="${package.dir}" includes="OpenDS-${pkgversion}/**/*"
623N/A excludes="OpenDS-${pkgversion}/bin/*,OpenDS-${pkgversion}/setup,OpenDS-${pkgversion}/uninstall"
0N/A filemode="644" dirmode="755" />
499N/A <zipfileset dir="${package.dir}"
499N/A includes="OpenDS-${pkgversion}/bin/*.bat"
499N/A filemode="644" dirmode="755" />
499N/A <zipfileset dir="${package.dir}" includes="OpenDS-${pkgversion}/bin/*"
499N/A excludes="OpenDS-${pkgversion}/bin/*.bat"
499N/A filemode="755" dirmode="755" />
623N/A <zipfileset dir="${package.dir}" includes="OpenDS-${pkgversion}/setup,OpenDS-${pkgversion}/uninstall"
499N/A filemode="755" dirmode="755" />
0N/A </zip>
0N/A </target>
0N/A
0N/A <!-- Prepare the Directory Server DSML library. -->
0N/A <target name="predsml" depends="prepackage"
0N/A description="Prepare the Directory Server DSML library.">
0N/A
0N/A <taskdef name="xjc" classname="com.sun.tools.xjc.XJCTask">
0N/A <classpath>
0N/A <fileset dir="${dsml.lib.dir}">
0N/A <include name="**/*.jar" />
0N/A </fileset>
0N/A </classpath>
0N/A </taskdef>
0N/A
0N/A <mkdir dir="${dsml.gen.dir}/org/opends/dsml/protocol" />
0N/A <xjc target="${dsml.gen.dir}" schema="${dsml.dir}/schema/DSMLv2.xsd"
0N/A removeOldOutput="yes" package="org.opends.dsml.protocol">
0N/A <produces dir="${dsml.gen.dir}/org/opends/dsml/protocol"
0N/A includes="* impl/*" />
0N/A </xjc>
0N/A
0N/A <mkdir dir="${dsml.classes.dir}" />
0N/A
0N/A <javac srcdir="${dsml.gen.dir}" destdir="${dsml.classes.dir}"
0N/A optimize="true" debug="on" debuglevel="lines,source" source="1.5"
0N/A target="1.5" deprecation="true" fork="true" memoryInitialSize="${MEM}"
0N/A memoryMaximumSize="${MEM}">
0N/A <compilerarg value="-Xlint:all" />
0N/A
0N/A <classpath>
0N/A <fileset dir="${dsml.lib.dir}">
0N/A <include name="*.jar" />
0N/A </fileset>
0N/A </classpath>
0N/A </javac>
0N/A
0N/A <javac srcdir="${dsml.src.dir}" destdir="${dsml.classes.dir}"
0N/A optimize="true" debug="on" debuglevel="lines,source" source="1.5"
0N/A target="1.5" deprecation="true" fork="true" memoryInitialSize="${MEM}"
0N/A memoryMaximumSize="${MEM}">
0N/A <compilerarg value="-Xlint:all" />
0N/A
0N/A <classpath>
0N/A <fileset dir="${dsml.lib.dir}">
0N/A <include name="*.jar" />
0N/A </fileset>
0N/A
0N/A <dirset dir="${classes.dir}" />
0N/A </classpath>
0N/A </javac>
0N/A
605N/A <war destfile="${classes.dir}/OpenDS-${pkgversion}-DSML.war"
0N/A webxml="${dsml.dir}/webapp/web.xml">
0N/A <fileset file="${dsml.dir}/webapp/server.properties" />
0N/A
0N/A <webinf dir="${dsml.dir}/webapp" includes="**/*"
0N/A excludes="web.xml, **/*.jar, **/*.properties" />
0N/A
0N/A <classes dir="${dsml.classes.dir}" />
0N/A
0N/A <lib dir="${dsml.lib.dir}">
0N/A <exclude name="j2ee.jar" />
0N/A </lib>
0N/A
0N/A <lib dir="${pdir}/lib">
0N/A <exclude name="activation.jar" />
0N/A <exclude name="je.jar" />
0N/A </lib>
0N/A </war>
0N/A
605N/A <copy todir="${package.dir}">
0N/A <fileset file="${classes.dir}/*.war" />
0N/A </copy>
0N/A </target>
0N/A
0N/A
0N/A
0N/A
0N/A <!-- Generate JavaDoc documentation from the source files -->
1N/A <target name="javadoc" depends="dsml"
0N/A description="Generate JavaDoc documentation.">
0N/A
0N/A <mkdir dir="${javadoc.dir}" />
0N/A
0N/A <javadoc destdir="${javadoc.dir}" source="1.5" additionalparam="-quiet"
0N/A linksource="yes" windowtitle="${PRODUCT_NAME} API Documentation"
0N/A maxmemory="${MEM}">
0N/A <classpath>
0N/A <fileset dir="${lib.dir}">
0N/A <include name="*.jar" />
0N/A </fileset>
0N/A
0N/A <fileset dir="${dsml.lib.dir}">
0N/A <include name="*.jar" />
0N/A </fileset>
0N/A
0N/A <dirset dir="${classes.dir}" />
0N/A <dirset dir="${dsml.classes.dir}" />
0N/A </classpath>
0N/A
0N/A <packageset dir="${src.dir}" />
0N/A <packageset dir="${dsml.src.dir}" />
0N/A </javadoc>
0N/A </target>
0N/A
0N/A
0N/A
121N/A <!-- Internal target to prepare to generate a code coverage report. -->
121N/A <target name="coverage">
0N/A
0N/A <property name="coverage.enabled" value="true" />
0N/A
0N/A <mkdir dir="${coverage.dir}" />
0N/A <mkdir dir="${coverage.data.dir}" />
0N/A <mkdir dir="${coverage.instr.dir}" />
0N/A <mkdir dir="${coverage.report.dir}" />
0N/A
0N/A <path id="run.classpath">
0N/A <pathelement location="${classes.dir}" />
0N/A </path>
0N/A </target>
0N/A
0N/A
0N/A
21N/A <!-- Prepare to execute the Directory Server TestNG unit tests. -->
984N/A <target name="testinit" depends="buildtools,compile, weave"
0N/A description="Prepare to execute the Directory Server TestNG unit tests.">
0N/A
0N/A <!-- If we are to perform coverage tests, then set that up. -->
0N/A <path id="emma.lib">
0N/A <pathelement location="${emma.dir}/emma.jar" />
0N/A <pathelement location="${emma.dir}/emma_ant.jar" />
0N/A </path>
0N/A
0N/A <taskdef resource="emma_ant.properties" classpathref="emma.lib" />
0N/A
0N/A <emma enabled="${coverage.enabled}">
0N/A <instr instrpathref="run.classpath" destdir="${coverage.instr.dir}"
0N/A metadatafile="${coverage.data.dir}/metadata.emma" merge="true" />
0N/A </emma>
0N/A
0N/A <!-- Compile the test cases -->
0N/A <mkdir dir="${unittest.classes.dir}" />
0N/A <javac srcdir="${unittest.testng.src.dir}" destdir="${unittest.classes.dir}"
0N/A optimize="true" debug="on" debuglevel="lines,source" source="1.5"
0N/A target="1.5" deprecation="true" fork="true" memoryInitialSize="${MEM}"
0N/A memoryMaximumSize="${MEM}">
0N/A <compilerarg value="-Xlint:all" />
0N/A
0N/A <classpath>
0N/A <fileset dir="${lib.dir}">
0N/A <include name="*.jar" />
0N/A </fileset>
0N/A
0N/A <fileset dir="${testng.lib.dir}">
0N/A <include name="*.jar" />
0N/A </fileset>
0N/A
0N/A <path refid="run.classpath" />
0N/A </classpath>
0N/A </javac>
712N/A
233N/A <!-- Prep the TestNG XML file -->
675N/A
675N/A <condition property="test.groups" value="exclude=slow">
675N/A <not>
675N/A <or>
675N/A <isset property="test.groups" />
675N/A <isset property="test.packages" />
675N/A <isset property="test.classes" />
675N/A <isset property="test.methods" />
675N/A </or>
675N/A </not>
675N/A </condition>
675N/A
675N/A <condition property="test.packages" value="org.opends.server.*">
675N/A <not>
675N/A <or>
675N/A <isset property="test.packages" />
675N/A <isset property="test.classes" />
675N/A <isset property="test.methods" />
675N/A </or>
675N/A </not>
675N/A </condition>
675N/A
675N/A <condition property="test.classes" value="">
675N/A <not>
675N/A <or>
675N/A <isset property="test.classes" />
675N/A <isset property="test.methods" />
675N/A </or>
675N/A </not>
675N/A </condition>
675N/A
675N/A <condition property="test.methods" value="">
675N/A <not>
675N/A <or>
675N/A <isset property="test.methods" />
675N/A </or>
675N/A </not>
675N/A </condition>
712N/A
233N/A <mkdir dir="${unittest.resource.dir}" />
233N/A <typedef name="preptestng" classname="org.opends.build.tools.PrepTestNG"
564N/A classpath="${build.dir}/build-tools/build-tools.jar" />
233N/A
233N/A
233N/A <preptestng file="${testng.dir}/testng.xml"
233N/A tofile="${unittest.resource.dir}/testng.xml"
712N/A grouplist="${test.groups}"
567N/A packagelist="${test.packages}"
712N/A classList="${test.classes}"
567N/A methodList="${test.methods}" />
318N/A
712N/A <antcall target="testinit.checkFailedTestsOnly"/>
712N/A </target>
233N/A
712N/A <!-- If we were asked to run only the tests that failed,
712N/A then we overwrite the testng.xml that we just generated
712N/A with testng-failed.xml, which TestNG generated. -->
712N/A <target name="testinit.checkFailedTestsOnly" if="test.failures">
712N/A <!-- Ensure that some of the tests failed last time. -->
712N/A <available property="testng-failed.xml.exists"
712N/A file="${unittest.report.dir}/testng-failed.xml"/>
712N/A <fail message="No unit tests failed in the previous run."
712N/A unless="testng-failed.xml.exists"/>
233N/A
712N/A <!-- We replace the 'Failed suite [OpenDS]' with 'OpenDS' so we
712N/A don't end up with 'Failed suite [Failed suite [OpenDS]]]' etc. -->
712N/A <replace file="${unittest.report.dir}/testng-failed.xml"
712N/A token="Failed suite [OpenDS]"
712N/A value="OpenDS"/>
712N/A <replace file="${unittest.report.dir}/testng-failed.xml"
712N/A token="default(failed)"
712N/A value="default"/>
712N/A
712N/A <copy file="${unittest.report.dir}/testng-failed.xml"
712N/A tofile="${unittest.resource.dir}/testng.xml"
712N/A overwrite="true"/>
712N/A
712N/A <echo message="Will run the failed unit tests only"/>
0N/A </target>
0N/A
675N/A <!-- Generate coverage diff report -->
675N/A <target name="coveragediff">
675N/A <condition property="test.diff.srcpath" value="">
675N/A <not>
675N/A <isset property="test.diff.srcpath" />
675N/A </not>
675N/A </condition>
21N/A
675N/A <condition property="test.diff.enabled" value="true">
675N/A <not>
675N/A <isset property="test.diff.disable" />
675N/A </not>
675N/A </condition>
675N/A
699N/A <condition property="test.diff.verbose" value="false">
699N/A <not>
699N/A <isset property="test.diff.verbose" />
699N/A </not>
699N/A </condition>
699N/A
675N/A <condition property="test.diff.enabled" value="false">
675N/A <isset property="test.diff.disable" />
675N/A </condition>
675N/A
675N/A <mkdir dir="${cvgdiff.report.dir}" />
675N/A <taskdef name="coveragediff" classname="org.opends.build.tools.CoverageDiff">
675N/A <classpath>
675N/A <fileset dir="${build.dir}/build-tools">
675N/A <include name="*.jar" />
675N/A </fileset>
675N/A <fileset dir="${emma.dir}">
675N/A <include name="*.jar" />
675N/A </fileset>
729N/A <fileset dir="${svnkit.dir}">
729N/A <include name="*.jar" />
729N/A </fileset>
675N/A </classpath>
675N/A </taskdef>
675N/A
675N/A <coveragediff emmadatapath="${coverage.data.dir}"
675N/A outputpath="${cvgdiff.report.dir}"
712N/A diffpath="${test.diff.srcpath}"
699N/A enabled="${test.diff.enabled}"
699N/A verbose="${test.diff.verbose}" />
675N/A
712N/A </target>
21N/A
0N/A <!-- Execute the Directory Server TestNG unit tests in text mode. -->
185N/A <target name="enableTestNGAssertions">
185N/A <property name="TESTASSERT" value="true"/>
185N/A </target>
185N/A
318N/A <!-- Execute Directory Server TestNG unit tests specified from CLI -->
699N/A <target name="testcustom">
712N/A <echo message="This target is deprecated. Please use the test target as it now supports the test.* properties." />
318N/A </target>
185N/A
185N/A <!-- Execute all of the Directory Server TestNG unit tests in text mode. -->
185N/A <target name="testall"
318N/A depends="enableTestNGAssertions,prepdefaultalltest,testinit,runtests"
712N/A description="Run all of the TestNG tests (including 'slow' ones) with assertions enabled. See 'testwithcoverage' for properties you can set.">
185N/A </target>
185N/A
185N/A
185N/A <!-- Execute the Directory Server TestNG unit tests in text mode. -->
21N/A <target name="test"
984N/A depends="prepdefaulttest,testinit,runtests"
712N/A description="Execute the Directory Server TestNG unit tests in text mode. Set '-Dorg.opends.test.suppressOutput=false' to see the output from the unit tests. Set '-Dtest.failures=true' to run only the tests that failed previously.">
121N/A </target>
121N/A
121N/A <!-- Execute the Directory Server TestNG unit tests in text mode with a coverage report. -->
121N/A <target name="testwithcoverage"
675N/A depends="coverage,test,coveragediff"
699N/A description="Execute the Directory Server TestNG unit tests in text mode with a coverage report. Use -Dtest.packages, -Dtest.classes, or -Dtest.methods to control which unit tests are run. Use -Dtest.diff.srcpath to control which src files show up in the coverage diff. See the 'test' package for other properties you can set.">
121N/A </target>
121N/A
233N/A <!-- Execute the Directory Server TestNG unit tests in text mode with a coverage report and slow tests. -->
233N/A <target name="testallwithcoverage"
675N/A depends="coverage,testall,coveragediff"
699N/A description="The same as 'testwithcoverage' except 'testall' is run instead of 'test'.">
233N/A </target>
233N/A
318N/A <!-- Execute the Directory Server TestNG unit tests specified from CLI in text mode with a coverage report. -->
699N/A <target name="testcustomwithcoverage">
675N/A <echo message="This target is deprecated. Please use the testwithcoverage target as it now supports the test.* properties." />
318N/A </target>
318N/A
712N/A <target name="testhelp" unless="disable.test.help">
712N/A <echo message="About to run the unit tests. Ant options to control the tests:"/>
712N/A <echo message=""/>
712N/A <echo message=" -Dorg.opends.test.suppressOutput=false"/>
712N/A <echo message=" writes the unit test output to the screen"/>
712N/A <echo message=""/>
712N/A <echo message=" -Dtest.failed=true"/>
712N/A <echo message=" runs only the tests that failed last time"/>
712N/A <echo message=""/>
984N/A <echo message=" -DWEAVE_ENABLED=false" />
902N/A <echo message=" builds the server without the debug logging facility." />
902N/A <echo message=" No debug logging messages will be included on test failures." />
902N/A <echo message=""/>
902N/A <echo message=" -Dtest.debug.target=org.opends.server.core:level=verbose,category=data_access"/>
902N/A <echo message=" for example only include debug messages in the core"/>
902N/A <echo message=" package that are related to data access and at the" />
902N/A <echo message=" verbose level or higher. The syntax of this target" />
902N/A <echo message=" definition is the same as the org.opends.server.debug.target.x" />
902N/A <echo message=" property when starting OpenDS. " />
902N/A <echo message=" Default debug target:"/>
902N/A <echo message=" org.opends.server:level=verbose,category=caught|data|database_access|message|protocol" />
902N/A <echo message=""/>
712N/A <echo message=" -Dtest.packages=org.opends.server.api"/>
712N/A <echo message=" for example runs only the tests in the api package"/>
712N/A <echo message=" For multiple packages, separate them with a ',' and "/>
984N/A <echo message=" quote the entire value. Debug logging is disabled."/>
712N/A <echo message=""/>
712N/A <echo message=" -Dtest.classes=org.opends.server.types.TestDN"/>
712N/A <echo message=" for example only runs the TestDN class"/>
712N/A <echo message=" For multiple classes, separate them with a ',' and "/>
984N/A <echo message=" quote the entire value. Debug logging is disabled."/>
712N/A <echo message=""/>
712N/A <echo message=" -Dtest.methods=org.opends.server.types.TestDN.testGetRDN"/>
712N/A <echo message=" for example only runs the testGetRDN method"/>
712N/A <echo message=" For multiple methods, separate them with a ',' and "/>
984N/A <echo message=" quote the entire value. Debug logging is disabled."/>
712N/A <echo message=""/>
712N/A <echo message=" -Dtest.diff.srcpath=src/server/org/opends/server/core"/>
712N/A <echo message=" for example includes only the classes in"/>
712N/A <echo message=" src/server/org/opends/server/core in the coveragediff report."/>
712N/A <echo message=" To list multiple directories or files, separate them with"/>
712N/A <echo message=" a space as you would an argument list to 'svn diff' and quote"/>
712N/A <echo message=" the whole value."/>
712N/A <echo message=""/>
712N/A </target>
712N/A
121N/A <!-- Internal target to execute the Directory Server TestNG unit tests in text mode after everything has been initialized. -->
121N/A <target name="runtests">
712N/A <antcall target="testhelp"/>
712N/A
0N/A <mkdir dir="${unittest.report.dir}" />
712N/A
0N/A <taskdef resource="testngtasks">
0N/A <classpath>
0N/A <fileset dir="${testng.lib.dir}">
0N/A <include name="*.jar" />
0N/A </fileset>
0N/A </classpath>
0N/A </taskdef>
0N/A
185N/A <!-- This sets TESTASSERT to false if and only if it's not already set. -->
161N/A <condition property="TESTASSERT" value="false">
161N/A <not>
161N/A <isset property="TESTASSERT" />
161N/A </not>
161N/A </condition>
503N/A
503N/A <!-- This sets org.opends.test.suppressOutput if and only if it's not
503N/A already set. -->
712N/A <condition property="org.opends.test.suppressOutput" value="true">
503N/A <not>
503N/A <isset property="org.opends.test.suppressOutput" />
503N/A </not>
503N/A </condition>
712N/A
902N/A <!-- This sets org.opends.test.debug.target if and only if its's not
902N/A alreadly set. -->
902N/A <condition property="org.opends.test.debug.target"
902N/A value="org.opends.server:level=verbose,category=caught|data|database_access|message|protocol">
902N/A <not>
902N/A <isset property="org.opends.test.debug.target" />
902N/A </not>
902N/A </condition>
902N/A
902N/A <!-- Cleanout the old reports. Otherwise, the old testng-failed.xml
712N/A will hang around even if all of the tests pass. -->
712N/A <delete>
712N/A <fileset dir="${unittest.report.dir}" includes="*"/>
712N/A </delete>
712N/A
712N/A <!-- Our testng listener will remove this file if all of the
712N/A tests passed. This allows us to generate the coverage
712N/A report even if the tests failed and still fail the build. -->
712N/A <touch file="${unittest.report.dir}/.tests-failed-marker"/>
712N/A
712N/A <testng outputdir="${unittest.report.dir}"
712N/A haltonfailure="false"
712N/A enableAssert="${TESTASSERT}"
712N/A listeners="org.opends.server.TestListener org.testng.reporters.FailedReporter"
712N/A useDefaultListeners="false"
712N/A suiteRunnerClass="org.opends.server.SuiteRunner">
0N/A <classpath>
0N/A <pathelement location="${coverage.instr.dir}" />
151N/A <pathelement location="${classes.dir}" />
151N/A <pathelement location="${unittest.classes.dir}" />
0N/A
0N/A <path refid="run.classpath" />
42N/A <path refid="emma.lib" />
0N/A
151N/A <fileset dir="${lib.dir}">
0N/A <include name="*.jar" />
0N/A </fileset>
0N/A
0N/A <fileset dir="${testng.lib.dir}">
0N/A <include name="*.jar" />
0N/A </fileset>
0N/A </classpath>
422N/A <jvmarg value="-Demma.coverage.out.file=${coverage.data.dir}/unit.emma" />
42N/A <jvmarg value="-Demma.coverage.out.merge=false" />
151N/A <jvmarg value="-Dorg.opends.server.BuildRoot=${basedir}" />
937N/A <jvmarg value="-Dorg.opends.server.RunningUnitTests=true" />
503N/A <jvmarg value="-Dorg.opends.test.suppressOutput=${org.opends.test.suppressOutput}" />
902N/A <jvmarg value="-Dorg.opends.test.debug.target=${org.opends.test.debug.target}" />
371N/A <jvmarg value="-Xms${MEM}" />
712N/A <jvmarg value="-Xmx${MEM}" />
233N/A <xmlfileset dir="${unittest.resource.dir}" includes="testng.xml" />
0N/A </testng>
121N/A
712N/A <!-- Our testng listener will create this file if any of the
712N/A tests failed. This allows us to generate the coverage
712N/A report even if the tests failed. -->
712N/A <available property="testng.tests.failed"
712N/A file="${unittest.report.dir}/.tests-failed-marker"/>
712N/A
712N/A <!-- Delete all of the report suite sub-directories since we only
712N/A have a single suite. -->
712N/A <delete dir="${unittest.report.dir}/OpenDS"/>
712N/A
42N/A <emma enabled="${coverage.enabled}" >
95N/A <report sourcepath="${src.dir}" >
422N/A <fileset dir="${coverage.data.dir}" >
422N/A <include name="unit.emma" />
422N/A <include name="metadata.emma" />
422N/A </fileset>
42N/A
724N/A <txt outfile="${coverage.report.dir}/coverage.txt" />
422N/A <html outfile="${coverage.report.dir}/index.html" />
724N/A <xml outfile="${coverage.report.dir}/coverage.xml" />
42N/A </report>
712N/A
42N/A </emma>
121N/A
712N/A <!-- We delay failing until after the coverage report is generated. -->
712N/A <fail message="The unit tests failed." if="testng.tests.failed"/>
712N/A
0N/A </target>
0N/A
318N/A <target name="prepdefaultalltest">
984N/A <condition property="WEAVE_ENABLED" value="true">
984N/A <not>
984N/A <or>
984N/A <isset property="WEAVE_ENABLED" />
984N/A <isset property="test.groups" />
984N/A <isset property="test.packages" />
984N/A <isset property="test.classes" />
984N/A <isset property="test.methods" />
984N/A </or>
984N/A </not>
984N/A </condition>
984N/A
984N/A <condition property="test.groups" value="">
984N/A <not>
984N/A <or>
984N/A <isset property="test.groups" />
984N/A <isset property="test.packages" />
984N/A <isset property="test.classes" />
984N/A <isset property="test.methods" />
984N/A </or>
984N/A </not>
984N/A </condition>
984N/A </target>
984N/A
984N/A <target name="prepdefaulttest">
984N/A <condition property="WEAVE_ENABLED" value="true">
984N/A <not>
984N/A <or>
984N/A <isset property="WEAVE_ENABLED" />
984N/A <isset property="test.groups" />
984N/A <isset property="test.packages" />
984N/A <isset property="test.classes" />
984N/A <isset property="test.methods" />
984N/A </or>
984N/A </not>
984N/A </condition>
984N/A
984N/A <condition property="test.groups" value="exclude=slow">
984N/A <not>
984N/A <or>
984N/A <isset property="test.groups" />
984N/A <isset property="test.packages" />
984N/A <isset property="test.classes" />
984N/A <isset property="test.methods" />
984N/A </or>
984N/A </not>
984N/A </condition>
233N/A </target>
21N/A
21N/A <target name="testreport"
21N/A depends="test"
0N/A description="Takes testng results and convert them into JUnit compatible xml">
0N/A <junitreport todir="${unittest.report.dir}">
0N/A <fileset dir="${unittest.report.dir}">
0N/A <include name="*.xml"/>
0N/A </fileset>
0N/A
0N/A <report format="noframes" todir="${unittest.report.dir}"/>
0N/A </junitreport>
0N/A </target>
0N/A
121N/A
121N/A <target name="integration-tests"
422N/A description="Builds the integration tests"
423N/A >
423N/A <ant dir="${functest.testng.dir}" inheritall="false"/>
51N/A </target>
233N/A
423N/A
233N/A <target name="buildtools"
233N/A description="Builds the build tools">
233N/A
233N/A <!-- Set the amount of memory to use for the build -->
233N/A <condition property="MEM" value="128M">
233N/A <not>
233N/A <isset property="MEM" />
233N/A </not>
233N/A </condition>
233N/A
233N/A <mkdir dir="${buildtools.classes.dir}" />
233N/A
233N/A <javac srcdir="${buildtools.src.dir}" destdir="${buildtools.classes.dir}"
233N/A optimize="true" debug="on" debuglevel="lines,source" source="1.5"
233N/A target="1.5" deprecation="true" fork="true" memoryInitialSize="${MEM}"
233N/A memoryMaximumSize="${MEM}">
233N/A <compilerarg value="-Xlint:all" />
233N/A
233N/A <classpath>
233N/A <fileset dir="${ant.lib.dir}">
233N/A <include name="*.jar" />
233N/A </fileset>
578N/A
578N/A <fileset dir="${emma.dir}">
578N/A <include name="*.jar" />
578N/A </fileset>
729N/A
729N/A <fileset dir="${svnkit.dir}">
729N/A <include name="*.jar" />
729N/A </fileset>
729N/A
233N/A <path refid="run.classpath" />
233N/A </classpath>
233N/A </javac>
233N/A
564N/A <jar jarfile="${build.dir}/build-tools/build-tools.jar"
233N/A basedir="${buildtools.classes.dir}" compress="true" index="true" />
233N/A </target>
51N/A
0N/A</project>