blob: 02420c3715227a814cdf4e855c61770fd7f22de4 [file] [log] [blame]
<project name="jtc-naming" default="main" basedir=".">
<!-- ===================== Initialize Property Values ================ -->
<property file="build.properties"/>
<property file="${user.home}/build.properties"/>
<property file="${user.home}/.build.properties"/>
<!-- ==================== ==================== -->
<property name="naming.build.dir" location="target" />
<property name="commons.src" location="../../jakarta-commons" />
<property name="jndi.home" location="${base.path}/jndi1.2.1" />
<property name="commons-logging.jar" location="${commons.src}/logging/dist/commons-logging.jar" />
<property name="tomcat-util.jar" location="../util/build/lib/tomcat-util.jar" />
<property name="commons-collections.jar" location="${commons.src}/collections/dist/commons-collections.jar" />
<path id="build-main.classpath">
<pathelement location="${commons-logging.jar}"/>
<pathelement location="${commons-collections.jar}"/>
<pathelement location="${tomcat-util.jar}"/>
<pathelement location="${naming.build.dir}/classes"/>
<pathelement location="${jndi.home}/lib/dns.jar"/>
<pathelement location="${jndi.home}/lib/dsml.jar"/>
<pathelement location="${jndi.home}/lib/fscontext.jar"/>
<pathelement location="${jndi.home}/lib/cosnaming.jar"/>
<pathelement location="${jndi.home}/lib/providerutil.jar"/>
<pathelement location="${jndi.home}/lib/ldap.jar"/>
<pathelement location="${jndi.home}/lib/ldapbp.jar"/>
<pathelement location="${jndi.home}/lib/ldapsec.jar"/>
<pathelement location="${jndi.home}/lib/jndibrowser.jar"/>
</path>
<target name="main" >
<mkdir dir="${naming.build.dir}/classes"/>
<javac srcdir="src"
destdir="${naming.build.dir}/classes"
deprecation="${compile.deprecation}"
debug="${compile.debug}"
optimize="${optimize}"
verbose="off" >
<exclude name="org/apache/ajp/tomcat4/**" unless="tomcat40.detect"/>
<classpath refid="build-main.classpath"/>
</javac>
<copy todir="${naming.build.dir}/classes" >
<fileset dir="src" includes="**/*.properties"/>
</copy>
</target>
<target name="test" >
<classloader classpathRef="build-main.classpath" />
<taskdef name="jndiSet" classname="org.apache.naming.ant.JndiSet"/>
<taskdef name="jndiProperties" classname="org.apache.naming.ant.JndiProperties"/>
<taskdef name="jndiFileCtx" classname="org.apache.naming.modules.fs.FileDirContext"/>
<!-- Enable ${jndi:...} dynamic properties -->
<jndiProperties/>
<!-- memory context -->
<jndiSet context="/foo" value="bar" />
<echo message="Value: ${jndi:/foo}"/>
<property name="dirname" location="." />
<!-- Create a JNDI context for the current dir -->
<jndiFileCtx docBase="${dirname}" id="docBaseId" />
<!-- Bind the file context to /currentDir -->
<jndiSet context="/currentDir" refId="docBaseId" />
<echo message="Value: ${jndi:/currentDir/build.xml}"/>
<echo message="Value: ${jndi:fs:/tmp}"/>
</target>
<target name="browser">
<java classpathref="build-main.classpath"
classname="examples.browser.Browser" fork="true">
<sysproperty key="java.naming.dns.url" value="dns://10.0.0.1/covalent.net"/>
<!-- LABEL|java.naming.factory.initial|java.naming.provider.url|root|auth( none, simple, etc ) |princ|pass -->
<arg value="LDAP|com.sun.jndi.ldap.LdapCtxFactory|ldap://localhost:389|dc=wyn,dc=org|simple|cn=Manager,dc=wyn,dc=org|secret" />
<!-- arg value="File|com.sun.jndi.fscontext.RefFSContextFactory|file:/" /-->
<arg value="DSML|com.sun.jndi.dsml.DsmlCtxFactory|file:/tmp/test.dsml.xml" />
<arg value="DNS|com.sun.jndi.dns.DnsContextFactory|dns://127.0.0.1/localhost" />
<arg value="FS|org.apache.naming.modules.fs.fsURLContextFactory|fs:/" />
<arg value="Mem|org.apache.naming.modules.memory.memoryURLContextFactory|memory:/" />
</java>
</target>
</project>