build.xml revision 2123
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 !
5037N/A ! Portions Copyright 2006-2007 Sun Microsystems, Inc.
6131N/A ! -->
6238N/A
0N/A<project name="Directory Server" basedir="." default="package">
0N/A <description>
6133N/A This is the build script for the OpenDS Directory Server. See the BUILDING
6133N/A file in this directory for build instructions.
0N/A </description>
5422N/A
0N/A <!-- General server-wide properties -->
0N/A <property name="src.dir" location="src/server" />
0N/A <property name="build.dir" location="build" />
3012N/A <property name="classes.dir" location="${build.dir}/classes" />
5040N/A <property name="lib.dir" location="lib" />
3381N/A <property name="ext.dir" location="ext" />
3349N/A <property name="package.dir" location="${build.dir}/package" />
3349N/A <property name="javadoc.dir" location="${build.dir}/javadoc" />
3012N/A <property name="resource.dir" location="resource" />
1083N/A <property name="scripts.dir" location="${resource.dir}/bin" />
1083N/A <property name="config.dir" location="${resource.dir}/config" />
1083N/A <property name="build.debuglevel" value="lines,vars,source" />
1083N/A
4156N/A <!-- Properties for build tools -->
1083N/A <property name="buildtools.src.dir" location="src/build-tools" />
1083N/A <property name="buildtools.classes.dir" location="${build.dir}/build-tools/classes" />
1083N/A
1083N/A <!-- Properties for use in unit testing. -->
3090N/A <property name="unittest.testng.dir" location="tests/unit-tests-testng"/>
3090N/A <property name="unittest.testng.src.dir"
3214N/A location="${unittest.testng.dir}/src/server"/>
5481N/A
1083N/A <property name="unittest.classes.dir"
1083N/A location="${build.dir}/unit-tests/classes" />
1083N/A <property name="unittest.report.dir"
1083N/A location="${build.dir}/unit-tests/report"/>
6133N/A <property name="unittest.resource.dir"
6133N/A location="${build.dir}/unit-tests/resource"/>
6157N/A
6157N/A <!-- Properties for use in functional/integration testing. -->
6157N/A <property name="functest.testng.dir"
6157N/A location="tests/integration-tests-testng" />
6157N/A <property name="functest.testng.src.dir"
6157N/A location="${functest.testng.dir}/src"/>
6157N/A
6157N/A <!-- Properties for use with the DSML component. -->
6157N/A <property name="dsml.dir" location="resource/dsml" />
233N/A <property name="dsml.src.dir" location="src/dsml" />
712N/A <property name="dsml.lib.dir" location="${dsml.dir}/lib" />
1177N/A <property name="dsml.gen.dir" location="${build.dir}/dsml/gen" />
564N/A <property name="dsml.classes.dir" location="${build.dir}/dsml/classes" />
0N/A
0N/A <!-- Properties for use with the Quick Setup. -->
0N/A <property name="quicksetup.src.dir" location="src/quicksetup" />
0N/A <property name="quicksetup.classes.dir"
712N/A location="${build.dir}/quicksetup/classes" />
0N/A <property name="quicksetup.globalcompile.classes.dir"
0N/A location="${classes.dir}/org/opends/quicksetup" />
0N/A <property name="ads.src.dir" location="src/ads" />
0N/A <property name="ads.classes.dir" location="${classes.dir}/org/opends/admin/ads"/>
0N/A
233N/A <!-- Properties for use with the GUI Tools that go in OpenDS jar. -->
233N/A <property name="guitools.src.dir" location="src/guitools" />
0N/A
0N/A <!-- Properties for coverage diff reports -->
0N/A <property name="cvgdiff.dir" location="build/diff" />
0N/A <property name="cvgdiff.report.dir"
0N/A location="${cvgdiff.dir}/report" />
0N/A
0N/A <!-- Properties for code coverage testing. -->
0N/A <property name="coverage.dir" location="build/coverage" />
567N/A <property name="coverage.report.dir"
567N/A location="${coverage.dir}/reports/unit" />
567N/A <property name="coverage.instr.dir"
567N/A location="${coverage.dir}/instrumentedcode" />
2046N/A <property name="coverage.data.dir"
2046N/A location="${coverage.dir}/gathereddata" />
1210N/A
2033N/A <!-- Properties for the EMMA code coverage tool. -->
712N/A <property name="emma.dir" location="${ext.dir}/emma/lib" />
5614N/A
2046N/A <!-- Properties for the AspectJ tools -->
712N/A <property name="aj.dir" location="${ext.dir}/aspectj" />
675N/A <property name="aj.lib.dir" location="${aj.dir}/lib" />
5058N/A
712N/A <!-- Properties for the TestNG unit testing tool. -->
675N/A <property name="testng.dir" location="${ext.dir}/testng" />
567N/A <property name="testng.lib.dir" location="${testng.dir}/lib" />
0N/A
5058N/A <!-- Properties for the ANT build tool. -->
712N/A <property name="ant.dir" location="${ext.dir}/ant" />
422N/A <property name="ant.lib.dir" location="${ant.dir}/lib" />
0N/A
422N/A <!-- Properties for the checkstyle tool. -->
0N/A <property name="checkstyle.dir" location="${ext.dir}/checkstyle" />
422N/A <property name="checkstyle.cache.dir" location=".checkstyle-cache" />
0N/A
0N/A <!-- Properties for the SVNKit tool. -->
0N/A <property name="svnkit.dir" location="${ext.dir}/svnkit" />
0N/A
902N/A <!-- Properties for Directory Server version information. -->
902N/A <property name="dynconstants.file"
902N/A location="${src.dir}/org/opends/server/util/DynamicConstants.java" />
902N/A <property name="dynconstants.stubfile"
0N/A location="${resource.dir}/DynamicConstants.java.stubs" />
0N/A
0N/A
0N/A <property file="PRODUCT" />
233N/A
233N/A <!-- Properties for administration framework code generation. -->
233N/A <property name="admin.defn.dir" location="src/admin/defn" />
233N/A <property name="admin.src.dir" location="src/admin/generated" />
730N/A <property name="admin.rules.dir" location="resource/admin" />
730N/A
730N/A <!-- Properties for generating messages. -->
0N/A <property name="msg.prop.dir" location="src/messages/messages" />
729N/A <property name="msg.javagen.dir" location="src/messages/generated" />
729N/A <property name="msg.package.dir" location="${classes.dir}/messages" />
729N/A <property name="msg.src.dir" location="src/messages/src" />
0N/A
0N/A
0N/A <!-- Create a package bundle containing the DSML library. -->
110N/A <target name="dsml" depends="predsml,package"
110N/A description="Build a Directory Server package bundle with DSML.">
121N/A </target>
699N/A
0N/A
0N/A
1008N/A
1008N/A <!-- The build target that should be used before committing code. -->
1008N/A <target name="precommit" depends="checkstyle,clean,checkprecommit,dsml,testwithcoverage"
1008N/A description="Perform all processing needed before committing code.">
3214N/A </target>
3381N/A
2086N/A
3646N/A
3646N/A
3646N/A <!-- The build target that should be used for nightly builds. -->
5947N/A <target name="nightly"
2086N/A depends="checkstyle,dsml,srczip,javadoc,coverage,testallwithcoverage"
3646N/A description="Perform all processing needed for nightly builds.">
1177N/A </target>
3980N/A
3980N/A
5058N/A
3980N/A
3980N/A <!-- The build target that should be used for weekly builds. -->
3349N/A <target name="weekly" depends="nightly"
3349N/A description="Perform all processing needed for weekly builds.">
3349N/A </target>
3349N/A
4686N/A
3349N/A
3349N/A
3381N/A <!-- The build target that should be used to build everything. -->
3349N/A <target name="all"
6608N/A depends="checkstyle,clean,checkprecommit,dsml,srczip,javadoc,testallwithcoverage"
6374N/A description="Build using all defined targets.">
6374N/A </target>
6374N/A
6374N/A
6374N/A <target name="generatemessages" depends="buildtools">
6374N/A <typedef name="genmsg"
6374N/A classname="org.opends.build.tools.GenerateMessageFile" >
6374N/A <classpath>
6374N/A <fileset dir="${build.dir}/build-tools">
6374N/A <include name="*.jar" />
6374N/A </fileset>
6374N/A </classpath>
6374N/A </typedef>
6374N/A <!--
6158N/A <genmsg sourceProps="${msg.prop.dir}/xxx.properties"
6571N/A destJava="${msg.javagen.dir}/org/opends/messages/XxxMessages.java">
6571N/A </genmsg>
6571N/A -->
6571N/A <genmsg sourceProps="${msg.prop.dir}/access_control.properties"
6571N/A destJava="${msg.javagen.dir}/org/opends/messages/AccessControlMessages.java">
6917N/A </genmsg>
6917N/A <genmsg sourceProps="${msg.prop.dir}/admin.properties"
6917N/A destJava="${msg.javagen.dir}/org/opends/messages/AdminMessages.java">
6158N/A </genmsg>
5713N/A <genmsg sourceProps="${msg.prop.dir}/admin_tool.properties"
6162N/A destJava="${msg.javagen.dir}/org/opends/messages/AdminToolMessages.java">
5713N/A </genmsg>
5902N/A <genmsg sourceProps="${msg.prop.dir}/backend.properties"
6280N/A destJava="${msg.javagen.dir}/org/opends/messages/BackendMessages.java">
5902N/A </genmsg>
5902N/A <genmsg sourceProps="${msg.prop.dir}/config.properties"
5902N/A destJava="${msg.javagen.dir}/org/opends/messages/ConfigMessages.java">
5902N/A </genmsg>
5902N/A <genmsg sourceProps="${msg.prop.dir}/core.properties"
5902N/A destJava="${msg.javagen.dir}/org/opends/messages/CoreMessages.java">
5902N/A </genmsg>
5902N/A <genmsg sourceProps="${msg.prop.dir}/extension.properties"
5713N/A destJava="${msg.javagen.dir}/org/opends/messages/ExtensionMessages.java">
3381N/A </genmsg>
0N/A <genmsg sourceProps="${msg.prop.dir}/jeb.properties"
0N/A destJava="${msg.javagen.dir}/org/opends/messages/JebMessages.java">
0N/A </genmsg>
0N/A <genmsg sourceProps="${msg.prop.dir}/log.properties"
3381N/A destJava="${msg.javagen.dir}/org/opends/messages/LoggerMessages.java">
5058N/A </genmsg>
5058N/A <genmsg sourceProps="${msg.prop.dir}/plugin.properties"
5058N/A destJava="${msg.javagen.dir}/org/opends/messages/PluginMessages.java">
3381N/A </genmsg>
0N/A <genmsg sourceProps="${msg.prop.dir}/protocol.properties"
5058N/A destJava="${msg.javagen.dir}/org/opends/messages/ProtocolMessages.java">
5896N/A </genmsg>
1177N/A <genmsg sourceProps="${msg.prop.dir}/quicksetup.properties"
1177N/A destJava="${msg.javagen.dir}/org/opends/messages/QuickSetupMessages.java">
0N/A </genmsg>
0N/A <genmsg sourceProps="${msg.prop.dir}/replication.properties"
0N/A destJava="${msg.javagen.dir}/org/opends/messages/ReplicationMessages.java">
3853N/A </genmsg>
1177N/A <genmsg sourceProps="${msg.prop.dir}/schema.properties"
1177N/A destJava="${msg.javagen.dir}/org/opends/messages/SchemaMessages.java">
0N/A </genmsg>
3853N/A <genmsg sourceProps="${msg.prop.dir}/task.properties"
3853N/A destJava="${msg.javagen.dir}/org/opends/messages/TaskMessages.java">
3853N/A </genmsg>
6917N/A <genmsg sourceProps="${msg.prop.dir}/third_party.properties"
3853N/A destJava="${msg.javagen.dir}/org/opends/messages/ThirdPartyMessages.java">
0N/A </genmsg>
3853N/A <genmsg sourceProps="${msg.prop.dir}/tools.properties"
3853N/A destJava="${msg.javagen.dir}/org/opends/messages/ToolMessages.java">
5896N/A </genmsg>
3853N/A <genmsg sourceProps="${msg.prop.dir}/user_defined.properties"
3853N/A destJava="${msg.javagen.dir}/org/opends/messages/UserDefinedMessages.java">
0N/A </genmsg>
0N/A <genmsg sourceProps="${msg.prop.dir}/utility.properties"
0N/A destJava="${msg.javagen.dir}/org/opends/messages/UtilityMessages.java">
0N/A </genmsg>
1177N/A <genmsg sourceProps="${msg.prop.dir}/version.properties"
1177N/A destJava="${msg.javagen.dir}/org/opends/messages/VersionMessages.java">
0N/A </genmsg>
6919N/A </target>
6916N/A
6916N/A
6916N/A <!-- Remove all dynamically-generated build files. -->
6916N/A <target name="clean" depends="cleanadmin,cleanmessages"
6916N/A description="Clean up any files generated during the build process">
6916N/A
6916N/A <delete dir="${build.dir}" />
6916N/A <delete file="${dynconstants.file}" />
6916N/A <fileset dir="${lib.dir}">
6916N/A <include name="*.jar" />
0N/A </fileset>
6919N/A </target>
6919N/A
6919N/A
6919N/A
6919N/A <!-- Perform common initialization common to several targets after cleaning out the previous build environment. -->
6919N/A <target name="cleaninit" depends="clean,init">
6919N/A </target>
3381N/A
3381N/A
0N/A
0N/A <!-- Set the property valid.java.version if the java version is valid. -->
5896N/A <target name="validjavaversion"
1177N/A depends="buildtools" >
1177N/A
0N/A <property name="min.java.version" value="1.5.0_08" />
0N/A
2086N/A <typedef name="validjavaversion"
2086N/A classname="org.opends.build.tools.ValidJavaVersion" >
2086N/A <classpath>
2086N/A <fileset dir="${build.dir}/build-tools">
2086N/A <include name="*.jar" />
2086N/A </fileset>
2086N/A </classpath>
2086N/A </typedef>
2086N/A
2086N/A <condition property="valid.java.version">
2086N/A <validjavaversion minVersion="${min.java.version}" />
2086N/A </condition>
2086N/A
2086N/A </target>
2086N/A
2086N/A <!-- Warn if the build java version is too old. -->
2086N/A <target name="checkjavaversion"
2086N/A depends="validjavaversion"
2086N/A unless="valid.java.version" >
2086N/A <echo level="warning"
2086N/A message="WARNING: Java version ${java.version} is too old."/>
2086N/A <echo level="warning"
2086N/A message="Java version ${min.java.version} or later is required to build ${SHORT_NAME}."/>
2086N/A </target>
2086N/A
2086N/A <!-- Perform common initialization common to several targets. -->
2086N/A <target name="init">
2086N/A
2086N/A <path id="run.classpath">
2086N/A <pathelement location="${classes.dir}" />
2086N/A </path>
2086N/A
2284N/A <path id="quickSetup.classpath">
2284N/A <pathelement location="${quicksetup.classes.dir}" />
2284N/A </path>
2086N/A
2086N/A <tstamp>
2086N/A <format property="timestamp" pattern="yyyyMMddHHmmss'Z'"
2086N/A timezone="UTC" />
2086N/A </tstamp>
2086N/A
2086N/A <condition property="DEBUG_BUILD" value="false">
2086N/A <not>
2086N/A <isset property="DEBUG_BUILD" />
2086N/A </not>
2086N/A </condition>
2086N/A
2086N/A <condition property="WEAVE_ENABLED" value="false">
2086N/A <not>
2086N/A <isset property="WEAVE_ENABLED" />
2086N/A </not>
2086N/A </condition>
2086N/A
2086N/A <condition property="MEM" value="192M">
2086N/A <not>
2086N/A <isset property="MEM" />
2086N/A </not>
2086N/A </condition>
2086N/A
2086N/A
2086N/A <!--
2086N/A ! For some reason, some Apple VMs put quotes around the value of the
2086N/A ! java.vm.vendor property, which wreaks havoc with DynamicConstants. This
2086N/A ! pair of conditions attempts to work around that by detecting the quote
2086N/A ! and surrounding the value with backslashes.
2086N/A ! -->
2086N/A <condition property="JVM_VENDOR" value="Apple Computer">
2086N/A <contains string="${java.vm.vendor}" substring="Apple Computer"
2086N/A casesensitive="false" />
2086N/A </condition>
2086N/A
3034N/A <condition property="JVM_VENDOR" value="${java.vm.vendor}">
3034N/A <not>
3034N/A <isset property="JVM_VENDOR" />
4156N/A </not>
4156N/A </condition>
0N/A </target>
5947N/A
5947N/A
5947N/A
5947N/A
5947N/A <!-- Build the DynamicConstants.java file and any of its dependencies. -->
5947N/A <target name="dynamicconstants" depends="init,buildtools">
5947N/A <!-- Get the revision number of the current Subversion workspace -->
5947N/A <taskdef name="getsvnrevision"
5947N/A classname="org.opends.build.tools.GetSubversionRevision">
5947N/A <classpath>
5947N/A <fileset dir="${build.dir}/build-tools">
5947N/A <include name="*.jar" />
5947N/A </fileset>
5947N/A <fileset dir="${svnkit.dir}">
5947N/A <include name="*.jar" />
5947N/A </fileset>
5947N/A </classpath>
5947N/A </taskdef>
5947N/A
5947N/A <getsvnrevision property="REVISION_NUMBER" />
5947N/A
5947N/A
5947N/A <!-- Construct the version number string -->
5947N/A <taskdef name="getversionnumber"
5947N/A classname="org.opends.build.tools.CreateVersionString">
5947N/A <classpath>
5947N/A <fileset dir="${build.dir}/build-tools">
5947N/A <include name="*.jar" />
5947N/A </fileset>
5947N/A </classpath>
5947N/A </taskdef>
5947N/A
5947N/A <getversionnumber property="VERSION_NUMBER_STRING" />
5947N/A
5947N/A
5947N/A <!-- Generate the DynamicConstants.java file.
5947N/A Be warned that the .stubs file references the following properties
5947N/A PRODUCT_NAME, SHORT_NAME, MAJOR_VERSION, MINOR_VERSION, POINT_VERSION,
5947N/A VERSION_QUALIFIER, FIX_IDS, timestamp, user.name, java.version,
5947N/A java.vendor, java.vm.version, JVM_VENDOR, DEBUG_BUILD, REVISION_NUMBER,
5947N/A WEAVE_ENABLED, VERSION_NUMBER_STRING
5947N/A If you change the name of any of those properties in this build.xml
5947N/A you'll need to reflect the same change in the .stubs file
5947N/A -->
5947N/A <condition property="BUILD_NUMBER" value="-1">
5947N/A <not>
5947N/A <isset property="BUILD_NUMBER" />
5947N/A </not>
5947N/A </condition>
5947N/A
5947N/A <copy file="${dynconstants.stubfile}"
5947N/A tofile="${dynconstants.file}"
5947N/A overwrite="true" >
5947N/A <filterchain>
5947N/A <expandproperties/>
5947N/A </filterchain>
5947N/A </copy>
5947N/A </target>
5947N/A
5947N/A
5947N/A
5947N/A
5947N/A <!-- Check modified files to see if any svn:eol-style or copyright updates
5947N/A are needed. -->
5947N/A <target name="checkprecommit" depends="buildtools"
5947N/A description="Ensure updated files eol-style and copyright info">
5947N/A <taskdef name="checkprecommit"
5947N/A classname="org.opends.build.tools.CheckPrecommit">
5947N/A <classpath>
5947N/A <fileset dir="${build.dir}/build-tools">
5947N/A <include name="*.jar" />
5947N/A </fileset>
5947N/A <fileset dir="${svnkit.dir}">
5947N/A <include name="*.jar" />
5947N/A </fileset>
5947N/A </classpath>
5947N/A </taskdef>
5947N/A
5947N/A <checkprecommit />
5947N/A </target>
5947N/A
5947N/A
5947N/A
5947N/A <!-- Ensure that the source code meets basic style requirements. -->
5947N/A <target name="checkstyle" description="Perform basic source style checks">
5947N/A <mkdir dir="${checkstyle.cache.dir}" />
5947N/A
5947N/A <taskdef resource="checkstyletask.properties"
0N/A classpath="${checkstyle.dir}/checkstyle-all-4.1.jar" />
6133N/A
0N/A <checkstyle config="${checkstyle.dir}/opends-checkstyle.xml"
0N/A failOnViolation="true">
2342N/A <fileset dir="${src.dir}">
1008N/A <include name="**/*.java"/>
6238N/A <exclude name="**/PublicAPI.java" />
6238N/A </fileset>
6238N/A <formatter type="plain" />
0N/A </checkstyle>
0N/A
0N/A <checkstyle config="${checkstyle.dir}/opends-checkstyle.xml"
1177N/A failOnViolation="true">
121N/A <fileset dir="${msg.src.dir}" includes="**/*.java" />
1177N/A <formatter type="plain" />
1177N/A </checkstyle>
1177N/A
0N/A <checkstyle config="${checkstyle.dir}/opends-checkstyle.xml"
0N/A failOnViolation="true">
1273N/A <fileset dir="${ads.src.dir}" includes="**/*.java" />
1273N/A <formatter type="plain" />
1273N/A </checkstyle>
1273N/A
5178N/A <checkstyle config="${checkstyle.dir}/opends-checkstyle.xml"
1273N/A failOnViolation="true">
5038N/A <fileset dir="${quicksetup.src.dir}" includes="**/*.java" />
1273N/A <formatter type="plain" />
1273N/A </checkstyle>
1273N/A
1273N/A <checkstyle config="${checkstyle.dir}/opends-checkstyle.xml"
1273N/A failOnViolation="true">
1273N/A <fileset dir="${guitools.src.dir}" includes="**/*.java" />
1273N/A <formatter type="plain" />
1273N/A </checkstyle>
1273N/A
1273N/A <checkstyle config="${checkstyle.dir}/opends-doctarget-checkstyle.xml"
1273N/A failOnViolation="true">
1273N/A <fileset dir="${src.dir}/org/opends/server/api" includes="**/*.java" />
1273N/A <fileset dir="${src.dir}/org/opends/server/protocols/internal"
1273N/A includes="**/*.java" />
1273N/A <fileset dir="${src.dir}/org/opends/server/types"
1273N/A includes="**/*.java" excludes="**/PublicAPI.java"/>
1273N/A <formatter type="plain" />
1273N/A </checkstyle>
1273N/A
1273N/A <checkstyle config="${checkstyle.dir}/opends-unittest-checkstyle.xml"
1273N/A failOnViolation="true">
1960N/A <fileset dir="${unittest.testng.src.dir}" includes="**/*.java" />
1273N/A <formatter type="plain" />
1273N/A </checkstyle>
5058N/A
0N/A <checkstyle config="${checkstyle.dir}/opends-functest-checkstyle.xml"
121N/A failOnViolation="true">
1177N/A <fileset dir="${functest.testng.src.dir}" includes="**/*.java" />
1177N/A <formatter type="plain" />
1177N/A </checkstyle>
1177N/A </target>
1177N/A
1559N/A
1559N/A
1559N/A <!-- Compile the Directory Server source files. -->
3381N/A <target name="cleancompile"
0N/A depends="cleaninit,compilequicksetup,weave"
1234N/A description="Recompile the Directory Server source files.">
1234N/A </target>
0N/A
0N/A <!-- Compile the Directory Server source files. -->
984N/A <target name="compile"
0N/A depends="init,checkjavaversion,dynamicconstants,generatemessages,compileadmin"
0N/A description="Compile the Directory Server source files.">
0N/A <mkdir dir="${classes.dir}" />
0N/A
0N/A <javac srcdir="${src.dir}:${admin.src.dir}:${msg.src.dir}:${msg.javagen.dir}:${ads.src.dir}:${quicksetup.src.dir}:${guitools.src.dir}"
0N/A destdir="${classes.dir}" debug="on" debuglevel="${build.debuglevel}"
0N/A source="1.5" target="1.5" deprecation="true" fork="true"
0N/A memoryInitialSize="${MEM}" 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 <fileset dir="${build.dir}/build-tools">
0N/A <include name="build-tools.jar" />
0N/A </fileset>
0N/A </classpath>
0N/A </javac>
0N/A
0N/A <copy todir="${classes.dir}">
0N/A <fileset dir="${src.dir}" includes="**/*.properties" />
3381N/A <fileset dir="${quicksetup.src.dir}" includes="**/*.properties, **/*.gif, **/*.png" />
3349N/A <fileset dir="${guitools.src.dir}" includes="**/*.properties, **/*.gif, **/*.png" />
3349N/A </copy>
3349N/A </target>
3349N/A
3349N/A
3349N/A
3349N/A <target name="prepweave">
3349N/A <condition property="weave.enabled" value="true">
3349N/A <equals arg1="${WEAVE_ENABLED}" arg2="true" />
3349N/A </condition>
3349N/A </target>
3349N/A
3381N/A
3853N/A
3853N/A <target name="weave" if="weave.enabled" depends="prepweave">
3853N/A <echo message=" Weaving the source code with automatic AspectJ debug logging."/>
3853N/A <echo message=" Build with -DWEAVE_ENABLED=false to turn this off."/>
3853N/A <taskdef resource="org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties">
3853N/A <classpath>
3853N/A <pathelement location="${aj.lib.dir}/aspectjtools.jar" />
3853N/A </classpath>
729N/A </taskdef>
729N/A
729N/A <iajc inpath="${classes.dir}" destdir="${classes.dir}"
729N/A debug="true" debuglevel="${build.debuglevel}" source="1.5" target="1.5"
729N/A deprecation="true" fork="true" maxmem="${MEM}">
729N/A <classpath>
729N/A <fileset dir="${lib.dir}">
729N/A <include name="*.jar" />
729N/A </fileset>
729N/A </classpath>
729N/A </iajc>
729N/A </target>
729N/A
729N/A
729N/A
729N/A <!-- Compile the Quick Setup source files. -->
729N/A <target name="compilequicksetup" depends="buildtools,compile"
729N/A description="Compile the Quick Setup source files.">
729N/A <mkdir dir="${quicksetup.classes.dir}" />
729N/A <javac srcdir="${ads.src.dir}" destdir="${quicksetup.classes.dir}"
729N/A optimize="true" debug="on" debuglevel="lines,source" source="1.5"
0N/A target="1.5" deprecation="true" fork="true" memoryInitialSize="${MEM}"
4274N/A memoryMaximumSize="${MEM}">
4274N/A <compilerarg value="-Xlint:all" />
4274N/A <classpath>
4274N/A <fileset dir="${build.dir}/build-tools">
4274N/A <include name="build-tools.jar" />
4274N/A </fileset>
4274N/A <pathelement path="${classes.dir}"/>
4274N/A </classpath>
4274N/A </javac>
4274N/A <javac srcdir="${src.dir}:${msg.src.dir}:${msg.javagen.dir}" destdir="${quicksetup.classes.dir}"
4274N/A debug="on" debuglevel="${build.debuglevel}" source="1.5"
4274N/A target="1.5" deprecation="true" fork="true" memoryInitialSize="${MEM}"
4274N/A memoryMaximumSize="${MEM}">
4274N/A <include name="**/org/opends/server/util/SetupUtils.java"/>
4274N/A <include name="**/org/opends/server/util/CertificateManager.java"/>
0N/A <include name="**/org/opends/server/util/DynamicConstants.java"/>
1344N/A <include name="**/org/opends/server/types/OperatingSystem.java"/>
1344N/A <include name="**/org/opends/messages/Message.java"/>
1344N/A <include name="**/org/opends/messages/MessageBuilder.java"/>
1344N/A <include name="**/org/opends/messages/MessageDescriptor.java"/>
1344N/A <include name="**/org/opends/messages/Severity.java"/>
1344N/A <include name="**/org/opends/messages/Category.java"/>
1344N/A <include name="**/org/opends/messages/QuickSetupMessages.java"/>
1344N/A <include name="**/org/opends/server/types/OpenDsException.java"/>
1344N/A <compilerarg value="-Xlint:all" />
1344N/A </javac>
1344N/A <javac srcdir="${quicksetup.src.dir}" destdir="${quicksetup.classes.dir}"
1344N/A debug="on" debuglevel="${build.debuglevel}" source="1.5"
1344N/A target="1.5" deprecation="true" fork="true" memoryInitialSize="${MEM}"
109N/A memoryMaximumSize="${MEM}">
109N/A <compilerarg value="-Xlint:all" />
109N/A
109N/A <classpath>
4274N/A <fileset dir="${build.dir}/build-tools">
4760N/A <include name="build-tools.jar" />
109N/A </fileset>
1238N/A <pathelement path="${classes.dir}"/>
109N/A </classpath>
1344N/A </javac>
1344N/A <copy todir="${quicksetup.classes.dir}">
1344N/A <fileset dir="${quicksetup.src.dir}"
1344N/A includes="**/*.properties, **/*.gif, **/*.png" />
1344N/A </copy>
1344N/A <mkdir dir="${quicksetup.classes.dir}/messages" />
110N/A <copy todir="${quicksetup.classes.dir}/messages">
109N/A <fileset dir="${msg.prop.dir}"
109N/A includes="**/quicksetup.properties" />
109N/A </copy>
109N/A
109N/A </target>
109N/A
0N/A
0N/A <!--
0N/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
1344N/A ! DynamicConstants.java won't be regenerated.
1344N/A ! -->
1344N/A <target name="rebuild"
1344N/A description="Rebuild the server without destroying config or data.">
1344N/A <!-- Set the amount of memory to use for the build -->
1344N/A <condition property="MEM" value="192M">
729N/A <not>
729N/A <isset property="MEM" />
729N/A </not>
729N/A </condition>
729N/A
729N/A <!-- Construct the version number string -->
729N/A <taskdef name="getversionnumber"
729N/A classname="org.opends.build.tools.CreateVersionString">
729N/A <classpath>
729N/A <fileset dir="${build.dir}/build-tools">
1344N/A <include name="*.jar" />
729N/A </fileset>
729N/A </classpath>
729N/A </taskdef>
729N/A
0N/A <getversionnumber property="VERSION_NUMBER_STRING" />
0N/A
5044N/A <!-- Set properties needed to find the packaged files -->
730N/A <property name="pdir"
0N/A location="${package.dir}/${SHORT_NAME}-${VERSION_NUMBER_STRING}" />
0N/A
0N/A <!-- Clean up a minimal set of files/directories for the rebuild. -->
567N/A <delete dir="${classes.dir}" />
662N/A <delete file="${package.dir}/lib/${SHORT_NAME}.jar" />
0N/A <delete file="${pdir}.zip" />
2086N/A <delete dir="${quicksetup.classes.dir}" />
2086N/A <delete file="${package.dir}/lib/quicksetup.jar" />
2086N/A
2086N/A <!-- Regenerate configuration files if necessary -->
2086N/A <antcall target="compileadmin" />
2086N/A
2086N/A <!-- Recreate the classes directory and recompile into it. -->
2086N/A <mkdir dir="${classes.dir}" />
2086N/A <javac srcdir="${src.dir}:${msg.src.dir}:${msg.javagen.dir}:${admin.src.dir}:${ads.src.dir}:${quicksetup.src.dir}:${guitools.src.dir}"
2086N/A destdir="${classes.dir}"
0N/A debug="on" debuglevel="${build.debuglevel}" source="1.5" target="1.5"
0N/A deprecation="true" fork="true" memoryInitialSize="${MEM}"
662N/A memoryMaximumSize="${MEM}">
1210N/A <compilerarg value="-Xlint:all" />
1210N/A
1210N/A <classpath>
1210N/A <fileset dir="${lib.dir}">
1210N/A <include name="*.jar" />
1210N/A </fileset>
567N/A <fileset dir="${build.dir}/build-tools">
567N/A <include name="build-tools.jar" />
3387N/A </fileset>
3387N/A </classpath>
3387N/A </javac>
3387N/A
3387N/A <copy todir="${classes.dir}">
3387N/A <fileset dir="${src.dir}" includes="**/*.properties" />
567N/A <fileset dir="${quicksetup.src.dir}" includes="**/*.properties, **/*.gif, **/*.png" />
563N/A <fileset dir="${guitools.src.dir}" includes="**/*.properties, **/*.gif, **/*.png" />
567N/A </copy>
712N/A
712N/A <!-- copy the message properties files -->
730N/A <mkdir dir="${msg.package.dir}"/>
2033N/A <copy todir="${msg.package.dir}">
712N/A <fileset dir="${msg.prop.dir}"/>
712N/A </copy>
0N/A
3381N/A <!-- copy the message descriptor registry file -->
3381N/A <copy todir="${classes.dir}/org/opends/messages"
3381N/A file="${msg.javagen.dir}/org/opends/messages/descriptors.reg" />
3381N/A
3381N/A <!-- Generate the OpenDS.jar file -->
3381N/A <jar jarfile="${pdir}/lib/${SHORT_NAME}.jar"
0N/A basedir="${classes.dir}"
0N/A excludes="${ads.classes.dir}, ${quicksetup.globalcompile.classes.dir}"
0N/A compress="true" index="true" />
0N/A
0N/A <!-- Recreate the quicksetup classes directory and recompile into it. -->
0N/A <mkdir dir="${quicksetup.classes.dir}" />
2058N/A <javac srcdir="${ads.src.dir}" destdir="${quicksetup.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}"
114N/A memoryMaximumSize="${MEM}">
114N/A <compilerarg value="-Xlint:all" />
114N/A <classpath>
114N/A <fileset dir="${build.dir}/build-tools">
114N/A <include name="build-tools.jar" />
114N/A </fileset>
0N/A <pathelement path="${classes.dir}"/>
0N/A </classpath>
0N/A </javac>
0N/A <javac srcdir="${src.dir}" destdir="${quicksetup.classes.dir}"
729N/A debug="on" debuglevel="${build.debuglevel}" source="1.5"
4760N/A target="1.5" deprecation="true" fork="true" memoryInitialSize="${MEM}"
121N/A memoryMaximumSize="${MEM}">
121N/A <include name="**/org/opends/server/util/SetupUtils.java"/>
1210N/A <include name="**/org/opends/server/util/CertificateManager.java"/>
6210N/A <include name="**/org/opends/server/util/DynamicConstants.java"/>
6210N/A <include name="**/org/opends/server/types/OperatingSystem.java"/>
6210N/A <compilerarg value="-Xlint:all" />
6210N/A </javac>
6210N/A <javac srcdir="${quicksetup.src.dir}" destdir="${quicksetup.classes.dir}"
6817N/A debug="on" debuglevel="${build.debuglevel}" source="1.5" target="1.5"
6817N/A deprecation="true" fork="true" memoryInitialSize="${MEM}"
6817N/A memoryMaximumSize="${MEM}">
6817N/A <compilerarg value="-Xlint:all" />
6817N/A <classpath>
6817N/A <fileset dir="${build.dir}/build-tools">
6817N/A <include name="build-tools.jar" />
6817N/A </fileset>
6817N/A <fileset dir="${pdir}/lib">
6817N/A <include name="${SHORT_NAME}.jar" />
6817N/A </fileset>
6817N/A </classpath>
121N/A </javac>
6210N/A
0N/A <copy todir="${quicksetup.classes.dir}">
0N/A <fileset dir="${quicksetup.src.dir}"
4156N/A includes="**/*.properties, **/*.gif, **/*.png"/>
4156N/A </copy>
2095N/A
5902N/A <!-- Generate the quicksetup.jar file -->
0N/A <jar jarfile="${pdir}/lib/quicksetup.jar"
6158N/A basedir="${quicksetup.classes.dir}" compress="true" index="true" />
2046N/A
2033N/A <!-- Regenerate example plugin. -->
2046N/A <antcall target="example-plugin" />
4156N/A </target>
4156N/A
4156N/A
0N/A
0N/A
1607N/A <!-- Populate the Directory Server package, but don't zip it up. -->
1607N/A <target name="prepackage" depends="cleancompile"
1607N/A description="Prepare the Directory Server package structure.">
2033N/A <property name="pdir"
2033N/A location="${package.dir}/${SHORT_NAME}-${VERSION_NUMBER_STRING}" />
1607N/A
0N/A <mkdir dir="${pdir}" />
0N/A <mkdir dir="${pdir}/adminDb" />
1177N/A <mkdir dir="${pdir}/bak" />
1177N/A <mkdir dir="${pdir}/bat" />
567N/A <mkdir dir="${pdir}/bin" />
1559N/A <mkdir dir="${pdir}/classes" />
567N/A <mkdir dir="${pdir}/config" />
567N/A <mkdir dir="${pdir}/config/upgrade" />
5902N/A <mkdir dir="${pdir}/config/schema" />
1210N/A <mkdir dir="${pdir}/config/messages" />
1210N/A <mkdir dir="${pdir}/config/MakeLDIF" />
1210N/A <mkdir dir="${pdir}/db" />
1210N/A <mkdir dir="${pdir}/changelogDb" />
1210N/A <mkdir dir="${pdir}/ldif" />
1210N/A <mkdir dir="${pdir}/legal-notices" />
1210N/A <mkdir dir="${pdir}/lib" />
5902N/A <mkdir dir="${pdir}/lib/extensions" />
1008N/A <mkdir dir="${pdir}/locks" />
1210N/A <mkdir dir="${pdir}/logs" />
1008N/A
1008N/A
2086N/A <!-- copy the message properties files -->
5902N/A <mkdir dir="${msg.package.dir}"/>
2086N/A <copy todir="${msg.package.dir}">
2086N/A <fileset dir="${msg.prop.dir}"/>
2086N/A </copy>
2115N/A
2115N/A <!-- copy the message descriptor registry file -->
1008N/A <copy todir="${classes.dir}/org/opends/messages"
5902N/A file="${msg.javagen.dir}/org/opends/messages/descriptors.reg" />
567N/A
567N/A <jar jarfile="${pdir}/lib/${SHORT_NAME}.jar"
567N/A basedir="${classes.dir}"
567N/A excludes="${ads.classes.dir}, ${quicksetup.globalcompile.classes.dir}"
567N/A compress="true" index="true" />
567N/A
567N/A <jar jarfile="${pdir}/lib/quicksetup.jar"
567N/A basedir="${quicksetup.classes.dir}" compress="true" index="true" />
567N/A
567N/A <copy todir="${pdir}/lib">
567N/A <fileset file="${lib.dir}/*.jar" />
6238N/A </copy>
6238N/A
6238N/A <copy todir="${pdir}/lib">
6238N/A <fileset file="${lib.dir}/*.exe" />
6238N/A </copy>
2556N/A
563N/A <antcall target="example-plugin" />
712N/A
1177N/A <fixcrlf srcDir="${scripts.dir}" destDir="${pdir}/bin" excludes="*.bat,_client-script.sh,_server-script.sh" eol="lf" />
2710N/A <fixcrlf srcDir="${scripts.dir}" destDir="${pdir}/lib" includes="_client-script.sh,_server-script.sh" eol="lf" />
2710N/A <fixcrlf srcDir="${scripts.dir}" destDir="${pdir}/bin" includes="README_WINDOWS.txt" eol="crlf" />
2710N/A <fixcrlf srcDir="${scripts.dir}" destDir="${pdir}/bat" excludes="_client-script.bat,_server-script.bat,setcp.bat" includes="*.bat" eol="crlf" />
2710N/A <fixcrlf srcDir="${scripts.dir}" destDir="${pdir}/lib" includes="_client-script.bat,_server-script.bat,setcp.bat" eol="crlf" />
2710N/A
2710N/A <copy todir="${pdir}/config">
2710N/A <fileset file="${config.dir}/*" />
2710N/A </copy>
2710N/A
3980N/A <copy file="${pdir}/config/config.ldif"
3980N/A tofile="${pdir}/config/upgrade/config.ldif.${REVISION_NUMBER}" />
3989N/A
5058N/A <taskdef name="concatschema"
5058N/A classname="org.opends.build.tools.ConcatSchema">
5058N/A <classpath>
5058N/A <fileset dir="${build.dir}/build-tools">
3980N/A <include name="*.jar" />
5058N/A </fileset>
5058N/A </classpath>
5058N/A </taskdef>
5058N/A
5058N/A <concatschema schemaDirectory="${resource.dir}/schema"
5058N/A toFile="${pdir}/config/upgrade/schema.ldif.${REVISION_NUMBER}" />
5058N/A
5058N/A <copy todir="${pdir}/config/schema">
5058N/A <fileset dir="${resource.dir}/schema" />
5058N/A </copy>
5058N/A
5058N/A <copy todir="${pdir}/config/messages">
5058N/A <fileset dir="${resource.dir}/messages" />
5058N/A </copy>
5058N/A
5058N/A <copy todir="${pdir}/config/MakeLDIF">
5058N/A <fileset dir="${resource.dir}/MakeLDIF" />
5058N/A </copy>
5058N/A
5058N/A <copy todir="${pdir}/legal-notices">
5058N/A <fileset dir="${resource.dir}/legal-notices" />
5058N/A </copy>
5058N/A
5058N/A <copy todir="${pdir}">
5058N/A <fileset file="${resource.dir}/README" />
5058N/A </copy>
3980N/A
2710N/A <fixcrlf srcDir="${resource.dir}" destDir="${pdir}" includes="setup,uninstall,uninstall-gui,upgrade"
0N/A eol="lf" />
563N/A <fixcrlf srcDir="${resource.dir}" destDir="${pdir}" includes="setup.bat,uninstall.bat,uninstall-gui.bat,upgrade.bat"
0N/A eol="crlf" />
0N/A
0N/A <chmod file="${pdir}/setup" perm="755" />
0N/A <chmod file="${pdir}/uninstall" perm="755" />
2143N/A <chmod file="${pdir}/uninstall-gui" perm="755" />
0N/A <chmod file="${pdir}/upgrade" perm="755" />
0N/A <chmod perm="755">
1362N/A <fileset dir="${pdir}/bin">
1362N/A </fileset>
1362N/A </chmod>
1362N/A <chmod file="${pdir}/lib/_client-script.sh" perm="755" />
1362N/A <chmod file="${pdir}/lib/_server-script.sh" perm="755" />
1362N/A </target>
1362N/A
1362N/A
1362N/A
1362N/A
1362N/A <!-- Package the Directory Server for distribution. -->
1362N/A <target name="package" depends="prepackage"
0N/A description="Package the Directory Server for distribution.">
0N/A <zip destfile="${package.dir}/${SHORT_NAME}-${VERSION_NUMBER_STRING}.zip">
1960N/A <zipfileset dir="${package.dir}" includes="${SHORT_NAME}-${VERSION_NUMBER_STRING}/**/*"
0N/A excludes="${SHORT_NAME}-${VERSION_NUMBER_STRING}/bin/*,${SHORT_NAME}-${VERSION_NUMBER_STRING}/lib/_client-script.sh,${SHORT_NAME}-${VERSION_NUMBER_STRING}/lib/_server-script.sh,${SHORT_NAME}-${VERSION_NUMBER_STRING}/setup,${SHORT_NAME}-${VERSION_NUMBER_STRING}/uninstall,${SHORT_NAME}-${VERSION_NUMBER_STRING}/uninstall-gui,${SHORT_NAME}-${VERSION_NUMBER_STRING}/upgrade"
0N/A filemode="644" dirmode="755" />
0N/A <zipfileset dir="${package.dir}"
1960N/A includes="${SHORT_NAME}-${VERSION_NUMBER_STRING}/lib/_client-script.sh,${SHORT_NAME}-${VERSION_NUMBER_STRING}/lib/_server-script.sh"
0N/A filemode="755" dirmode="755" />
563N/A <zipfileset dir="${package.dir}" includes="${SHORT_NAME}-${VERSION_NUMBER_STRING}/bin/*"
563N/A excludes="${SHORT_NAME}-${VERSION_NUMBER_STRING}/bin/README_WINDOWS.txt"
712N/A filemode="755" dirmode="755" />
1008N/A <zipfileset dir="${package.dir}" includes="${SHORT_NAME}-${VERSION_NUMBER_STRING}/bin/README_WINDOWS.txt"
6210N/A filemode="644" dirmode="755" />
1008N/A <zipfileset dir="${package.dir}" includes="${SHORT_NAME}-${VERSION_NUMBER_STRING}/setup,${SHORT_NAME}-${VERSION_NUMBER_STRING}/uninstall,${SHORT_NAME}-${VERSION_NUMBER_STRING}/uninstall-gui,${SHORT_NAME}-${VERSION_NUMBER_STRING}/upgrade"
0N/A filemode="755" dirmode="755" />
0N/A </zip>
2098N/A <property name="package.built" value="true"/>
5902N/A </target>
0N/A
6158N/A
2046N/A
2033N/A <!-- Prepare the Directory Server DSML library. -->
2046N/A <target name="predsml" depends="prepackage"
4156N/A description="Prepare the Directory Server DSML library.">
4156N/A <taskdef name="xjc" classname="com.sun.tools.xjc.XJCTask">
4156N/A <classpath>
0N/A <fileset dir="${dsml.lib.dir}">
0N/A <include name="**/*.jar" />
3381N/A </fileset>
1607N/A </classpath>
1607N/A </taskdef>
2046N/A
2033N/A <mkdir dir="${dsml.gen.dir}/org/opends/dsml/protocol" />
1607N/A <xjc target="${dsml.gen.dir}" schema="${dsml.dir}/schema/DSMLv2.xsd"
1607N/A removeOldOutput="yes" package="org.opends.dsml.protocol">
2086N/A <produces dir="${dsml.gen.dir}/org/opends/dsml/protocol"
2710N/A includes="* impl/*" />
2086N/A </xjc>
3980N/A
2122N/A <mkdir dir="${dsml.classes.dir}" />
2122N/A
2122N/A <javac srcdir="${dsml.gen.dir}" destdir="${dsml.classes.dir}"
2122N/A debug="on" debuglevel="${build.debuglevel}" source="1.5"
0N/A target="1.5" deprecation="true" fork="true" memoryInitialSize="${MEM}"
1960N/A memoryMaximumSize="${MEM}">
2033N/A <compilerarg value="-Xlint:all" />
2046N/A
2046N/A <classpath>
712N/A <fileset dir="${dsml.lib.dir}">
563N/A <include name="*.jar" />
563N/A </fileset>
5902N/A </classpath>
1210N/A </javac>
1210N/A
1210N/A <javac srcdir="${dsml.src.dir}" destdir="${dsml.classes.dir}"
1210N/A debug="on" debuglevel="${build.debuglevel}" source="1.5"
1210N/A target="1.5" deprecation="true" fork="true" memoryInitialSize="${MEM}"
1210N/A memoryMaximumSize="${MEM}">
1210N/A <compilerarg value="-Xlint:all" />
5902N/A
1008N/A <classpath>
1210N/A <fileset dir="${dsml.lib.dir}">
1008N/A <include name="*.jar" />
1008N/A </fileset>
4495N/A
4495N/A <dirset dir="${classes.dir}" />
4495N/A </classpath>
4495N/A </javac>
4495N/A
4495N/A <war destfile="${classes.dir}/${SHORT_NAME}-${VERSION_NUMBER_STRING}-DSML.war"
4495N/A webxml="${dsml.dir}/webapp/web.xml">
1008N/A <fileset file="${dsml.dir}/webapp/server.properties" />
5902N/A
1008N/A <webinf dir="${dsml.dir}/webapp" includes="**/*"
1008N/A excludes="web.xml, **/*.jar, **/*.properties" />
1008N/A
1008N/A <classes dir="${dsml.classes.dir}" />
4495N/A
1008N/A <lib dir="${dsml.lib.dir}">
563N/A <exclude name="j2ee.jar" />
563N/A </lib>
563N/A
1008N/A <lib dir="${pdir}/lib">
563N/A <exclude name="activation.jar" />
563N/A <exclude name="je.jar" />
563N/A </lib>
563N/A </war>
563N/A
563N/A <copy todir="${package.dir}">
712N/A <fileset file="${classes.dir}/*.war" />
4156N/A </copy>
4156N/A </target>
4156N/A
4156N/A
4358N/A
1008N/A
1008N/A <!-- Generate JavaDoc documentation from the source files -->
6608N/A <target name="javadoc" depends="dsml,compileadmin"
6374N/A description="Generate JavaDoc documentation.">
6374N/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"
3214N/A maxmemory="${MEM}">
3214N/A <classpath>
3214N/A <fileset dir="${lib.dir}">
3381N/A <include name="*.jar" />
3381N/A </fileset>
3214N/A
3214N/A <fileset dir="${dsml.lib.dir}">
3214N/A <include name="*.jar" />
3090N/A </fileset>
3214N/A
3214N/A <dirset dir="${classes.dir}" />
3214N/A <dirset dir="${dsml.classes.dir}" />
3214N/A <dirset dir="${quicksetup.classes.dir}" />
3090N/A </classpath>
3090N/A
6158N/A <packageset dir="${src.dir}" />
3090N/A <packageset dir="${admin.src.dir}" />
3090N/A <packageset dir="${ads.src.dir}" />
3214N/A <packageset dir="${dsml.src.dir}" />
3764N/A </javadoc>
3381N/A </target>
3214N/A
3214N/A
3214N/A
3214N/A <!-- Internal target to prepare to generate a code coverage report. -->
3214N/A <target name="coverage">
3214N/A <property name="coverage.enabled" value="true" />
3214N/A
3214N/A <mkdir dir="${coverage.dir}" />
3214N/A <mkdir dir="${coverage.data.dir}" />
3214N/A <mkdir dir="${coverage.instr.dir}" />
3214N/A <mkdir dir="${coverage.report.dir}" />
3214N/A
6158N/A <path id="run.classpath">
3214N/A <pathelement location="${classes.dir}" />
3214N/A </path>
3214N/A
3764N/A <path id="quickSetup.classpath">
3214N/A <pathelement location="${quicksetup.classes.dir}" />
3381N/A </path>
3090N/A </target>
6608N/A
6374N/A
6608N/A
6374N/A <!-- Prepare to execute the Directory Server TestNG unit tests. -->
6374N/A <target name="testinit" depends="buildtools, weave"
6608N/A description="Prepare to execute the Directory Server TestNG unit tests.">
6374N/A <!-- If we are to perform coverage tests, then set that up. -->
6374N/A <path id="emma.lib">
6608N/A <pathelement location="${emma.dir}/emma.jar" />
6374N/A <pathelement location="${emma.dir}/emma_ant.jar" />
6374N/A </path>
6608N/A
6374N/A <taskdef resource="emma_ant.properties" classpathref="emma.lib" />
6374N/A
6374N/A <emma enabled="${coverage.enabled}">
6374N/A <instr instrpathref="run.classpath" destdir="${coverage.instr.dir}"
6374N/A metadatafile="${coverage.data.dir}/metadata.emma" merge="true" />
6374N/A </emma>
0N/A
0N/A <!-- Compile the test cases -->
121N/A <mkdir dir="${unittest.classes.dir}" />
0N/A <javac srcdir="${unittest.testng.src.dir}" destdir="${unittest.classes.dir}"
0N/A debug="on" debuglevel="${build.debuglevel}" source="1.5"
1960N/A target="1.5" deprecation="true" fork="true" memoryInitialSize="${MEM}"
0N/A memoryMaximumSize="${MEM}">
2556N/A <compilerarg value="-Xlint:all" />
2556N/A
2556N/A <classpath>
2556N/A <fileset dir="${lib.dir}">
2556N/A <include name="*.jar" />
2556N/A </fileset>
6238N/A
6318N/A <fileset dir="${testng.lib.dir}">
6318N/A <include name="*.jar" />
6318N/A </fileset>
6238N/A
6238N/A <path refid="run.classpath" />
6238N/A <path refid="quickSetup.classpath" />
6238N/A </classpath>
6238N/A </javac>
6318N/A
6318N/A <!-- Prep the TestNG XML file -->
6318N/A
6318N/A <condition property="test.groups" value="exclude=slow">
6318N/A <not>
6238N/A <or>
6238N/A <isset property="test.groups" />
6238N/A <isset property="test.packages" />
6238N/A <isset property="test.classes" />
6238N/A <isset property="test.methods" />
2556N/A </or>
2556N/A </not>
2556N/A </condition>
2556N/A
2556N/A <!-- do not run tests dependent upon creation of the .zip file -->
2556N/A <condition property="test.packages" value="org.opends.server.*,org.opends.messages.*">
2556N/A <and>
2556N/A <not>
2556N/A <or>
2556N/A <isset property="test.packages" />
0N/A <isset property="test.classes" />
2086N/A <isset property="test.methods" />
2086N/A </or>
2710N/A </not>
2086N/A <not>
3980N/A <equals arg1="${package.built}" arg2="true" />
3980N/A </not>
3980N/A </and>
3980N/A </condition>
2122N/A
2122N/A <!-- run tests dependent upon creation of the .zip file -->
2122N/A <condition property="test.packages" value="org.opends.server.*,org.opends.messages.*,org.opends.quicksetup.*">
3381N/A <and>
1960N/A <not>
2556N/A <or>
6131N/A <isset property="test.packages" />
6131N/A <isset property="test.classes" />
4495N/A <isset property="test.methods" />
6131N/A </or>
4495N/A </not>
4495N/A <equals arg1="${package.built}" arg2="true" />
4495N/A </and>
4495N/A </condition>
4495N/A
4495N/A
4495N/A <condition property="test.classes" value="">
4495N/A <not>
4495N/A <or>
4495N/A <isset property="test.classes" />
4495N/A <isset property="test.methods" />
4495N/A </or>
4495N/A </not>
4495N/A </condition>
4495N/A
4495N/A <condition property="test.methods" value="">
4495N/A <not>
4495N/A <or>
4495N/A <isset property="test.methods" />
4495N/A </or>
4495N/A </not>
4495N/A </condition>
4495N/A
4495N/A <mkdir dir="${unittest.resource.dir}" />
4495N/A <typedef name="preptestng" classname="org.opends.build.tools.PrepTestNG"
4495N/A classpath="${build.dir}/build-tools/build-tools.jar" />
4495N/A
4495N/A
4495N/A <preptestng file="${testng.dir}/testng.xml"
4495N/A tofile="${unittest.resource.dir}/testng.xml"
4495N/A grouplist="${test.groups}"
4495N/A packagelist="${test.packages}"
4495N/A classList="${test.classes}"
4495N/A methodList="${test.methods}" />
6131N/A
6131N/A <antcall target="testinit.checkFailedTestsOnly"/>
6131N/A </target>
6131N/A
712N/A
6131N/A
5020N/A <!-- If we were asked to run only the tests that failed,
6131N/A then we overwrite the testng.xml that we just generated
6131N/A with testng-failed.xml, which TestNG generated. -->
5020N/A <target name="testinit.checkFailedTestsOnly" if="test.failures">
563N/A <!-- Ensure that some of the tests failed last time. -->
563N/A <available property="testng-failed.xml.exists"
712N/A file="${unittest.report.dir}/testng-failed.xml"/>
6174N/A <fail message="No unit tests failed in the previous run."
6174N/A unless="testng-failed.xml.exists"/>
0N/A
3381N/A <!-- We replace the 'Failed suite [OpenDS]' with 'OpenDS' so we
1008N/A don't end up with 'Failed suite [Failed suite [OpenDS]]]' etc. -->
1008N/A <replace file="${unittest.report.dir}/testng-failed.xml"
1008N/A token="Failed suite [OpenDS]"
4358N/A value="OpenDS"/>
3534N/A <replace file="${unittest.report.dir}/testng-failed.xml"
3534N/A token="default(failed)"
2976N/A value="default"/>
2976N/A
2976N/A <copy file="${unittest.report.dir}/testng-failed.xml"
2976N/A tofile="${unittest.resource.dir}/testng.xml"
1008N/A overwrite="true"/>
6238N/A
5607N/A <echo message="Will run the failed unit tests only"/>
0N/A </target>
3381N/A
3349N/A
6256N/A
6256N/A <!-- Generate coverage diff report -->
6256N/A <target name="coveragediff">
6256N/A <condition property="test.diff.srcpath" value="">
6256N/A <not>
6256N/A <isset property="test.diff.srcpath" />
6256N/A </not>
6256N/A </condition>
6256N/A
6256N/A <condition property="test.diff.enabled" value="true">
6256N/A <not>
6280N/A <isset property="test.diff.disable" />
6256N/A </not>
6256N/A </condition>
6280N/A
6256N/A <condition property="test.diff.verbose" value="false">
6256N/A <not>
4495N/A <isset property="test.diff.verbose" />
6131N/A </not>
6238N/A </condition>
920N/A
920N/A <condition property="test.diff.enabled" value="false">
920N/A <isset property="test.diff.disable" />
920N/A </condition>
920N/A
920N/A <!-- The SVN revision to perform the diff against when calculating
920N/A the coverage diff. It can be a revision number, a timestamp,
920N/A or a revision keyword (BASE, COMMITTED, and PREV make the
920N/A most sense). The primary use case for this setting is to do
920N/A a coverage diff against the previous revision when there are
920N/A no changes in the working copy. It defaults to BASE. -->
6238N/A <condition property="test.diff.from.revision" value="BASE">
6238N/A <not>
6238N/A <isset property="test.diff.from.revision" />
0N/A </not>
0N/A </condition>
4358N/A
6238N/A <mkdir dir="${cvgdiff.report.dir}" />
0N/A <taskdef name="coveragediff" classname="org.opends.build.tools.CoverageDiff">
0N/A <classpath>
0N/A <fileset dir="${build.dir}/build-tools">
6238N/A <include name="*.jar" />
107N/A </fileset>
107N/A <fileset dir="${emma.dir}">
107N/A <include name="*.jar" />
29N/A </fileset>
29N/A <fileset dir="${svnkit.dir}">
29N/A <include name="*.jar" />
6374N/A </fileset>
29N/A </classpath>
29N/A </taskdef>
29N/A
29N/A <coveragediff emmadatapath="${coverage.data.dir}"
3537N/A outputpath="${cvgdiff.report.dir}"
6307N/A diffpath="${test.diff.srcpath}"
3012N/A enabled="${test.diff.enabled}"
3012N/A verbose="${test.diff.verbose}"
2549N/A fromrevision="${test.diff.from.revision}" />
547N/A
2549N/A </target>
547N/A
84N/A
565N/A
712N/A <!-- Execute the Directory Server TestNG unit tests in text mode. -->
1345N/A <target name="enableTestNGAssertions">
2556N/A <property name="TESTASSERT" value="true"/>
2556N/A </target>
2556N/A
2556N/A
6280N/A
6280N/A <!-- Execute Directory Server TestNG unit tests specified from CLI -->
6280N/A <target name="testcustom">
6280N/A <echo message="This target is deprecated. Please use the test target as it now supports the test.* properties." />
6280N/A </target>
6280N/A
2556N/A
2556N/A
2556N/A <!-- Execute all of the Directory Server TestNG unit tests in text mode. -->
2556N/A <target name="testall"
2556N/A depends="enableTestNGAssertions,prepdefaultalltest,package,testinit,runtests"
2556N/A description="Run all of the TestNG tests (including 'slow' ones) with assertions enabled. See 'testwithcoverage' for properties you can set.">
2556N/A </target>
2556N/A
6280N/A
6280N/A
6280N/A <!-- Execute the Directory Server TestNG unit tests in text mode. -->
6280N/A <target name="test"
6280N/A depends="testinit,runtests"
6280N/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.">
2556N/A </target>
2556N/A
2556N/A
2556N/A
2556N/A <!-- Execute the Directory Server TestNG unit tests in text mode with a coverage report. -->
3853N/A <target name="testwithcoverage"
3853N/A depends="coverage,test,coveragediff"
2556N/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.">
6280N/A </target>
6280N/A
6280N/A
6280N/A
6280N/A <!-- Execute the Directory Server TestNG unit tests in text mode with a coverage report and slow tests. -->
6280N/A <target name="testallwithcoverage"
2556N/A depends="coverage,testall,coveragediff"
2556N/A description="The same as 'testwithcoverage' except 'testall' is run instead of 'test'.">
3853N/A </target>
2556N/A
2556N/A
2556N/A
485N/A <!-- Execute the Directory Server TestNG unit tests specified from CLI in text mode with a coverage report. -->
6178N/A <target name="testcustomwithcoverage">
485N/A <echo message="This target is deprecated. Please use the testwithcoverage target as it now supports the test.* properties." />
1197N/A </target>
1197N/A
6178N/A
6178N/A
6178N/A <target name="testhelp" unless="disable.test.help">
6238N/A <echo message="About to run the unit tests. Ant options to control the tests:"/>
6238N/A <echo message=""/>
6238N/A <echo message=" -Dorg.opends.test.suppressOutput=false"/>
0N/A <echo message=" writes the unit test output to the screen"/>
4575N/A <echo message=""/>
4575N/A <echo message=" -Dorg.opends.test.pauseOnFailure=true"/>
0N/A <echo message=" pauses the test suite whenever a failure occurs allowing you to inspect"/>
0N/A <echo message=" the server more closely in the failure state"/>
0N/A <echo message=""/>
1960N/A <echo message=" -Dtest.failed=true"/>
6238N/A <echo message=" runs only the tests that failed last time"/>
6238N/A <echo message=""/>
6238N/A <echo message=" -DWEAVE_ENABLED=false" />
6238N/A <echo message=" builds the server without the debug logging facility." />
6238N/A <echo message=" No debug logging messages will be included on test failures." />
6238N/A <echo message=""/>
6238N/A <echo message=" -Dorg.opends.test.debug.target=org.opends.server.core:level=verbose,category=data"/>
6238N/A <echo message=" for example only include debug messages in the core"/>
6238N/A <echo message=" package that are related to data access and at the" />
6238N/A <echo message=" verbose level or higher. The syntax of this target" />
6238N/A <echo message=" definition is the same as the org.opends.server.debug.target.x" />
6238N/A <echo message=" property when starting ${SHORT_NAME}. " />
0N/A <echo message=" Default debug target:"/>
1559N/A <echo message=" org.opends.server:level=warning,category=caught|data|database-access|message|protocol" />
3381N/A <echo message=""/>
2308N/A <echo message=" -Dtest.groups=exclude=slow"/>
2308N/A <echo message=" for example excludes the slow tests. Each value is expected" />
2308N/A <echo message=" group inclusion/exclusion clause which consists of either 'include'" />
2308N/A <echo message=" or 'exclude' followed by the '=' character and then a group name." />
2308N/A <echo message=" For multiple group clauses, separate them with a ',' and "/>
0N/A <echo message=" quote the entire value. Debug logging is disabled."/>
0N/A <echo message=""/>
6560N/A <echo message=" -Dtest.packages=org.opends.server.api"/>
6560N/A <echo message=" for example runs only the tests in the api package"/>
6560N/A <echo message=" For multiple packages, separate them with a ',' and "/>
6571N/A <echo message=" quote the entire value. Debug logging is disabled."/>
6560N/A <echo message=""/>
6560N/A <echo message=" -Dtest.classes=org.opends.server.types.TestDN"/>
6560N/A <echo message=" for example only runs the TestDN class"/>
6560N/A <echo message=" For multiple classes, separate them with a ',' and "/>
6560N/A <echo message=" quote the entire value. Debug logging is disabled."/>
6560N/A <echo message=""/>
6560N/A <echo message=" -Dtest.methods=org.opends.server.types.TestDN.testGetRDN"/>
6560N/A <echo message=" for example only runs the testGetRDN method"/>
6560N/A <echo message=" For multiple methods within the same class, append additional"/>
6560N/A <echo message=" method names to the end separating them with a ',' and "/>
6560N/A <echo message=" quote the entire value. Debug logging is disabled."/>
6560N/A <echo message=""/>
6560N/A <echo message=" -Dtest.diff.srcpath=src/server/org/opends/server/core"/>
6560N/A <echo message=" for example includes only the classes in"/>
6560N/A <echo message=" src/server/org/opends/server/core in the coveragediff report."/>
6560N/A <echo message=" To list multiple directories or files, separate them with"/>
6560N/A <echo message=" a space as you would an argument list to 'svn diff' and quote"/>
6560N/A <echo message=" the whole value."/>
6560N/A <echo message=""/>
6560N/A </target>
6560N/A
6560N/A
6560N/A
6560N/A <!-- Internal target to execute the Directory Server TestNG unit tests in text mode after everything has been initialized. -->
6560N/A <target name="runtests">
6560N/A <antcall target="testhelp"/>
6560N/A
6560N/A <mkdir dir="${unittest.report.dir}" />
6560N/A
6560N/A <taskdef resource="testngtasks">
6560N/A <classpath>
6561N/A <fileset dir="${testng.lib.dir}">
6560N/A <include name="*.jar" />
6560N/A </fileset>
6560N/A </classpath>
6560N/A </taskdef>
6560N/A
6560N/A <!-- This sets TESTASSERT to false if and only if it's not already set. -->
6560N/A <condition property="TESTASSERT" value="false">
6560N/A <not>
6560N/A <isset property="TESTASSERT" />
6560N/A </not>
6560N/A </condition>
6560N/A
6560N/A <!-- This sets org.opends.test.suppressOutput if and only if it's not
6560N/A already set. -->
6561N/A <condition property="org.opends.test.suppressOutput" value="true">
6560N/A <not>
6560N/A <isset property="org.opends.test.suppressOutput" />
6560N/A </not>
6560N/A </condition>
6560N/A
6560N/A <!-- This sets org.opends.test.pauseOnFailure if and only if it's not
6560N/A already set. -->
6560N/A <condition property="org.opends.test.pauseOnFailure" value="false">
6560N/A <not>
6560N/A <isset property="org.opends.test.pauseOnFailure" />
6560N/A </not>
6561N/A </condition>
6561N/A
6560N/A <!-- This sets org.opends.test.debug.target if and only if its's not
6560N/A already set. -->
6560N/A <condition property="org.opends.test.debug.target"
6560N/A value="org.opends.server:level=warning,category=caught|data|database-access|message|protocol">
6560N/A <not>
6560N/A <isset property="org.opends.test.debug.target" />
6560N/A </not>
6560N/A </condition>
6560N/A
3069N/A <!-- Cleanout the old reports. Otherwise, the old testng-failed.xml
3069N/A will hang around even if all of the tests pass. -->
6131N/A <delete>
3069N/A <fileset dir="${unittest.report.dir}" includes="*"/>
6131N/A </delete>
3069N/A
3069N/A <!-- Our testng listener will remove this file if all of the
3069N/A tests passed. This allows us to generate the coverage
3069N/A report even if the tests failed and still fail the build. -->
3069N/A <touch file="${unittest.report.dir}/.tests-failed-marker"/>
3069N/A
3069N/A <testng outputdir="${unittest.report.dir}"
3069N/A haltonfailure="false"
3069N/A enableAssert="${TESTASSERT}"
6238N/A listeners="org.opends.server.TestListener org.testng.reporters.FailedReporter"
6283N/A useDefaultListeners="false"
6521N/A suiteRunnerClass="org.opends.server.SuiteRunner">
6521N/A <classpath>
6521N/A <pathelement location="${coverage.instr.dir}" />
6521N/A <pathelement location="${classes.dir}" />
6521N/A <pathelement location="${quicksetup.classes.dir}" />
6647N/A <pathelement location="${unittest.classes.dir}" />
6647N/A <pathelement location="${resource.dir}" />
6521N/A <path refid="run.classpath" />
6521N/A <path refid="emma.lib" />
6521N/A
6521N/A <fileset dir="${lib.dir}">
6521N/A <include name="*.jar" />
6521N/A </fileset>
6521N/A
6521N/A <!-- Needed by quicksetup tests -->
6647N/A <fileset dir="${build.dir}/build-tools">
6521N/A <include name="build-tools.jar" />
6521N/A </fileset>
6521N/A
6521N/A <fileset dir="${testng.lib.dir}">
6521N/A <include name="*.jar" />
6521N/A </fileset>
6521N/A </classpath>
6521N/A <jvmarg value="-Demma.coverage.out.file=${coverage.data.dir}/unit.emma" />
6521N/A <jvmarg value="-Demma.coverage.out.merge=false" />
6521N/A <jvmarg value="-Dorg.opends.server.BuildRoot=${basedir}" />
6521N/A <jvmarg value="-Dorg.opends.server.RunningUnitTests=true" />
6521N/A <jvmarg value="-Dorg.opends.test.suppressOutput=${org.opends.test.suppressOutput}" />
6647N/A <jvmarg value="-Dorg.opends.test.pauseOnFailure=${org.opends.test.pauseOnFailure}" />
6521N/A <jvmarg value="-Dorg.opends.test.debug.target=${org.opends.test.debug.target}" />
6521N/A <jvmarg value="-Xms${MEM}" />
6521N/A <jvmarg value="-Xmx${MEM}" />
6521N/A <xmlfileset dir="${unittest.resource.dir}" includes="testng.xml" />
6521N/A </testng>
6521N/A
3069N/A <!-- Our testng listener will create this file if any of the
3069N/A tests failed. This allows us to generate the coverage
3069N/A report even if the tests failed. -->
3069N/A <available property="testng.tests.failed"
3069N/A file="${unittest.report.dir}/.tests-failed-marker"/>
3079N/A
6647N/A <!-- Delete all of the report suite sub-directories since we only
6521N/A have a single suite. -->
6543N/A <delete dir="${unittest.report.dir}/${SHORT_NAME}"/>
6647N/A
6521N/A <emma enabled="${coverage.enabled}" >
6647N/A <report sourcepath="${src.dir}" >
6543N/A <fileset dir="${coverage.data.dir}" >
6647N/A <include name="unit.emma" />
6521N/A <include name="metadata.emma" />
6521N/A </fileset>
6647N/A
6642N/A <txt outfile="${coverage.report.dir}/coverage.txt" />
6647N/A <html outfile="${coverage.report.dir}/index.html" />
6238N/A <xml outfile="${coverage.report.dir}/coverage.xml" />
6238N/A </report>
6521N/A
6521N/A </emma>
6238N/A
6647N/A <!-- We delay failing until after the coverage report is generated. -->
6521N/A <fail message="The unit tests failed." if="testng.tests.failed"/>
3069N/A
3069N/A </target>
3069N/A
3069N/A
3069N/A
3069N/A <target name="prepdefaultalltest">
6647N/A <condition property="test.groups" value="">
6238N/A <not>
6238N/A <or>
6238N/A <isset property="test.groups" />
6238N/A <isset property="test.packages" />
6238N/A <isset property="test.classes" />
6238N/A <isset property="test.methods" />
6238N/A </or>
6238N/A </not>
6238N/A </condition>
6238N/A </target>
6238N/A
6238N/A
6238N/A
6238N/A <!--
6642N/A ! Previously a dependency of the nightly, all, testall and test targets.
6642N/A ! Weaving is now disabled by default due to the excessive need for memory
6642N/A ! during weaving.
6642N/A ! -->
6238N/A <target name="enableweave">
6238N/A <condition property="WEAVE_ENABLED" value="true">
6238N/A <not>
6238N/A <or>
6280N/A <isset property="WEAVE_ENABLED" />
6238N/A <isset property="test.groups" />
6238N/A <isset property="test.packages" />
6238N/A <isset property="test.classes" />
6238N/A <isset property="test.methods" />
6283N/A </or>
6238N/A </not>
6238N/A </condition>
6310N/A </target>
6238N/A
6238N/A
6647N/A
6642N/A <target name="testreport"
6642N/A depends="test"
6630N/A description="Takes testng results and convert them into JUnit compatible xml">
6642N/A <junitreport todir="${unittest.report.dir}">
6642N/A <fileset dir="${unittest.report.dir}">
6238N/A <include name="*.xml"/>
6649N/A </fileset>
6238N/A
6280N/A <report format="noframes" todir="${unittest.report.dir}"/>
6290N/A </junitreport>
6635N/A </target>
6642N/A
6238N/A
6713N/A <target name="integration-tests"
6238N/A description="Builds the integration tests">
6642N/A <ant dir="${functest.testng.dir}" inheritall="false"/>
6238N/A </target>
6642N/A
6713N/A
6238N/A
6642N/A <target name="buildtools" depends="init"
6238N/A description="Builds the build tools">
6642N/A <!-- Set the amount of memory to use for the build -->
6647N/A <condition property="MEM" value="192M">
6716N/A <not>
6642N/A <isset property="MEM" />
6642N/A </not>
6647N/A </condition>
6238N/A
6238N/A <mkdir dir="${buildtools.classes.dir}" />
1177N/A
0N/A <javac srcdir="${src.dir}:${msg.src.dir}" destdir="${buildtools.classes.dir}"
0N/A sourcepath=""
0N/A includes="org/opends/messages/Severity.java,
6647N/A org/opends/messages/Category.java,
0N/A org/opends/messages/Message.java,
6647N/A org/opends/messages/MessagePropertyKey.java,
6647N/A org/opends/messages/MessageDescriptor.java"
6647N/A debug="on" debuglevel="${build.debuglevel}" source="1.5"
6647N/A target="1.5" deprecation="true" fork="true" memoryInitialSize="${MEM}"
6647N/A memoryMaximumSize="${MEM}"/>
6647N/A
6647N/A
6647N/A <javac srcdir="${buildtools.src.dir}" destdir="${buildtools.classes.dir}"
6647N/A debug="on" debuglevel="${build.debuglevel}" source="1.5"
6647N/A target="1.5" deprecation="true" fork="true" memoryInitialSize="${MEM}"
6647N/A memoryMaximumSize="${MEM}">
6647N/A <compilerarg value="-Xlint:all" />
6647N/A
0N/A <classpath>
0N/A <fileset dir="${ant.lib.dir}">
5902N/A <include name="*.jar" />
3107N/A </fileset>
0N/A
0N/A <fileset dir="${emma.dir}">
0N/A <include name="*.jar" />
0N/A </fileset>
0N/A
0N/A <fileset dir="${svnkit.dir}">
0N/A <include name="*.jar" />
5902N/A </fileset>
3107N/A
0N/A <path refid="run.classpath" />
0N/A </classpath>
0N/A </javac>
0N/A
0N/A <jar jarfile="${build.dir}/build-tools/build-tools.jar"
0N/A basedir="${buildtools.classes.dir}" compress="true" index="true" />
0N/A </target>
0N/A
0N/A
3000N/A
3000N/A <!-- Code generation for core administration components. -->
3000N/A <target name="compileadmin" depends="validateadmin" description="Code generation for configuration Object.">
3000N/A <!-- The XSLT task creates a lot of noise.
3000N/A I can't find any other way to shut it up. -->
1960N/A
0N/A <condition property="antcmd" value="ant.bat">
0N/A <os family="windows" />
0N/A </condition>
0N/A
0N/A <condition property="antcmd" value="ant">
0N/A <not>
0N/A <isset property="antcmd" />
0N/A </not>
3058N/A </condition>
4495N/A
4495N/A <exec executable="${ant.home}/bin/${antcmd}" failonerror="true">
4495N/A <arg value="-buildfile" />
4495N/A <arg value="${ant.file}" />
4495N/A <arg value="-quiet" />
4495N/A <arg value="compileadminsubtask" />
4495N/A </exec>
6131N/A </target>
6131N/A
0N/A
0N/A
0N/A <target name="compileadminsubtask">
605N/A <!-- Generate introspection API for core administration components. -->
0N/A <xslt basedir="${admin.defn.dir}" destdir="${admin.src.dir}" includes="**/*Configuration.xml" style="${admin.rules.dir}/metaMO.xsl">
0N/A <regexpmapper handledirsep="true" from="^(.*)/([^/]+)Configuration\.xml$$" to="\1/meta/\2CfgDefn.java" />
0N/A <param name="base-dir" expression="${admin.defn.dir}" />
0N/A </xslt>
0N/A
0N/A <xslt basedir="${admin.defn.dir}" destdir="${admin.src.dir}" includes="**/Package.xml" style="${admin.rules.dir}/package-info.xsl">
0N/A <regexpmapper handledirsep="true" from="^(.*)/([^/]+)\.xml$$" to="\1/meta/package-info.java" />
0N/A <param name="type" expression="meta" />
6210N/A </xslt>
0N/A
0N/A <!-- Generate client API for core administration components. -->
0N/A <xslt basedir="${admin.defn.dir}" destdir="${admin.src.dir}" includes="**/*Configuration.xml" style="${admin.rules.dir}/clientMO.xsl">
5178N/A <regexpmapper handledirsep="true" from="^(.*)/([^/]+)Configuration\.xml$$" to="\1/client/\2CfgClient.java" />
0N/A <param name="base-dir" expression="${admin.defn.dir}" />
0N/A </xslt>
0N/A
6158N/A <xslt basedir="${admin.defn.dir}" destdir="${admin.src.dir}" includes="**/Package.xml" style="${admin.rules.dir}/package-info.xsl">
0N/A <regexpmapper handledirsep="true" from="^(.*)/([^/]+)\.xml$$" to="\1/client/package-info.java" />
0N/A <param name="type" expression="client" />
0N/A </xslt>
0N/A
0N/A <!-- Generate server API for core administration components. -->
2528N/A <xslt basedir="${admin.defn.dir}" destdir="${admin.src.dir}" includes="**/*Configuration.xml" style="${admin.rules.dir}/serverMO.xsl">
2528N/A <regexpmapper handledirsep="true" from="^(.*)/([^/]+)Configuration\.xml$$" to="\1/server/\2Cfg.java" />
2528N/A <param name="base-dir" expression="${admin.defn.dir}" />
2528N/A </xslt>
0N/A
0N/A <xslt basedir="${admin.defn.dir}" destdir="${admin.src.dir}" includes="**/Package.xml" style="${admin.rules.dir}/package-info.xsl">
1527N/A <regexpmapper handledirsep="true" from="^(.*)/([^/]+)\.xml$$" to="\1/server/package-info.java" />
0N/A <param name="type" expression="server" />
0N/A </xslt>
5607N/A
1008N/A <!-- Generate LDAP profile for core administration components. -->
1527N/A <mkdir dir="${classes.dir}" />
0N/A <xslt basedir="${admin.defn.dir}" destdir="${classes.dir}/admin/profiles/ldap" includes="**/*Configuration.xml" style="${admin.rules.dir}/ldapMOProfile.xsl">
2255N/A <regexpmapper handledirsep="true" from="^(.*)/([^/]+)Configuration\.xml$$" to="\1/meta/\2CfgDefn.properties" />
0N/A <param name="base-dir" expression="${admin.defn.dir}" />
0N/A </xslt>
0N/A
0N/A <!-- Generate CLI profile for core administration components. -->
2900N/A <xslt basedir="${admin.defn.dir}" destdir="${classes.dir}/admin/profiles/cli" includes="**/*Configuration.xml" style="${admin.rules.dir}/cliMOProfile.xsl">
2896N/A <regexpmapper handledirsep="true" from="^(.*)/([^/]+)Configuration\.xml$$" to="\1/meta/\2CfgDefn.properties" />
2900N/A <param name="base-dir" expression="${admin.defn.dir}" />
2900N/A </xslt>
2896N/A
2896N/A <!-- Generate I18N messages for core administration components. -->
2896N/A <xslt basedir="${admin.defn.dir}" destdir="${classes.dir}/admin/messages" includes="**/*Configuration.xml" style="${admin.rules.dir}/messagesMO.xsl">
6140N/A <regexpmapper handledirsep="true" from="^(.*)/([^/]+)Configuration\.xml$$" to="\1/meta/\2CfgDefn.properties" />
2896N/A <param name="base-dir" expression="${admin.defn.dir}" />
2900N/A </xslt>
2896N/A
2900N/A <!-- Generate manifest file for core administration components. -->
2900N/A <tempfile property="admin.temp.dir" destDir="${build.dir}" prefix="tmp" />
2900N/A <mkdir dir="${admin.temp.dir}" />
2896N/A <xslt basedir="${admin.defn.dir}" destdir="${admin.temp.dir}" extension=".manifest" includes="**/*Configuration.xml" style="${admin.rules.dir}/manifestMO.xsl"/>
2896N/A <concat destfile="${classes.dir}/admin/core.manifest">
2900N/A <fileset dir="${admin.temp.dir}" includes="**/*.manifest" />
2900N/A </concat>
2896N/A <delete dir="${admin.temp.dir}" />
2900N/A </target>
2900N/A
2896N/A
2896N/A
2900N/A <!-- Remove all dynamically-generated build files. -->
2896N/A <target name="cleanadmin" description="Clean up any generated source files for admin">
2896N/A <delete includeemptydirs="true">
6140N/A <fileset dir="${admin.src.dir}" includes="**/*" />
2896N/A </delete>
2900N/A </target>
3853N/A
2896N/A <!-- Validate core administration component XML definition files. -->
2896N/A <target name="validateadmin" description="Validate core administration component XML definition files.">
2896N/A <schemavalidate>
2896N/A <fileset dir="${admin.defn.dir}" includes="**/*.xml" />
2896N/A <schema namespace="http://www.opends.org/admin" file="${admin.rules.dir}/admin.xsd"/>
2896N/A <schema namespace="http://www.opends.org/admin-ldap" file="${admin.rules.dir}/admin-ldap.xsd"/>
2896N/A <schema namespace="http://www.opends.org/admin-cli" file="${admin.rules.dir}/admin-cli.xsd"/>
2900N/A </schemavalidate>
2900N/A </target>
2900N/A
2900N/A <!-- Remove all dynamically-generated build files. -->
2896N/A <target name="cleanmessages" description="Clean up any generated source files for messages">
2900N/A <delete includeemptydirs="true">
2900N/A <fileset dir="${msg.javagen.dir}" includes="**/*" />
2896N/A </delete>
2896N/A </target>
2900N/A
2900N/A <!-- Generate a src.zip file containing all the server source. -->
2900N/A <target name="srczip" depends="compileadmin"
2900N/A description="Generate a src.zip file with all the server source.">
2900N/A <zip destfile="${build.dir}/src.zip">
2900N/A <zipfileset dir="${src.dir}" excludes="**/.svn" filemode="644"
2900N/A dirmode="755" />
6140N/A <zipfileset dir="${admin.src.dir}" excludes="**/.svn" filemode="644"
2900N/A dirmode="755" />
2900N/A <zipfileset dir="${ads.src.dir}" excludes="**/.svn" filemode="644"
2900N/A dirmode="755" />
2900N/A <zipfileset dir="${quicksetup.src.dir}" excludes="**/.svn" filemode="644"
2900N/A dirmode="755" />
2900N/A <zipfileset dir="${guitools.src.dir}" excludes="**/.svn" filemode="644"
3005N/A dirmode="755" />
2900N/A </zip>
2900N/A </target>
6140N/A
2900N/A
2900N/A
2900N/A <!-- Generate example plugin package. -->
2900N/A <target name="example-plugin" if="pdir">
2900N/A <!-- Create folder hierarchy in temporary directory. -->
2900N/A <tempfile property="plugin.temp.dir" destDir="${build.dir}" prefix="tmp"/>
2900N/A <mkdir dir="${plugin.temp.dir}/example-plugin" />
2900N/A <mkdir dir="${plugin.temp.dir}/example-plugin/src" />
2900N/A <mkdir dir="${plugin.temp.dir}/example-plugin/src-generated" />
2900N/A <mkdir dir="${plugin.temp.dir}/example-plugin/lib" />
2900N/A <mkdir dir="${plugin.temp.dir}/example-plugin/ext" />
2900N/A <mkdir dir="${plugin.temp.dir}/example-plugin/resource" />
2900N/A <mkdir dir="${plugin.temp.dir}/example-plugin/resource/admin" />
2896N/A <mkdir dir="${plugin.temp.dir}/example-plugin/resource/config" />
2896N/A <mkdir dir="${plugin.temp.dir}/example-plugin/resource/schema" />
2896N/A <copy todir="${plugin.temp.dir}/example-plugin/src">
2896N/A <fileset dir="${admin.defn.dir}" includes="**/*.xml" />
2896N/A </copy>
2896N/A <copy todir="${plugin.temp.dir}/example-plugin/resource/admin">
2896N/A <fileset dir="${admin.rules.dir}" excludes="example-plugin/**" />
6158N/A </copy>
2900N/A <copy todir="${plugin.temp.dir}/example-plugin" file="${admin.rules.dir}/example-plugin/build.xml" />
2896N/A <copy todir="${plugin.temp.dir}/example-plugin" file="${admin.rules.dir}/example-plugin/README" />
2896N/A <copy todir="${plugin.temp.dir}/example-plugin/resource/schema" file="${admin.rules.dir}/example-plugin/99-example-plugin.ldif" />
4235N/A <copy todir="${plugin.temp.dir}/example-plugin/resource/config" file="${admin.rules.dir}/example-plugin/example-plugin.ldif" />
4235N/A <copy todir="${plugin.temp.dir}/example-plugin/src/com/example/opends">
2900N/A <fileset dir="${admin.rules.dir}/example-plugin" includes="*.java,*.xml" excludes="build.xml" />
2896N/A </copy>
2900N/A
2896N/A <!-- Package up the plugin in the OpenDS package folder. -->
2896N/A <zip destfile="${pdir}/example-plugin.zip">
2896N/A <zipfileset dir="${plugin.temp.dir}" filemode="644" dirmode="755" />
2896N/A </zip>
2896N/A <delete dir="${plugin.temp.dir}" />
2896N/A </target>
6158N/A</project>
2900N/A