morgand     01/08/08 13:35:22

  Modified:    logging/src/java/org/apache/commons/logging Log.java
                        Log4JCategoryLog.java LogSource.java NoOpLog.java
                        SimpleLog.java
  Added:       logging  build.properties.sample build.xml
  Log:
  proposal for stand-alone logging component
  
  Revision  Changes    Path
  1.1                  jakarta-commons/logging/build.properties.sample
  
  Index: build.properties.sample
  ===================================================================
  # log4j.jar - log4j classes (see http://jakarta.apache.org/log4j)
  log4j.jar=/java/log4j/log4j.jar
  
  
  
  1.1                  jakarta-commons/logging/build.xml
  
  Index: build.xml
  ===================================================================
  <project name="Logging" default="compile" basedir=".">
  
  
  <!--
          "Logging" component of the Jakarta Commons Subproject
          $Id: build.xml,v 1.1 2001/08/08 20:35:22 morgand 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"/>
  
  
  <!-- ========== Derived Values ============================================ -->
  
  
    <!-- The locations of necessary jar files -->
    <property name="junit.jar"               value="${junit.home}/junit.jar"/>
  
  
  <!-- ========== Component Declarations ==================================== -->
  
  
    <!-- The name of this component -->
    <property name="component.name"          value="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-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="true"/>
  
    <!-- Construct compile classpath -->
    <path id="compile.classpath">
      <pathelement location="${build.home}/classes"/>
      <pathelement location="${junit.jar}"/>
      <pathelement location="${log4j.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="${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="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">
      <javac  srcdir="${source.home}"
             destdir="${build.home}/classes"
               debug="${compile.debug}"
         deprecation="${compile.deprecation}"
            optimize="${compile.optimize}">
        <classpath refid="compile.classpath"/>
      </javac>
      <copy    todir="${build.home}/classes" filtering="on">
        <fileset dir="${source.home}" excludes="**/*.java"/>
      </copy>
    </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="&lt;h1&gt;${component.title}&lt;/h1&gt;"
              windowtitle="${component.title} (Version ${component.version})"
                   bottom="Copyright (c) 2001 - 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}"/>
      <jar    jarfile="${dist.home}/commons-${component.name}.jar"
              basedir="${build.home}/classes"
             manifest="${build.home}/conf/MANIFEST.MF"/>
      <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>
  
  
  1.4       +2 -2      
jakarta-commons/logging/src/java/org/apache/commons/logging/Log.java
  
  Index: Log.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons/logging/src/java/org/apache/commons/logging/Log.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Log.java  2001/08/07 17:37:22     1.3
  +++ Log.java  2001/08/08 20:35:22     1.4
  @@ -6,12 +6,12 @@
    * the LICENSE file.
    */
   
  -package org.apache.commons.httpclient.log;
  +package org.apache.commons.logging;
   
   /**
    * A simple logging interface abstracting log4j.
    * @author Rod Waldhoff
  - * @version $Id: Log.java,v 1.3 2001/08/07 17:37:22 rwaldhoff Exp $
  + * @version $Id: Log.java,v 1.4 2001/08/08 20:35:22 morgand Exp $
    */
   public interface Log {
       public void debug(Object message);
  
  
  
  1.4       +2 -2      
jakarta-commons/logging/src/java/org/apache/commons/logging/Log4JCategoryLog.java
  
  Index: Log4JCategoryLog.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons/logging/src/java/org/apache/commons/logging/Log4JCategoryLog.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Log4JCategoryLog.java     2001/08/07 17:37:22     1.3
  +++ Log4JCategoryLog.java     2001/08/08 20:35:22     1.4
  @@ -6,14 +6,14 @@
    * the LICENSE file.
    */
   
  -package org.apache.commons.httpclient.log;
  +package org.apache.commons.logging;
   
   import org.apache.log4j.Category;
   import org.apache.log4j.Priority;
   
   /**
    * @author Rod Waldhoff
  - * @version $Id: Log4JCategoryLog.java,v 1.3 2001/08/07 17:37:22 rwaldhoff Exp $
  + * @version $Id: Log4JCategoryLog.java,v 1.4 2001/08/08 20:35:22 morgand Exp $
    */
   public class Log4JCategoryLog  implements Log {
       Category _category = null;
  
  
  
  1.2       +2 -2      
jakarta-commons/logging/src/java/org/apache/commons/logging/LogSource.java
  
  Index: LogSource.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons/logging/src/java/org/apache/commons/logging/LogSource.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- LogSource.java    2001/08/02 16:27:06     1.1
  +++ LogSource.java    2001/08/08 20:35:22     1.2
  @@ -6,14 +6,14 @@
    * the LICENSE file.
    */
   
  -package org.apache.commons.httpclient.log;
  +package org.apache.commons.logging;
   
   import java.util.HashMap;
   import java.lang.reflect.Constructor;
   
   /**
    * @author Rod Waldhoff
  - * @version $Id: LogSource.java,v 1.1 2001/08/02 16:27:06 rwaldhoff Exp $
  + * @version $Id: LogSource.java,v 1.2 2001/08/08 20:35:22 morgand Exp $
    */
   public class LogSource {
       static protected HashMap _logs = new HashMap();
  
  
  
  1.4       +2 -2      
jakarta-commons/logging/src/java/org/apache/commons/logging/NoOpLog.java
  
  Index: NoOpLog.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons/logging/src/java/org/apache/commons/logging/NoOpLog.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- NoOpLog.java      2001/08/07 17:37:22     1.3
  +++ NoOpLog.java      2001/08/08 20:35:22     1.4
  @@ -6,11 +6,11 @@
    * the LICENSE file.
    */
   
  -package org.apache.commons.httpclient.log;
  +package org.apache.commons.logging;
   
   /**
    * @author Rod Waldhoff
  - * @version $Id: NoOpLog.java,v 1.3 2001/08/07 17:37:22 rwaldhoff Exp $
  + * @version $Id: NoOpLog.java,v 1.4 2001/08/08 20:35:22 morgand Exp $
    */
   public final class NoOpLog implements Log {
       public NoOpLog() { }
  
  
  
  1.4       +2 -2      
jakarta-commons/logging/src/java/org/apache/commons/logging/SimpleLog.java
  
  Index: SimpleLog.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons/logging/src/java/org/apache/commons/logging/SimpleLog.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SimpleLog.java    2001/08/07 17:37:22     1.3
  +++ SimpleLog.java    2001/08/08 20:35:22     1.4
  @@ -6,7 +6,7 @@
    * the LICENSE file.
    */
   
  -package org.apache.commons.httpclient.log;
  +package org.apache.commons.logging;
   
   import java.util.Properties;
   import java.util.Enumeration;
  @@ -17,7 +17,7 @@
   
   /**
    * @author Rod Waldhoff
  - * @version $Id: SimpleLog.java,v 1.3 2001/08/07 17:37:22 rwaldhoff Exp $
  + * @version $Id: SimpleLog.java,v 1.4 2001/08/08 20:35:22 morgand Exp $
    */
   public class SimpleLog implements Log {
       static protected final Properties _simplelogProps = new Properties();
  
  
  

Reply via email to