0N/A<!--
6330N/A CDDL HEADER START
3012N/A
6330N/A The contents of this file are subject to the terms of the
6330N/A Common Development and Distribution License, Version 1.0 only
6330N/A (the "License"). You may not use this file except in compliance
6330N/A with the License.
233N/A
6330N/A You can obtain a copy of the license via
6330N/A http://opendj.forgerock.org/license.html .
6330N/A See the License for the specific language governing permissions
6330N/A and limitations under the License.
0N/A
6330N/A When distributing Covered Code, include this CDDL HEADER in each
6330N/A file and include the License file://resource/legal-notices/CDDLv1_0.txt .
6330N/A If applicable, add the following below this CDDL HEADER, with the fields
6330N/A enclosed by brackets "[]" replaced with your own identifying information:
6330N/A Portions Copyright [yyyy] [name of copyright owner]
6330N/A
6330N/A CDDL HEADER END
6330N/A
6330N/A
6330N/A Copyright 2006-2010 Sun Microsystems, Inc.
6330N/A Portions Copyright 2011-2013 ForgeRock AS
6330N/A Portions Copyright 2012 Delta Victor Consultants
6330N/A Portions Copyright 2013 Jens Elkner
6330N/A-->
0N/A
6331N/A<project name="opendj2" basedir="." default="pkg.generic"
6330N/A xmlns:ivy="antlib:org.apache.ivy.ant"
6330N/A xmlns:if="ant:if" xmlns:unless="ant:unless"
6330N/A>
6330N/A <description>
6330N/A This is the build script for OpenDJ.
6330N/A See the etc/README.txt file for build instructions and details.
6330N/A </description>
3381N/A
6330N/A <!-- Build JVM properties -->
6330N/A <property name="MEM" value="1024M"/>
6330N/A <property name="ant.build.javac.source" value="1.7"/>
6330N/A <property name="ant.build.javac.target" value="1.7"/>
6331N/A <property name="ant.regexp.regexpimpl"
6331N/A value="org.apache.tools.ant.util.regexp.Jdk14RegexpRegexp" />
6330N/A <property name="build.sysclasspath" value="ignore" />
6330N/A <property name="JVM_VENDOR" value="${java.vm.vendor}" />
3980N/A
6330N/A <!-- Build OpenDMK properties -->
6330N/A <property file="build.properties"/>
6301N/A <property file="${user.home}/config/ant/${ant.project.name}.properties" />
6301N/A <property file="${user.home}/config/ant/global.properties" />
6301N/A <property file="/local/share/javax/global.properties" />
3012N/A
6330N/A <property file="PRODUCT" />
6330N/A <property name="vendor.name" value="ForgeRock AS" />
6331N/A <!-- property name="vendor.url" value="${DOC_REFERENCE_HOME}" / -->
6330N/A <property name="vendor.url" value="http://www.foregrock.com/" />
6331N/A <property name="vendor.email" value="opendj@forgerock.org" />
6331N/A <property name="vendor.prefix" value="FR" />
233N/A
6330N/A <!-- If true, unmangled exception messages and full stacktrace gets logged,
6330N/A otherwise, className if message == null and at most 20 stacktrace elements -->
6330N/A <property name="DEBUG_BUILD" value="false" />
6330N/A <property name="build.debuglevel" value="lines,vars,source" />
0N/A
6330N/A <!-- General server-wide properties -->
6330N/A <property name="src.dir" location="src/server" />
6330N/A <property name="build.dir" location="build" />
6330N/A <property name="classes.dir" location="${build.dir}/classes" />
6330N/A <property name="lib.dir" location="lib" />
6330N/A <property name="ext.dir" location="ext" />
6330N/A <property name="package.dir" location="${build.dir}/package" />
6330N/A <property name="PROTO" location="${package.dir}/generic" />
6330N/A <property name="javadoc.dir" location="${build.dir}/javadoc" />
6330N/A <property name="docgen.dir" location="${build.dir}/docgen" />
6330N/A <property name="configguide.dir"
6330N/A location="${docgen.dir}/configuration_guide" />
6330N/A <property name="configguideldap.dir"
6330N/A location="${docgen.dir}/configuration_guide_with_ldap_mapping" />
6330N/A <property name="wiki.home"
6330N/A value="https://wikis.forgerock.org/confluence/display/opendj/Home"/>
6330N/A <property name="resource.dir" location="resource" />
6330N/A <property name="scripts.dir" location="${resource.dir}/bin" />
6330N/A <property name="config.dir" location="${resource.dir}/config" />
6331N/A <property name="svr4.srcdir" value="${basedir}/src/svr4/OpenDJ" />
567N/A
6330N/A <!-- man page related properties -->
6330N/A <property name="src.man.dir" location="${resource.dir}/man"/>
6330N/A <property name="build.man.dir" location="${build.dir}/man"/>
6330N/A <property name="man.os" value="" /> <!-- important !!! -->
6330N/A <property name="docbook.xsl.dir" location="/usr/share/sgml/docbook/xsl-stylesheets" />
0N/A
6330N/A <!-- Properties for build tools -->
6330N/A <property name="buildtools.src.dir" location="src/build-tools" />
6330N/A <property name="buildtools.classes.dir"
6330N/A location="${build.dir}/build-tools/classes" />
0N/A
6330N/A <!-- Properties for use in unit testing -->
6330N/A <selector id="test.libs">
6330N/A <or>
6330N/A <filename name="**/assertj-core.jar" />
6330N/A <filename name="**/hamcrest-core.jar" />
6330N/A <filename name="**/mockito-core.jar" />
6330N/A <filename name="**/objenesis.jar" />
6330N/A </or>
6330N/A </selector>
6330N/A <property name="unittest.testng.dir" location="tests/unit-tests-testng"/>
6330N/A <property name="unittest.testng.src.dir"
6330N/A location="${unittest.testng.dir}/src/server"/>
902N/A
6330N/A <property name="unittest.classes.dir"
6330N/A location="${build.dir}/unit-tests/classes" />
6330N/A <property name="unittest.report.dir"
6330N/A location="${build.dir}/unit-tests/report"/>
6330N/A <property name="unittest.resource.dir"
6330N/A location="${build.dir}/unit-tests/resource"/>
233N/A
6330N/A <!-- Properties for use with the DSML component -->
6330N/A <property name="dsml.dir" location="resource/dsml" />
6330N/A <property name="dsml.src.dir" location="src/dsml" />
6330N/A <property name="dsml.lib.dir" location="${dsml.dir}/lib" />
6330N/A <property name="dsml.gen.dir" location="${build.dir}/dsml/gen" />
6330N/A <property name="dsml.classes.dir" location="${build.dir}/dsml/classes" />
699N/A
6330N/A <!-- Properties for use with the Quick Setup -->
6330N/A <property name="quicksetup.src.dir" location="src/quicksetup" />
6330N/A <property name="quicksetup.classes.dir"
6330N/A location="${build.dir}/quicksetup/classes" />
6330N/A <property name="quicksetup.globalcompile.classes.dir"
6330N/A location="${classes.dir}/org/opends/quicksetup" />
6330N/A <property name="ads.src.dir" location="src/ads" />
6330N/A <property name="ads.classes.dir"
6330N/A location="${classes.dir}/org/opends/admin/ads"/>
3381N/A
6330N/A <!-- Properties for use with the GUI Tools that go in OpenDJ jar -->
6330N/A <property name="guitools.src.dir" location="src/guitools" />
0N/A
6330N/A <!-- Properties for coverage diff reports -->
6330N/A <property name="cvgdiff.dir" location="${build.dir}/diff" />
6330N/A <property name="cvgdiff.report.dir" location="${cvgdiff.dir}/report" />
1177N/A
6330N/A <!-- Properties for code coverage testing -->
6330N/A <property name="coverage.dir" location="${build.dir}/coverage" />
6330N/A <property name="coverage.report.dir"
6330N/A location="${coverage.dir}/reports/unit" />
6330N/A <property name="coverage.instr.dir"
6330N/A location="${coverage.dir}/instrumentedcode" />
6330N/A <property name="coverage.data.dir"
6330N/A location="${coverage.dir}/gathereddata" />
3980N/A
6330N/A <!-- Properties for the EMMA code coverage tool -->
6330N/A <property name="emma.dir" location="${ext.dir}/emma/lib" />
6401N/A
6330N/A <!-- Properties for the AspectJ tools -->
6330N/A <property name="aj.dir" location="${ext.dir}/aspectj" />
6330N/A <property name="aj.lib.dir" location="${aj.dir}/lib" />
3381N/A
6330N/A <!-- Properties for the TestNG unit testing tool -->
6330N/A <property name="testng.dir" location="${ext.dir}/testng" />
6330N/A <property name="testng.lib.dir" location="${testng.dir}/lib" />
6158N/A
6330N/A <!-- Properties for the ANT build tool. -->
6330N/A <property name="ant.dir" location="${ext.dir}/ant" />
6330N/A <property name="ant.lib.dir" location="${ant.dir}/lib" />
6165N/A
6330N/A <!-- Properties for the checkstyle tool -->
6330N/A <property name="checkstyle.dir" location="${ext.dir}/checkstyle" />
6330N/A <property name="checkstyle.cache.dir" location=".checkstyle-cache" />
3381N/A
6330N/A <!-- Properties for Directory Server version information -->
6330N/A <property name="dynconstants.file"
6330N/A location="${src.dir}/org/opends/server/util/DynamicConstants.java" />
6330N/A <property name="dynconstants.stubfile"
6330N/A location="${resource.dir}/DynamicConstants.java.stubs" />
6158N/A
6330N/A <!-- Properties for administration framework code generation -->
6330N/A <property name="admin.defn.dir" location="src/admin/defn" />
6330N/A <property name="admin.src.dir" location="src/admin/generated" />
6330N/A <property name="admin.rules.dir" location="resource/admin" />
6330N/A <property name="configguide.resource.dir"
6330N/A location="resource/admin/config-guide" />
3381N/A
6330N/A <!-- Properties for generating messages -->
6330N/A <property name="msg.dir" location="src/messages" />
6330N/A <property name="msg.prop.dir" location="${msg.dir}/messages" />
6330N/A <property name="msg.javagen.dir" location="${msg.dir}/generated" />
6330N/A <property name="msg.logref.dir" location="${docgen.dir}/logref" />
6330N/A <property name="msg.package.dir" location="${classes.dir}/messages" />
6330N/A <property name="msg.src.dir" location="${msg.dir}/src" />
3381N/A
6330N/A <!-- Properties for L10n for generating messages -->
6330N/A <property name="msgl10n.prop.dir" location="src/admin/messages/" />
6330N/A <selector id="msgl10n.prop.files">
6330N/A <or>
6330N/A <filename name="**/*_ca_ES.properties" />
6330N/A <filename name="**/*_de.properties" />
6330N/A <filename name="**/*_es.properties" />
6330N/A <filename name="**/*_fr.properties" />
6330N/A <filename name="**/*_ja.properties" />
6330N/A <filename name="**/*_ko.properties" />
6330N/A <filename name="**/*_pl.properties" />
6330N/A <filename name="**/*_zh_TW.properties" />
6330N/A <filename name="**/*_zh_CN.properties" />
6330N/A </or>
6330N/A </selector>
6330N/A <property name="msgl10n.diff.dir" location="${build.dir}/l10nmsg/" />
0N/A
6330N/A <!-- Properties for SNMP extension -->
6330N/A <property name="snmp.mib.dir" location="src/snmp/resource/mib" />
6330N/A <property name="snmp.security.dir" location="src/snmp/resource/security" />
6330N/A <property name="snmp.config.dir" location="src/snmp/resource/config" />
6330N/A <property name="snmp.resource.dir" location="src/snmp/resource" />
6330N/A <property name="snmp.gen.dir" location="src/snmp/generated" />
6330N/A <property name="snmp.src.dir" location="src/snmp/src" />
6330N/A <property name="snmp.classes.dir"
6330N/A location="${classes.dir}/org/opends/server/snmp" />
0N/A
6330N/A <!-- Data dir for internal testing/development -->
6330N/A <property name="instance.dir" value="${build.dir}/instance"/>
0N/A
6330N/A <!-- Prevent ant runtime from being included on classpath during compilation -->
6330N/A <presetdef name="javac">
6330N/A <javac optimize="true" debug="on" debuglevel="${build.debuglevel}"
6330N/A deprecation="true" fork="true"
6330N/A memoryInitialSize="${MEM}" memoryMaximumSize="${MEM}"
6330N/A >
6330N/A <compilerarg value="-Xlint:all" />
6330N/A <compilerarg value="-Xlint:-rawtypes" />
6330N/A <compilerarg value="-Xlint:-static" />
6330N/A <compilerarg value="-Xlint:-unchecked" />
6330N/A <compilerarg value="-Xprefer:source"/>
6330N/A </javac>
6330N/A </presetdef>
0N/A
0N/A
6330N/A <!-- ######################### IVY #################################### -->
6330N/A <property name="ivy.install.version" value="2.3.0"/>
6330N/A <property name="ivy.jar.file" value="${ext.dir}/ivy.jar"/>
6330N/A <condition property="ivy.checkmodified" value="false" else="true">
6330N/A <isset property="build.offline"/>
6301N/A </condition>
6330N/A <condition property="ivy.changingpattern" value="" else=".*-SNAPSHOT">
6330N/A <isset property="build.offline"/>
6330N/A </condition>
5947N/A
6302N/A <target name="-check.ivy">
6302N/A <dependset>
6302N/A <srcfileset dir="${basedir}" includes="ivy.xml, ivysettings.xml"/>
6330N/A <targetfileset file="${lib.dir}/libs.ok"/>
6302N/A </dependset>
6330N/A <available file="${lib.dir}/libs.ok" property="ivy.uptodate"/>
6302N/A <available file="${ivy.jar.file}" property="ivy.installed"/>
6302N/A </target>
5947N/A
6302N/A <target name="download.ivy" depends="-check.ivy" unless="ivy.installed">
6302N/A <!-- download Ivy from web site so that it can be used even without any
6302N/A special installation -->
6302N/A <echo message="Getting ivy ..."/>
6302N/A <property name="ivy.baseurl"
6302N/A value="http://repo1.maven.org/maven2/org/apache/ivy/ivy" />
6302N/A <get src="${ivy.baseurl}/${ivy.install.version}/ivy-${ivy.install.version}.jar"
6302N/A dest="${ivy.jar.file}" usetimestamp="true"/>
6302N/A </target>
0N/A
6302N/A <!--
6302N/A Try to load ivy here from local ivy dir, in case the user has not already
6302N/A dropped it into ant's lib dir (note that the latter copy will always take
6302N/A precedence). We will not fail as long as local lib dir exists (it may be
6302N/A empty) and ivy is in at least one of ant's lib dir or the local lib dir.
6302N/A -->
6302N/A <target name="ivy.task" depends="download.ivy">
6330N/A <path id="ivy.lib.path" location="${ivy.jar.file}" cache="true"/>
6302N/A <taskdef resource="org/apache/ivy/ant/antlib.xml"
6302N/A uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/>
6302N/A </target>
3381N/A
6330N/A <target name="check.libs" depends="ivy.task" unless="ivy.uptodate"
6330N/A description="Check and download required libs via ivy if not avail."
6330N/A >
6302N/A <ivy:retrieve pattern="${lib.dir}/[type]/[artifact].[ext]"/>
6330N/A <touch file="${lib.dir}/libs.ok"></touch>
6302N/A </target>
0N/A
6330N/A <target name="clean.libs"
6330N/A description="Remove all libs which can be/were downloaded via ivy."
6330N/A >
6302N/A <delete>
6330N/A <fileset dir="${lib.dir}" includes="**/*.jar,libs.ok" />
6302N/A </delete>
6302N/A </target>
1344N/A
6330N/A <target name="clean.ivy">
6302N/A <delete file="${ivy.jar.file}"/>
6302N/A </target>
1344N/A
6302N/A <target name="clean.ivy-cache" depends="ivy.task"
6330N/A description="Remove everything in the ivy cache."
6330N/A >
6302N/A <ivy:cleancache/>
6302N/A </target>
0N/A
0N/A
6330N/A <!-- ########################## INIT ################################## -->
6330N/A <target name="init" depends="check.libs">
6331N/A <condition property="isUnix"><os family="unix"/></condition>
567N/A
6330N/A <available file="${opendmk.lib.dir}/jdmkrt.jar" property="jdmkrt.lib"
6330N/A value="${opendmk.lib.dir}/jdmkrt.jar" />
6330N/A <available file="${opendmk.lib.dir}/jdmktk.jar" property="jdmktk.lib"
6330N/A value="${opendmk.lib.dir}/jdmktk.jar" />
6330N/A <available file="${ext.dir}/jdmkrt.jar" property="jdmkrt.lib"
6330N/A value="${ext.dir}/jdmkrt.jar" />
6330N/A <available file="${ext.dir}/jdmktk.jar" property="jdmktk.lib"
6330N/A value="${ext.dir}/jdmktk.jar"/>
6330N/A <condition property="jdmk.present" value="true">
6330N/A <and>
6330N/A <isset property="jdmkrt.lib" />
6330N/A <isset property="jdmktk.lib" />
6330N/A </and>
6330N/A </condition>
6330N/A <path id="jdmk.jars">
6330N/A <path location="${jdmkrt.lib}" if:set="jdmkrt.lib"/>
6330N/A <path location="${jdmktk.lib}" if:set="jdmktk.lib" />
6330N/A </path>
6330N/A
6330N/A <condition property="dbk.xsl"
6330N/A value="${docbook.xsl.dir}/manpages/profile-docbook.xsl"
6330N/A >
6330N/A <and>
6330N/A <available file="${docbook.xsl.dir}/manpages/profile-docbook.xsl" />
6330N/A <available file="${src.man.dir}/common.xml" />
6330N/A </and>
6330N/A </condition>
662N/A
6330N/A <mkdir dir="${classes.dir}" />
6330N/A <mkdir dir="${quicksetup.classes.dir}" />
1210N/A
6330N/A <!-- defs here since we cache the result: dirs, libs must be avail -->
6330N/A <path id="opendj.runtime.jars" cache="true">
6330N/A <fileset dir="${lib.dir}/bundle" includes="*.jar" />
6330N/A <fileset dir="${lib.dir}/jar" includes="*.jar">
6330N/A <not><selector refid="test.libs"/></not>
6330N/A </fileset>
6330N/A </path>
3387N/A
6330N/A <path id="quicksetup.classpath" cache="true">
6330N/A <pathelement location="${quicksetup.classes.dir}" />
6330N/A </path>
712N/A
6330N/A <path id="run.classpath" cache="true">
6330N/A <pathelement location="${classes.dir}" />
6330N/A <path refid="quicksetup.classpath" />
6330N/A <path refid="opendj.runtime.jars"/>
6330N/A <path refid="jdmk.jars" />
6330N/A <!-- messages. Dueto strange src tree layout, it contains more than
6330N/A needed (i.e. not only messages) -->
6330N/A <pathelement location="${msg.dir}" />
6330N/A <pathelement location="${msgl10n.prop.dir}/.."/>
6330N/A <pathelement location="${msg.javagen.dir}" />
6330N/A </path>
3381N/A
6330N/A <local name="snmp"/>
6330N/A <condition property="snmp" value="enabled" else="disabled (OpenDMK not found)">
6330N/A <isset property="jdmk.present" />
6330N/A </condition>
6331N/A <local name="dbk"/>
6331N/A <condition property="dbk" value="available" else="not found">
6331N/A <isset property="dbk.xsl" />
6331N/A </condition>
114N/A
6330N/A <echo
6330N/A> Java Version: ${java.runtime.version} (JVM ${java.vm.version})
6330N/A SNMP support: ${snmp}
6331N/A Docbook XSLT: ${dbk}
6331N/A Ant:
6331N/A ${ant.home}
6331N/A ${ant.version}
6330N/A</echo>
6330N/A </target>
0N/A
6330N/A <target name="buildtools" depends="init"
6330N/A description="Builds the build tools."
6330N/A >
6330N/A <mkdir dir="${buildtools.classes.dir}" />
6330N/A <copy file="${resource.dir}/Messages.java.stub"
6330N/A todir="${buildtools.classes.dir}/org/opends/build/tools/resource"/>
6330N/A <javac srcdir="${src.dir}:${msg.src.dir}"
6330N/A destdir="${buildtools.classes.dir}">
6330N/A <src path="${src.dir}" />
6330N/A <patternset includes="**/PublicAPI.java,**/StabilityLevel.java"/>
6330N/A <src path="${msg.src.dir}" />
6330N/A <patternset includes="**/Message.java,**/MessagePropertyKey.java,
6330N/A **/MessageDescriptor.java,**/Severity.java,**/Category.java "/>
6330N/A </javac>
4156N/A
6330N/A <javac srcdir="${buildtools.src.dir}" destdir="${buildtools.classes.dir}"
6330N/A includes="org/**/*,netscape/**/*"
6330N/A >
6330N/A <classpath>
6330N/A <pathelement location="${ant.lib.dir}/ant.jar" />
6330N/A <pathelement location="${emma.dir}/emma.jar" />
6330N/A </classpath>
6330N/A </javac>
6330N/A
6330N/A <jar jarfile="${build.dir}/build-tools/build-tools.jar"
6330N/A basedir="${buildtools.classes.dir}" compress="true" index="true" />
1607N/A
6330N/A <path id="build.tools" path="${build.dir}/build-tools/build-tools.jar"
6330N/A cache="true"/>
0N/A
6330N/A <typedef name="genmsg"
6330N/A classname="org.opends.build.tools.GenerateMessageFile"
6330N/A >
6330N/A <classpath refid="build.tools"/>
6330N/A </typedef>
6330N/A <presetdef name="genlogref">
6330N/A <genmsg writelogref="true" />
6330N/A </presetdef>
6330N/A </target>
1177N/A
6330N/A <target name="-check.repo">
6330N/A <available file="${basedir}/.hg/store" property="is.hg"/>
6330N/A <available file="${basedir}/.svn" property="is.svn" />
6330N/A <condition property="svn.uptodate">
6330N/A <istrue value="${is.hg}" />
6330N/A </condition>
6330N/A <condition property="hg.uptodate">
6330N/A <istrue value="${is.svn}" />
6330N/A </condition>
6330N/A </target>
2556N/A
6330N/A <target name="-check.hg" depends="-check.repo" if="is.hg">
6330N/A <dependset>
6410N/A <srcfileset dir="${basedir}" includes=".hg/last-message.txt,PRODUCT" />
6330N/A <targetfileset file="${build.dir}/buildnumber" />
6330N/A </dependset>
6330N/A <available file="${build.dir}/buildnumber" property="hg.uptodate"/>
6330N/A </target>
6330N/A <target name="-check.svn" depends="-check.repo" if="is.svn">
6330N/A <dependset>
6410N/A <srcfileset dir="${basedir}" includes=".svn/wc.db,PRODUCT" />
6330N/A <targetfileset file="${build.dir}/buildnumber" />
6330N/A </dependset>
6330N/A <available file="${build.dir}/buildnumber" property="svn.uptodate"/>
6330N/A </target>
6330N/A
6330N/A <target name="version.svn" depends="init,buildtools,-check.svn"
6330N/A unless="svn.uptodate">
6410N/A <exec executable="svnversion" outputproperty="BUILD_ID" />
6410N/A <exec executable="svn" outputproperty="svn.version">
6410N/A <arg line="info" />
6410N/A <env key="LC_ALL" value="C"/>
6410N/A </exec>
6410N/A <script language="javascript"><![CDATA[
6410N/A var line, s;
6410N/A var lines = project.getProperty("hg.version").split("\n");
6410N/A for each (var line in lines) {
6410N/A s = line.split(" ", 2);
6410N/A if (s[0] == "URL:") {
6410N/A project.setProperty("URL_REPOSITORY", s[1]);
6410N/A } else if (s[0] == "Revision:") {
6410N/A project.setProperty("BUILD_NUMBER", s[1]);
6410N/A }
6410N/A }
6410N/A var x = parseInt(project.getProperty("MAJOR_VERSION"), 10) * 1000000
6410N/A + parseInt(project.getProperty("MINOR_VERSION"), 10) * 1000
6410N/A + parseInt(project.getProperty("POINT_VERSION"), 10);
6410N/A project.setProperty("REVISION_NUMBER", x);
6410N/A ]]></script>
6410N/A <property name="BILD_NUMBER" value="0" />
6330N/A <property name="URL_REPOSITORY"
6330N/A value="https://svn.forgerock.org/opendj/trunk/opends" />
6330N/A <echo file="${build.dir}/buildnumber" message="${line.separator}
6410N/A BUILD_NUMBER=${BUILD_NUMBER}${line.separator}
6410N/A BUILD_ID=${BUILD_ID}${line.separator}
6330N/A REVISION_NUMBER=${REVISION_NUMBER}${line.separator}
6330N/A URL_REPOSITORY=${URL_REPOSITORY}${line.separator}"/>
6330N/A </target>
5058N/A
6330N/A <target name="version.hg" depends="init,buildtools,-check.hg"
6330N/A unless="hg.uptodate"
6330N/A >
6330N/A <!-- '+' => current branch has modifications, like M for svn -->
6330N/A <exec executable="hg" outputproperty="hg.version">
6330N/A <arg line="id -in" />
6330N/A </exec>
6330N/A <script language="javascript"><![CDATA[
6330N/A var s = project.getProperty("hg.version").split(" ");
6410N/A var idx = s[1].lastIndexOf("+", s[1].length()-2);
6330N/A idx = (idx < 0) ? 0 : idx+1;
6330N/A var bn = s[1].endsWith("+")
6330N/A ? parseInt(s[1].substr(idx, s[1].length()-1), 10) + 1
6330N/A : parseInt(s[1].substr(idx), 10);
6410N/A var x = parseInt(project.getProperty("MAJOR_VERSION"), 10) * 1000000
6410N/A + parseInt(project.getProperty("MINOR_VERSION"), 10) * 1000
6410N/A + parseInt(project.getProperty("POINT_VERSION"), 10);
6410N/A project.setProperty("REVISION_NUMBER", x);
6330N/A project.setProperty("BUILD_NUMBER", bn);
6410N/A project.setProperty("BUILD_ID", s[0]);
6330N/A ]]></script>
6330N/A <property name="URL_REPOSITORY"
6330N/A value="https://svn.forgerock.org/opendj/trunk/opends" />
6330N/A <echo file="${build.dir}/buildnumber" message="${line.separator}
6410N/A BUILD_NUMBER=${BUILD_NUMBER}${line.separator}
6410N/A BUILD_ID=${BUILD_ID}${line.separator}
6330N/A REVISION_NUMBER=${REVISION_NUMBER}${line.separator}
6330N/A URL_REPOSITORY=${URL_REPOSITORY}${line.separator}"/>
6330N/A </target>
0N/A
6330N/A <!-- Generate the DynamicConstants.java file.
6330N/A Be warned that the .stubs file references the following properties
6330N/A PRODUCT_NAME, SHORT_NAME, MAJOR_VERSION, MINOR_VERSION, POINT_VERSION,
6410N/A VERSION_QUALIFIER, FIX_IDS, BUILD_NUMBER, BUILD_ID, user.name,
6330N/A java.version, java.vendor, java.vm.version, JVM_VENDOR, DEBUG_BUILD,
6410N/A URL_REPOSITORY, DOC_REFERENCE_HOME, DOC_REFERENCE_WIKI,
6330N/A DOC_QUICK_REFERENCE_GUIDE, ADMINISTRATION_GUIDE_URL, VERSION-BUILD.
6330N/A If you change the name of any of those properties in this build.xml
6330N/A you'll need to reflect the same change in the .stubs file
6330N/A -->
6330N/A <target name="dynamicconstants" depends="version.svn,version.hg">
6330N/A <property file="${build.dir}/buildnumber" />
6330N/A <property name="BUILD_NUMBER" value="-1"/>
712N/A
6330N/A <!-- Construct the version number string -->
6330N/A <loadresource property="PKG_QUALIFIER">
6330N/A <propertyresource name="VERSION_QUALIFIER" />
6330N/A <filterchain>
6330N/A <tokenfilter>
6330N/A <replaceregex pattern="[^0-9a-zA-Z]+" replace="" flags="g"/>
6330N/A </tokenfilter>
6330N/A </filterchain>
6330N/A </loadresource>
6330N/A <property name="PKG_QUALIFIER" value="" />
1008N/A
6330N/A <property name="VERSION_FULL"
6330N/A value="${MAJOR_VERSION}.${MINOR_VERSION}.${POINT_VERSION}" />
6330N/A <property name="VERSION_SHORT" value="${MAJOR_VERSION}${MINOR_VERSION}"/>
6330N/A <property name="VERSION-BUILD"
6330N/A value="${VERSION_FULL}-build${BUILD_NUMBER}"/>
6330N/A <property name="PKG_DIRNAME" value="${SHORT_NAME}-${VERSION-BUILD}" />
3381N/A
6330N/A <uptodate property="dyn.uptodate" targetfile="${dynconstants.file}">
6330N/A <srcfiles file="${build.dir}/buildnumber"/>
6330N/A <srcfiles file="${dynconstants.stubfile}"/>
6330N/A </uptodate>
6330N/A <copy file="${dynconstants.stubfile}" tofile="${dynconstants.file}"
6330N/A overwrite="true" unless:true="${dyn.uptodate}"
6330N/A >
6330N/A <filterchain>
6330N/A <expandproperties/>
6330N/A </filterchain>
6330N/A </copy>
6330N/A </target>
2086N/A
3980N/A
6330N/A <!-- ################ GENERATE source, xml files ###################### -->
6330N/A <target name="gen.server" depends="buildtools"
6330N/A description="Generate server messages source files.">
6330N/A <genmsg sourceProps="${msg.prop.dir}/access_control.properties"
6330N/A destJava="${msg.javagen.dir}/org/opends/messages/AccessControlMessages.java" />
6330N/A <genmsg sourceProps="${msg.prop.dir}/admin.properties"
6330N/A destJava="${msg.javagen.dir}/org/opends/messages/AdminMessages.java" />
6330N/A <genmsg sourceProps="${msg.prop.dir}/admin_tool.properties"
6330N/A destJava="${msg.javagen.dir}/org/opends/messages/AdminToolMessages.java" />
6330N/A <genmsg sourceProps="${msg.prop.dir}/backend.properties"
6330N/A destJava="${msg.javagen.dir}/org/opends/messages/BackendMessages.java" />
6330N/A <genmsg sourceProps="${msg.prop.dir}/config.properties"
6330N/A destJava="${msg.javagen.dir}/org/opends/messages/ConfigMessages.java" />
6330N/A <genmsg sourceProps="${msg.prop.dir}/core.properties"
6330N/A destJava="${msg.javagen.dir}/org/opends/messages/CoreMessages.java" />
6330N/A <genmsg sourceProps="${msg.prop.dir}/dsconfig.properties"
6330N/A destJava="${msg.javagen.dir}/org/opends/messages/DSConfigMessages.java" />
6330N/A <genmsg sourceProps="${msg.prop.dir}/extension.properties"
6330N/A destJava="${msg.javagen.dir}/org/opends/messages/ExtensionMessages.java" />
6330N/A <genmsg sourceProps="${msg.prop.dir}/jeb.properties"
6330N/A destJava="${msg.javagen.dir}/org/opends/messages/JebMessages.java" />
6330N/A <genmsg sourceProps="${msg.prop.dir}/log.properties"
6330N/A destJava="${msg.javagen.dir}/org/opends/messages/LoggerMessages.java"/>
6330N/A <genmsg sourceProps="${msg.prop.dir}/plugin.properties"
6330N/A destJava="${msg.javagen.dir}/org/opends/messages/PluginMessages.java" />
6330N/A <genmsg sourceProps="${msg.prop.dir}/protocol.properties"
6330N/A destJava="${msg.javagen.dir}/org/opends/messages/ProtocolMessages.java" />
6330N/A <genmsg sourceProps="${msg.prop.dir}/quicksetup.properties"
6330N/A destJava="${msg.javagen.dir}/org/opends/messages/QuickSetupMessages.java" />
6330N/A <genmsg sourceProps="${msg.prop.dir}/replication.properties"
6330N/A destJava="${msg.javagen.dir}/org/opends/messages/ReplicationMessages.java" />
6330N/A <genmsg sourceProps="${msg.prop.dir}/schema.properties"
6330N/A destJava="${msg.javagen.dir}/org/opends/messages/SchemaMessages.java" />
6330N/A <genmsg sourceProps="${msg.prop.dir}/task.properties"
6330N/A destJava="${msg.javagen.dir}/org/opends/messages/TaskMessages.java" />
6330N/A <genmsg sourceProps="${msg.prop.dir}/tools.properties"
6330N/A destJava="${msg.javagen.dir}/org/opends/messages/ToolMessages.java" />
6330N/A <genmsg sourceProps="${msg.prop.dir}/utility.properties"
6330N/A destJava="${msg.javagen.dir}/org/opends/messages/UtilityMessages.java" />
6330N/A <genmsg sourceProps="${msg.prop.dir}/version.properties"
6330N/A destJava="${msg.javagen.dir}/org/opends/messages/VersionMessages.java" />
6330N/A <genmsg sourceProps="${msg.prop.dir}/runtime_information.properties"
6330N/A destJava="${msg.javagen.dir}/org/opends/messages/RuntimeMessages.java" />
6330N/A </target>
6330N/A <target name="clean.server"
6330N/A description="Remove all generated server messages source files.">
6330N/A <delete includeemptydirs="true" failonerror="false">
6330N/A <fileset dir="${msg.javagen.dir}" includes="**/*" />
6330N/A </delete>
6330N/A </target>
712N/A
6330N/A <!-- same as generate.messages but output is xml instead of java file -->
6330N/A <target name="gen.logrefs" depends="buildtools"
6330N/A description="Create DS log reference docbook source archive (core docs).">
6330N/A <genlogref sourceProps="${msg.prop.dir}/access_control.properties"
6330N/A destJava="${msg.logref.dir}/log-ref-access-control.xml" />
6330N/A <genlogref sourceProps="${msg.prop.dir}/admin.properties"
6330N/A destJava="${msg.logref.dir}/log-ref-admin.xml" />
6330N/A <!-- Ignore admin tool messages while documenting only serious errors.
6330N/A <genlogref sourceProps="${msg.prop.dir}/admin_tool.properties"
6330N/A destJava="${msg.logref.dir}/log-ref-admin-tool.xml" />
6330N/A -->
6330N/A <genlogref sourceProps="${msg.prop.dir}/backend.properties"
6330N/A destJava="${msg.logref.dir}/log-ref-backend.xml" />
6330N/A <genlogref sourceProps="${msg.prop.dir}/config.properties"
6330N/A destJava="${msg.logref.dir}/log-ref-config.xml" />
6330N/A <genlogref sourceProps="${msg.prop.dir}/core.properties"
6330N/A destJava="${msg.logref.dir}/log-ref-core.xml" />
6330N/A <genlogref sourceProps="${msg.prop.dir}/dsconfig.properties"
6330N/A destJava="${msg.logref.dir}/log-ref-dsconfig.xml" />
6330N/A <genlogref sourceProps="${msg.prop.dir}/extension.properties"
6330N/A destJava="${msg.logref.dir}/log-ref-extension.xml" />
6330N/A <genlogref sourceProps="${msg.prop.dir}/jeb.properties"
6330N/A destJava="${msg.logref.dir}/log-ref-jeb.xml" />
6330N/A <genlogref sourceProps="${msg.prop.dir}/log.properties"
6330N/A destJava="${msg.logref.dir}/log-ref-log.xml" />
6330N/A <genlogref sourceProps="${msg.prop.dir}/plugin.properties"
6330N/A destJava="${msg.logref.dir}/log-ref-plugin.xml" />
6330N/A <genlogref sourceProps="${msg.prop.dir}/protocol.properties"
6330N/A destJava="${msg.logref.dir}/log-ref-protocol.xml" />
6330N/A <!-- Ignore QuickSetup messages that users handle interactively.
6330N/A <genlogref sourceProps="${msg.prop.dir}/quicksetup.properties"
6330N/A destJava="${msg.logref.dir}/log-ref-quicksetup.xml" />
6330N/A -->
6330N/A <genlogref sourceProps="${msg.prop.dir}/replication.properties"
6330N/A destJava="${msg.logref.dir}/log-ref-replication.xml"
6330N/A writelogref="true" />
6330N/A <!-- Ignore runtime info messages while documenting only serious errors.
6330N/A <genlogref sourceProps="${msg.prop.dir}/runtime_information.properties"
6330N/A destJava="${msg.logref.dir}/log-ref-runtime-information.xml" />
6330N/A -->
6330N/A <genlogref sourceProps="${msg.prop.dir}/schema.properties"
6330N/A destJava="${msg.logref.dir}/log-ref-schema.xml" />
6330N/A <genlogref sourceProps="${msg.prop.dir}/task.properties"
6330N/A destJava="${msg.logref.dir}/log-ref-task.xml" />
6330N/A <genlogref sourceProps="${msg.prop.dir}/tools.properties"
6330N/A destJava="${msg.logref.dir}/log-ref-tools.xml" />
6330N/A <genlogref sourceProps="${msg.prop.dir}/utility.properties"
6330N/A destJava="${msg.logref.dir}/log-ref-utility.xml" />
6330N/A <!-- Ignore version messages while documenting only serious errors.
6330N/A <genlogref sourceProps="${msg.prop.dir}/version.properties"
6330N/A destJava="${msg.logref.dir}/log-ref-version.xml />
6330N/A -->
563N/A
6330N/A <jar destfile="${docgen.dir}/log-ref.jar">
6330N/A <fileset dir="${msg.logref.dir}" includes="**/*.xml" />
6330N/A <filename name="${resource.dir}/log-message-reference.xml"/>
6330N/A </jar>
6330N/A </target>
6330N/A <!-- no need to clean: everything below build/ -->
712N/A
6330N/A <target name="-check.schema">
6330N/A <dependset>
6330N/A <srcfileset dir="${admin.defn.dir}" includes="**/*.xml"/>
6330N/A <srcfileset dir="${admin.rules.dir}" includes="*.xsd"/>
6330N/A <targetfilelist files="${build.dir}/schema.ok"/>
6330N/A </dependset>
6330N/A <condition property="schema.uptodate">
6330N/A <available file="${build.dir}/schema.ok"/>
6330N/A </condition>
6330N/A </target>
6330N/A <target name="check.schema" depends="-check.schema" unless="schema.uptodate"
6330N/A description="Validate core admin component XML definition files."
6330N/A >
6330N/A <schemavalidate>
6330N/A <fileset dir="${admin.defn.dir}" includes="**/*.xml" />
6330N/A <schema namespace="http://www.opends.org/admin"
6330N/A file="${admin.rules.dir}/admin.xsd"/>
6330N/A <schema namespace="http://www.opends.org/admin-ldap"
6330N/A file="${admin.rules.dir}/admin-ldap.xsd"/>
6330N/A <schema namespace="http://www.opends.org/admin-cli"
6330N/A file="${admin.rules.dir}/admin-cli.xsd"/>
6330N/A </schemavalidate>
6330N/A <touch file="${build.dir}/schema.ok"/>
6330N/A </target>
6330N/A <target name="-check.admin">
6330N/A <dependset>
6330N/A <srcfileset dir="${admin.defn.dir}" includes="*.xml"/>
6330N/A <srcfileset dir="${admin.rules.dir}" includes="*.xsl"/>
6330N/A <targetfileset dir="${admin.src.dir}" />
6330N/A <targetfileset dir="${classes.dir}"
6330N/A includes="admin/profiles/**/*.properties,
6330N/A admin/messages/**/*.properties,admin/core.manifest"/>
6330N/A </dependset>
6330N/A <condition property="admin.uptodate">
6330N/A <available file="${classes.dir}/admin/core.manifest"/>
6330N/A </condition>
6330N/A </target>
6330N/A <target name="gen.admin" depends="init,check.schema,-check.admin"
6330N/A unless="admin.uptodate"
6330N/A description="Generate admin messages source files."
6330N/A >
6330N/A <!-- Xalan-J Class Path : refer to it explicitly from each XSLT task. -->
6330N/A <path id="xalan.class.path" cache="true">
6330N/A <fileset dir="${ext.dir}/xalan-j" includes="*.jar" />
6330N/A </path>
3381N/A
6330N/A <fileset id="cfgFiles" dir="${admin.defn.dir}"
6330N/A includes="**/*Configuration.xml"/>
6330N/A <pathconvert property="cfgFileList" pathsep=' ' refid="cfgFiles">
6330N/A <!-- Glob not really needed: just to reduce length of the lists -->
6330N/A <globmapper from="${basedir}/*" to="../../*"/>
6330N/A </pathconvert>
6330N/A
6330N/A <!-- Generate manifest file for core administration components -->
6330N/A <xslt in="build.xml" out="${classes.dir}/admin/core.manifest"
6330N/A style="${admin.rules.dir}/manifestMO.xsl">
6330N/A <param name="files" expression="${cfgFileList}"/>
6330N/A <classpath refid="xalan.class.path" />
6330N/A </xslt>
6330N/A
6330N/A <!-- Now silence, please -->
6330N/A <script language="javascript"><![CDATA[
6330N/A // no way to get the log.level from ant, so we use cmdline
6330N/A var level = 2; // info
6330N/A var args = project.getProperty("sun.java.command").split("\\s");
6330N/A for (var i=0; i < args.length; i++) {
6330N/A if (args[i] == "-q" || args[i] == "--quiet") {
6330N/A level = 1;
6330N/A } else if (args[i] == "-v" || args[i] == "--verbose") {
6330N/A level = 3;
6330N/A } else if ( args[i] == "-d" || args[i] == "--debug") {
6330N/A level = 4;
6330N/A }
6330N/A }
6330N/A project.setProperty("log.level", level);
6330N/A if (level > 1) {
6330N/A var logger = project.getBuildListeners().firstElement();
6330N/A logger.setMessageOutputLevel(level-1);
6330N/A }
6330N/A ]]></script>
3214N/A
6330N/A <!-- Generate introspection API for core administration components -->
6330N/A <xslt basedir="${admin.defn.dir}" destdir="${admin.src.dir}"
6330N/A includes="**/*Configuration.xml" style="${admin.rules.dir}/metaMO.xsl">
6330N/A <regexpmapper handledirsep="true"
6330N/A from="^(.*)/([^/]+)Configuration\.xml$$" to="\1/meta/\2CfgDefn.java"/>
6330N/A <param name="base-dir" expression="${admin.defn.dir}" />
6330N/A <classpath refid="xalan.class.path" />
6330N/A </xslt>
6330N/A
6330N/A <xslt basedir="${admin.defn.dir}" destdir="${admin.src.dir}"
6330N/A includes="**/Package.xml" style="${admin.rules.dir}/package-info.xsl">
6330N/A <regexpmapper handledirsep="true"
6330N/A from="^(.*)/([^/]+)\.xml$$" to="\1/meta/package-info.java" />
6330N/A <param name="type" expression="meta" />
6330N/A <classpath refid="xalan.class.path" />
6330N/A </xslt>
0N/A
6330N/A <!-- Generate client API for core administration components -->
6330N/A <xslt basedir="${admin.defn.dir}" destdir="${admin.src.dir}"
6330N/A includes="**/*Configuration.xml" style="${admin.rules.dir}/clientMO.xsl">
6330N/A <regexpmapper handledirsep="true"
6330N/A from="^(.*)/([^/]+)Configuration\.xml$$" to="\1/client/\2CfgClient.java" />
6330N/A <param name="base-dir" expression="${admin.defn.dir}" />
6330N/A <classpath refid="xalan.class.path" />
6330N/A </xslt>
6330N/A
6330N/A <xslt basedir="${admin.defn.dir}" destdir="${admin.src.dir}"
6330N/A includes="**/Package.xml" style="${admin.rules.dir}/package-info.xsl">
6330N/A <regexpmapper handledirsep="true"
6330N/A from="^(.*)/([^/]+)\.xml$$" to="\1/client/package-info.java" />
6330N/A <param name="type" expression="client" />
6330N/A <classpath refid="xalan.class.path" />
6330N/A </xslt>
6330N/A
6330N/A <!-- Generate server API for core administration components -->
6330N/A <xslt basedir="${admin.defn.dir}" destdir="${admin.src.dir}"
6330N/A includes="**/*Configuration.xml" style="${admin.rules.dir}/serverMO.xsl">
6330N/A <regexpmapper handledirsep="true"
6330N/A from="^(.*)/([^/]+)Configuration\.xml$$" to="\1/server/\2Cfg.java" />
6330N/A <param name="base-dir" expression="${admin.defn.dir}" />
6330N/A <classpath refid="xalan.class.path" />
6330N/A </xslt>
3214N/A
6330N/A <xslt basedir="${admin.defn.dir}" destdir="${admin.src.dir}"
6330N/A includes="**/Package.xml" style="${admin.rules.dir}/package-info.xsl">
6330N/A <regexpmapper handledirsep="true"
6330N/A from="^(.*)/([^/]+)\.xml$$" to="\1/server/package-info.java" />
6330N/A <param name="type" expression="server" />
6330N/A <classpath refid="xalan.class.path" />
6330N/A </xslt>
6330N/A
6330N/A <!-- Generate LDAP profile for core administration components -->
6330N/A <xslt basedir="${admin.defn.dir}" destdir="${classes.dir}/admin/profiles/ldap"
6330N/A includes="**/*Configuration.xml" style="${admin.rules.dir}/ldapMOProfile.xsl">
6330N/A <regexpmapper handledirsep="true"
6330N/A from="^(.*)/([^/]+)Configuration\.xml$$" to="\1/meta/\2CfgDefn.properties"/>
6330N/A <param name="base-dir" expression="${admin.defn.dir}" />
6330N/A <classpath refid="xalan.class.path" />
6330N/A </xslt>
0N/A
6330N/A <!-- Generate CLI profile for core administration components -->
6330N/A <xslt basedir="${admin.defn.dir}" destdir="${classes.dir}/admin/profiles/cli"
6330N/A includes="**/*Configuration.xml" style="${admin.rules.dir}/cliMOProfile.xsl">
6330N/A <regexpmapper handledirsep="true"
6330N/A from="^(.*)/([^/]+)Configuration\.xml$$" to="\1/meta/\2CfgDefn.properties"/>
6330N/A <param name="base-dir" expression="${admin.defn.dir}" />
6330N/A <classpath refid="xalan.class.path" />
6330N/A </xslt>
6330N/A
6330N/A <!-- Generate I18N messages for core administration components -->
6330N/A <xslt basedir="${admin.defn.dir}" destdir="${classes.dir}/admin/messages"
6330N/A includes="**/*Configuration.xml" style="${admin.rules.dir}/messagesMO.xsl">
6330N/A <regexpmapper handledirsep="true"
6330N/A from="^(.*)/([^/]+)Configuration\.xml$$" to="\1/meta/\2CfgDefn.properties" />
6330N/A <param name="base-dir" expression="${admin.defn.dir}" />
6330N/A <classpath refid="xalan.class.path" />
6330N/A </xslt>
0N/A
6330N/A <!-- restore log level -->
6330N/A <script language="javascript"><![CDATA[ // restore log.level
6330N/A var level = project.getProperty("log.level");
6330N/A project.getBuildListeners().firstElement().setMessageOutputLevel(level);
6330N/A ]]></script>
6330N/A </target>
6330N/A <target name="clean.admin"
6330N/A description="Remove all generated admin messages source files."
6330N/A >
6330N/A <delete failonerror="false">
6330N/A <fileset dir="${admin.src.dir}" includes="**/*" />
6330N/A <fileset file="${build.dir}/schema.ok"/>
6330N/A <fileset file="${classes.dir}/admin/core.manifest"/>
6330N/A </delete>
6330N/A </target>
0N/A
6330N/A <target name="-check.mibs">
6330N/A <dependset>
6330N/A <srcfileset dir="${snmp.mib.dir}" includes="*.txt"/>
6330N/A <targetfileset dir="${snmp.gen.dir}/org/opends/server/snmp"/>
6330N/A </dependset>
6330N/A <condition property="mib.uptodate">
6330N/A <available file="${snmp.gen.dir}/org/opends/server/snmp/DIRECTORY_SERVER_MIB.java"/>
6330N/A </condition>
6330N/A </target>
6330N/A <target name="gen.snmp" if="jdmk.present" unless="mib.uptodate"
6330N/A depends="init,-check.mibs" description="Generate SNMP source files.">
6330N/A <property name="opendmktk.path" location="${opendmk.lib.dir}/jdmktk.jar"/>
6330N/A <mkdir dir="${snmp.gen.dir}/org/opends/server/snmp" />
6330N/A <exec dir="${snmp.mib.dir}" executable="java">
6330N/A <arg line="-classpath ${opendmktk.path} com.sun.jdmk.tools.MibGen
6330N/A -X:use-display-hint -d '${snmp.gen.dir}/org/opends/server/snmp'
6330N/A -mc -desc -tp org.opends.server.snmp
6330N/A '${snmp.mib.dir}/rfc2605.txt'
6330N/A '${snmp.mib.dir}/mib_core.txt'
6330N/A '${snmp.mib.dir}/rfc2021.txt'
6330N/A '${snmp.mib.dir}/rfc2788.txt'"/>
6330N/A </exec>
6330N/A </target>
6330N/A <target name="clean.snmp"
6330N/A description="Remove all generated SNMP source files."
6330N/A >
6330N/A <delete includeemptydirs="true" failonerror="false">
6330N/A <fileset dir="${snmp.gen.dir}" includes="**/*" />
6330N/A </delete>
6330N/A </target>
2086N/A
6330N/A <target name="gen"
6330N/A description="Generate all needed admin/server/SNMP source files."
6330N/A depends="gen.server,gen.admin,gen.snmp"/>
3980N/A
3980N/A
6330N/A <!-- ####################### COMPILE ################################## -->
6330N/A <target name="compile.server" depends="dynamicconstants,gen.server,gen.admin"
6330N/A description="Compile DS source files."
6330N/A >
6330N/A <javac destdir="${classes.dir}">
6330N/A <src path="${src.dir}"/>
6330N/A <src path="${admin.src.dir}"/>
6330N/A <src path="${msg.src.dir}"/>
6330N/A <src path="${msg.javagen.dir}"/>
6330N/A <src path="${ads.src.dir}"/>
6330N/A <src path="${quicksetup.src.dir}"/>
6330N/A <src path="${guitools.src.dir}"/>
6330N/A <classpath>
6330N/A <path refid="opendj.runtime.jars" />
6330N/A <path refid="build.tools" />
6330N/A <pathelement location="${java.home}/lib/javaws.jar"/>
6330N/A </classpath>
6330N/A </javac>
6330N/A </target>
6256N/A
6330N/A <target name="compile.setup" depends="compile.server"
6330N/A description="Compile QuickSetup source files."
6330N/A >
6330N/A <javac destdir="${quicksetup.classes.dir}">
6330N/A <src path="${ads.src.dir}" />
6330N/A <src path="${quicksetup.src.dir}" />
6330N/A <classpath>
6330N/A <pathelement location="${java.home}/lib/javaws.jar"/>
6330N/A <pathelement location="${classes.dir}"/>
6330N/A </classpath>
6330N/A </javac>
6330N/A <javac destdir="${quicksetup.classes.dir}">
6330N/A <src path="${src.dir}"/>
6330N/A <patternset includes="**/SetupUtils.java,
6330N/A **/CertificateManager.java,**/DynamicConstants.java,
6330N/A **/OperatingSystem.java,**/OpenDsException.java" />
6330N/A <src path="${msg.src.dir}"/>
6330N/A <patternset includes="**/Severity.java,**/Category.java,
6330N/A **/Message.java,**/MessageBuilder.java,**/MessageDescriptor.java"/>
6330N/A <src path="${msg.javagen.dir}"/>
6330N/A <patternset includes="**/QuickSetupMessages.java"/>
6330N/A <classpath>
6330N/A <pathelement location="${classes.dir}"/>
6330N/A </classpath>
6330N/A </javac>
6330N/A </target>
2556N/A
6330N/A <target name="compile.snmp" depends="gen.snmp,compile.server"
6330N/A if="jdmk.present"
6330N/A description="Compile SNMP Connection Handler extensions."
6330N/A >
6330N/A <javac destdir="${classes.dir}">
6330N/A <src path="${snmp.gen.dir}" />
6330N/A <src path="${snmp.src.dir}" />
6330N/A <classpath>
6330N/A <path refid="opendj.runtime.jars"/>
6330N/A <path refid="jdmk.jars" />
6330N/A </classpath>
6330N/A <compilerarg value="-Xlint:-serial" />
6330N/A </javac>
6330N/A </target>
6330N/A
6330N/A <target name="compile" depends="compile.setup,compile.snmp"
6330N/A description="Compile DS, QuickSetup and SNMP extensions."/>
4575N/A
4575N/A
6330N/A <!-- ####################### PROTO ################################# -->
6330N/A <target name="proto.dir" depends="dynamicconstants">
6330N/A <mkdir dir="${PROTO}" />
6330N/A <local name="resetperms"/>
6330N/A <available file="${PROTO}/template" property="reset"/>
6330N/A <chmod perm="u+w" dir="${PROTO}/template" includes="**/*" if:set="reset"/>
6330N/A </target>
3381N/A
6330N/A <target name="proto.example" depends="proto.dir"
6330N/A description="Assemble example plugin source archive."
6330N/A >
6330N/A <local name="prefix" />
6330N/A <property name="prefix" value="example-plugin" />
6330N/A <local name="codebase" />
6330N/A <property name="codebase" value="com/example/opends" />
0N/A
6330N/A <zip destfile="${PROTO}/${prefix}.zip" whenempty="create">
6330N/A <zipfileset dirmode="755" filemode="644"
6330N/A prefix="${prefix}"
6330N/A dir="${admin.rules.dir}/example-plugin"
6330N/A includes="build.xml,README" />
6330N/A <zipfileset dirmode="755" filemode="644"
6330N/A prefix="${prefix}/lib"
6330N/A dir="${build.dir}/build-tools"
6330N/A includes="build-tools.jar" />
6330N/A <zipfileset dirmode="755" filemode="644"
6330N/A prefix="${prefix}/src"
6330N/A dir="${admin.defn.dir}"
6330N/A includes="**/*.xml" />
6330N/A <zipfileset dirmode="755" filemode="644"
6330N/A prefix="${prefix}/src/${codebase}"
6330N/A dir="${admin.rules.dir}/example-plugin"
6330N/A includes="*.java,*.xml" excludes="build.xml" />
6330N/A <zipfileset dirmode="755" filemode="644"
6330N/A prefix="${prefix}/resource/admin"
6330N/A dir="${admin.rules.dir}"
6330N/A excludes="example-plugin/**" />
6330N/A <zipfileset dirmode="755" filemode="644"
6330N/A prefix="${prefix}/resource/config"
6330N/A dir="${admin.rules.dir}/example-plugin"
6330N/A includes="example-plugin.ldif" />
6330N/A <zipfileset dirmode="755" filemode="644"
6330N/A prefix="${prefix}/resource/schema"
6330N/A dir="${admin.rules.dir}/example-plugin"
6330N/A includes="99-example-plugin.ldif" />
6330N/A <zipfileset dirmode="755" filemode="644"
6330N/A prefix="${prefix}/resource/messages/${codebase}/messages"
6330N/A dir="${admin.rules.dir}/example-plugin"
6330N/A includes="example_plugin.properties,example_plugin_fr.properties" />
6330N/A <!-- empty dirs -->
6330N/A <zipfileset dirmode="755" filemode="644"
6330N/A prefix="${prefix}/src-generated"
6330N/A dir="${admin.rules.dir}/example-plugin" excludes="**/*" />
6330N/A <zipfileset dirmode="755" filemode="644"
6330N/A prefix="${prefix}/ext"
6330N/A dir="${admin.rules.dir}/example-plugin" excludes="**/*" />
6330N/A </zip>
6330N/A </target>
3069N/A
6330N/A <target name="proto.snmp" depends="compile.snmp,proto.dir" if="jdmk.present"
6330N/A description="Assemble DS SNMP extension."
6330N/A >
6330N/A <copy todir="${PROTO}/template/config/snmp/security">
6330N/A <fileset dir="${snmp.security.dir}"/>
6330N/A </copy>
6330N/A <copy todir="${PROTO}/snmp/mib" file="${snmp.mib.dir}/rfc2605.txt"/>
3069N/A
6330N/A <mkdir dir="${PROTO}/lib/extensions" />
6330N/A <jar destfile="${PROTO}/lib/extensions/snmp-mib2605.jar" compress="true"
6330N/A index="true">
6330N/A <fileset dir="${classes.dir}" includes="org/opends/server/snmp/**" />
6330N/A <fileset dir="${snmp.resource.dir}" includes="admin/**" />
6330N/A <manifest>
6330N/A <attribute name="Extension-Name" value="snmp-mib2605"/>
6330N/A <attribute name="Implementation-Version" value="${VERSION-BUILD}"/>
6330N/A <attribute name="Revision-Number" value="${REVISION_NUMBER}"/>
6330N/A </manifest>
6330N/A </jar>
6330N/A </target>
3069N/A
6330N/A <macrodef name="create.buildinfo" description="Create the buildinfo file.">
6330N/A <attribute name="dir"
6330N/A description="directory, where the new file should be created." />
6330N/A <sequential>
6330N/A <mkdir dir="@{dir}"/>
6330N/A <echo message="${VERSION_FULL}.${REVISION_NUMBER}"
6330N/A file="@{dir}/buildinfo"/>
6330N/A </sequential>
6330N/A </macrodef>
6330N/A <macrodef name="create.l10n.jar">
6330N/A <attribute name="lang" />
6330N/A <sequential>
6330N/A <jar destfile="${PROTO}/lib/${SHORT_NAME}_@{lang}.jar"
6330N/A compress="true" index="true">
6330N/A <fileset dir="${msg.dir}"
6330N/A includes="messages/**/*_@{lang}.properties"/>
6330N/A <zipfileset dir="${msgl10n.prop.dir}" prefix="${prefix}"
6330N/A includes="**/*_@{lang}.properties"/>
6330N/A </jar>
6330N/A </sequential>
6330N/A </macrodef>
6330N/A <macrodef name="create.subcmd.inc">
6330N/A <attribute name="cmd" description="command name"/>
6330N/A <attribute name="cname" description="class name"/>
6330N/A <sequential>
6330N/A <echo file="${build.man.dir}/scmd-@{cmd}.xml"
6330N/A ><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
6330N/A<refentry>
6330N/A]]></echo>
6330N/A <java fork="true" logerror="true" classname="@{cname}"
6330N/A output="${build.man.dir}/scmd-@{cmd}.xml" append="true">
6330N/A <classpath>
6330N/A <pathelement location="${classes.dir}" />
6330N/A <pathelement location="${msg.dir}"/>
6330N/A </classpath>
6330N/A <jvmarg line="-Dorg.forgerock.opendj.gendoc=true"/>
6330N/A <jvmarg line="-Dorg.opends.server.InstanceRoot=${build.dir}/tmp"/>
6330N/A <arg line="-?"/>
6330N/A </java>
6330N/A <echo file="${build.man.dir}/scmd-@{cmd}.xml" append="true"
6330N/A ><![CDATA[</refentry>]]></echo>
6330N/A </sequential>
6330N/A </macrodef>
3069N/A
6330N/A <target name="-check.man.subcmds" depends="compile.server">
6330N/A <condition property="subcmds.uptodate">
6330N/A <or>
6330N/A <not><isset property="dbk.xsl"/></not>
6330N/A <and>
6330N/A <available file="${build.man.dir}/scmd-dsconfig.xml" />
6330N/A <available file="${build.man.dir}/scmd-dsframework.xml" />
6330N/A <available file="${build.man.dir}/scmd-dsreplication.xml" />
6330N/A <available file="${build.man.dir}/scmd-manage-account.xml" />
6330N/A </and>
6330N/A </or>
6330N/A </condition>
6330N/A </target>
3069N/A
6330N/A <target name="gen.man.subcmds" depends="-check.man.subcmds"
6330N/A unless="subcmds.uptodate"
6330N/A >
6330N/A <create.buildinfo dir="${build.dir}/tmp/config"/>
6330N/A <create.subcmd.inc cmd="dsconfig"
6330N/A cname="org.opends.server.tools.dsconfig.DSConfig"/>
6330N/A <create.subcmd.inc cmd="dsframework"
6330N/A cname="org.opends.server.admin.client.cli.DsFrameworkCliMain"/>
6330N/A <create.subcmd.inc cmd="dsreplication"
6330N/A cname="org.opends.server.tools.dsreplication.ReplicationCliMain"/>
6330N/A <create.subcmd.inc cmd="manage-account"
6330N/A cname="org.opends.server.tools.ManageAccount"/>
6330N/A </target>
3069N/A
6330N/A <macrodef name="xsltproc">
6330N/A <attribute name="os"
6330N/A description="target OS: solaris|linux|bsd" />
6330N/A <attribute name="files"
6330N/A description="space separated list of docbook files to xlate" />
6330N/A <attribute name="pathes"
6330N/A description="pathes where to find xinclude files" />
6330N/A <attribute name="prefer" default=""
6330N/A description="indicates the call for the preferred OS" />
6330N/A <sequential>
6330N/A <local name="touchfile"/>
6330N/A <property name="touchfile" location="${build.man.dir}/@{os}.ok" />
6330N/A <local name="do"/>
6330N/A <condition property="do">
6330N/A <and>
6330N/A <length string="@{os}" trim="true" when="gt" length="0"/>
6330N/A <or>
6330N/A <and>
6330N/A <length string="${man.os}" trim="true" length="0"/>
6330N/A <not><istrue value="@{prefer}" /></not>
6330N/A </and>
6330N/A <and>
6330N/A <length string="${man.os}" trim="true"
6330N/A when="greater" length="0"/>
6330N/A <istrue value="@{prefer}" />
6330N/A </and>
6330N/A </or>
6330N/A <not>
6330N/A <uptodate targetfile="${touchfile}" >
6330N/A <srcfiles refid="man.src.files" />
6331N/A <srcfiles file="${src.man.dir}/common.xml" />
6330N/A <srcfiles dir="${build.man.dir}" includes="scmd-*.xml"/>
6330N/A </uptodate>
6330N/A </not>
6330N/A </and>
6330N/A </condition>
6330N/A <exec executable="xsltproc" dir="${build.man.dir}" if:set="do">
6330N/A <arg line="--xinclude" />
6330N/A <arg line="--stringparam profile.os @{os}" />
6330N/A <arg line="--param man.output.in.separate.dir 1" />
6330N/A <arg line="--stringparam man.output.base.dir ./@{os}/" />
6330N/A <arg line="--param man.authors.section.enabled 0" />
6330N/A <arg line="--param man.copyright.section.enabled 0" />
6330N/A <arg line="--param man.hyphenate 1" />
6330N/A <arg line="--param man.justify 1" />
6330N/A <arg line="--param refentry.meta.get.quietly 1" />
6330N/A <arg line="--path '@{pathes}'" />
6330N/A <arg line="--nonet --novalid"/>
6330N/A <arg line="${dbk.xsl}" />
6330N/A <arg line="@{files}" />
6330N/A <redirector>
6330N/A <errorfilterchain>
6330N/A <linecontainsregexp negate="true">
6330N/A <regexp pattern="namesp. cut :|cannot add @xml:base"/>
6330N/A </linecontainsregexp>
6330N/A </errorfilterchain>
6330N/A </redirector>
6330N/A </exec>
6330N/A <touch file="${touchfile}" if:set="do" />
6330N/A </sequential>
6330N/A </macrodef>
6238N/A
6330N/A <target name="gen.man" depends="gen.man.subcmds"
6330N/A description="Generate man pages." if="dbk.xsl"
6330N/A >
6330N/A <!-- see also http://sources.forgerock.org/browse/opendj/trunk/opendj3/src/main/docbkx/shared -->
6330N/A <fileset id="man.src.files" dir="${src.man.dir}" includes="man-*.xml"/>
6330N/A <pathconvert property="mans2xlate" refid="man.src.files" pathsep=" "/>
6330N/A <pathconvert property="man.dir.pathes">
6330N/A <path>
6330N/A <pathelement location="${src.man.dir}" />
6330N/A <pathelement location="${build.man.dir}"/>
6330N/A </path>
6330N/A </pathconvert>
6330N/A <xsltproc os="solaris" files="${mans2xlate}" pathes="${man.dir.pathes}" />
6330N/A <xsltproc os="linux" files="${mans2xlate}" pathes="${man.dir.pathes}" />
6330N/A <xsltproc os="${man.os}" files="${mans2xlate}" pathes="${man.dir.pathes}"
6330N/A prefer="true"/>
6330N/A </target>
6330N/A <target name="clean.man" description="Remove all generated man pages.">
6330N/A <delete dir="${build.man.dir}" failonerror="false" />
6330N/A </target>
6280N/A
6331N/A <macrodef name="copy.dbk.mans"
6331N/A description="Copy docbook generated man pages to the given directory
6331N/A and apply misc fixes. Both params are expected to be the parent
6331N/A of the man[0-9]*/ directories.">
6331N/A <attribute name="fromdir" />
6331N/A <attribute name="todir" />
6331N/A <sequential>
6331N/A <copy todir="@{todir}" if:set="dbk.xsl">
6331N/A <fileset dir="@{fromdir}" includes="man*/*"/>
6331N/A <filterchain>
6331N/A <replacetokens>
6331N/A <token key="VERS" value="${VERSION_SHORT}" />
6331N/A <token key="VERS_FULL" value="${VERSION_FULL}" />
6331N/A <token key="PRODUCT"
6331N/A value="${PRODUCT_NAME} ${VERSION_FULL}" />
6331N/A </replacetokens>
6331N/A <tokenfilter>
6331N/A <!-- replace stupid groff colored links with a ref -->
6331N/A <replaceregex pattern="\\m\[blue\](.*)\\m\[\]"
6331N/A replace="\1" flags="g" />
6331N/A <replaceregex pattern="\\s-2\\u(\[[0-9]+\])\\d\\s\+2"
6331N/A replace=" \1" flags="g" />
6331N/A <!-- lines with '^.sp .' produce strange chars -->
6331N/A <replaceregex pattern="^\.sp \..*"
6331N/A replace=".sp" flags="g" />
6331N/A </tokenfilter>
6331N/A </filterchain>
6331N/A <filtermapper><replacestring from="1M" to="1m"/></filtermapper>
6331N/A </copy>
6331N/A </sequential>
6331N/A </macrodef>
1177N/A
6330N/A <target name="proto.man" depends="gen.man,proto.dir"
6331N/A description="Assemble man pages."
6331N/A >
6330N/A <local name="man2use"/>
6330N/A <condition property="man2use" value="linux" else="${man.os}">
6330N/A <length string="${man.os}" trim="true" length="0" />
6330N/A </condition>
6331N/A
6331N/A <copy.dbk.mans fromdir="${build.man.dir}/${man2use}"
6331N/A todir="${PROTO}/man" />
6330N/A <copy todir="${PROTO}/man" unless:set="dbk.xsl">
6330N/A <fileset dir="${src.man.dir}" includes="man1/*,man5/*" />
6330N/A </copy>
6330N/A </target>
0N/A
6331N/A <macrodef name="add.symlinks">
6331N/A <attribute name="script"
6331N/A description="The script to parse for '#link's" />
6331N/A <attribute name="dir"
6331N/A description="The directory, where the links need to created." />
6331N/A <attribute name="link" description="the source of the link to create." />
6331N/A <attribute name="file"
6331N/A description="The file where to add the link commands to execute." />
6331N/A <sequential>
6331N/A <local name="fileNames" />
6331N/A <loadresource property="fileNames" if:set="isUnix">
6331N/A <file file="@{script}" />
6331N/A <filterchain>
6331N/A <linecontains>
6331N/A <contains value="#link" />
6331N/A </linecontains>
6331N/A <tokenfilter>
6331N/A <replaceregex pattern="^\s*([^)]+)\s*[)].*"
6331N/A replace="ln -sf '@{link}' '@{dir}/\1'" />
6331N/A </tokenfilter>
6331N/A </filterchain>
6331N/A </loadresource>
6331N/A <!-- symlink task does a native 'ln -s' on each anyway, so ... -->
6331N/A <echo file="@{file}" message="${fileNames}" append="true" />
6331N/A </sequential>
6331N/A </macrodef>
0N/A
6330N/A <target name="proto.server" depends="compile.setup,proto.dir"
6330N/A description="Assemble main DS and QuickSetup bits."
6330N/A >
6330N/A <!-- per default empty dirs. All others get created as needed. -->
6330N/A <mkdir dir="${PROTO}/template/bak" />
6330N/A <mkdir dir="${PROTO}/template/changelogDb" />
6330N/A <mkdir dir="${PROTO}/template/classes" />
6330N/A <mkdir dir="${PROTO}/template/db" />
6330N/A <mkdir dir="${PROTO}/template/import-tmp" />
6330N/A <mkdir dir="${PROTO}/template/ldif" />
6330N/A <mkdir dir="${PROTO}/template/locks" />
6330N/A <mkdir dir="${PROTO}/template/logs" />
0N/A
6330N/A <!-- create jars -->
6330N/A <copy todir="${PROTO}/lib" flatten="true">
6330N/A <path refid="opendj.runtime.jars"/>
6330N/A <fileset dir="${lib.dir}" includes="*.exe" />
6330N/A </copy>
0N/A
6330N/A <local name="prefix"/>
6330N/A <property name="prefix"
6330N/A value="admin/messages/org/opends/server/admin/std/meta"/>
6330N/A <jar destfile="${PROTO}/lib/${SHORT_NAME}.jar" compress="true" index="true">
6330N/A <fileset dir="${classes.dir}" excludes="${ads.classes.dir},
6330N/A ${quicksetup.globalcompile.classes.dir},org/opends/server/snmp/**" />
6330N/A <fileset dir="${guitools.src.dir}" includes="**/*.gif,**/*.png" />
6330N/A <fileset dir="${quicksetup.src.dir}" includes="**/*.gif,**/*.png" />
6330N/A <zipfileset dir="${msg.prop.dir}" prefix="messages">
6330N/A <not><selector refid="msgl10n.prop.files"/></not>
6330N/A <!-- quicksetup.properties really needed -->
6330N/A </zipfileset>
6330N/A <fileset dir="${msg.javagen.dir}"
6330N/A includes="org/opends/messages/descriptors.reg"/>
6330N/A </jar>
6330N/A <create.l10n.jar lang="fr"/>
6330N/A <create.l10n.jar lang="ja"/>
6330N/A <create.l10n.jar lang="de"/>
6330N/A <create.l10n.jar lang="es"/>
6330N/A <create.l10n.jar lang="ko"/>
6330N/A <create.l10n.jar lang="zh_CN"/>
6330N/A <create.l10n.jar lang="zh_TW"/>
6330N/A <create.l10n.jar lang="pl"/>
6330N/A <create.l10n.jar lang="ca_ES"/>
0N/A
6330N/A <jar destfile="${PROTO}/lib/quicksetup.jar" compress="true" index="true">
6330N/A <fileset dir="${quicksetup.classes.dir}" />
6330N/A <fileset dir="${quicksetup.src.dir}" includes="**/*.gif,**/*.png" />
6330N/A <zipfileset prefix="messages"
6330N/A file="${msg.prop.dir}/quicksetup.properties" />
6330N/A </jar>
0N/A
6330N/A <manifestclasspath property="manifest.classpath"
6330N/A jarfile="${PROTO}/lib/bootstrap.jar">
6330N/A <classpath location="${PROTO}/lib/*.jar" />
6330N/A </manifestclasspath>
6330N/A <jar destfile="${PROTO}/lib/bootstrap.jar">
6330N/A <manifest>
6330N/A <attribute name="Built-By" value="${user.name}" />
6330N/A <attribute name="Class-Path" value="${manifest.classpath}" />
6330N/A </manifest>
6330N/A </jar>
3000N/A
6330N/A <!-- populate ${PROTO}/template/ -->
6330N/A <copy todir="${PROTO}/template/config">
6330N/A <fileset dir="${config.dir}">
6330N/A <exclude name="config.ldif" if:set="jdmk.present"/>
6330N/A </fileset>
6330N/A </copy>
6330N/A <copy todir="${PROTO}/template/config" if:set="jdmk.present"
6330N/A file="${config.dir}/config.ldif" >
6330N/A <filterchain>
6330N/A <concatfilter append="${snmp.config.dir}/config.snmp.ldif" />
6330N/A </filterchain>
6330N/A </copy>
6330N/A <create.buildinfo dir="${PROTO}/template/config" />
6330N/A <mkdir dir="${PROTO}/template/config/upgrade" />
6330N/A <taskdef name="concatschema" classname="org.opends.build.tools.ConcatSchema">
6330N/A <classpath refid="build.tools" />
6330N/A </taskdef>
6330N/A <concatschema schemaDirectory="${resource.dir}/schema"
6330N/A toFile="${PROTO}/template/config/upgrade/schema.ldif.${REVISION_NUMBER}" />
6330N/A <copy todir="${PROTO}/template/config/schema">
6330N/A <fileset dir="${resource.dir}/schema" />
6330N/A </copy>
6330N/A <copy todir="${PROTO}/template/config/messages">
6330N/A <fileset dir="${resource.dir}/messages" />
6330N/A </copy>
6330N/A <copy todir="${PROTO}/template/config/MakeLDIF">
6330N/A <fileset dir="${resource.dir}/MakeLDIF" />
6330N/A </copy>
0N/A
6331N/A <copy todir="${PROTO}">
6374N/A <fileset dir="${resource.dir}" includes="README,
6374N/A images/opendj_logo.png,legal-notices/*" />
6331N/A </copy>
0N/A
6331N/A <!-- copy Mac specific stuff -->
6330N/A <copy todir="${PROTO}" >
6330N/A <fileset dir="${resource.dir}/mac" includes="**/*.plist"/>
6330N/A <filtermapper>
6330N/A <replacestring from="ControlPanel.app" to="bin/ControlPanel.app" />
6330N/A </filtermapper>
6330N/A <filterchain>
6330N/A <replacetokens>
6330N/A <token key="version" value="${VERSION_FULL}" />
6330N/A <token key="revision" value="${REVISION_NUMBER}" />
6330N/A </replacetokens>
6330N/A </filterchain>
6330N/A </copy>
6330N/A <copy todir="${PROTO}" >
6330N/A <fileset dir="${resource.dir}/mac" excludes="**/*.plist"/>
6330N/A <filtermapper>
6330N/A <replacestring from="ControlPanel.app" to="bin/ControlPanel.app" />
6330N/A </filtermapper>
6330N/A </copy>
0N/A
6331N/A <!-- copy unix scripts -->
6331N/A <copy todir="${PROTO}/bin">
6418N/A <fileset dir="${scripts.dir}" includes="start-ds,stop-ds,idsconfig"/>
6418N/A <filterchain>
6418N/A <fixcrlf eol="lf" />
6418N/A <replacetokens>
6418N/A <token key="VERS" value="${VERSION_SHORT}"/>
6418N/A </replacetokens>
6418N/A </filterchain>
6331N/A </copy>
6331N/A <copy todir="${PROTO}/bin">
6331N/A <fileset dir="${scripts.dir}" includes="README_WINDOWS.txt"/>
6331N/A <filterchain><fixcrlf eol="crlf" /></filterchain>
6331N/A </copy>
6331N/A <copy todir="${PROTO}/lib">
6331N/A <fileset dir="${scripts.dir}" includes="_*.sh"/>
6331N/A <filterchain>
6331N/A <fixcrlf eol="lf" />
6331N/A <replacetokens>
6331N/A <token key="VERS" value="${VERSION_SHORT}"/>
6331N/A </replacetokens>
6331N/A </filterchain>
6331N/A </copy>
6331N/A <copy todir="${PROTO}">
6331N/A <fileset dir="${resource.dir}" includes="setup,uninstall"/>
6331N/A <filterchain><fixcrlf eol="lf" /></filterchain>
6331N/A </copy>
6331N/A <!-- ant's symlink task is pretty inefficient and error prone. So we
6331N/A just collect the links in a script and exec it later - even if not
6331N/A needed that's still cheaper -->
6331N/A <local name="script" />
6331N/A <property name="script" location="${build.dir}/tmp/doLinks.sh" />
6331N/A <delete file="${script}" failonerror="false" quiet="true" />
6331N/A <add.symlinks script="${scripts.dir}/_client-script.sh"
6331N/A dir="${PROTO}/bin" link="/lib/_client-script.sh" file="${script}"/>
6331N/A <add.symlinks script="${scripts.dir}/_mixed-script.sh"
6331N/A dir="${PROTO}/bin" link="/lib/_mixed-script.sh" file="${script}"/>
6331N/A <add.symlinks script="${scripts.dir}/_server-script.sh"
6331N/A dir="${PROTO}/bin" link="/lib/_server-script.sh" file="${script}"/>
6331N/A <echo file="${script}" append="true" message="ln -sf
6331N/A '/lib/_server-script.sh' '${PROTO}/upgrade'${line.separator}" />
6331N/A <echo file="${script}" append="true" message="ln -sf '/CDDLv1_0.txt'
6331N/A '${PROTO}/legal-notices/OpenDJ.LICENSE'${line.separator}" />
6331N/A <exec executable="/bin/sh" if:set="isUnix">
6331N/A <arg value="${script}" />
6331N/A </exec>
0N/A
6331N/A <!-- copy batch files -->
6331N/A <copy todir="${PROTO}/bat">
6331N/A <fileset dir="${scripts.dir}"
6331N/A includes="*.bat" excludes="_*.bat,setcp.bat"/>
6331N/A <filterchain><fixcrlf eol="crlf" /></filterchain>
6331N/A </copy>
6331N/A <copy todir="${PROTO}/lib">
6331N/A <fileset dir="${scripts.dir}" includes="_*.bat,setcp.bat"/>
6331N/A <filterchain><fixcrlf eol="crlf" /></filterchain>
6331N/A </copy>
6330N/A <copy todir="${PROTO}">
6330N/A <fileset dir="${resource.dir}"
6331N/A includes="setup.bat,uninstall.bat,upgrade.bat"/>
6331N/A <filterchain><fixcrlf eol="crlf" /></filterchain>
6330N/A </copy>
6331N/A <copy file="${PROTO}/legal-notices/CDDLv1_0.txt"
6331N/A tofile="${PROTO}/legal-notices/OpenDJ.LICENSE" unless:set="isUnix" />
6331N/A <echo level="warning" message="Not a UNIX like OS! Skipping symlinks."
6331N/A unless:set="isUnix" />
6330N/A </target>
2528N/A
6406N/A <target name="proto.license" depends="proto.dir" if="license.file">
6406N/A <fail message="The license file '${license.file}' could not be found or is empty">
6406N/A <condition>
6406N/A <not>
6406N/A <and>
6406N/A <length string="${license.file}" trim="true"
6406N/A when="greater" length="0"/>
6406N/A <available file="${license.file}" type="file" />
6406N/A </and>
6406N/A </not>
6406N/A </condition>
6406N/A </fail>
6406N/A </target>
0N/A
6406N/A <target name="proto" depends="proto.server,proto.example,proto.snmp,
6406N/A proto.man,proto.license"
6330N/A description="Create and populate the DS proto directory."
6330N/A >
6330N/A <chmod perm="755">
6330N/A <fileset dir="${PROTO}" includes="**/MacOS/JavaApplicationStub" />
6331N/A <fileset dir="${PROTO}"
6418N/A includes="setup,uninstall,bin/start-ds,bin/stop-ds,bin/idsconfig"/>
6331N/A <fileset dir="${PROTO}/lib" includes="_*.sh" />
6330N/A </chmod>
6330N/A <chmod perm="444">
6330N/A <fileset dir="${PROTO}/template" />
6330N/A </chmod>
6330N/A </target>
6330N/A <target name="clean.proto" description="Remove the DS proto directory.">
6330N/A <delete dir="${PROTO}" failonerror="false"/>
6330N/A </target>
0N/A
0N/A
6330N/A <!-- ####################### DSML ################################## -->
6330N/A <target name="-check.dsml">
6330N/A <dependset>
6330N/A <srcfileset dir="${dsml.dir}/schema"
6330N/A includes="DSMLv2.xsd,bindings.xjb"/>
6330N/A <targetfileset dir="${dsml.gen.dir}/org/opends/dsml/protocol"
6330N/A includes="*.java"/>
6330N/A </dependset>
6330N/A <condition property="dsml.uptodate">
6330N/A <available file="${dsml.gen.dir}/org/opends/dsml/protocol/ResultCode.java"/>
6330N/A </condition>
6330N/A </target>
2900N/A
6330N/A <target name="gen.dsml" depends="-check.dsml" unless="dsml.uptodate"
6330N/A description="Generate DSML source files."
6330N/A >
6330N/A <!-- xjc ant task screws up ant classloaders: use external variant! -->
6330N/A <mkdir dir="${dsml.gen.dir}/org/opends/dsml/protocol" />
6330N/A <!-- Don't gen package-info.java: conflicts with the one in src/dsml -->
6330N/A <exec executable="xjc">
6330N/A <arg value="-npa" />
6330N/A <arg value="-verbose" />
6330N/A <arg line="-target 2.1" />
6330N/A <arg line="-p org.opends.dsml.protocol" />
6330N/A <arg line="-d ${dsml.gen.dir}" />
6330N/A <arg value="${dsml.dir}/schema/DSMLv2.xsd" />
6330N/A <arg line="-b ${dsml.dir}/schema/bindings.xjb"/>
6330N/A </exec>
6330N/A </target>
2900N/A
6330N/A <!-- Basically compile.server dep would be sufficient, but we need to make
6330N/A sure, that the bundled OpenDJ.jar contains everything needed by DSML -->
6330N/A <target name="compile.dsml" depends="gen.dsml,proto.server"
6330N/A description="Compile DSML source files."
6330N/A >
6330N/A <mkdir dir="${dsml.classes.dir}" />
6330N/A <javac destdir="${dsml.classes.dir}">
6330N/A <src path="${dsml.gen.dir}" />
6330N/A <src path="${dsml.src.dir}" />
6330N/A <classpath location="${PROTO}/lib/${SHORT_NAME}.jar"/>
6330N/A <classpath location="${lib.dir}/jar/javax.servlet-api.jar"/>
6330N/A <compilerarg value="-Xlint:-path" />
6330N/A </javac>
6330N/A </target>
2900N/A
6330N/A <target name="dsml" depends="compile.dsml"
6330N/A description="Create the DSML web archive."
6330N/A >
6330N/A <jar destfile="${PROTO}-DSML.war" compress="true" index="true">
6330N/A <zipfileset dir="${dsml.dir}/webapp" prefix="WEB-INF"
6330N/A includes="*.xml" />
6330N/A <zipfileset dir="${dsml.classes.dir}" prefix="WEB-INF/classes"/>
6330N/A <zipfileset dir="${dsml.dir}/schema"
6330N/A prefix="WEB-INF/classes/resources" includes="DSMLv2.xsd"/>
6330N/A <zipfileset dir="${PROTO}/lib" prefix="WEB-INF/lib"
6330N/A includes="${SHORT_NAME}*.jar"/>
6330N/A </jar>
6330N/A </target>
6330N/A <target name="clean.dsml"
6330N/A description="Remove all generated DSML source files."
6330N/A >
6330N/A <delete dir="${dsml.gen.dir}" failonerror="false"/>
6330N/A <delete file="${PROTO}-DSML.war" failonerror="false" />
6330N/A </target>
0N/A
3381N/A
6330N/A <!-- ######################## DOCUMENTATION ########################### -->
6330N/A <!-- Generate the Configuration guides. -->
6330N/A <macrodef name="create.configguide">
6330N/A <attribute name="dir" description="destination directory" />
6330N/A <attribute name="jvmargx" default="" />
6330N/A <sequential>
6330N/A <mkdir dir="@{dir}" />
6330N/A <copy todir="@{dir}">
6330N/A <fileset dir="${configguide.resource.dir}" />
6330N/A </copy>
6330N/A <java fork="true" failonerror="true"
6330N/A classname="org.opends.server.admin.doc.ConfigGuideGeneration">
6330N/A <classpath>
6330N/A <fileset refid="opendj.runtime.jars"/>
6330N/A <pathelement location="${classes.dir}" />
6330N/A <pathelement location="${msg.dir}" />
6330N/A </classpath>
6330N/A <jvmarg value="-DGenerationDir=@{dir} @{jvmargx}"/>
6330N/A <jvmarg value="-DOpendsWiki=${wiki.home}"/>
6330N/A </java>
6330N/A </sequential>
6330N/A </macrodef>
0N/A
6330N/A <target name="guide.std" depends="compile.server"
6330N/A description="Generate html Config Guide (standard)."
6330N/A >
6330N/A <create.configguide dir="${configguide.dir}" />
6330N/A </target>
6330N/A
6330N/A <target name="guide.ldap" depends="compile.server"
6330N/A description="Generate html Config Guide with LDAP mapping."
6330N/A >
6330N/A <create.configguide dir="${configguideldap.dir}" jvmargx="-DLdapMapping"/>
6330N/A </target>
6330N/A
6330N/A <target name="guide" depends="guide.std,guide.ldap"
6330N/A description="Generate html Config Guides." />
675N/A
6330N/A <!-- Generate JavaDoc documentation from the source files -->
6330N/A <target name="-setAltTodoTaglet" unless="ToDoTaglet.available">
6330N/A <property name="tag"
6330N/A value="&lt;div class=&quot;todo&quot;&gt;To Do:&lt;/div&gt;" />
6330N/A <property name="todoParam" value="-tag todo:a:&quot;${tag}&quot;" />
6330N/A </target>
2556N/A
6330N/A <target name="-setTodoTaglet" if="ToDoTaglet.available">
6330N/A <property name="todoParam"
6330N/A value="-taglet taglets.ToDoTaglet -tagletpath ${taglets.jar}" />
6330N/A </target>
675N/A
6330N/A <target name="api"
6330N/A depends="compile.setup,compile.dsml,-setAltTodoTaglet,-setTodoTaglet"
6330N/A description="Generate JavaDoc documentation."
6330N/A >
6330N/A <mkdir dir="${javadoc.dir}" />
675N/A
6330N/A <!-- appears in <head><title>...</title> -->
6330N/A <local name="windowtitle" />
6330N/A <!-- appears in <head><meta NAME="keywords" CONTENT="..."/> -->
6330N/A <local name="doctitle" />
6330N/A <!-- appears as heading in the <body> AND
6330N/A as version info on the right of the nav_bar -->
6330N/A <local name="header" />
6330N/A <!-- appears after the bottom nav_bar as footer -->
6330N/A <local name="bottom" />
6330N/A
6330N/A <property name="windowtitle"
6330N/A value="${PRODUCT_NAME} ${VERSION_FULL} API Documentation" />
6330N/A <property name="doctitle"
6330N/A value="${windowtitle}" />
6330N/A <property name="header"
6330N/A value="&lt;b&gt;${PRODUCT_NAME}
6330N/A &lt;font size=&quot;-1&quot;&gt;Version
6330N/A ${VERSION_FULL}&lt;/font&gt;&lt;/b&gt;" />
6330N/A <property name="bottom"
6330N/A value="&lt;font size=&quot;-1&quot;&gt;
6330N/A ${PRODUCT_NAME} is maintained by &lt;a
6330N/A href=&quot;${vendor.url}&quot;&gt;${vendor.name}&lt;/a&gt;."/>
1849N/A
6330N/A <javadoc destdir="${javadoc.dir}"
6330N/A author="true" verbose="true" use="true"
6330N/A additionalparam="-breakiterator ${todoParam}"
6330N/A doctitle="${doctitle}" windowtitle="${windowtitle}"
6330N/A header="${header}" bottom="${bottom}"
6330N/A linksource="yes"
6330N/A maxmemory="${MEM}"
6330N/A >
6330N/A <classpath>
6330N/A <path refid="run.classpath"/>
6330N/A <pathelement location="${dsml.classes.dir}" />
6330N/A </classpath>
6415N/A <link href="${jdkAPI}" />
675N/A
6330N/A <packageset dir="${src.dir}" />
6330N/A <packageset dir="${admin.src.dir}" />
6330N/A <packageset dir="${ads.src.dir}" />
6330N/A <packageset dir="${dsml.src.dir}" />
6330N/A <packageset dir="${msg.src.dir}" />
6330N/A </javadoc>
6330N/A <concat destfile="${javadoc.dir}/stylesheet.css" append="yes">
6330N/A .todo { background-color: #FFCCCC; }
6330N/A </concat>
6330N/A </target>
185N/A
1177N/A
6330N/A <!-- ########################## PACKAGES ############################ -->
6330N/A <!-- Package the Directory Server for distribution. -->
6331N/A <target name="pkg.generic" depends="proto"
6330N/A description="Create a generic zipped DS package."
6330N/A >
6330N/A <local name="prefix"/>
6330N/A <property name="prefix" value="opendj${VERSION_SHORT}"/>
6331N/A <copy todir="${package.dir}" file="${svr4.srcdir}/README">
6331N/A <filterset>
6331N/A <filter token="CLIENT_BASEDIR" value="/opt/${prefix}"/>
6331N/A </filterset>
6331N/A </copy>
6330N/A <zip destfile="${PROTO}.zip">
6330N/A <zipfileset dir="${PROTO}" prefix="${prefix}"
6330N/A filemode="644" dirmode="755"
6330N/A includes="**/*"
6330N/A excludes="bin/*,template/**/*,lib/_client-script.sh,
6330N/A lib/_script-util.sh,lib/_server-script.sh,lib/_mixed-script.sh,
6330N/A setup,uninstall,upgrade,
6330N/A QuickSetup.app/Contents/MacOS/JavaApplicationStub,
6330N/A Uninstall.app/Contents/MacOS/JavaApplicationStub,
6330N/A bin/ControlPanel.app/Contents/MacOS/JavaApplicationStub" />
6330N/A <zipfileset dir="${PROTO}" prefix="${prefix}"
6330N/A filemode="755" dirmode="755"
6330N/A includes="lib/_client-script.sh,lib/_script-util.sh,
6330N/A lib/_server-script.sh,lib/_mixed-script.sh" />
6330N/A <zipfileset dir="${PROTO}" prefix="${prefix}"
6330N/A filemode="755" dirmode="755"
6330N/A includes="bin/*" excludes="bin/README_WINDOWS.txt" />
6330N/A <zipfileset dir="${PROTO}" prefix="${prefix}"
6330N/A filemode="644" dirmode="755"
6330N/A includes="bin/README_WINDOWS.txt" />
6330N/A <zipfileset dir="${PROTO}" prefix="${prefix}"
6330N/A filemode="755" dirmode="755"
6330N/A includes="setup,uninstall,upgrade,
6330N/A QuickSetup.app/Contents/MacOS/JavaApplicationStub,
6330N/A Uninstall.app/Contents/MacOS/JavaApplicationStub,
6330N/A bin/ControlPanel.app/Contents/MacOS/JavaApplicationStub" />
6330N/A <zipfileset dir="${PROTO}" prefix="${prefix}"
6330N/A filemode="444" dirmode="744"
6330N/A includes="template/**/*" />
6330N/A </zip>
6330N/A <property name="package.built" value="true"/>
1177N/A
6330N/A <!-- print a time stamp in Unix 'date' format -->
6330N/A <tstamp>
6330N/A <format property="package.built.ts" pattern="EEE MMM dd HH:mm:ss zzz yyyy" />
6330N/A </tstamp>
6330N/A <echo message="Package built: ${package.built.ts}"/>
6330N/A </target>
6331N/A <target name="release" depends="clean, pkg.generic"
6331N/A description="Convinience target for 'ant clean pkg.generic'" />
318N/A
6330N/A <!-- Package the Directory Server for the RPM distribution. -->
6331N/A <target name="pkg.rpm" depends="pkg.generic"
6330N/A description="Create an RPM DS package."
6330N/A >
6330N/A <taskdef name="genrpm" classname="org.opends.build.tools.GenerateRpm">
6330N/A <classpath refid="build.tools" />
6330N/A </taskdef>
6330N/A
6330N/A <local name="prefix"/>
6330N/A <property name="prefix" value="/opt/opendj${VERSION_SHORT}"/>
6330N/A <local name="release"/>
6330N/A <property name="release" value="1"/>
6330N/A
6330N/A <mkdir dir="${build.dir}/rpm/BUILD" />
6330N/A <mkdir dir="${build.dir}/rpm/RPMS" />
6330N/A <mkdir dir="${build.dir}/rpm/SOURCES" />
6330N/A <mkdir dir="${build.dir}/rpm/SPECS" />
6330N/A <mkdir dir="${build.dir}/rpm/SRPMS" />
6330N/A <genrpm topDir="${build.dir}/rpm" prefix="${prefix}"
6330N/A productName="${PRODUCT_NAME}" shortName="${PKG_NAME}"
6330N/A referenceURL="${DOC_REFERENCE_HOME}"
6330N/A sourceDirName="${PROTO}"
6330N/A specFileName="${build.dir}/rpm/SPECS/specFile"
6330N/A version="${VERSION_FULL}"
6330N/A release="${release}.${PKG_QUALIFIER}"
6330N/A overwrite="true" />
712N/A
6330N/A <rpm specfile="specFile" topDir="${build.dir}/rpm" quiet="true" />
6330N/A <copy todir="${package.dir}">
6330N/A <fileset dir="${build.dir}/rpm/RPMS/noarch" includes="*.rpm" />
6330N/A </copy>
6330N/A </target>
712N/A
6330N/A <!-- Package the Directory Server for the DEB distribution. -->
6331N/A <target name="pkg.deb" depends="pkg.generic"
6330N/A description="Create a Debian DS package."
6330N/A >
6330N/A <taskdef name="deb" classname="org.vafer.jdeb.ant.DebAntTask"/>
0N/A
6330N/A <local name="prefix"/>
6330N/A <property name="prefix" value="/opt/opendj${VERSION_SHORT}"/>
6330N/A <local name="release"/>
6330N/A <property name="release" value="1"/>
2342N/A
6330N/A <mkdir dir="${build.dir}/deb/control" />
6330N/A <copy todir="${build.dir}/deb/control">
6330N/A <fileset dir="resource/debian/control"/>
6330N/A <filterset>
6330N/A <filter token="version" value="${VERSION-BUILD}"/>
6330N/A <filter token="name" value="${PKG_NAME}"/>
6331N/A <filter token="homepage" value="${vendor.url}"/>
6331N/A <filter token="maintainer" value="${vendor.email}"/>
6330N/A <filter token="description" value="${PRODUCT_NAME}"/>
6330N/A <filter token="prefix" value="${prefix}"/>
6330N/A </filterset>
6330N/A </copy>
712N/A
6330N/A <deb destfile="${package.dir}/${PKG_NAME}_${VERSION_FULL}-${release}${PKG_QUALIFIER}_all.deb"
6330N/A control="${build.dir}/deb/control" verbose="false"
6330N/A >
6330N/A <tarfileset dir="${PROTO}" prefix="${prefix}"
6330N/A dirmode="755" filemode="644"
6330N/A includes="**/*"
6331N/A excludes="**/bat/**, **/*.app/**, **/*.bat, bin/*,template/**/*,
6410N/A lib/*.exe,lib/*.sh,setup,uninstall*,upgrade,**/bootstrap.jar,
6374N/A README" />
6331N/A <tarfileset dir="${package.dir}" prefix="${prefix}"
6331N/A dirmode="755" filemode="644"
6331N/A includes="README" />
6330N/A <tarfileset dir="${PROTO}" prefix="${prefix}"
6330N/A dirmode="755" filemode="755"
6331N/A includes="lib/*.sh" />
6330N/A <tarfileset dir="${PROTO}" prefix="${prefix}"
6331N/A dirmode="755" filemode="755" followsymlinks="false"
6330N/A includes="bin/*" excludes="bin/README_WINDOWS.txt" />
6330N/A <tarfileset dir="${PROTO}" prefix="${prefix}"
6330N/A dirmode="755" filemode="755"
6410N/A includes="setup,upgrade" />
6330N/A <tarfileset dir="${PROTO}" prefix="${prefix}"
6330N/A dirmode="744" filemode="444"
6330N/A includes="template/**/*"/>
6330N/A </deb>
6330N/A </target>
2342N/A
6331N/A <!-- Package the Directory Server for SVR4 pkg distribution. -->
6331N/A <target name="-pkg.svr4.init" depends="proto">
6331N/A <property name="svr4.tmpdir" value="${build.dir}/svr4" />
6331N/A <property name="svr4.pkg.name"
6331N/A value="${vendor.prefix}${PKG_NAME}${VERSION_SHORT}"/>
6331N/A <property name="svr4.pkg.dir"
6331N/A value="${svr4.tmpdir}/root/opt/opendj${VERSION_SHORT}"/>
6331N/A <local name="man.ok" />
6331N/A <condition property="man.ok">
6331N/A <available file="${build.man.dir}/solaris" />
6331N/A </condition>
6331N/A <condition property="svr4.manCopy">
6331N/A <and>
6331N/A <isset property="dbk.xsl" />
6331N/A <isset property="man.ok" />
6331N/A <not><equals arg1="solaris" arg2="${man.os}" /></not>
6331N/A </and>
6331N/A </condition>
6406N/A <echo level="error" unless:set="man.ok"
6406N/A message="Solaris man pages not available. Packaging Linux man pages ..." />
6331N/A <condition property="svr4.proto.add" else=""
6331N/A value="${svr4.pkg.dir}/man=opendj${VERSION_SHORT}/man">
6331N/A <isset property="svr4.manCopy" />
6331N/A </condition>
6331N/A <mkdir dir="${svr4.pkg.dir}"/>
6331N/A <delete dir="${svr4.tmpdir}" includes="s.awk,prototype.error"
6331N/A failonerror="false" />
6331N/A <copy file="${svr4.srcdir}/prototype.awk" tofile="${svr4.tmpdir}/s.awk">
6331N/A <filterchain if:set="svr4.manCopy">
6331N/A <tokenfilter >
6331N/A <replacestring from="#marker#" to="" />
6331N/A </tokenfilter>
6331N/A </filterchain>
6331N/A </copy>
6331N/A </target>
3381N/A
6331N/A <target name="-svr4.copy" if="svr4.manCopy">
6331N/A <!-- proto contains non-solaris man pages -->
6331N/A <copy.dbk.mans fromdir="${build.man.dir}/solaris"
6331N/A todir="${svr4.pkg.dir}/man" />
6331N/A </target>
6158N/A
6331N/A <target name="pkg.svr4" depends="-pkg.svr4.init,-svr4.copy"
6331N/A description="Create a SVR4 DS package."
6331N/A >
6331N/A <!-- SMF/RBAC stuff - see also ${svr4.srcdir}/prototype.awk -->
6374N/A <copy todir="${svr4.tmpdir}">
6374N/A <fileset dir="${svr4.srcdir}" includes="exec_attr,README" />
6331N/A <filterset>
6331N/A <filter token="DJ_DIR" value="opendj${VERSION_SHORT}" />
6331N/A </filterset>
6331N/A </copy>
6331N/A <copy tofile="${svr4.tmpdir}/svc.sh" file="${svr4.srcdir}/opendj-method.sh">
6331N/A <filterset>
6331N/A <filter token="VERS" value="${VERSION_SHORT}" />
6331N/A </filterset>
6331N/A </copy>
6331N/A <copy tofile="${svr4.tmpdir}/svc.xml" file="${svr4.srcdir}/opendj-manifest.xml">
6331N/A <filterset>
6331N/A <filter token="VERS" value="${VERSION_SHORT}" />
6331N/A </filterset>
6331N/A </copy>
121N/A
6331N/A <copy todir="${svr4.tmpdir}" file="${svr4.srcdir}/pkginfo">
6331N/A <filterset>
6331N/A <filter token="PKG" value="${svr4.pkg.name}" />
6331N/A <filter token="VERSION" value="${VERSION_FULL}" />
6331N/A <filter token="SERIALNUM" value="${BUILD_NUMBER}" />
6331N/A <filter token="EMAIL" value="${vendor.email}" />
6331N/A <filter token="VENDOR" value="${vendor.name}" />
6331N/A <filter token="BASEDIR" value="/opt" />
6331N/A </filterset>
6331N/A </copy>
6331N/A <exec executable="pkgproto" output="${svr4.tmpdir}/prototype"
6331N/A error="${svr4.tmpdir}/prototype.error" failonerror="true"
6331N/A >
6374N/A <arg line="'${PROTO}=opendj${VERSION_SHORT}'
6331N/A ${svr4.proto.add}" />
6331N/A </exec>
6331N/A <exec executable="nawk" output="${svr4.tmpdir}/prototype.final"
6331N/A error="${svr4.tmpdir}/prototype.error" failonerror="true"
6331N/A >
6331N/A <arg line="-v TMPDIR='${svr4.tmpdir}'" />
6331N/A <arg line="-v SRCDIR='${svr4.srcdir}'" />
6331N/A <arg line="-v SVERS=${VERSION_SHORT}" />
6331N/A <arg line="-f '${svr4.tmpdir}/s.awk'" />
6331N/A <arg value="${svr4.tmpdir}/prototype" />
6331N/A </exec>
6331N/A <exec executable="pkgmk" failonerror="true">
6331N/A <arg value="-o" />
6331N/A <arg line="-f ${svr4.tmpdir}/prototype.final" />
6331N/A <arg line="-d ${package.dir}" />
6331N/A </exec>
6331N/A <!-- create a single stream pkg -->
6331N/A <exec executable="pkgtrans" failonerror="true">
6331N/A <arg line="-s ${package.dir}" />
6331N/A <arg value="${package.dir}/${svr4.pkg.name}.pkg" />
6331N/A <arg value="${svr4.pkg.name}" />
6331N/A </exec>
6331N/A <!-- compress it (saves ~6.5 MB) -->
6331N/A <exec executable="gzip" failonerror="true">
6331N/A <arg value="-9" />
6331N/A <arg value="-f" />
6331N/A <arg value="${package.dir}/${svr4.pkg.name}.pkg" />
6331N/A </exec>
6331N/A </target>
2086N/A
2086N/A
6330N/A <!-- ########################### TESTING ############################## -->
6330N/A <target name="test.help"
6330N/A description="Show info about test tuning parameters."
6330N/A >
6330N/A <echo message="Please read etc/test.help.txt !" />
6330N/A </target>
578N/A
6330N/A <target name="test.init" depends="buildtools"
6374N/A description="Setup essential DS unit test environment."
6330N/A >
6330N/A <path id="opendj.test.jars" cache="true">
6374N/A <fileset dir="${lib.dir}/jar">
6330N/A <selector refid="test.libs"/>
6330N/A </fileset>
6330N/A </path>
6330N/A <!-- If we are to perform coverage tests, then set that up -->
6330N/A <path id="emma.jars" cache="true">
6330N/A <pathelement location="${emma.dir}/emma.jar" />
6330N/A <pathelement location="${emma.dir}/emma_ant.jar" />
6330N/A </path>
6330N/A <taskdef resource="emma_ant.properties" classpathref="emma.jars" />
6330N/A <copy todir="${unittest.classes.dir}">
6330N/A <fileset dir="${unittest.testng.src.dir}" includes="**/*.properties" />
6330N/A </copy>
729N/A
6330N/A <path id="testng.jars" cache="true">
6330N/A <fileset dir="${testng.lib.dir}" includes="*.jar" />
6330N/A </path>
729N/A
6330N/A <mkdir dir="${unittest.resource.dir}" />
6330N/A <mkdir dir="${unittest.classes.dir}" />
6330N/A </target>
233N/A
6330N/A <!-- If we were asked to run only the tests that failed, then we overwrite
6330N/A the testng.xml that we just generated with testng-failed.xml, which
6330N/A TestNG generated -->
6330N/A <target name="test.prepare.failedOnly" depends="test.init"
6330N/A if="test.failures"
6330N/A >
6330N/A <!-- Ensure that some of the tests failed last time. -->
6330N/A <available property="testng-failed.xml.exists"
6330N/A file="${unittest.report.dir}/testng-failed.xml"/>
6330N/A <fail message="No unit tests failed in the previous run."
6330N/A unless="testng-failed.xml.exists"/>
1177N/A
6330N/A <copy file="${unittest.report.dir}/testng-failed.xml"
6330N/A tofile="${unittest.resource.dir}/testng.xml"
6330N/A >
6330N/A <!-- We replace the 'Failed suite [OpenDS]' with 'OpenDS' so we don't
6330N/A end up with 'Failed suite [Failed suite [OpenDS]]]' etc. -->
6330N/A <filterset>
6330N/A <filter token="Failed suite [OpenDS]" value="OpenDS"/>
6330N/A <filter token="default(failed)" value="default"/>
6330N/A </filterset>
6330N/A </copy>
6330N/A
6330N/A <echo message="Will run the failed unit tests only"/>
6330N/A </target>
1238N/A
6330N/A <!-- Prep the default TestNG XML file -->
6330N/A <target name="test.prepare.all" depends="test.init"
6330N/A unless="test.failures"
6330N/A >
6330N/A <condition property="test.groups" value="exclude=slow">
6330N/A <not>
6330N/A <or>
6330N/A <isset property="test.packages" />
6330N/A <isset property="test.classes" />
6330N/A <isset property="test.methods" />
6330N/A </or>
6330N/A </not>
6330N/A </condition>
1238N/A
6330N/A <!-- do not run tests dependent upon creation of the .zip file -->
6330N/A <condition property="test.packages"
6330N/A value="org.opends.server.*,org.opends.messages.*"
6330N/A >
6330N/A <and>
6330N/A <not>
6330N/A <or>
6330N/A <isset property="test.classes" />
6330N/A <isset property="test.methods" />
6330N/A </or>
6330N/A </not>
6330N/A <not>
6330N/A <equals arg1="${package.built}" arg2="true" />
6330N/A </not>
6330N/A </and>
6330N/A </condition>
1177N/A
6330N/A <!-- run tests dependent upon creation of the .zip file -->
6330N/A <condition property="test.packages"
6330N/A value="org.opends.server.*,org.opends.messages.*,
6330N/A org.opends.quicksetup.*"
6330N/A >
6330N/A <and>
6330N/A <not>
6330N/A <or>
6330N/A <isset property="test.classes" />
6330N/A <isset property="test.methods" />
6330N/A </or>
6330N/A </not>
6330N/A <equals arg1="${package.built}" arg2="true" />
6330N/A </and>
6330N/A </condition>
3381N/A
6330N/A <condition property="test.classes" value="">
6330N/A <not><isset property="test.methods" /></not>
6330N/A </condition>
6330N/A
6330N/A <property name="test.methods" value="" />
6330N/A
6330N/A <typedef name="preptestng" classname="org.opends.build.tools.PrepTestNG"
6330N/A classpathref="build.tools" />
6330N/A
6330N/A <preptestng file="${testng.dir}/testng.xml"
6330N/A tofile="${unittest.resource.dir}/testng.xml"
6330N/A grouplist="${test.groups}"
6330N/A packagelist="${test.packages}"
6330N/A classList="${test.classes}"
6330N/A methodList="${test.methods}" />
6330N/A </target>
5058N/A
6330N/A <target name="test.compile.snmp" depends="compile.snmp,test.init"
6330N/A if="jdmk.present"
6330N/A >
6330N/A <!-- Compile the SNMP test cases -->
6330N/A <javac srcdir="${unittest.testng.src.dir}" destdir="${unittest.classes.dir}"
6330N/A includes="org/opends/server/snmp/**">
6330N/A <classpath>
6330N/A <path refid="run.classpath" />
6330N/A <path refid="opendj.test.jars"/>
6330N/A <path refid="testng.jars" />
6330N/A </classpath>
6330N/A </javac>
6330N/A </target>
6330N/A
6330N/A <target name="test.compile.server" depends="compile.setup,test.init">
6330N/A <!-- Compile the test cases -->
6330N/A <javac srcdir="${unittest.testng.src.dir}"
6330N/A destdir="${unittest.classes.dir}"
6330N/A excludes="org/opends/server/snmp/**">
6330N/A <classpath>
6330N/A <path refid="run.classpath" />
6330N/A <path refid="opendj.test.jars"/>
6330N/A <path refid="testng.jars" />
6330N/A </classpath>
6330N/A </javac>
6330N/A </target>
6330N/A
6330N/A <target name="test.compile" depends="test.compile.server,test.compile.snmp"/>
1008N/A
6374N/A <!-- Phased out for IDE users to be able to create a proper testng.xml
6374N/A without actually running the tests -->
6374N/A <target name="test.prepare"
6330N/A depends="test.prepare.failedOnly,test.prepare.all,test.compile"
6374N/A description="Prepare to run DS unit tests." />
6374N/A
6374N/A <target name="test" depends="test.prepare" description="Run DS unit tests.">
6330N/A <taskdef resource="testngtasks">
6330N/A <classpath refid="testng.jars" />
6330N/A </taskdef>
1008N/A
6330N/A <property name="TESTASSERT" value="false" />
6330N/A <property name="testng.verbosity0to5" value="0"/>
6330N/A <condition property="org.opends.test.suppressOutput"
6330N/A value="false" else="true"
6330N/A >
6330N/A <not><equals arg1="${testng.verbosity0to5}" arg2="0"/></not>
6330N/A </condition>
6330N/A <property name="org.opends.test.pauseOnFailure" value="false" />
6330N/A <property name="org.opends.server.debug.target"
6330N/A value="org.opends.server:level=warning,category=caught|data|database-access|message|protocol,stack,cause"
6330N/A />
6330N/A <property name="org.opends.test.copyClassesToTestPackage" value="false" />
6330N/A <property name="test.progress" value="" />
1008N/A
6330N/A <!-- If the debug port was set, we pass the options into the 'testng'
6330N/A target below. E.g.:
6330N/A -Xdebug -Xnoagent -Djava.compiler=NONE
6330N/A -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005
6330N/A -->
6330N/A <property name="test.remote.debug.suspend" value="y" />
6330N/A <condition property="jvm.debug.arg1"
6330N/A value="-Xdebug" else="-Dopends.bogus.debug.arg1"
6330N/A >
6330N/A <isset property="test.remote.debug.port" />
6330N/A </condition>
6330N/A <condition property="jvm.debug.arg2"
6330N/A value="-Xnoagent" else="-Dopends.bogus.debug.arg2"
6330N/A >
6330N/A <isset property="test.remote.debug.port" />
6330N/A </condition>
6330N/A <condition property="jvm.debug.arg3"
6330N/A value="-Djava.compiler=NONE" else="-Dopends.bogus.debug.arg3"
6330N/A >
6330N/A <isset property="test.remote.debug.port" />
6330N/A </condition>
6330N/A <condition property="jvm.debug.arg4"
6330N/A value="-Xrunjdwp:transport=dt_socket,server=y,suspend=${test.remote.debug.suspend},address=${test.remote.debug.port}"
6330N/A else="-Dopends.bogus.debug.arg4"
6330N/A >
6330N/A <isset property="test.remote.debug.port" />
6330N/A </condition>
1008N/A
6330N/A <!-- Cleanout the old reports. Otherwise, the old testng-failed.xml
6330N/A will hang around even if all of the tests pass -->
6330N/A <delete dir="${unittest.report.dir}" failonerror="false" />
6330N/A <mkdir dir="${unittest.report.dir}" />
6330N/A
6330N/A <!-- Our testng listener will remove this file if all of the tests
6330N/A passed. This allows us to generate the coverage report even if the
6330N/A tests failed and still fail the build -->
6330N/A <touch file="${unittest.report.dir}/.tests-failed-marker"/>
1008N/A
6410N/A <emma enabled="${coverage.enabled}">
6410N/A <instr instrpath="${classes.dir}" destdir="${coverage.instr.dir}"
6410N/A metadatafile="${coverage.data.dir}/metadata.emma" merge="true" />
6410N/A </emma>
6410N/A
6330N/A <testng outputdir="${unittest.report.dir}" haltonfailure="false"
6330N/A verbose="${testng.verbosity0to5}" enableAssert="${TESTASSERT}"
6330N/A listeners="org.opends.server.TestListener
6330N/A org.testng.reporters.FailedReporter"
6330N/A useDefaultListeners="false"
6330N/A suiteRunnerClass="org.opends.server.SuiteRunner"
6330N/A >
6330N/A <classpath>
6330N/A <pathelement location="${coverage.instr.dir}" />
6330N/A <pathelement location="${unittest.classes.dir}" />
6330N/A <pathelement location="${resource.dir}" />
6330N/A <path refid="run.classpath" />
6330N/A <path refid="emma.jars" />
6330N/A <path refid="opendj.test.jars"/>
6330N/A <!-- Needed by quicksetup tests -->
6330N/A <path refid="build.tools" />
6330N/A <path refid="testng.jars" />
6330N/A </classpath>
1008N/A
6330N/A <jvmarg value="-Demma.coverage.out.file=${coverage.data.dir}/unit.emma" />
6330N/A <jvmarg value="-Demma.coverage.out.merge=false" />
6330N/A <jvmarg value="-Dorg.opends.server.BuildRoot=${basedir}" />
6330N/A <jvmarg value="-Dorg.opends.server.BuildDir=${build.dir}" />
6330N/A <jvmarg value="-Dorg.opends.server.RunningUnitTests=true" />
6330N/A <jvmarg value="-Dorg.opends.server.snmp.opendmk=${opendmk.lib.dir}"/>
6330N/A <jvmarg value="-Dorg.opends.test.suppressOutput=${org.opends.test.suppressOutput}" />
6330N/A <jvmarg value="-Dorg.opends.test.pauseOnFailure=${org.opends.test.pauseOnFailure}" />
6330N/A <jvmarg value="-Dorg.opends.server.debug.target=${org.opends.server.debug.target}" />
6330N/A <jvmarg value="-Dorg.opends.test.copyClassesToTestPackage=${org.opends.test.copyClassesToTestPackage}" />
6330N/A <jvmarg value="-Dtest.progress=${test.progress}" />
6330N/A <jvmarg value="-Xms${MEM}" />
6330N/A <jvmarg value="-Xmx${MEM}" />
6330N/A <jvmarg value="${jvm.debug.arg1}" />
6330N/A <jvmarg value="${jvm.debug.arg2}" />
6330N/A <jvmarg value="${jvm.debug.arg3}" />
6330N/A <jvmarg value="${jvm.debug.arg4}" />
1530N/A
6330N/A <xmlfileset dir="${unittest.resource.dir}" includes="testng.xml" />
6330N/A </testng>
6330N/A
6330N/A <!-- Our testng listener will create this file if any of the tests
6330N/A failed. This allows us to generate the coverage report even if the
6330N/A tests failed -->
6330N/A <available property="testng.tests.failed"
6330N/A file="${unittest.report.dir}/.tests-failed-marker"/>
6330N/A
6330N/A <!-- Delete all of the report suite sub-directories since we only have
6330N/A a single suite -->
6330N/A <delete dir="${unittest.report.dir}/${SHORT_NAME}" failonerror="false"/>
3381N/A
6330N/A <emma enabled="${coverage.enabled}" >
6330N/A <report sourcepath="${src.dir}" >
6330N/A <fileset dir="${coverage.data.dir}"
6330N/A includes="unit.emma,metadata.emma" />
6330N/A <txt outfile="${coverage.report.dir}/coverage.txt" />
6330N/A <html outfile="${coverage.report.dir}/index.html" />
6330N/A <xml outfile="${coverage.report.dir}/coverage.xml" />
6330N/A </report>
6330N/A </emma>
6330N/A
6330N/A <!-- We delay failing until after the coverage report is generated -->
6330N/A <fail message="The unit tests failed." if="testng.tests.failed"/>
6330N/A </target>
6330N/A
6330N/A <!-- Internal target to prepare to generate a code coverage report -->
6410N/A <target name="test.enable.coverage">
6330N/A <property name="coverage.enabled" value="true" />
1008N/A
6330N/A <mkdir dir="${coverage.dir}" />
6330N/A <mkdir dir="${coverage.data.dir}" />
6330N/A <mkdir dir="${coverage.instr.dir}" />
6330N/A <mkdir dir="${coverage.report.dir}" />
6330N/A </target>
1177N/A
6330N/A <target name="test.enable.slow">
6330N/A <!-- props are read-only, once set. So this prevents the fallback to
6330N/A value='exclude=slow' in test -->
6330N/A <condition property="test.groups" value="">
6330N/A <not>
6330N/A <or>
6330N/A <isset property="test.packages" />
6330N/A <isset property="test.classes" />
6330N/A <isset property="test.methods" />
6330N/A </or>
6330N/A </not>
6330N/A </condition>
6330N/A </target>
6330N/A
6330N/A <target name="test.enable.assertions">
6330N/A <property name="TESTASSERT" value="true"/>
6330N/A </target>
1395N/A
6330N/A <target name="test.all"
6330N/A depends="test.enable.slow,test.enable.assertions,test"
6330N/A description="Run all unit tests (including 'slow' ones)."/>
6330N/A
6410N/A <target name="test.+coverage" depends="test.enable.coverage,test"
6330N/A description="Run DS unit tests + coverage report." />
6330N/A
6410N/A <target name="test.all+coverage" depends="test.enable.coverage,test.all"
6330N/A description="Run all unit tests (including 'slow' ones) + coverage report" />
6330N/A
6330N/A <target name="test.report" depends="test"
6330N/A description="HTMLize unit test results.">
6330N/A <junitreport todir="${unittest.report.dir}">
6330N/A <fileset dir="${unittest.report.dir}" includes="*.xml"/>
6330N/A <report format="noframes" todir="${unittest.report.dir}"/>
6330N/A </junitreport>
6330N/A </target>
3381N/A
3381N/A
6330N/A <!-- ##################### PRE COMMIT CHECKS ######################### -->
6410N/A <!-- Check modified files to see if any copyright fixes are needed -->
6330N/A <target name="check.eol+copy" depends="buildtools" unless="is.hg"
6410N/A description="Check modified files: copyright info."
6330N/A >
6330N/A <taskdef name="checkprecommit"
6330N/A classname="org.opends.build.tools.CheckPrecommit"
6330N/A >
6410N/A <classpath refid="build.tools" />
6330N/A </taskdef>
6330N/A
6330N/A <checkprecommit />
6330N/A </target>
3381N/A
6330N/A <!-- check if the english generated files are different from the ones used
6330N/A for localization and copy the files that are different to a directory
6330N/A named diff -->
6330N/A <target name="check.l10nmessages" depends="gen.admin">
6330N/A <copy todir="${msgl10n.diff.dir}/diff" verbose="true">
6330N/A <fileset dir="${classes.dir}/admin/messages/org/opends/server/admin/std/meta/"
6330N/A includes="*.properties">
6330N/A <different targetdir="${msgl10n.prop.dir}" ignoreFileTimes="true" />
6330N/A </fileset>
6330N/A </copy>
3381N/A
6330N/A <fileset id="fs" dir="${msgl10n.diff.dir}/diff"/>
6330N/A <condition property="dir_empty">
6330N/A <length length="0">
6330N/A <fileset refid="fs"/>
6330N/A </length>
6330N/A </condition>
6330N/A
6330N/A <fail unless="dir_empty" message="
6330N/AGenerated admin message properties files differ from existing files: Copy all
6330N/Afiles from ${msgl10n.diff.dir}/diff to ${msgl10n.prop.dir}
6330N/Aand include them for commit to resolve." />
6330N/A </target>
6330N/A
6330N/A <!-- Ensure that the source code meets basic style requirements. -->
6330N/A <target name="check.style" description="Perform basic source style checks.">
6330N/A <mkdir dir="${checkstyle.cache.dir}" />
3381N/A
6330N/A <taskdef resource="checkstyletask.properties"
6330N/A classpath="${checkstyle.dir}/checkstyle-all-4.1.jar" />
3381N/A
6330N/A <checkstyle config="${checkstyle.dir}/opends-checkstyle.xml">
6330N/A <fileset dir="${src.dir}" includes="**/*.java"
6330N/A excludes="**/PublicAPI.java" />
6330N/A </checkstyle>
6330N/A
6330N/A <checkstyle config="${checkstyle.dir}/opends-checkstyle.xml">
6330N/A <fileset dir="${msg.src.dir}" includes="**/*.java" />
6330N/A </checkstyle>
3381N/A
6330N/A <checkstyle config="${checkstyle.dir}/opends-checkstyle.xml">
6330N/A <fileset dir="${ads.src.dir}" includes="**/*.java" />
6330N/A </checkstyle>
6330N/A
6330N/A <checkstyle config="${checkstyle.dir}/opends-checkstyle.xml">
6330N/A <fileset dir="${snmp.src.dir}" includes="**/*.java" />
6330N/A </checkstyle>
6330N/A
6330N/A <checkstyle config="${checkstyle.dir}/opends-checkstyle.xml">
6330N/A <fileset dir="${quicksetup.src.dir}" includes="**/*.java" />
6330N/A </checkstyle>
3381N/A
6330N/A <checkstyle config="${checkstyle.dir}/opends-checkstyle.xml">
6330N/A <fileset dir="${guitools.src.dir}" includes="**/*.java" />
6330N/A </checkstyle>
3381N/A
6330N/A <checkstyle config="${checkstyle.dir}/opends-checkstyle.xml">
6330N/A <fileset dir="${dsml.src.dir}" includes="**/*.java" />
6330N/A </checkstyle>
3349N/A
6330N/A <checkstyle config="${checkstyle.dir}/opends-doctarget-checkstyle.xml">
6330N/A <fileset dir="${src.dir}/org/opends/server/api" includes="**/*.java" />
6330N/A <fileset dir="${src.dir}/org/opends/server/protocols/internal"
6330N/A includes="**/*.java" />
6330N/A <fileset dir="${src.dir}/org/opends/server/types"
6330N/A includes="**/*.java" excludes="**/PublicAPI.java"/>
6330N/A </checkstyle>
3381N/A
6330N/A <checkstyle config="${checkstyle.dir}/opends-unittest-checkstyle.xml">
6330N/A <fileset dir="${unittest.testng.src.dir}" includes="**/*.java" />
6330N/A </checkstyle>
6330N/A </target>
6330N/A
6330N/A <!-- The build target that should be used before committing code -->
6330N/A <target name="precommit"
6330N/A depends="clean,check.style,check.eol+copy,check.l10nmessages,
6331N/A pkg.generic,dsml,test"
6330N/A description="Perform needed checks before committing code." />
3349N/A
3381N/A
6330N/A <!-- ############################# MISC ############################### -->
6330N/A <target name="src.zip" depends="gen.admin,gen.snmp"
6330N/A description="Archive the server source into a zip file."
6330N/A >
6330N/A <zip destfile="${build.dir}/src.zip">
6330N/A <zipfileset dir="${src.dir}" dirmode="755" filemode="644" />
6330N/A <zipfileset dir="${admin.src.dir}" dirmode="755" filemode="644" />
6330N/A <zipfileset dir="${ads.src.dir}" dirmode="755" filemode="644" />
6330N/A <zipfileset dir="${quicksetup.src.dir}" dirmode="755" filemode="644" />
6330N/A <zipfileset dir="${guitools.src.dir}" dirmode="755" filemode="644" />
6330N/A <zipfileset dir="${snmp.gen.dir}" dirmode="755" filemode="644" />
6330N/A <zipfileset dir="${snmp.src.dir}" dirmode="755" filemode="644" />
6330N/A </zip>
6330N/A </target>
6330N/A
6330N/A <!-- The build target that should be used for build part of nightly builds -->
6330N/A <target name="nightly.build" description="Build nightly."
6330N/A depends="clean,check.style,compile.dsml,api,guide,src.zip" />
3381N/A
6330N/A <!-- The build target that should be used for nightly builds -->
6330N/A <target name="nightly" depends="nightly.build,test.all"
6330N/A description="Build nightly incl. tests." />
6330N/A
6330N/A <!-- The build target that should be used to build everything. -->
6330N/A <!-- target name="all" description="Build using all defined targets."
6330N/A depends="nightly" / -->
6330N/A
6330N/A <target name="clean" depends="clean.admin,clean.server,clean.snmp"
6330N/A description="Remove all generated source files incl. build dirs."
6330N/A >
6330N/A <delete file="${dynconstants.file}" />
6330N/A <delete dir="${build.dir}" failonerror="false" />
6330N/A <delete dir="eclipse-build" failonerror="false" />
6330N/A </target>
6330N/A
6330N/A <target name="realclean" depends="clean,clean.libs,clean.ivy"
6330N/A description="Remove all files and dirs producible by this build."
6330N/A >
6330N/A <delete dir="${checkstyle.cache.dir}" failonerror="false" />
6330N/A </target>
3381N/A
6330N/A <target name="gen.instance" depends="proto"
6330N/A description="Create a temp. data instance dir for internal testing."
6330N/A >
6330N/A <copy todir="${instance.dir}">
6330N/A <fileset dir="${PROTO}/template" />
6330N/A </copy>
6418N/A <!-- inital password is 'password' -->
6418N/A <replaceregexp file="${instance.dir}/config/config.ldif"
6418N/A match="ds-cfg-listen-port: 389"
6418N/A replace="ds-cfg-listen-port: 1389"/>
6331N/A <echo message="Remember to set INSTANCE_ROOT:${line.separator}
6331N/A setenv INSTANCE_ROOT '${instance.dir}'${line.separator}
6331N/A export INSTANCE_ROOT='${instance.dir}'" />
6330N/A </target>
6330N/A <!-- don't include in any dependency settings - the developer should call it
6330N/A explicitly if needed! -->
6330N/A <target name="clean.instance"
6330N/A description="Reomve the current instance.dir unconditionally!"
6330N/A >
6330N/A <delete dir="${instance.dir}" failonerror="false" />
6330N/A </target>
6330N/A <!-- Internal target to run the Directory Server directly -->
6330N/A <target name="run.server" depends="gen.instance">
6330N/A <java fork="true" classname="org.opends.server.core.DirectoryServer"
6330N/A failonerror="true"
6330N/A >
6330N/A <classpath refid="run.classpath"/>
6330N/A <jvmarg value="-Dorg.opends.server.scriptName=start-ds"/>
6330N/A <jvmarg value="-Dorg.opends.server.InstallRoot=${PROTO}"/>
6330N/A <jvmarg value="-Dorg.opends.server.InstanceRoot=${instance.dir}"/>
6330N/A <arg value="--configClass=org.opends.server.extensions.ConfigFileHandler"/>
6330N/A <arg value="--configFile=${instance.dir}/config/config.ldif"/>
6330N/A <arg value="--nodetach"/>
6330N/A </java>
6330N/A </target>
3381N/A
6330N/A <!-- Internal target to run directly dsconfig -->
6330N/A <target name="run.dsconfig" depends="gen.instance">
6330N/A <java fork="true" classname="org.opends.server.tools.dsconfig.DSConfig"
6330N/A failonerror="true"
6330N/A >
6330N/A <classpath refid="run.classpath"/>
6330N/A <jvmarg value="-Dorg.opends.server.scriptName=dsconfig" />
6330N/A <jvmarg value="-Dorg.opends.server.InstallRoot=${PROTO}"/>
6330N/A <jvmarg value="-Dorg.opends.server.InstanceRoot=${instance.dir}"/>
6330N/A </java>
6330N/A </target>
3381N/A
3381N/A
6330N/A <!-- ####################### ECLIPSE ################################## -->
6330N/A <target name="eclipse.jars" depends="gen">
6330N/A <copy file="${build.dir}/build-tools/build-tools.jar" todir="${lib.dir}"/>
6330N/A <!-- The src tree layout is so stupid -> need to package stuff like
6330N/A message property files (res bundles) to avoid classpath
6330N/A overlapping, which actually means, that we need to re-build
6330N/A this jar, if a *.properties/*Message stuff gets changed. =8-( -->
6330N/A <jar destfile="${lib.dir}/opendj-resources.jar">
6330N/A <fileset dir="${build.dir}/classes"
6330N/A includes="**/meta/*.properties,**/*.manifest"/>
6330N/A <fileset dir="${msg.dir}" includes="messages/*" />
6330N/A </jar>
6330N/A <!-- there is per default no JRE variable in eclipse anymore :( -->
6330N/A <copy todir="${lib.dir}" file="${java.home}/lib/javaws.jar"
6330N/A failonerror="true"/>
6330N/A </target>
6133N/A
6330N/A <target name="eclipse" depends="eclipse.jars"
6330N/A description="Generate stuff required to make eclipse IDE happy.">
6330N/A <fail unless="${jdmk.present}"
6330N/A message=":${line.separator}${line.separator}
6330N/ADownload the OpenDMK from https://opendmk.java.net and set property${line.separator}
6330N/Aopendmk.lib.dir build to the path, which contains the corresponding jars.
6330N/A${line.separator} (see etc/build.properties)"/>
6330N/A </target>
6133N/A
6133N/A
6330N/A <!-- ####################### NETBEANS ################################## -->
6330N/A <!-- Netbeans target to debug the Directory Server. -->
6330N/A <target name="nb-debug-server" depends="gen.instance">
6330N/A <nbjpdastart addressproperty="jpda.address" name="Directory Server"
6330N/A transport="dt_socket"
6330N/A >
6330N/A <classpath refid="run.classpath"/>
6330N/A </nbjpdastart>
6330N/A <java classname="org.opends.server.core.DirectoryServer" fork="true">
6330N/A <classpath refid="run.classpath"/>
6330N/A <jvmarg value="-Xdebug"/>
6330N/A <jvmarg value="-Xrunjdwp:transport=dt_socket,address=${jpda.address}"/>
6330N/A <jvmarg value="-Dorg.opends.server.scriptName=start-ds"/>
6330N/A <jvmarg value="-Dorg.opends.server.InstallRoot=${PROTO}"/>
6331N/A <jvmarg value="-Dorg.opends.server.InstanceRoot=${instance.dir}"/>
6330N/A <jvmarg value="-Dorg.opends.server.debug.enabled=true"/>
6330N/A <arg value="--configClass=org.opends.server.extensions.ConfigFileHandler"/>
6330N/A <arg value="--configFile=${instance.dir}/config/config.ldif"/>
6330N/A <arg value="--nodetach"/>
6330N/A </java>
6330N/A </target>
6133N/A
6330N/A <!-- Netbeans target to profile the Directory Server. -->
6330N/A <target name="nb-profile-server" depends="gen.instance">
6330N/A <nbprofiledirect>
6330N/A <classpath refid="run.classpath"/>
6330N/A </nbprofiledirect>
6330N/A <java fork="true" classname="org.opends.server.core.DirectoryServer">
6330N/A <classpath refid="run.classpath"/>
6330N/A <jvmarg value="${profiler.info.jvmargs.agent}"/>
6330N/A <jvmarg value="-Dorg.opends.server.scriptName=start-ds"/>
6330N/A <jvmarg value="-Dorg.opends.server.InstallRoot=${PROTO}"/>
6330N/A <jvmarg value="-Dorg.opends.server.InstanceRoot=${instance.dir}"/>
6330N/A <arg value="--configClass=org.opends.server.extensions.ConfigFileHandler"/>
6330N/A <arg value="--configFile=${instance.dir}/config/config.ldif"/>
6330N/A <arg value="--nodetach"/>
6330N/A </java>
6330N/A </target>
6162N/A
6330N/A <!-- Netbeans target to debug dsconfig. -->
6330N/A <target name="nb-debug-dsconfig" depends="gen.instance">
6330N/A <nbjpdastart addressproperty="jpda.address" name="Directory Server"
6330N/A transport="dt_socket"
6330N/A >
6330N/A <classpath refid="run.classpath"/>
6330N/A </nbjpdastart>
6330N/A <java classname="org.opends.server.tools.dsconfig.DSConfig" fork="true">
6330N/A <classpath refid="run.classpath"/>
6330N/A <jvmarg value="-Xdebug"/>
6330N/A <jvmarg value="-Xrunjdwp:transport=dt_socket,address=${jpda.address}"/>
6330N/A <jvmarg value="-Dorg.opends.server.scriptName=dsconfig" />
6330N/A <jvmarg value="-Dorg.opends.server.InstallRoot=${PROTO}"/>
6330N/A <jvmarg value="-Dorg.opends.server.InstanceRoot=${instance.dir}"/>
6330N/A <jvmarg value="-Dorg.opends.server.debug.enabled=true"/>
6330N/A </java>
6330N/A </target>
0N/A</project>