<project name="struts1upd" default="deploy">
    <target name="compile">
        <delete dir="bin\demo"/>
        <javac srcdir="src" destdir="bin" classpath="lib\struts-core-1.3.10.jar;lib\commons-beanutils-1.8.0.jar;C:\Apache\apache-tomcat-8.5.12\lib\servlet-api.jar"/>
    </target>
	<target name="pack" depends="compile">
        <war warfile="test.war" webxml="web.xml">
            <classes dir="bin" includes="**/*.class"/>
            <fileset dir="jsp" includes="*.jsp"/>
            <lib dir="lib"/>
            <webinf dir="." includes="struts-config.xml"/>
        </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>