<?xml version="1.0"?>

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

  <!-- ==================================================== -->
  <!--             chapter 7 JacORB build file              -->
  <!-- ==================================================== -->


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

   <target name="all" depends="init,naming,printing">	
   </target>

   <target name="naming" depends="init,idl">
      <javac srcdir="${src}/naming"
	       destdir="${classdir}"
	       includes="generated/**/*.java"
	        />
   </target>

   <target name="xx" depends="init,idl">
      <javac srcdir="${src}"
	       destdir="${classdir}"
	       includes="generated/**/*.java"
	        />
   </target>


   <target name="idl" depends="init">
      <exec dir="${src}" executable="${orb.idlcompiler}">
           <arg line="${orb.idlcompiler.outflag} ${idlout}
           ${orb.idlcompiler.strictflag}
           ${orb.idlcompiler.includeflag}.
           ${orb.idlcompiler.includeflag}${includepath} ${src}/printing.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}/CosNaming.idl"/>
      </exec>  
   </target>

   <target name="tradingidl" 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}/CosTrading.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}/CosTradingRepos.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}/CosTradingDynamic.idl"/>
      </exec> 
   </target>


   <target name="printing" depends="init,idl,tradingidl">
      <javac srcdir="${src}"
	       destdir="${classdir}"
	       includes="generated/**/*.java,printing/**.java"
	        />
   </target>

   <!-- executes the naming client program -->

   <target name="namingclient" depends="init">
       <exec dir="${src}" executable="${orb.script}">
           <arg line="com.wiley.compbooks.brose.chapter7.naming.ContextLister"/>
        </exec>
   </target>

   <!-- executes the printer server program -->
   <!-- Note: this is just a simple example, and the way it     -->
   <!-- it is started here will cause problems on non-Unix OSes -->
   <!-- because of missing lpr/lpq commands                     -->

   <target name="printserver" depends="init">
       <exec dir="${src}" executable="${orb.script}">
           <arg
           line="com.wiley.compbooks.brose.chapter7.printing.PrinterServer
           lpr lpq HP 600 Main 2"/>
        </exec>
   </target>

   <!-- executes the printer client program -->

   <target name="printclient" depends="init">
       <exec dir="${src}" executable="${orb.script}">
           <arg
           line="com.wiley.compbooks.brose.chapter7.printing.PrintClient
           build.xml"/>
        </exec>
   </target>

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

</project>





