<project name="LogManager" default="compile" basedir=".">
<property file="build.properties" />
<property name="src.home" value='${basedir}/src' />
<property name="build.home" value='${basedir}/WebContent' />
<property name="conf.home" value='${basedir}/conf' />
<path id="compile.classpath">
<fileset dir="${build.home}/WEB-INF/lib">
<include name="*.jar" />
</fileset>
</path>
<!-- compile the project -->
<target name="compile" description="Compile Java sources">
<mkdir dir="${build.home}/WEB-INF/classes" />
<javac srcdir="${src.home}" destdir="${build.home}/WEB-INF/classes" source="1.5" target="1.5" debug="true" deprecation="false" optimize="true">
<classpath refid="compile.classpath" />
</javac>
<copy todir="${build.home}/WEB-INF/classes">
<fileset dir="${conf.home}" includes="*.*" />
<fileset dir="${src.home}" includes="**/*.xml" />
</copy>
</target>
<!-- deploy the project to tomcat webapps folder -->
<target name="deploy" depends="compile" description="Deploy the project">
<mkdir dir="${deploy.localhost}/${app.name}" />
<copy todir="${deploy.localhost}/${app.name}">
<fileset dir="${build.home}" includes="**/*.*" />
</copy>
</target>
<!-- start tomcat using ant command -->
<target name="tomcat.start">
<java jar="${tomcat.home}/bin/bootstrap.jar" fork="true">
<jvmarg value="-Dcatalina.home=${tomcat.home}" />
</java>
</target>
<!-- stop tomcat using ant command -->
<target name="tomcat.stop">
<java jar="${tomcat.home}/bin/bootstrap.jar" fork="true">
<jvmarg value="-Dcatalina.home=${tomcat.home}" />
<arg line="stop" />
</java>
</target>
<!-- using tomcat command to start tomcat and can debug the project -->
<target name="tomcat.debug">
<java jar="${tomcat.home}/bin/bootstrap.jar" fork="true">
<jvmarg value="-Dcatalina.home=${tomcat.home}" />
<jvmarg value="-Xdebug" />
<jvmarg value="-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n" />
</java>
</target>
</project>