It seems all is working fine now, including the log4j JMX stuff in the default config ( adding the 'setName()' sovled the problems ) git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/logging/trunk@138889 13f79535-47bb-0310-9956-ffa450edef68
265 lines
9.6 KiB
XML
265 lines
9.6 KiB
XML
<project name="Logging" default="compile" basedir=".">
|
|
|
|
|
|
<!--
|
|
"Logging" component of the Jakarta Commons Subproject
|
|
$Id: build.xml,v 1.16 2002/06/07 20:22:29 costin Exp $
|
|
-->
|
|
|
|
|
|
<!-- ========== Initialize Properties ===================================== -->
|
|
|
|
|
|
<property file="build.properties"/> <!-- Component local -->
|
|
<property file="../build.properties"/> <!-- Commons local -->
|
|
<property file="${user.home}/build.properties"/> <!-- User local -->
|
|
|
|
|
|
<!-- ========== External Dependencies ===================================== -->
|
|
|
|
|
|
<!-- The directories corresponding to your necessary dependencies -->
|
|
<property name="junit.home" value="/usr/local/junit3.5"/>
|
|
<property name="jakarta.home" value="../.."/>
|
|
|
|
|
|
<!-- ========== Derived Values ============================================ -->
|
|
|
|
|
|
<!-- The locations of necessary jar files -->
|
|
<property name="junit.jar" value="${junit.home}/junit.jar"/>
|
|
<property name="log4j.jar" value="${jakarta.home}/jakarta-log4j/dist/lib/log4j.jar"/>
|
|
<property name="logkit.jar" value="${jakarta.home}/jakarta-avalon-logkit/build/log/logkit"/>
|
|
|
|
|
|
<!-- ========== Component Declarations ==================================== -->
|
|
|
|
|
|
<!-- The name of this component -->
|
|
<property name="component.name" value="logging"/>
|
|
|
|
<!-- The primary package name of this component -->
|
|
<property name="component.package" value="org.apache.commons.logging"/>
|
|
|
|
<!-- The title of this component -->
|
|
<property name="component.title" value="Logging Library"/>
|
|
|
|
<!-- The current version number of this component -->
|
|
<property name="component.version" value="1.0.1-dev"/>
|
|
|
|
<!-- The base directory for compilation targets -->
|
|
<property name="build.home" value="target"/>
|
|
|
|
<!-- The base directory for component configuration files -->
|
|
<property name="conf.home" value="src/conf"/>
|
|
|
|
<!-- The base directory for distribution targets -->
|
|
<property name="dist.home" value="dist"/>
|
|
|
|
<!-- The base directory for component sources -->
|
|
<property name="source.home" value="src/java"/>
|
|
|
|
<!-- The base directory for unit test sources -->
|
|
<property name="test.home" value="src/test"/>
|
|
|
|
<!-- ========== Compiler Defaults ========================================= -->
|
|
|
|
|
|
<!-- Should Java compilations set the 'debug' compiler option? -->
|
|
<property name="compile.debug" value="true"/>
|
|
|
|
<!-- Should Java compilations set the 'deprecation' compiler option? -->
|
|
<property name="compile.deprecation" value="false"/>
|
|
|
|
<!-- Should Java compilations set the 'optimize' compiler option? -->
|
|
<property name="compile.optimize" value="false"/>
|
|
|
|
<!-- Construct compile classpath -->
|
|
<path id="compile.classpath">
|
|
<pathelement location="${build.home}/classes"/>
|
|
<pathelement location="${junit.jar}"/>
|
|
<pathelement location="${log4j.jar}"/>
|
|
<pathelement location="${logkit.jar}"/>
|
|
</path>
|
|
|
|
|
|
<!-- ========== Test Execution Defaults =================================== -->
|
|
|
|
|
|
<!-- Construct unit test classpath -->
|
|
<path id="test.classpath">
|
|
<pathelement location="${build.home}/classes"/>
|
|
<pathelement location="${build.home}/tests"/>
|
|
<pathelement location="${junit.jar}"/>
|
|
<pathelement location="${log4j.jar}"/>
|
|
<pathelement location="${logkit.jar}"/>
|
|
<pathelement location="${conf.home}"/>
|
|
</path>
|
|
|
|
<!-- Should all tests fail if one does? -->
|
|
<property name="test.failonerror" value="true"/>
|
|
|
|
<!-- The test runner to execute -->
|
|
<property name="test.runner" value="junit.textui.TestRunner"/>
|
|
<property name="test.entry" value="org.apache.commons.logging.TestAll"/>
|
|
|
|
<!-- ========== Executable Targets ======================================== -->
|
|
|
|
|
|
<target name="init"
|
|
description="Initialize and evaluate conditionals">
|
|
<echo message="-------- ${component.title} ${component.version} --------"/>
|
|
<filter token="name" value="${component.name}"/>
|
|
<filter token="package" value="${component.package}"/>
|
|
<filter token="version" value="${component.version}"/>
|
|
</target>
|
|
|
|
|
|
<target name="prepare" depends="init"
|
|
description="Prepare build directory">
|
|
<mkdir dir="${build.home}"/>
|
|
<mkdir dir="${build.home}/classes"/>
|
|
<mkdir dir="${build.home}/conf"/>
|
|
<mkdir dir="${build.home}/docs"/>
|
|
<mkdir dir="${build.home}/docs/api"/>
|
|
<mkdir dir="${build.home}/tests"/>
|
|
</target>
|
|
|
|
|
|
<target name="static" depends="prepare"
|
|
description="Copy static files to build directory">
|
|
<tstamp/>
|
|
<copy todir="${build.home}/conf" filtering="on">
|
|
<fileset dir="${conf.home}" includes="*.MF"/>
|
|
<fileset dir="${conf.home}" includes="*.properties"/>
|
|
</copy>
|
|
</target>
|
|
|
|
|
|
<target name="compile" depends="static"
|
|
description="Compile shareable components">
|
|
<available property="jdk.1.4.present"
|
|
classname="java.util.logging.Logger"/>
|
|
<available classname="org.apache.log4j.Category"
|
|
classpathref="compile.classpath"
|
|
property="log4j.present"/>
|
|
<available property="logkit.present"
|
|
classpathref="compile.classpath"
|
|
classname="org.apache.log.Logger"/>
|
|
|
|
<echo message="jdk.1.4.present=${jdk.1.4.present}"/>
|
|
<echo message="log4j.present=${log4j.present}"/>
|
|
<echo message="logkit.present=${logkit.present}"/>
|
|
|
|
|
|
<javac srcdir="${source.home}"
|
|
destdir="${build.home}/classes"
|
|
debug="${compile.debug}"
|
|
deprecation="${compile.deprecation}"
|
|
optimize="${compile.optimize}">
|
|
<classpath refid="compile.classpath"/>
|
|
<exclude name="org/apache/commons/logging/impl/Jdk14Logger.java"
|
|
unless="jdk.1.4.present"/>
|
|
<exclude name="org/apache/commons/logging/impl/Log4JCategoryLog.java"
|
|
unless="log4j.present"/>
|
|
<exclude name="org/apache/commons/logging/impl/Log4jFactory.java"
|
|
unless="log4j.present"/>
|
|
<exclude name="org/apache/commons/logging/impl/LogKitLogger.java"
|
|
unless="logkit.present"/>
|
|
</javac>
|
|
<copy todir="${build.home}/classes" filtering="on">
|
|
<fileset dir="${source.home}" excludes="**/*.java"/>
|
|
</copy>
|
|
<jar jarfile="${build.home}/commons-${component.name}.jar"
|
|
basedir="${build.home}/classes"
|
|
manifest="${build.home}/conf/MANIFEST.MF"/>
|
|
<jar jarfile="${build.home}/commons-${component.name}-api.jar"
|
|
basedir="${build.home}/classes"
|
|
manifest="${build.home}/conf/MANIFEST.MF">
|
|
<include name="org/apache/commons/logging/*.class" />
|
|
<include name="org/apache/commons/logging/impl/LogFactoryImpl*.class" />
|
|
<include name="org/apache/commons/logging/impl/Jdk14*.class" />
|
|
<include name="org/apache/commons/logging/impl/SimpleLog*.class" />
|
|
<include name="org/apache/commons/logging/impl/NoOpLog*.class" />
|
|
</jar>
|
|
</target>
|
|
|
|
|
|
<target name="compile.tests" depends="compile"
|
|
description="Compile unit test cases">
|
|
<javac srcdir="${test.home}"
|
|
destdir="${build.home}/tests"
|
|
debug="${compile.debug}"
|
|
deprecation="${compile.deprecation}"
|
|
optimize="${compile.optimize}">
|
|
<classpath refid="test.classpath"/>
|
|
</javac>
|
|
<copy todir="${build.home}/tests" filtering="on">
|
|
<fileset dir="${test.home}" excludes="**/*.java"/>
|
|
</copy>
|
|
</target>
|
|
|
|
|
|
<target name="clean"
|
|
description="Clean build and distribution directories">
|
|
<delete dir="${build.home}"/>
|
|
<delete dir="${dist.home}"/>
|
|
</target>
|
|
|
|
|
|
<target name="all" depends="clean,compile"
|
|
description="Clean and compile all components"/>
|
|
|
|
|
|
<target name="javadoc" depends="compile"
|
|
description="Create component Javadoc documentation">
|
|
<mkdir dir="${dist.home}"/>
|
|
<mkdir dir="${dist.home}/docs"/>
|
|
<mkdir dir="${dist.home}/docs/api"/>
|
|
<javadoc sourcepath="${source.home}"
|
|
destdir="${dist.home}/docs/api"
|
|
packagenames="org.apache.commons.*"
|
|
author="true"
|
|
private="true"
|
|
version="true"
|
|
doctitle="<h1>${component.title} (Version ${component.version})</h1>"
|
|
windowtitle="${component.title} (Version ${component.version})"
|
|
bottom="Copyright (c) 2002 - Apache Software Foundation">
|
|
<classpath refid="test.classpath"/>
|
|
</javadoc>
|
|
</target>
|
|
|
|
|
|
<target name="dist" depends="compile,javadoc"
|
|
description="Create binary distribution">
|
|
<!-- TODO: top level files like LICENSE and README -->
|
|
<mkdir dir="${dist.home}"/>
|
|
<copy file="../LICENSE"
|
|
todir="${dist.home}"/>
|
|
<mkdir dir="${build.home}/classes/META-INF"/>
|
|
<copy file="../LICENSE"
|
|
tofile="${build.home}/classes/META-INF/LICENSE.txt"/>
|
|
<copy file="${build.home}/commons-${component.name}.jar"
|
|
tofile="${dist.home}/commons-${component.name}.jar" />
|
|
<copy file="${build.home}/commons-${component.name}-api.jar"
|
|
tofile="${dist.home}/commons-${component.name}-api.jar" />
|
|
<mkdir dir="${dist.home}/src"/>
|
|
<copy todir="${dist.home}/src" filtering="on">
|
|
<fileset dir="${source.home}"/>
|
|
</copy>
|
|
</target>
|
|
|
|
|
|
<!-- ========== Unit Test Targets ========================================= -->
|
|
|
|
|
|
<target name="test" depends="compile.tests" if="test.entry"
|
|
description="Run all unit test cases">
|
|
<java classname="${test.runner}" fork="yes" failonerror="${test.failonerror}">
|
|
<arg value="${test.entry}"/>
|
|
<classpath refid="test.classpath"/>
|
|
</java>
|
|
</target>
|
|
|
|
</project>
|