OpenNMS Ant Build

<?xml version="1.0"?>

<!--========================================================

$Id: build.xml 5175 2006-11-19 01:20:21Z djgregor $

Build file for OpenNMS

Refactoring notes:

ELB - All targets that should be displayed require a description attribute.

ELB - All targets that should not be displayed require it's absence.

======================================================== -->

<project name="opennms" default="usage" basedir=".">

<description>

Build file for OpenNMS.

OpenNMS is a network monitoring system implemented in Java.

For more information consult the README file included in

your distribution.

</description>

<!-- overrride with site-specific settings (first proprety set wins) -->

<property file="build.properties"/>

<!-- versioning options -->

<property name="product.version" value="1.2.9"/>

<property name="product.release" value="0"/>

<property name="product.snapshot" value="true"/>

<property name="product.fullversion"

value="${product.version}-${product.release}"/>

<!-- build options -->

<!-- Warning: there are some internal ant properties named build.* -->

<!-- Note: build.dir needs to be a path relative to ${basedir}, and

the same thing might be the case for some properties that

contain build.dir -->

<property name="relative.build.dir" value="work"/>

<property name="build.dir" value="${basedir}/${relative.build.dir}"/>

<property name="build.castor.source.dir" value="${build.dir}/castor"/>

<property name="build.sablecc.source.dir" value="${build.dir}/sablecc"/>

<property name="build.docs.dir" value="${build.dir}/docs"/>

<property name="build.rpm.dir" value="${build.dir}/rpm"/>

<property name="build.filter.docs.dir" value="${build.dir}/docs.filter"/>

<property name="build.api.dir" value="${build.docs.dir}/javadoc"/>

<property name="build.classes.dir" value="${build.dir}/opennms/classes"/>

<property name="build.tests.dir" value="${build.dir}/opennms/tests"/>

<property name="build.jar.dir" value="${build.dir}/jar"/>

<property name="build.jicmp.dir" value="${build.dir}/jicmp"/>

<property name="build.jrrd.dir" value="${build.dir}/jrrd"/>

<property name="build.postgresql.dir" value="${build.dir}/postgresql"/>

<property name="build.release.dir" value="${build.dir}/releases"/>

<property name="build.postgresql.include.dir"

value="/usr/include/pgsql/server"/>

<property name="build.rrdtool.include.dir" value="/usr/include"/>

<property name="build.rrdtool.lib.dir" value="/usr/lib"/>

<property name="build.rrdtool.bin" value="/usr/bin/rrdtool"/>

<property name="database.name" value="opennms"/>

<property name="database.user" value="opennms"/>

<property name="database.password" value="opennms"/>

<!--compiler options-->

<property name="compiler.debug" value="true"/>

<property name="compiler.optimize" value="true"/>

<property name="compiler.verbose" value="false"/>

<!-- XXX This should be true, but will have to set it false for now -->

<property name="compiler.deprecation" value="false"/>

<!--source directories -->

<property name="source.dir" value="${basedir}/src"/>

<property name="core.source.dir" value="${source.dir}/core"/>

<property name="joesnmp.source.dir" value="${source.dir}/joesnmp"/>

<property name="postgresql.source.dir" value="${source.dir}/postgresql"/>

<property name="report.source.dir" value="${source.dir}/report"/>

<property name="services.source.dir" value="${source.dir}/services"/>

<property name="install.source.dir" value="${source.dir}/install"/>

<property name="web.source.dir" value="${source.dir}/web/src"/>

<!-- test results directory -->

<property name="test.xml.dir" value="${build.dir}/test-results" />

<property name="mock.logLevel" value="WARN" />

<property name="mock.debug" value="false" />

<property name="mock.rundbtests" value="false" />

<!-- docs source directory -->

<property name="docs.source.dir" value="${basedir}/docs"/>

<!--library directories-->

<!-- packaged libraries that are included in binary distributions -->

<property name="packaged.lib.dir" value="${basedir}/lib"/>

<!-- development libraries that are not included in binary distributions -->

<property name="dev.lib.dir" value="${basedir}/devlib"/>

<!-- castor specific -->

<property name="castor.xsd.dir" value="${basedir}/schema/xsd"/>

<property name="castor.config.dir"

value="${services.source.dir}/org/opennms/netmgt/config"/>

<property name="castor.typefactory" value="j2"/>

<!-- sablecc specific -->

<property name="sablecc.filter.dir" value="org/opennms/netmgt/filter"/>

<!-- relative directories for use in filesets and for install.dir -->

<property name="relative.install.dir" value="dist"/>

<!-- dist options and archive names -->

<property name="dist.source.archive.prefix"

value="${ant.project.name}-${product.version}-src"/>

