build.xml
001 <project name="init ear" default="build">
002 
003   <property environment="env" />
004 
005   <property file="../medrec.properties"/>
006 
007   <property name="build.compiler" value="${compiler}" />
008 
009   <!-- this is the src directory out of which when combined with
010        the build directory is a wls formatted ear -->
011   <property name="srcdir" value="." />
012   <property name="mbeandir" value="../common/mbeans" />
013 
014   <!-- this is the build directory for the wls formatted ear -->
015   <property name="dest.dir" value="${init.ear.wlcompile.build.dir}" />
016 
017   <!-- This is an archived J2EE formatted ear, combining
018        the build and src elements of the medrec ear -->
019   <property name="ear.file" value="${init.ear.file}" />
020 
021   <!-- This is an exploded J2EE formatted ear, combining
022        the build and src elements of the medrec ear -->
023   <property name="ear.exploded.dir" value="${init.ear.exploded.dir}" />
024 
025   <!-- these all apply to the src and build directory for wls formatted ear -->
026   <property name="app-inf.dest.classes" value="${dest.dir}/APP-INF/classes"/>
027   <property name="app-inf.dest.lib" value="${dest.dir}/APP-INF/lib"/>
028 
029   <!-- user name and pass of WLS Server  -->
030   <property name="username" value="weblogic" />
031   <property name="password" value="weblogic" />
032 
033   <target name="banner">
034     <echo>+------------------------------------+</echo>
035     <echo>+        Building Init Ear           +</echo>
036     <echo>+------------------------------------+</echo>
037   </target>
038 
039   <target name="all" depends="clean, build" />
040   <target name="stage" depends="clean, build, exploded.ear" />
041   <target name="stage.prod" depends="clean, build, ear" />
042 
043   <target name="prepare">
044     <!--Setup the directories for the ear level -->
045     <mkdir dir="${app-inf.dest.classes}"/>
046     <mkdir dir="${app-inf.dest.lib}"/>
047   </target>
048   
049   <!-- builds entire application -->
050   <target name="build" depends="banner">
051     <wlcompile srcdir="${mbeandir}" destdir="${dest.dir}" classpath="${java.class.path};${log.classpath}">
052       <javac deprecation="${deprecation}" />
053       <javac debug="${debug}" debugLevel="${debugLevel}" />
054     </wlcompile>
055     <wlcompile srcdir="${srcdir}" destdir="${dest.dir}">
056       <javac deprecation="${deprecation}" />
057       <javac debug="${debug}" debugLevel="${debugLevel}" />
058     </wlcompile>
059     <wlappc source="${dest.dir}" />
060   </target>
061 
062   <!-- package the application as J2EE formatted archived .ear -->
063   <target name="ear">
064     <mkdir dir="${dist.dir}"/>
065     <wlpackage srcdir="${srcdir}" destdir="${dest.dir}"
066                toFile="${ear.file}" />
067   </target>
068 
069   <!-- package the application a J2EE formatted exploded ear -->
070   <target name="exploded.ear">
071     <wlpackage srcdir="${srcdir}" destdir="${dest.dir}"
072                toDir="${ear.exploded.dir}" />
073   </target>
074   
075   <!-- deploys entire application -->
076   <target name="deploy.init.ear"
077     description="Deploy build/init to WebLogic on ${wls.admin.server.host}:${wls.admin.server.port}.">
078     <!-- "url" is not required, but the default url is iiop://${wls.admin.server.host}:${wls.admin.server.port} -->
079     <wldeploy
080       user="${wls.username}"
081       password="${wls.password}"
082       adminurl="t3://${wls.admin.server.host}:${wls.admin.server.port}"
083       action="deploy"
084       name="${init.ear.display.name}"
085       source="${dest.dir}" />
086   </target>
087 
088   <target name="redeploy.init.ear"
089     description="Redeploy build/initEar to WebLogic on ${wls.admin.server.host}:${wls.admin.server.port}.">
090     <!-- "url" is not required, but the default url is iiop://${wls.admin.server.host}:${wls.admin.server.port} -->
091     <wldeploy
092       user="${wls.username}"
093       password="${wls.password}"
094       adminurl="t3://${wls.admin.server.host}:${wls.admin.server.port}"
095       action="redeploy"
096       name="${init.ear.display.name}"/>
097   </target>
098 
099   <target name="clean" depends="clean.ear,clean.exploded.ear,clean.prepare">
100     <delete dir="${dest.dir}" />
101   </target>
102   
103   <target name="clean.ear">
104     <delete file="${ear.file}"/>
105   </target>
106 
107   <target name="clean.exploded.ear">
108     <delete dir="${ear.exploded.dir}"/>
109   </target>
110 
111   <target name="clean.prepare">
112     <delete dir="${app-inf.dest.classes}"/>
113     <delete dir="${app-inf.dest.lib}"/>
114   </target>
115 
116 </project>