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