<project name="jcademo" default="deploy">
	<target name="pack">
        <jar destfile="/work/test.jar">
            <fileset dir="bin" includes="jcademo/domain/*.class"/>
        </jar>
        <jar destfile="/work/test-ejb.jar">
            <fileset dir="bin" includes="jcademo/ejb/*.class"/>
            <metainf dir="." includes="jboss-ejb3.xml"/>
        </jar>
		<war warfile="/work/test.war" webxml="web.xml">
		    <classes dir="bin" includes="jcademo/web/*.class"/>
		</war>
        <jar destfile="/work/udp.jar">
            <fileset dir="bin" includes="jcademo/rainbound/udp/*.class"/>
        </jar>
        <jar destfile="/work/test-udp.rar">
            <fileset dir="/work" includes="udp.jar"/>
            <metainf dir="udp" includes="ra.xml"/>
        </jar>
            <jar destfile="/work/tcp.jar">
                <fileset dir="bin" includes="jcademo/rainbound/tcp/*.class"/>
            </jar>
            <jar destfile="/work/test-tcp.rar">
                <fileset dir="/work" includes="tcp.jar"/>
                <metainf dir="tcp" includes="ra.xml"/>
            </jar>
            <jar destfile="/work/multcp.jar">
                <fileset dir="bin" includes="jcademo/rainbound/multcp/*.class"/>
            </jar>
            <jar destfile="/work/test-multcp.rar">
                <fileset dir="/work" includes="multcp.jar"/>
                <metainf dir="multcp" includes="ra.xml"/>
            </jar>
            <jar destfile="/work/permtcp.jar">
                <fileset dir="bin" includes="jcademo/rainbound/permtcp/*.class"/>
            </jar>
            <jar destfile="/work/test-permtcp.rar">
                <fileset dir="/work" includes="permtcp.jar"/>
                <metainf dir="permtcp" includes="ra.xml"/>
            </jar>
        <ear destfile="/work/test.ear" appxml="application.xml">
            <fileset dir="/work" includes="test-ejb.jar,test.war,test-udp.rar,test-tcp.rar,test-multcp.rar,test-permtcp.rar"/>
            <zipfileset prefix="lib" file="/work/test.jar"/>
        </ear>
	</target>
    <target name="deploy" depends="pack">
    	<copy file="/work/test.ear" todir="/JBoss/wildfly-10.1.0.Final/standalone/deployments"/>
	</target>
</project>