gecko-dev/directory/java-sdk/build.xml

254 строки
10 KiB
XML

<project name="Mozilla Java LDAP SDK" default="show" basedir=".">
<!--
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1999 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*
* Tony Dahbura (tony@dahbura.com) initial creation of ant build files
*
*/
-->
<!-- ===================== Initialize Property Values =================== -->
<property file="build.properties"/>
<!-- Project Properties -->
<property name="name" value="java-sdk" />
<property name="year" value="2002" />
<property name="version" value="4.17" />
<property name="sdkjarfilename" value="ldapjdk.jar" />
<property name="filtjarfilename" value="ldapfilt.jar" />
<property name="jdnijarfilename" value="ldapsp.jar" />
<property name="beansjarfilename" value="ldapbeans.jar" />
<property name="doczipfilename" value="ldapdoc.zip" />
<!-- Build Defaults -->
<property name="jdk.dist" value="${basedir}/dist/classes"/>
<property name="filter.dist" value="${basedir}/dist/ldapfilt"/>
<property name="jndi.dist" value="${basedir}/dist/classes"/>
<property name="doc.dist" value="${basedir}/dist/doc"/>
<property name="package.dist" value="${basedir}/dist/packages"/>
<property name="src" value="."/>
<property name="build" value="build"/>
<property name="dist" value="dist"/>
<!-- the following is to setup the correct info for sun jsse which
is jdk dependent -->
<property name="ssllibs14" value="${basedir}/ldapjdk/lib/jss32_stub.jar"/>
<property name="ssllibs13" value="${basedir}/ldapjdk/lib/jaas.jar:${basedir}/ldapjdk/lib/jnet.jar:${basedir}/ldapjdk/lib/jsse.jar:${basedir}/ldapjdk/lib/jss32_stub.jar"/>
<!-- we do not use the users existing classpath and instead build our own
comment the following line out if this is not desired -->
<property name="build.sysclasspath" value="ignore"/>
<!-- the following target is the default target so show some help -->
<target name="show">
<echo>The following targets are defined:
dist : will build entire sdk and package all the pieces
dist-jdk : will build only the ldap jdk jar (ldapjdk.jar)
dist-filter : will build only the ldap filter jar (ldapfilt.jar)
dist-beans : will build only the beans jar (ldapbeans.jar)
dist-jndi : will build only the jndi service provider (ldapsp.jar)
dist-docs : will package up all the documentation (ldapdoc.zip)
build : will compile the entire sdk but not package
build-jdk : will compile only the ldap jdk jar
build-filter : will compile only the filter classes
build-beans : will compile only the ldap beans
build-jndi : will compile only the jndi service provider
build-docs : will compile the complete javadocs
clean : will remove all compiled files and packages
clean-dists : will remove all the jars and zips
clean-builds : will remove all the compiled classes
NOTE: in order to compile the filter classes you will need to
edit the build.properties file and place the path to
your oro pattern matching jar in it.
</echo>
</target>
<target name="init">
<echo>compiling for jdk version=${ant.java.version}</echo>
<condition property="jsselibs" value="${ssllibs13}">
<or>
<equals arg1="${ant.java.version}" arg2="1.1" />
<equals arg1="${ant.java.version}" arg2="1.2" />
<equals arg1="${ant.java.version}" arg2="1.3" />
</or>
</condition>
<condition property="jsselibs" value="${ssllibs14}">
<not>
<or>
<equals arg1="${ant.java.version}" arg2="1.1" />
<equals arg1="${ant.java.version}" arg2="1.2" />
<equals arg1="${ant.java.version}" arg2="1.3" />
</or>
</not>
</condition>
<echo>ssl libraries path=${jsselibs}</echo>
<!-- create dist directories in case a clean was executed -->
<mkdir dir="${jdk.dist}"/>
<mkdir dir="${filter.dist}"/>
<mkdir dir="${jndi.dist}"/>
<mkdir dir="${doc.dist}"/>
<mkdir dir="${package.dist}"/>
</target>
<target name="dist" depends="dist-jdk,dist-filter,dist-beans,dist-jndi,dist-docs">
<echo>Building all packages....</echo>
</target>
<target name="dist-jdk" depends="build-jdk">
<jar jarfile="${package.dist}/${sdkjarfilename}"
basedir="${jdk.dist}"
excludes="cvs/**"
includes="netscape/ldap/*.class,netscape/ldap/client/*.class,netscape/ldap/client/opers/*.class,netscape/ldap/ber/stream/*.class,netscape/ldap/controls/*.class,netscape/ldap/factory/*.class,netscape/ldap/util/*.class,netscape/ldap/errors/*.props,com/netscape/sasl/*.class,com/netscape/sasl/mechanisms/*.class,*.class"
/>
</target>
<target name="dist-filter" depends="build-filter">
<jar jarfile="${package.dist}/${filtjarfilename}"
basedir="${filter.dist}"
excludes="cvs/**"
includes="netscape/ldap/util/*.class"
/>
</target>
<target name="dist-beans" depends="build-beans">
<jar jarfile="${package.dist}/${beansjarfilename}"
basedir="${jdk.dist}"
excludes="cvs/**"
includes="netscape/ldap/beans/*"
/>
</target>
<target name="dist-jndi" depends="build-jndi">
<jar jarfile="${package.dist}/${jdnijarfilename}"
basedir="${jdk.dist}"
excludes="cvs/**"
includes="com/netscape/jndi/ldap/*.class com/netscape/jndi/ldap/common/*.class com/netscape/jndi/ldap/schema/*.class com/netscape/jndi/ldap/controls/*.class"
/>
</target>
<target name="dist-docs" depends="build-docs">
<jar jarfile="${package.dist}/${doczipfilename}"
update="no"
basedir="${doc.dist}"
excludes="cvs/**"
includes="*.html *.css netscape/ldap/*.html netscape/ldap/beans/*.html netscape/ldap/controls/*.html netscape/ldap/util/*.html netscape/ldap/ber/stream/*.html"
/>
</target>
<!-- The following targets do the builds (compiles of the source files) -->
<target name="build" depends="build-jdk,build-filter,build-beans,build-jndi"/>
<target name="build-jdk" depends="init">
<!-- Compile the java jdk code from ${src} into ${dest} -->
<javac srcdir="${basedir}/ldapjdk/com" destdir="${jdk.dist}"
excludes="cvs/**"
classpath="${jsselibs}"
/>
<javac srcdir="${basedir}/ldapjdk/netscape" destdir="${jdk.dist}"
excludes="cvs/**"
classpath="${jsselibs}"
/>
<javac srcdir="${basedir}/tools" destdir="${jdk.dist}"
excludes="cvs/**"
classpath="${jsselibs}"
/>
</target>
<target name="build-filter" depends="init,build-jdk">
<!-- filter requires the oro regular expression libraries -->
<fail unless="ororegexp.jar" message="place path to oro regular expression library in build.properties file."/>
<javac srcdir="${basedir}/ldapfilter" destdir="${filter.dist}"
excludes="cvs/**"
classpath="${jdk.dist}:${jsselibs}:${ororegexp.jar}"
/>
</target>
<target name="build-beans" depends="init">
<!-- Compile the java jdk bean code from ${src} into ${dest} -->
<javac srcdir="${basedir}/ldapbeans" destdir="${jdk.dist}"
excludes="cvs/**"
classpath="${jsselibs}"
/>
</target>
<target name="build-jndi" depends="init,build-jdk">
<!-- Compile the java code from ${src} into ${dest} -->
<javac srcdir="${basedir}/ldapsp" destdir="${jndi.dist}"
excludes="cvs/**"
classpath="${jsselibs}:${basedir}/ldapsp/lib/jndi.jar"
/>
</target>
<target name="build-docs">
<!-- Create the javadocs for the sdk -->
<javadoc
packagenames="netscape.ldap.*,netscape.ldap.beans.*,netscape.ldap.controls.*,netscape.ldap.util.*,netscape.ldap.factory.*,com.netscape.sasl.*,com.netscape.sasl.mechanisms.*,netscape.ldap.ber.stream.*"
sourcepath="${basedir}/ldapbeans:${basedir}/ldapjdk"
sourcefiles="${basedir}/tools/LDAPDelete.java,${basedir}/tools/LDAPModify.java,${basedir}/tools/LDAPSearch.java,${basedir}/tools/LDAPTool.java"
destdir="${doc.dist}"
author="true"
version="true"
use="true"
classpath="${basedir}/ldapjdk:${basedir}/ldapjdk/lib/jss32_stub.jar:${basedir}/ldapbeans" >
</javadoc>
<javadoc packagenames="com.netscape.jndi.ldap.controls.*"
sourcepath="${basedir}/ldapsp"
destdir="${doc.dist}/ldapsp"
classpath="${jndi.dist}:${basedir}/ldapsp:${basedir}/ldapsp/lib/jndi.jar"
author="true"
version="true"
use="true">
</javadoc>
</target>
<target name="clean" depends="clean-builds,clean-dists"/>
<target name="clean-dists">
<!-- Delete the jar and zip files -->
<delete includeEmptyDirs="true">
<fileset dir="${package.dist}" includes="*.jar *.zip" />
</delete>
</target>
<target name="clean-builds">
<!-- Delete the .class and javadoc files built up from builds -->
<delete includeEmptyDirs="true">
<fileset dir="${basedir}/dist" excludes="*.jar *.zip"/>
</delete>
</target>
</project>