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