<?xml version="1.0" encoding="UTF-8" ?>
<!-- main build script -->
<project name="rpm" default="help" basedir=".">
<!-- setup all variables required for build -->
<!-- environment -->
<property environment="env"/>
<property name="java.home" value="${env.JAVA_HOME}"/>
<property name="work.dir" value="${env.WORK_DIR}"/>
<property name="jboss.home" value="${env.JBOSS_HOME}"/>
<property name="build.dir" value="${env.OUT_DIR}"/>
<!-- local variables -->
<property name="lib.path" value="${work.dir}/Lib"/>
<property name="rpm.properties.path" value="${work.dir}/Lib/rpm/props"/>
<property name="dir.prefix" value="com/cadmus/rpm"/>
<property name="server.dir" value="${work.dir}/Server"/>
<property name="domain.dir" value="${work.dir}/Domain"/>
<property name="client.dir" value="${work.dir}/Client"/>
<property name="model.dir" value="${domain.dir}/${dir.prefix}/domain/model"/>
<property name="server.jar" value="rpm_server.jar"/>
<property name="domain.jar" value="rpm_domain.jar"/>
<property name="server.rel.jar" value="rpm_server.jar"/>
<property name="PollerStartup.jar" value="PollerService.jar"/>
<!-- added for deploying into
JBoss -->
<property name="deploy.dir" value="${jboss.home}/server/default/deploy"/>
<!-- Added to pickup the files from Server and Domain dirs in rpmjars folder -->
<property name="server.dest" value="${build.dir}/Server"/>
<property name="domain.dest" value="${build.dir}/Domain"/>
<!-- ProcessManager File's Path -->
<!--
Please add the Process Manager Deployment Descriptors in the Server DD
-->
<property name="processMgr.path" value="${work.dir}/Lib/processmanager/src"/>
<!-- Property Added by Saroj for the no. of jar -->
<property name="X" value="1"/>
<!--************************************
build targets
****************************************-->
<!-- target to generate code -->
<target name="gen.code">
<ant antfile="codegen.xml" target="gen.code"/>
</target>
<!-- target to build server code -->
<target name="build.server">
<ant antfile="server.xml" target="compile.server"/>
<ant antfile="server.xml" target="package.server"/>
</target>
<!-- target to build domain code -->
<target name="build.domain">
<ant antfile="domain.xml" target="compile.domain"/>
<ant antfile="domain.xml" target="compile.processMgr"/>
<ant antfile="domain.xml" target="package.domain"/>
</target>
<!-- target to deploy all source code modules -->
<!-- CURRENTLY UNSUPPORTED - NEED TO ENHANCE -->
<target name="deploy.jars" description="deploys all jars.">
<echo message="*******************************"/>
<echo message="Deployment to be done manually."/>
<echo message="*******************************"/>
<!--
<ant antfile="server.xml" target="deploy.server"/>
<ant antfile="domain.xml" target="deploy.domain"/>
-->
</target>
<!-- target to undeploy all source code modules -->
<!-- CURRENTLY UNSUPPORTED - NEED TO ENHANCE -->
<target name="undeploy.jars" description="undeploys all jars.">
<echo message="Undeploying..."/>
<ant antfile="server.xml" target="undeploy.server"/>
<ant antfile="domain.xml" target="undeploy.domain"/>
</target>
<!--************************************
Batch Targets
****************************************-->
<!-- targets to clean up -->
<target name="clean">
<echo message="cleaning up previous build..."/>
<ant antfile="codegen.xml" target="clean.codegen"/>
<ant antfile="server.xml" target="clean.server"/>
<ant antfile="domain.xml" target="clean.domain"/>
<delete file="${build.dir}/${server.rel.jar}"/>
</target>
<!-- target to generate code -->
<target name="generate" description="generates code.">
<antcall target="gen.code"/>
</target>
<!-- target to build all source code modules -->
<target name="build.code" description="compiles all sources.">
<echo message="Building code..."/>
<antcall target="build.server"/>
<antcall target="build.domain"/>
</target>
<!-- target to build the jar for Poller Service Startup -->
<target name="build.pollerstartup" description="compiles poller startup sources.">
<echo message="Building poller startup code..."/>
<jar jarfile ="${build.dir}/PollerService.jar"
basedir="${build.dir}/Server"
includes="com/cadmus/rpm/domain/poller/PollerServiceStartup*.class"/>
</target>
<!-- target to recompile all source code modules -->
<target name="recompile" depends="clean">
<antcall target="compile"/>
</target>
<!-- target to help in releasing server jars -->
<target name="release.jar">
<tstamp>
<format property="time.stamp" pattern="yyyy_MM_dd" locale="en"/>
</tstamp>
<!--
CHANGE NOTE: Now all files are being compiled in OUT_DIR\Server.
Jar is being made using this directory.
This directory should contain the latest deployment
descriptors.
Domain directory has become USELESS.
<jar jarfile="${build.dir}/${server.rel.jar}_${time.stamp}_${X}.jar">
-->
<jar jarfile="${build.dir}/${server.rel.jar}">
<fileset dir="${server.dest}"
includes="com/**,META-INF/**,**"/>
<!-- Commented for
testing <fileset dir="${rpm.properties.path}"
includes="*.*"/>
-->
<fileset dir="${rpm.properties.path}" >
<patternset>
<include name="*.*"/>
<exclude name="rpmserver.properties"/>
<exclude name="AdminEventConfig*.*"/>
<exclude name="oracle-service.xml"/>
<exclude name="properties-service.xml"/>
<exclude name="log4j.xml"/>
</patternset>
</fileset>
</jar>
<echo message="*********************************"/>
<echo message="Jars ready for release procedure."/>
<echo message="*********************************"/>
</target>
<!--************************************
Target to do it all!
****************************************-->
<!-- target to build -->
<target name="build" description="builds everything.">
<echo message="Building RPM..."/>
<antcall target="clean"/>
<antcall target="generate"/>
<antcall target="build.code"/>
</target>
<!-- target to build and release -->
<target name="build.rel" description="builds and prepares for
releasing jars">
<antcall target="build"/>
<antcall target="release.jar"/>
<antcall target="build.pollerstartup"/>
</target>
<!-- target to build Only Entity Beans -->
<target name="build.EB" description="builds Entity Bean Only">
<echo message="Building Only Entity Beans ..."/>
<ant antfile="domain.xml" target="build.EB"/>
</target>
<!-- target to build Only Models -->
<target name="build.models" description="builds Models Only">
<echo message="Building Only Models..."/>
<ant antfile="domain.xml" target="build.models"/>
</target>
<!-- target to build Domain except Models -->
<target name="build.others" description="builds Domain Others Only">
<echo message="Building Only Models..."/>
<ant antfile="domain.xml" target="build.others"/>
<ant antfile="domain.xml" target="compile.processMgr"/>
</target>
<!-- target to build System Integration -->
<target name="build.si" description="builds System Integration Only">
<echo message="Building System Integration ..."/>
<ant antfile="domain.xml" target="build.si"/>
</target>
<!-- target to build Actions package -->
<target name="build.actions" description="builds Actions Package Only">
<echo message="Building Actions Package ..."/>
<ant antfile="domain.xml" target="build.actions"/>
</target>
<!-- target to build Common package -->
<target name="build.common" description="builds Common Package Only">
<echo message="Building Common Package ..."/>
<ant antfile="domain.xml" target="build.common"/>
</target>
<!-- target to build Comparators package -->
<target name="build.comp" description="builds Comparators Package Only">
<echo message="Building Comparators Package ..."/>
<ant antfile="domain.xml" target="build.comp"/>
</target>
<!-- target to build Custom package -->
<target name="build.custom" description="builds Custom Package Only">
<echo message="Building Custom Package ..."/>
<ant antfile="domain.xml" target="build.custom"/>
</target>
<!-- target to build Exception package -->
<target name="build.excep" description="builds exception Package Only">
<echo message="Building Exception Package ..."/>
<ant antfile="domain.xml" target="build.excep"/>
</target>
<!-- target to build QueryParams package -->
<target name="build.query" description="builds QueryParams Package Only">
<echo message="Building QueryParams Package ..."/>
<ant antfile="domain.xml" target="build.query"/>
</target>
<!-- target to build Reports package -->
<target name="build.report" description="builds Reports Package Only">
<echo message="Building Reports Package ..."/>
<ant antfile="domain.xml" target="build.report"/>
</target>
<!-- target to build Session package -->
<target name="build.session" description="builds Session Package Only">
<echo message="Building Session Package ..."/>
<ant antfile="domain.xml" target="build.session"/>
</target>
<!-- target to build workflow package -->
<target name="build.workflow" description="builds Workflow Package Only">
<echo message="Building workflow Package ..."/>
<ant antfile="domain.xml" target="build.workflow"/>
</target>
<!-- target to build ProcessManager package -->
<target name="build.process" description="builds ProcessManager Package Only">
<echo message="Building ProcessManager Package ..."/>
<ant antfile="domain.xml" target="compile.processMgr"/>
</target>
<!-- target to deploy rpm_server.jar in Jboss -->
<target name="deploy.server" description="Deploys rpm_server.jar.">
<echo message="deploying rpm_server.jar"/>
<copy file="${build.dir}/${server.jar}"
todir="${jboss.home}/server/default/deploy"/>
</target>
<target name="build.war">
<echo message="Creating war ..........."/>
<ant antfile="releasebuild.xml" target="client.build"/>
</target>
<target name="build.protocol">
<echo message="Builing the protocol"/>
<ant antfile="protocol.xml" target="build.protocol"/>
</target>
<target name="build.rpm" description="builds and prepares for
releasing jars and war file">
<echo message="${jboss.home}
" />
<echo message="${work.dir}
" />
<echo message="${build.dir}
" />
<antcall target="build.protocol"/>
<antcall target="build"/>
<antcall target="release.jar"/>
<antcall target="build.pollerstartup"/>
<antcall target="copy.protocol"/>
<antcall target="build.war"/>
<antcall target="copy.server.properties"/>
<antcall target="copy.ui.properties"/>
<antcall target="build.307"/>
</target>
<target name="deploy" description="Deploys the rpm_server.jar to the JBOSS deploy directory and Places the rpm.war file
in the
tomcat webapps directory.">
<antcall target="deploy.server"/>
<antcall target="deploy.client"/>
</target>
<target name="deploy.client">
<echo message="Updating the rpm war to your tomcat webapps folder ..... "/>
<echo message="Cleaning rpm folder and rpm war .... "/>
<delete dir="${env.CATALINA_HOME}/webapps/rpm"/>
<delete>
<fileset dir="${env.CATALINA_HOME}/webapps">
<include name="rpm.war"/>
</fileset>
</delete>
<echo message="Copying the latest war to webapps directory ..."/>
<copy todir="${env.CATALINA_HOME}/webapps">
<fileset dir="${env.OUT_DIR}">
<include name="rpm.war"/>
</fileset>
</copy>
</target>
<target name="help">
<echo message="build.rpm Creates the rpm server and client code ready to be deployed. "/>
<echo message="build.domain Compiles the Domain packages for RPM server module."/>
<echo message="build.server Compiles the Server packages for RPM server module."/>
<echo message="release.jar Packages the Domain and Server Modules and creates a composite package for deployment."/>
<echo message="build.war Compiles and creates the Web interface modules for the RPM "/>
<echo message="deploy Deploys the RPM application"/>
</target>
<target name="copy.protocol">
<copy todir="${build.dir}">
<fileset dir="${lib.path}">
<include name="protocol.jar"/>
</fileset>
</copy>
</target>
<target name="copy.server.properties">
<copy todir="${build.dir}">
<fileset dir="${lib.path}/rpm/props">
<include name="rpmserver.properties"/>
</fileset>
</copy>
</target>
<target name="copy.ui.properties">
<copy todir="${build.dir}">
<fileset dir="${work.dir}/Client/config">
<include name="rpmui.properties"/>
</fileset>
</copy>
</target>
<!-- target to deploy rpm_server.jar in Jboss -->
<target name="build.307" description="Build RPM for integrated version">
<ant antfile="deploy.xml" target="build.307"/>
</target>
<target name="deploy.307" description="Deploy RPM in integrated version">
<ant antfile="deploy.xml" target="deploy.307"/>
</target>
<!-- target to deploy the JAVADOC file -->
<target name="javadoc" description="Generate Javadocs">
<ant antfile="build_javadocs.xml" target="javadocs"/>
</target>
</project>