<!-- Copyright (c) 2002 by ObjectLearn. All Rights Reserved. -->
<project name="OBSH" basedir="." default="deploy" >
<!--add path to javac-->
<path id="project.class.path">
<pathelement path="WEB-INF/lib/*.jar" />
<pathelement path="WEB-INF/classes/" />
<pathelement path="C://Sun//AppServer//lib//j2ee.jar" />//Put them in if you don't wanna to use the “Build“ in eclipse
<pathelement path="C://Program Files//jakarta-struts-1.1//jakarta-struts-1.1//lib//struts.jar" />
<pathelement path="${classpath}" />
<pathelement path="C://eclipse-SDK-3.0M6-win32//eclipse//workspace//OBSH//bin" />
</path>
<!--initProperties-->
<target name="initProperties" description="loading the build.properties">
<property file="build.properties"/>
</target>
<!--init-->
<target name="init" depends="initProperties" description="init the values">
<property name="deploy.dir" value="${deploy.dir}" />
<property name="dist.name" value="OBSH" />
</target>
<!-- Adds the time and minimize the time.-->
<target name="prepare" description="add the time stamp">
<tstamp/>
</target>
<!-- Copy the resources to the class -->
<target name="resources" description="copy the resources">
<copy todir="./classes/resources">
<fileset dir="./src/resources">
<include name="*.*" />
</fileset>
</copy>
</target>
<!-- Compile the src file -->
<target name="compile" depends="prepare,init" description="compiling the source file">
<javac srcdir="src" destdir="classes">
<classpath refid="project.class.path"/>
</javac>
</target>
<!-- clean work -->
<target name="clean" description="clean the /classes" depends="deploy">
<delete dir="classes"/>
<mkdir dir="classes"/>
</target>
<!-- create the war file-->
<target name="war" description="creat the war" depends="compile,resources">
<delete dir="./dist"/>
<mkdir dir="./dist"/>
<war warfile="./dist/${dist.name}.war"
webxml="../WEB-INF/web.xml"
manifest="../META-INF/MANIFEST.MF">
<fileset dir="../">
<exclude name="WEB-INF/src/**/*.*" />
<exclude name="WEB-INF/web.xml" />
</fileset>
</war>
</target>
<!-- create the jar file -->
<target name="jar" description="create an ear file" depends="war">
<jar jarfile="./dist/${dist.name}.jar" >
<fileset dir="${project.dir}/${bin.dir}">
<include name="**/*.*"/>
<exclude name="vincent/TestClient/**/*.*" />
</fileset>
<fileset dir="${project.dir}/BeanBoxes">
<include name="META-INF/**/*.*"/>
<exclude name="META-INF/beans.xml"/>
<exclude name="META-INF/build.xml"/>
<exclude name="META-INF/deploy.xml"/>
<exclude name="META-INF/undeploy.xml"/>
<exclude name="META-INF/build.properties"/>
<exclude name="META-INF/ejbs.xml"/>
<exclude name="META-INF/xdoclet.xml"/>
<exclude name="META-INF/servers.xml"/>
<exclude name="META-INF/targets.xml"/>
</fileset>
</jar>
</target>
<!--create the ear file-->
<target name="ear" description="create an ear file" depends="jar">
<delete dir="./ear" />
<mkdir dir="./ear" />
<ear destfile="./ear/${dist.name}.ear"
appxml="../META-INF/application.xml">
<fileset dir="./dist" includes="*.jar,*.war" />
</ear>
</target>
<!--deploy on the JBoss-->
<target name="deploy" description="deploy on the JBoss" depends="ear">
<copy todir="${deploy.dir}"
file="./ear/${dist.name}.ear"
/>
<delete dir="./dist" />
<delete dir="./ear" />
</target>
</project>