<property name="dist.docs.archive.prefix"

value="${ant.project.name}-${product.version}-docs"/>

<!-- install directories -->

<!-- install.dir: the top directory into which to install OpenNMS -->

<property name="install.dir" value="${basedir}/${relative.install.dir}"/>

<property name="install.init.dir" value="${install.dir}/bin"/>

<property name="install.webapps.dir" value="${install.dir}/webapps" />

<property name="install.servlet.dir"

value="${install.webapps.dir}/opennms"/>

<property name="install.share.dir" value="${install.dir}/share"/>

<property name="install.bin.dir" value="${install.dir}/bin"/>

<property name="install.postgresql.dir" value="${install.dir}/lib"/>

<property name="install.contrib.dir" value="${install.dir}/contrib"/>

<property name="install.etc.dir" value="${install.dir}/etc"/>

<property name="install.logs.dir" value="${install.dir}/logs"/>

<property name="install.pid.file" value="${install.dir}/logs/opennms.pid"/>

<!-- install.prefix: a prefix used for installation in or chroot -->

<property name="install.prefix" value=""/>

<property name="install.postgresql.service" value="postgresql"/>

<property name="install.database.name" value="${database.name}"/>

<property name="install.database.user" value="${database.user}"/>

<property name="install.database.password" value="${database.password}"/>

<property name="install.database.driver" value="org.postgresql.Driver"/>

<!-- XXX why is compatible=7.1 being used?

It's not added here... see etc/opennms-database.xml and

src/web/etc/web.xml where @install.database.driver@ is used. -->

<property name="install.database.url"

value="jdbc:postgresql://localhost:5432/"/>

<property name="install.database.bindir"

value="/usr/bin"/>

<property name="install.rrdtool.bin" value="${build.rrdtool.bin}"/>

<property name="install.perl.bin" value="/usr/bin/perl"/>

<!-- rpm specific -->

<property name="rpm.install.dir" value="/opt/OpenNMS"/>

<property name="rpm.build.executable" value="rpmbuild"/>

<property name="rpm.build.docs" value="1"/>

<property name="rpm.sign" value="false"/>

<property name="rpm.buildtests" value="false"/>

<property name="rpm.database.name" value="opennms"/>

<property name="rpm.database.password" value="opennms"/>

<property name="rpm.database.user" value="opennms"/>

<property name="rpm.additional.args" value=""/>

<!-- jars that are referenced in multiple places -->

<property name="postgresql.jar" value="pg74.215.jdbc3.jar" />

<!-- paths -->

<path id="sources.java.path">

<pathelement path="${build.castor.source.dir}"/>

<pathelement path="${build.sablecc.source.dir}"/>

<pathelement path="${core.source.dir}"/>

<pathelement path="${joesnmp.source.dir}"/>

<pathelement path="${services.source.dir}"/>

<pathelement path="${web.source.dir}"/>

<pathelement path="${report.source.dir}"/>

<pathelement path="${install.source.dir}"/>

</path>

<!-- Classpath reference for <javac/> and <javadoc/> -->

<path id="libraries.java.path">

<pathelement path="${packaged.lib.dir}/log4j.jar"/>

<pathelement path="${packaged.lib.dir}/regexp120.jar"/>

<pathelement path="${packaged.lib.dir}/servlet.jar"/>

<pathelement path="${packaged.lib.dir}/ldap.jar"/>

<pathelement path="${packaged.lib.dir}/catalina.jar"/>

<pathelement path="${packaged.lib.dir}/castor-0.9.3.9.jar"/>

<pathelement path="${packaged.lib.dir}/fop0205.jar"/>

<pathelement path="${packaged.lib.dir}/avalon-framework-cvs-20020806.jar"/>

<pathelement path="${packaged.lib.dir}/batik.jar"/>

<pathelement path="${packaged.lib.dir}/mx4j-3.0.1.jar"/>

<pathelement path="${packaged.lib.dir}/jdhcp.jar"/>

<pathelement path="${packaged.lib.dir}/jcifs.jar"/>

<pathelement path="${packaged.lib.dir}/bsf220.jar"/>

<pathelement path="${packaged.lib.dir}/xerces201.jar"/>

<pathelement path="${packaged.lib.dir}/xmlrpc-1.2-b1.jar"/>

<pathelement path="${packaged.lib.dir}/jrobin-1.4.0.jar"/>

<pathelement path="${packaged.lib.dir}/mailapi.jar"/>

<pathelement path="${packaged.lib.dir}/smtp.jar"/>

<pathelement path="${packaged.lib.dir}/jradius-client.jar"/>

<pathelement path="${packaged.lib.dir}/smack.jar"/>

