<project name="portaldemo" default="deploy">
	<target name="pack">
        <war warfile="/work/testjsf_std.war" webxml="std/web.xml">
            <classes dir="bin" includes="test/standard/*.class"/>
            <classes dir="resources" includes="*.properties"/>
            <fileset dir="jsp_std" includes="*.jsp"/>
            <fileset dir="facelet_std" includes="*.xhtml"/>
            <fileset dir="html" includes="*.html"/>
            <webinf dir="." includes="beans.xml"/>
            <webinf dir="std" includes="faces-config.xml"/>
            <metainf dir="." includes="Context.xml"/>
        </war>
        <war warfile="/work/testjsf_t.war" webxml="t/web.xml">
            <classes dir="bin" includes="test/tomahawk/*.class"/>
            <lib dir="/Apache/tomahawk20-1.1.14/lib" includes="tomahawk20*.jar,commons-*.jar"/>
            <fileset dir="jsp_t" includes="*.jsp"/>
            <fileset dir="facelet_t" includes="*.xhtml"/>
            <fileset dir="html" includes="*.html"/>
            <webinf dir="." includes="beans.xml"/>
            <webinf dir="t" includes="faces-config.xml"/>
            <metainf dir="." includes="Context.xml"/>
        </war>
        <war warfile="/work/testjsf_tr.war" webxml="tr/web.xml">
            <classes dir="bin" includes="test/trinidad/*.class"/>
            <lib dir="/Apache/trinidad-assembly-2.2.1/lib" includes="trinidad*.jar,commons-*.jar"/>
            <fileset dir="jsp_tr" includes="*.jsp"/>
            <fileset dir="facelet_tr" includes="*.xhtml"/>
            <fileset dir="html" includes="*.html"/>
            <webinf dir="." includes="beans.xml"/>
            <webinf dir="tr" includes="faces-config.xml"/>
            <metainf dir="." includes="Context.xml"/>
        </war>
        <war warfile="/work/testjsf_rich.war" webxml="rich/web.xml">
            <classes dir="bin" includes="test/richfaces/*.class"/>
            <lib dir="/JBoss/richfaces-distribution-4.5.17.Final" includes="richfaces*Final.jar"/>
            <lib dir="/JBoss/richfaces-distribution-4.5.17.Final/lib" includes="*.jar"/>
            <fileset dir="facelet_rich" includes="*.xhtml"/>
            <fileset dir="html" includes="*.html"/>
            <webinf dir="." includes="beans.xml"/>
            <webinf dir="rich" includes="faces-config.xml"/>
            <metainf dir="." includes="Context.xml"/>
        </war>
        <war warfile="/work/testjsf_cust.war" webxml="cust/web.xml">
            <classes dir="bin" includes="test/custom/*.class"/>
            <fileset dir="jsp_cust" includes="*.jsp"/>
            <fileset dir="facelet_cust" includes="*.xhtml"/>
            <fileset dir="html" includes="*.html"/>
            <webinf dir="." includes="beans.xml"/>
            <webinf dir="cust" includes="faces-config.xml,cust.tld"/>
            <metainf dir="." includes="Context.xml"/>
            <fileset dir="." includes="resources/*/*.xhtml"/>
        </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="500"/>
        <delete dir="C:\Apache\apache-tomcat-8.5.12\work" failonerror="false"/>
        <delete dir="C:\Apache\apache-tomcat-8.5.12\webapps\testjsf_std" failonerror="false"/>
        <delete dir="C:\Apache\apache-tomcat-8.5.12\webapps\testjsf_t" failonerror="false"/>
        <delete dir="C:\Apache\apache-tomcat-8.5.12\webapps\testjsf_tr" failonerror="false"/>
        <delete dir="C:\Apache\apache-tomcat-8.5.12\webapps\testjsf_rich" failonerror="false"/>
        <delete dir="C:\Apache\apache-tomcat-8.5.12\webapps\testjsf_cust" failonerror="false"/>
        <copy file="/work/testjsf_std.war" todir="/Apache/apache-tomcat-8.5.12/webapps"/>
        <copy file="/work/testjsf_t.war" todir="/Apache/apache-tomcat-8.5.12/webapps"/>
        <copy file="/work/testjsf_tr.war" todir="/Apache/apache-tomcat-8.5.12/webapps"/>
        <copy file="/work/testjsf_rich.war" todir="/Apache/apache-tomcat-8.5.12/webapps"/>
        <copy file="/work/testjsf_cust.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>