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