<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project basedir="." default="build" name="BAPWeb">
    <property environment="env"/>
    <property name="WEBLOGIC_HOME.location" value="/weblogic/Oracle14120-21/MiddleWare/Oracle_Home" />
	<!-- <property name="WEBLOGIC_HOME.location" value="C:\Oracle\Middleware\Oracle_Home"/>	 -->
    <property name="debuglevel" value="source,lines,vars"/>
    <property name="target" value="1.8"/>
    <property name="source" value="1.8"/>
	<property name="BAPRMSClient.location" value="../BAPRMSClient"/>
	
    <path id="WebApp.Libraries">
    	<fileset dir="WebContent/WEB-INF/lib/" includes="*.jar"/>
    	<fileset dir="${BAPRMSClient.location}/.deploy" includes="BAPRMSClient.jar"/>
    </path>

    <!--path id="Servlet.Libraries">
    	<fileset dir="../COMWeb/module-build/" includes="*.jar"/>
    </path-->
    <path id="WebLogic System Libraries.libraryclasspath">
    	<fileset dir="${WEBLOGIC_HOME.location}/wlserver/server/lib/" includes="*.jar"/>
    	<fileset dir="${WEBLOGIC_HOME.location}/oracle_common/modules/" includes="*.jar"/>
    	<fileset dir="${WEBLOGIC_HOME.location}/wlserver/modules/" includes="*.jar"/>
    	
       <!-- <pathelement location="${WEBLOGIC_HOME.location}/wlserver/server/lib/api.jar"/>
        <pathelement location="${WEBLOGIC_HOME.location}/wlserver/modules/org.glassfish.web.javax.servlet.jsp.jstl.jar"/>
        <pathelement location="${WEBLOGIC_HOME.location}/oracle_common/modules/javax.annotation_1.2.0.0_1-1.jar"/>
        <pathelement location="${WEBLOGIC_HOME.location}/oracle_common/modules/javax.ejb_3.3.0.jar"/>
        <pathelement location="${WEBLOGIC_HOME.location}/wlserver/modules/javax.enterprise.deploy_1.4.jar"/>
        <pathelement location="${WEBLOGIC_HOME.location}/wlserver/modules/javax.enterprise.inject_1.2.jar"/>
        <pathelement location="${WEBLOGIC_HOME.location}/wlserver/modules/javax.interceptor_1.3.jar"/>
        <pathelement location="${WEBLOGIC_HOME.location}/wlserver/modules/javax.jdo_2.0.4.jar"/>
        <pathelement location="${WEBLOGIC_HOME.location}/oracle_common/modules/javax.jms_1.1.4.jar"/>
        <pathelement location="${WEBLOGIC_HOME.location}/wlserver/modules/glassfish.jsf_2.0.0.0_2-1-20.jar"/>
        <pathelement location="${WEBLOGIC_HOME.location}/oracle_common/modules/javax.jsp_4.0.0.0_2-2.jar"/>
        <pathelement location="${WEBLOGIC_HOME.location}/oracle_common/modules/javax.mail_2.0.0.0_1-4-4.jar"/>
        <pathelement location="${WEBLOGIC_HOME.location}/oracle_common/modules/javax.management.j2ee_1.2.0.0.jar"/>
        <pathelement location="${WEBLOGIC_HOME.location}/oracle_common/modules/javax.persistence_2.0.0.0_2-0.jar"/>
        <pathelement location="${WEBLOGIC_HOME.location}/wlserver/modules/javax.resource_1.7.0.jar"/>
        <pathelement location="${WEBLOGIC_HOME.location}/wlserver/modules/javax.security.auth.message_2.2.jar"/>
        <pathelement location="${WEBLOGIC_HOME.location}/wlserver/modules/javax.security.jacc_1.2.0.0_1-1.jar"/>
        <pathelement location="${WEBLOGIC_HOME.location}/oracle_common/modules/javax.servlet_2.2.0.0_3-0.jar"/>
        <pathelement location="${WEBLOGIC_HOME.location}/wlserver/modules/javax.transaction_2.2.0.0_1-1.jar"/>
        <pathelement location="${WEBLOGIC_HOME.location}/wlserver/modules/javax.validation_1.2.0.jar"/>
        <pathelement location="${WEBLOGIC_HOME.location}/oracle_common/modules/javax.xml.bind_1.0.0.0_2-2-3.jar"/>
        <pathelement location="${WEBLOGIC_HOME.location}/wlserver/modules/javax.xml.registry_1.2.0.0_1-0-4.jar"/>
        <pathelement location="${WEBLOGIC_HOME.location}/oracle_common/modules/jaxrpc-api-1.1.jar"/>
        <pathelement location="${WEBLOGIC_HOME.location}/oracle_common/modules/javax.xml.ws_1.0.0.0_2-2.jar"/>
        <pathelement location="${WEBLOGIC_HOME.location}/wlserver/modules/javax.websocket_1.0.0.0.jar"/>
        <pathelement location="${WEBLOGIC_HOME.location}/wlserver/modules/javax.json_1.0.0.0_1-0.jar"/>
        <pathelement location="${WEBLOGIC_HOME.location}/wlserver/server/lib/wls-api.jar"/> -->
    </path>
    <path id="BAPWeb.classpath">
        <pathelement location="build/classes"/>
        <path refid="WebApp.Libraries"/>
    	<path refid="WebLogic System Libraries.libraryclasspath"/>
    </path>
    <target name="init">
        <mkdir dir="build/classes"/>
        <copy includeemptydirs="false" todir="build/classes">
            <fileset dir="src">
                <exclude name="**/*.java"/>
            </fileset>
        </copy>
    </target>
    <target name="clean">
        <delete dir="build/classes"/>
    </target>
    <target depends="clean" name="cleanall">
    </target>
    <target depends="build-project" name="build"/>
    <target name="build-subprojects">
    	<ant antfile="build-server.xml" dir="${BAPRMSClient.location}" inheritAll="false" target="archive">
            <propertyset>
                <propertyref name="build.compiler"/>
            </propertyset>
        </ant>
    </target>
    <target depends="init" name="build-project">
        <echo message="${ant.project.name}: ${ant.file}"/>
        <javac debug="true" debuglevel="${debuglevel}" destdir="build/classes" includeantruntime="false" source="${source}" target="${target}" encoding="utf-8">
            <src path="src"/>
            <classpath refid="BAPWeb.classpath"/>
        </javac>
    </target>
	<target depends="clean,build-subprojects,build-project" name="war" >
		<delete dir="dist"></delete>
		<mkdir dir="dist"></mkdir>
		<war jarfile="dist/BAPWeb.war" webxml="WebContent/WEB-INF/web.xml">
			<zipfileset dir="WebContent" >
				<include name="**/*.*"/>	
				<exclude name="WEB-INF/web.xml" />
				<exclude name="META-INF/context*.xml" />
			</zipfileset>
			<zipfileset dir="${BAPRMSClient.location}/.deploy" prefix="WEB-INF/lib" >
				<include name="BAPRMSClient.jar"/>	
			</zipfileset>
			<classes dir="build/classes" />
		</war>
		<tstamp>
		  <format property="EndTime" pattern="yyyy-MM-dd HH:mm:ss:sss zzz" />
		</tstamp>
		<echo>finished to make distribute files ${EndTime}</echo>
	</target>
</project>
