<?xml version="1.0"?>

<project name="chapter11" default="all" basedir="../..">

  <!-- ==================================================== -->
  <!--             Chapter 11 build file                    -->
  <!-- ==================================================== -->

   <target name="init">
        <property file="${basedir}/src/ant-properties"/>
    	<property name="name" value="chapter11"/>
	    <property name="src" value="${dirs.base}/src/${name}"/>
	    <property name="idlout" value="${src}/generated"/>
   </target>

   <target name="all" depends="init,idl,event,notification">	
   </target>

   <target name="idl" depends="init">
      <exec dir="${src}" executable="${orb.idlcompiler}">
           <arg line="${orb.idlcompiler.strictflag} ${orb.idlcompiler.outflag} ${idlout} ${src}/Office.idl"/>
      </exec>  
      <javac srcdir="${src}/generated/"
	         destdir="${classdir}"
	         includes="**/*.java"
	  />
   </target>  

   <target name="event" depends="init,idl,eventidl">
	   <javac srcdir="${dirs.base}/src/chapter11/event/"
	       destdir="${classdir}"
	       includes="*.java"
	   />
   </target>

   <!-- required for VisiBroker because the VB 4.0 event service  -->
   <!-- library does not contain TIE classes -->

   <target name="eventidl" depends="init" if="vb">
      <exec dir="${src}" executable="${orb.idlcompiler}">
           <arg line="${orb.idlcompiler.packageflag} org.omg ${orb.idlcompiler.strictflag} ${orb.idlcompiler.outflag} ${idlout} ${orb.idlcompiler.includeflag}. ${orb.idlcompiler.includeflag}${includepath} ${src}/CosEventComm.idl"/>
      </exec>  
      <exec dir="${src}" executable="${orb.idlcompiler}">
           <arg line="${orb.idlcompiler.packageflag} org.omg ${orb.idlcompiler.strictflag} ${orb.idlcompiler.outflag} ${idlout} ${orb.idlcompiler.includeflag}. ${orb.idlcompiler.includeflag}${includepath} ${src}/CosEventChannelAdmin.idl"/>
      </exec>  
      <javac srcdir="${src}/generated/"
	         destdir="${classdir}"
	         includes="org/**/*.java"
	  />
   </target>  

   <!-- required for JacORB with OpenFusion Notification Service -->
   <!-- because the OpenFusion library contains VB-specific code, -->
   <!-- so we need to generate strictly-compliant stubs for the  -->
   <!-- client side -->

   <target name="notificationidl" depends="init">
      <exec dir="${src}" executable="${orb.idlcompiler}">
           <arg line="${orb.idlcompiler.packageflag} org.omg ${orb.idlcompiler.strictflag} ${orb.idlcompiler.outflag} ${idlout} ${orb.idlcompiler.includeflag}. ${orb.idlcompiler.includeflag}${includepath} ${src}/CosNotification.idl"/>
      </exec>  
      <exec dir="${src}" executable="${orb.idlcompiler}">
           <arg line="${orb.idlcompiler.packageflag}  org.omg ${orb.idlcompiler.strictflag} ${orb.idlcompiler.outflag} ${idlout} ${orb.idlcompiler.includeflag}. ${orb.idlcompiler.includeflag}${includepath} ${src}/CosNotifyChannelAdmin.idl"/>
      </exec>  
      <exec dir="${src}" executable="${orb.idlcompiler}">
           <arg line="${orb.idlcompiler.packageflag} org.omg ${orb.idlcompiler.strictflag} ${orb.idlcompiler.outflag} ${idlout} ${orb.idlcompiler.includeflag}. ${orb.idlcompiler.includeflag}${includepath} ${src}/CosNotifyComm.idl"/>
      </exec>  
      <exec dir="${src}" executable="${orb.idlcompiler}">
           <arg line="${orb.idlcompiler.packageflag} org.omg ${orb.idlcompiler.strictflag} ${orb.idlcompiler.outflag} ${idlout} ${orb.idlcompiler.includeflag}. ${orb.idlcompiler.includeflag}${includepath} ${src}/CosNotifyFilter.idl"/>
      </exec>  
      <javac srcdir="${src}/generated/"
	         destdir="${classdir}"
	         includes="org/**/*.java"
	  />
   </target>  

   <target name="notification" depends="init,idl,notificationidl">
	   <javac srcdir="${dirs.base}/src/chapter11/notification/"
	       destdir="${classdir}"
	       includes="*.java"
	    />
   </target>

   <!-- starts the print server (event example) -->

   <target name="eventserver" depends="init">
       <exec dir="${src}" executable="${orb.script}">
           <arg
           line="${orb.runtime.naming}
           com.wiley.compbooks.brose.chapter11.event.PrinterImpl"/>
        </exec>
   </target>

   <!-- starts the print client (event example) -->

   <target name="eventclient" depends="init">
       <exec dir="${src}" executable="${orb.script}">
           <arg
           line="${orb.runtime.naming}
           com.wiley.compbooks.brose.chapter11.event.PrintClient"/>
        </exec>
   </target>

   <!-- starts the print server (notification example) -->

   <target name="notificationserver" depends="init">
       <exec dir="${src}" executable="${orb.script}">
           <arg
           line="${orb.runtime.naming}
           com.wiley.compbooks.brose.chapter11.notification.PrintServer"/>
        </exec>
   </target>

   <!-- starts the print client (notification example) -->

   <target name="notificationclient" depends="init">
       <exec dir="${src}" executable="${orb.script}">
           <arg
           line="${orb.runtime.naming}
           com.wiley.compbooks.brose.chapter11.notification.PrintClient"/>
        </exec>
   </target>

  <target name="clean" depends="init">
       <delete dir="${classdir}/com/wiley/compbooks/brose/${name}"/>
       <delete dir="${classdir}/org"/>
       <delete dir="${idlout}/com" />
       <delete dir="${idlout}/org" />
   </target>



</project>





