<project name="tapestry" default="deploy">
    <target name="compile">
        <delete dir="bin\demo"/>
        <javac srcdir="src" destdir="bin">
             <classpath>
                 <fileset dir="lib" includes="*.jar"/>
             </classpath>
        </javac>
    </target>
	<target name="pack" depends="compile">
        <war warfile="test.war" webxml="web.xml">
            <classes dir="bin" includes="**/*.class"/>
            <lib dir="lib" includes="*.jar"/>
            <fileset dir="tml" includes="**/*.tml"/>
        </war>
	</target>
    <target name="deploy" depends="pack">
    	<exec executable="cmd" dir="C:\Apache\apache-tomcat-8.5.12\bin">
    	    <arg value="/c"/>
   	        <arg value="shutdown"/>
   	    </exec>
    	<sleep milliseconds="1000"/>
        <delete dir="C:\Apache\apache-tomcat-8.5.12\work" failonerror="false"/>
        <delete dir="C:\Apache\apache-tomcat-8.5.12\webapps\test" failonerror="false"/>
        <copy file="test.war" todir="/Apache/apache-tomcat-8.5.12/webapps"/>
        <exec executable="cmd" dir="C:\Apache\apache-tomcat-8.5.12\bin">
            <arg value="/c"/>
            <arg value="startup"/>
        </exec>
	</target>
</project>