<!--
Copyright 2006 Nokia Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!--
Created by: Ferenc Dosa Racz
-->
<project name="gw" default="build" basedir=".">
<!-- properties defined in this file will override the ones
defaulted here
-->
<property file="build.properties"/>
<property file="gw.build.properties"/>
<property name="catalina.home" value="cf gw.build.properties"/>
<property name="util.home" value="util"/>
<property name="db.home" value="db"/>
<property name="gwdb.home" value="gwdb"/>
<property name="iapi.home" value="iapi"/>
<property name="connector.server.home" value="connector/server"/>
<property name="connector.client.home" value="connector/client"/>
<property name="valve.home" value="valve"/>
<property name="funcsystest.home" value="funcsystest"/>
<property name="httpclient.home" value="httpclient"/>
<property name="webutil.home" value="webutil"/>
<property name="webapps.test.home" value="webapps/test"/>
<property name="webapps.musers.home" value="webapps/musers"/>
<property name="webapps.oos.home" value="webapps/oos"/>
<property name="webapps.props.home" value="webapps/props"/>
<property name="webapps.systest.home" value="webapps/systest"/>
<property name="webapps.admin.home" value="webapps/admin"/>
<property name="webapps.account.home" value="webapps/account"/>
<property name="webapps.hits.home" value="webapps/hits"/>
<property name="webapps.messenger.home" value="webapps/messenger"/>
<target name="check"
description="Checks if *.orig files have been customized">
<available file="gw.build.properties"
property="gw.build.properties.exists"/>
<fail message="You don't have a customized gw.build.properties.">
<condition>
<not>
<isset property="gw.build.properties.exists"/>
</not>
</condition>
</fail>
</target>
<target name="brief"
description="Gives a short overall description of this build file.">
<echo>
This build file is ment mainly for daily development. For
installation, it is recommended to build and test the components
separattely, and manual installation is required in many case.
However, one can use this build file to get a clue what to install
where - to some extent.
</echo>
</target>
<target name="cleancore"
description="Cleans gw core libraries">
<ant antfile="build.xml"
dir="${util.home}"
target="clean"/>
<ant antfile="build.xml"
dir="${db.home}"
target="clean"/>
<ant antfile="build.xml"
dir="${gwdb.home}"
target="clean"/>
<ant antfile="build.xml"
dir="${iapi.home}"
target="clean"/>
<ant antfile="build.xml"
dir="${connector.server.home}"
target="clean"/>
<ant antfile="build.xml"
dir="${connector.client.home}"
target="clean"/>
<ant antfile="build.xml"
dir="${valve.home}"
target="clean"/>
<ant antfile="build.xml"
dir="${funcsystest.home}"
target="clean"/>
</target>
<target name="cleanwebapps"
description="Cleans webapps">
<ant antfile="build.xml"
dir="${webutil.home}"
target="clean"/>
<ant antfile="build.xml"
dir="${httpclient.home}"
target="clean"/>
<ant antfile="build.xml"
dir="${webapps.test.home}"
target="clean"/>
<ant antfile="build.xml"
dir="${webapps.musers.home}"
target="clean"/>
<ant antfile="build.xml"
dir="${webapps.oos.home}"
target="clean"/>
<ant antfile="build.xml"
dir="${webapps.props.home}"
target="clean"/>
<ant antfile="build.xml"
dir="${webapps.systest.home}"
target="clean"/>
<ant antfile="build.xml"
dir="${webapps.admin.home}"
target="clean"/>
<ant antfile="build.xml"
dir="${webapps.account.home}"
target="clean"/>
<ant antfile="build.xml"
dir="${webapps.hits.home}"
target="clean"/>
<ant antfile="build.xml"
dir="${webapps.messenger.home}"
target="clean"/>
</target>
<target name="cleanall"
description="Cleans all (gw core libs and webapps)"
depends="cleancore,cleanwebapps">
</target>
<target name="buildcore"
description="Builds gw core libraries"
depends="check">
<ant antfile="build.xml"
dir="${util.home}"
target="jar"
inheritAll="false"/>
<ant antfile="build.xml"
dir="${db.home}"
target="jar"
inheritAll="false"/>
<ant antfile="build.xml"
dir="${gwdb.home}"
target="jar"
inheritAll="false"/>
<ant antfile="build.xml"
dir="${iapi.home}"
target="jar"
inheritAll="false"/>
<ant antfile="build.xml"
dir="${connector.server.home}"
target="jar"
inheritAll="false"/>
<ant antfile="build.xml"
dir="${connector.client.home}"
target="jar"
inheritAll="false"/>
<ant antfile="build.xml"
dir="${valve.home}"
target="jar"
inheritAll="false"/>
<ant antfile="build.xml"
dir="${funcsystest.home}"
target="jar"
inheritAll="false"/>
</target>
<target name="buildwebapps"
description="Builds webapps"
depends="check,buildcore">
<ant antfile="build.xml"
dir="${webutil.home}"
target="jar"
inheritAll="false"/>
<ant antfile="build.xml"
dir="${httpclient.home}"
target="jar"
inheritAll="false"/>
<ant antfile="build.xml"
dir="${webapps.test.home}"
target="compile"
inheritAll="false"/>
<ant antfile="build.xml"
dir="${webapps.musers.home}"
target="compile"
inheritAll="false"/>
<ant antfile="build.xml"
dir="${webapps.oos.home}"
target="compile"
inheritAll="false"/>
<ant antfile="build.xml"
dir="${webapps.props.home}"
target="compile"
inheritAll="false"/>
<ant antfile="build.xml"
dir="${webapps.systest.home}"
target="compile"
inheritAll="false"/>
<ant antfile="build.xml"
dir="${webapps.admin.home}"
target="compile"
inheritAll="false"/>
<ant antfile="build.xml"
dir="${webapps.account.home}"
target="compile"
inheritAll="false"/>
<ant antfile="build.xml"
dir="${webapps.hits.home}"
target="compile"
inheritAll="false"/>
<ant antfile="build.xml"
dir="${webapps.messenger.home}"
target="compile"
inheritAll="false"/>
</target>
<target name="build"
description="Default target, does exactly the same as buildcore"
depends="buildall">
</target>
<target name="buildall"
description="Builds all (gw core libs and webapps)"
depends="buildcore,buildwebapps">
</target>
<target name="rebuildcore"
description="Rebuilds gw core libraries"
depends="cleancore,buildcore">
</target>
<target name="rebuildwebapps"
description="Rebuilds webapps"
depends="cleanwebapps,buildwebapps">
</target>
<target name="rebuildall"
description="Rebuilds all (gw core libs and webapps)"
depends="rebuildcore,rebuildwebapps">
</target>
<target name="installcorelibs"
description="Installs gw core libraries to tomcat5"
depends="buildcore">
<copy file="${mws.util.jar}"
todir="${catalina.home}/common/lib"/>
<copy file="${mws.db.jar}"
todir="${catalina.home}/common/lib"/>
<copy file="${mws.gwdb.jar}"
todir="${catalina.home}/common/lib"/>
<copy file="${mws.iapi.jar}"
todir="${catalina.home}/common/lib"/>
<copy file="${mws.connector.server.jar}"
todir="${catalina.home}/server/lib"/>
<copy file="${mws.valve.jar}"
todir="${catalina.home}/server/lib"/>
<echo>
Copied these JARs to ${catalina.home}/common/lib:
o mws-util.jar
o mws-db.jar
o mws-gwdb.jar
o mws-iapi.jar
Copied these JARs to ${catalina.home}/server/lib:
o mws-connector-server.jar
o mws-valve.jar
NOTE
Remember, that the mysql connector (JDBC driver for mysql) JAR
must be in ${catalina.home}/common/lib.
Remember, that the created mws-gw-db.cfg (see ${db.home}/bin/dbmgr.sh)
must be in the ${catalina.home}/bin directory. Every time you change
GW DB (or it's settings, you'd better copy the new mws-gw-db.cfg
to that place).
Remember, that only (common and server) libraries were copied
to tomcat, web apps were not. Most of those need manual configuration
and installation.
Please (re)start tomcat.
</echo>
</target>
<target name="installcorewebapps"
description="Deploys essential webapps to tomcat5 (oos, props)"
depends="buildwebapps">
<ant antfile="build.xml"
dir="${webapps.oos.home}"
target="install"
inheritAll="false"/>
<ant antfile="build.xml"
dir="${webapps.props.home}"
target="install"
inheritAll="false"/>
<echo>
Deployed the two most important webapp to tomcat5
o webapps/oos to context /mws-oos,
o webapps/props to context /mws-props.
</echo>
</target>
</project>