<pathelement path="${packaged.lib.dir}/smackx.jar"/>

<!-- <pathelement path="${packaged.lib.dir}/imap.jar"/> -->

<!-- <pathelement path="${packaged.lib.dir}/pop3.jar"/> -->

<pathelement path="${packaged.lib.dir}/activation.jar"/>

<pathelement path="${packaged.lib.dir}/jmta.jar"/>

<pathelement path="${packaged.lib.dir}/c3p0-0.9.0-pre5.jar"/>

<pathelement path="/System/Library/Java"/>

</path>

<!-- The jars listed for Class-Path in the MANIFEST.MF for the installer's

JAR file -->

<path id="install.manifest.jars">

<pathelement path="${packaged.lib.dir}/${postgresql.jar}"/>

</path>

<pathconvert refid="install.manifest.jars" pathsep=" "

property="install.manifest.classes">

<map from="${packaged.lib.dir}/" to=""/>

</pathconvert>

<!-- Libraries that are linked into Tomcat's server/lib directory from

WEB-INF/lib by the installer or by the RPM. These also need to be

in web.jars or one of the opennms_*.jar files so that the libraries

make it into WEB-INF/lib. See the "install.servlet" target to see

how things are copied into WEB-INF/lib. -->

<path id="tomcatlib.jars.path">

<pathelement path="${packaged.lib.dir}/log4j.jar"/>

<pathelement path="${packaged.lib.dir}/castor-0.9.3.9.jar"/>

<pathelement path="${packaged.lib.dir}/castor-0.9.3.9-xml.jar"/>

<pathelement path="${build.jar.dir}/opennms_core.jar"/>

<pathelement path="${build.jar.dir}/opennms_services.jar"/>

<pathelement path="${build.jar.dir}/opennms_web.jar"/>

<!-- These are the libraries that were in opennms.spec.in:

castor-0.9.3.9.jar \

log4j.jar \

opennms_common.jar \

opennms_core.jar \

opennms_services.jar \

opennms_web.jar \

-->

</path>

<pathconvert targetos="unix" refid="tomcatlib.jars.path"

property="install.tomcat.serverlibs">

<map from="${packaged.lib.dir}/" to=""/>

<map from="${build.jar.dir}/" to=""/>

</pathconvert>

<!-- patterns and sets -->

<!-- XXX not used -->

<!--

<patternset id="not.run">

<exclude name="nightly-build.pl"/>

<exclude name="*.bat"/>

</patternset>

-->

<!-- Files in ${packaged.lib.dir} that are copied into ${install.dir}/lib.

Note: everything in ${build.jar.dir} is also copied. -->

<patternset id="lib.jars">

<include name="*.jar" />

<exclude name="ant*.jar" />

<exclude name="fop0170.jar" />

<exclude name="fop0203.jar" />

<exclude name="avalon-framework-4.0.jar" />

<exclude name="jakarta-regexp*.jar" />

<exclude name="pylib*.jar" />

<exclude name="sablecc*.jar" />

</patternset>

<!-- Files in ${packaged.lib.dir} that are copied into

${install.servlet.dir}/WEB-INF/lib.

Note: opennms_*.jar from ${build.jar.dir} is also copied. -->

<patternset id="web.jars">

<include name="castor*.jar" />

<include name="fop0205.jar" />

<include name="jms*.jar" />

<include name="log4j*.jar" />

<include name="${postgresql.jar}" />

<include name="regexp*.jar" />

<include name="w3c*.jar" />

<!--- Remove this for 1.4 since it is included in the JVM

<include name="xalan231.jar" />

-->

<include name="avalon-framework-cvs-20020806.jar" />

<include name="logkit-1.0.jar" />

<include name="batik.jar" />

<include name="jcifs.jar" />

<include name="ldap.jar" />

<include name="jrobin*.jar" />

<include name="activation.jar" />

<include name="imap.jar" />

<include name="jmta.jar" />

<include name="mailapi.jar" />

<include name="pop3.jar" />

<include name="smtp.jar" />

<include name="c3p0-0.9.0-pre5.jar"/>

</patternset>

<!-- The includes in this patternset need to match the directories in

the <fop> tasks for the pdf.docs target, along with the common

directory. -->

<patternset id="doc.dirs">

<include name="common/**"/>

<include name="install/**"/>

<include name="releasenotes/**"/>

</patternset>

<patternset id="source.dirs">

<include name="**/*"/>

<include name="**/CVS/**"/>

<include name="${relative.build.dir}/**"/>

<exclude name="${relative.install.dir}/**"/>

</patternset>

<!-- ant tasks -->

margin: 0cm 0c

你可能感兴趣的:(Web,log4j,ant,PostgreSQL,cvs)