<commit_before>
<!-- This file is an ANT build script. ANT is a Java based build tool. -->
<!-- It is availale from http://jakarta.apache.org/ant/                -->


<!-- ================================================================= -->
<!-- NOTE: all directories are relative to jakarta-log4j/              -->
<!-- the parent of build/                                              -->
<!-- ================================================================= -->
<project name="log4j" default="build" basedir="." >


  <!-- The build.properties file defines the parth to local jar files -->
  <property file="build.properties"/>

  <property name="version" value="1.3alpha0"/>

  <!-- The base directory relative to which most targets are built -->
  <property name="base" value="."/>

  <!-- The directory where source files are stored. -->
  <property name="java.source.dir" value="src/java/"/>

  <!-- The directory where the package-list file is found, ./ or -->
  <!-- build/ -->
  <property name="packaging.dir" value="build"/>

  <!-- Destination for compiled files -->
  <property name="javac.dest" value="dist/classes"/>

  <!-- Source directory for the examples/ -->
  <property name="examples.src" value="examples/src"/>

  <!-- Destination for compiled files for examples/ -->
  <property name="examples.javac.dest" value="examples/classes"/>

  <!-- Destination for generated jar files -->
  <property name="jar.dest" value="${basedir}"/>

  <!-- The jar file that the jar task will generate -->
  <property name="log4j.jar" value="log4j-${version}.jar"/>

  <!-- The jar file that the jar-chainsaw task will generate -->
  <property name="log4j-chainsaw.jar" value="log4j-chainsaw-${version}.jar"/>
    
  <!-- The jar file that the jar-lf5 task will generate -->
  <property name="log4j-lf5.jar" value="log4j-lf5-${version}.jar"/>

  <!-- Destination for documentation files -->
  <property name="docs.dest" value="./docs"/>
  <!-- Source directory for xml docs -->
  <property name="xdocs.src" value="./src/xdocs"/>


  <!-- Destination for javadoc generated files -->
  <property name="javadoc.dest" value="docs/api"/>

  <!-- Icons source directory. -->
  <property name="icons.source" value="icons"/>

  <!-- The stem where most log4j source code is located. -->
  <property name="stem" value="org/apache/log4j"/>

  <!-- Some targets needs a more precise stem. -->
  <property name="BSTEM" value="${java.source.dir}/${stem}"/>

  <!-- Original manifest.mf file before filtering. -->
  <property name="manifest.src" value="build/manifest.mf"/>

  <!-- Directory where release images go. -->
  <property name="dist.images"  value="dist/images"/>

  <!-- Directory for temporary files. -->
  <property name="dist.tmp" value="dist/tmp"/>


  <!-- Construct compile classpath -->
  <path id="compile.classpath">
    <pathelement location="${javac.dest}"/>
    <pathelement location="${javamail.jar}"/>
    <pathelement location="${activation.jar}"/>
    <pathelement location="${jaxp.jaxp.jar}"/>
    <pathelement location="${jaxp.parser.jar}"/>
    <pathelement location="${jms.jar}"/>
    <pathelement location="${jmx.jar}"/>
    <pathelement location="${jmx-extra.jar}"/>
    <pathelement location="${avalon-framework.jar}"/>
    <pathelement location="${servlet-api.jar}"/>
    <pathelement location="${jdbc-stdext.jar}"/>
    <pathelement location="${jndi.jar}"/>
  </path>

  <!-- Construct classpath for building the html pages-->
  <path id="site.classpath">
    <fileset dir="${logging-site}/lib">
      <include name="*.jar"/>
    </fileset>
  </path>


  <!-- ================================================================= -->
  <!-- Default target                                                    -->
  <!-- ================================================================= -->

  <target name="usage">
    <echo>

    These are the targets supported by this ANT build scpript:

    build   - compile all project files, if a certain library is missing,
        then the compilation of its dependents are skipped.

    javadoc - build project javadoc files

    jar     - build log4j-core and log4j jar files

    dist    - will create a complete distribution in dist/
    </echo>
  </target>

  <target name="jaxpCheck">
    <available classname="javax.xml.parsers.DocumentBuilderFactory"
                          property="jaxp-present"/>
  </target>

  <target name="jaxp" depends="jaxpCheck" if="jaxp-present">
    <echo message="JAXP present."/>
  </target>

  <target name="jndiCheck">
    <available classname="javax.naming.Context" property="jndi-present">
      <classpath refid="compile.classpath"/>
    </available>
    <fail unless="jndi-present">

The JNDI API is required to build ContextJNDISelector, which has
become a core log4j class. The JNDI API ships with JDK 1.3 and
later. For JDK 1.2, you can get the JNDI API from

   http://java.sun.com/products/jndi/downloads/index.html

</fail>
  </target>
  <target name="jndi" depends="jndiCheck" if="jndi-present">
    <echo message="JNDI is present."/>
  </target>

  <target name="avalonFrameworkCheck">
    <available classname="org.apache.avalon.framework.logger.Logger"
        property="avalonFramework-present">
         <classpath refid="compile.classpath"/>
    </available>
  </target>
  <target name="avalonFramework" depends="avalonFrameworkCheck" if="avalonFramework-present">
    <echo message="Avalon Framework is present."/>
  </target>

  <target name="jmxCheck" depends="jndiCheck" if="jndi-present">
    <available classname="javax.management.MBeanInfo" property="jmx-present">
     <classpath refid="compile.classpath"/>
    </available>
  </target>
  <target name="jmx" depends="jmxCheck" if="jmx-present">
    <echo message="JMX is present."/>
  </target>

  <target name="jmsCheck" depends="jndiCheck" if="jndi-present">
    <available classname="javax.jms.Message" property="jms-present">
     <classpath refid="compile.classpath"/>
    </available>
  </target>
  <target name="jms" depends="jmsCheck" if="jms-present">
    <echo message="JMS is present."/>
  </target>

  <target name="javamailCheck">
    <available classname="javax.mail.Message" property="javamail-present">
      <classpath refid="compile.classpath"/>
    </available>
  </target>
  <target name="javamail" depends="javamailCheck" if="javamail-present">
    <echo message="JAVAMAIL is present."/>
  </target>

  <target name="servletAPICheck">
    <available classname="javax.servlet.ServletContext" property="servletAPI-present">
     <classpath refid="compile.classpath"/>
    </available>
  </target>
  <target name="servletAPI" depends="servletAPICheck" if="servletAPI-present">
    <echo message="Servlet API is present."/><commit_msg>This change gets around the condition where you use the 'j2ee.jar', which includes the classes needed for the JMS side of things, and SOME of the classes that JMX needs.  Otherwise the JMX check will pass, but won't complie because of some missing classes.<commit_after>
<!-- This file is an ANT build script. ANT is a Java based build tool. -->
<!-- It is availale from http://jakarta.apache.org/ant/                -->


<!-- ================================================================= -->
<!-- NOTE: all directories are relative to jakarta-log4j/              -->
<!-- the parent of build/                                              -->
<!-- ================================================================= -->
<project name="log4j" default="build" basedir="." >


  <!-- The build.properties file defines the parth to local jar files -->
  <property file="build.properties"/>

  <property name="version" value="1.3alpha0"/>

  <!-- The base directory relative to which most targets are built -->
  <property name="base" value="."/>

  <!-- The directory where source files are stored. -->
  <property name="java.source.dir" value="src/java/"/>

  <!-- The directory where the package-list file is found, ./ or -->
  <!-- build/ -->
  <property name="packaging.dir" value="build"/>

  <!-- Destination for compiled files -->
  <property name="javac.dest" value="dist/classes"/>

  <!-- Source directory for the examples/ -->
  <property name="examples.src" value="examples/src"/>

  <!-- Destination for compiled files for examples/ -->
  <property name="examples.javac.dest" value="examples/classes"/>

  <!-- Destination for generated jar files -->
  <property name="jar.dest" value="${basedir}"/>

  <!-- The jar file that the jar task will generate -->
  <property name="log4j.jar" value="log4j-${version}.jar"/>

  <!-- The jar file that the jar-chainsaw task will generate -->
  <property name="log4j-chainsaw.jar" value="log4j-chainsaw-${version}.jar"/>
    
  <!-- The jar file that the jar-lf5 task will generate -->
  <property name="log4j-lf5.jar" value="log4j-lf5-${version}.jar"/>

  <!-- Destination for documentation files -->
  <property name="docs.dest" value="./docs"/>
  <!-- Source directory for xml docs -->
  <property name="xdocs.src" value="./src/xdocs"/>


  <!-- Destination for javadoc generated files -->
  <property name="javadoc.dest" value="docs/api"/>

  <!-- Icons source directory. -->
  <property name="icons.source" value="icons"/>

  <!-- The stem where most log4j source code is located. -->
  <property name="stem" value="org/apache/log4j"/>

  <!-- Some targets needs a more precise stem. -->
  <property name="BSTEM" value="${java.source.dir}/${stem}"/>

  <!-- Original manifest.mf file before filtering. -->
  <property name="manifest.src" value="build/manifest.mf"/>

  <!-- Directory where release images go. -->
  <property name="dist.images"  value="dist/images"/>

  <!-- Directory for temporary files. -->
  <property name="dist.tmp" value="dist/tmp"/>


  <!-- Construct compile classpath -->
  <path id="compile.classpath">
    <pathelement location="${javac.dest}"/>
    <pathelement location="${javamail.jar}"/>
    <pathelement location="${activation.jar}"/>
    <pathelement location="${jaxp.jaxp.jar}"/>
    <pathelement location="${jaxp.parser.jar}"/>
    <pathelement location="${jms.jar}"/>
    <pathelement location="${jmx.jar}"/>
    <pathelement location="${jmx-extra.jar}"/>
    <pathelement location="${avalon-framework.jar}"/>
    <pathelement location="${servlet-api.jar}"/>
    <pathelement location="${jdbc-stdext.jar}"/>
    <pathelement location="${jndi.jar}"/>
  </path>

  <!-- Construct classpath for building the html pages-->
  <path id="site.classpath">
    <fileset dir="${logging-site}/lib">
      <include name="*.jar"/>
    </fileset>
  </path>


  <!-- ================================================================= -->
  <!-- Default target                                                    -->
  <!-- ================================================================= -->

  <target name="usage">
    <echo>

    These are the targets supported by this ANT build scpript:

    build   - compile all project files, if a certain library is missing,
        then the compilation of its dependents are skipped.

    javadoc - build project javadoc files

    jar     - build log4j-core and log4j jar files

    dist    - will create a complete distribution in dist/
    </echo>
  </target>

  <target name="jaxpCheck">
    <available classname="javax.xml.parsers.DocumentBuilderFactory"
                          property="jaxp-present"/>
  </target>

  <target name="jaxp" depends="jaxpCheck" if="jaxp-present">
    <echo message="JAXP present."/>
  </target>

  <target name="jndiCheck">
    <available classname="javax.naming.Context" property="jndi-present">
      <classpath refid="compile.classpath"/>
    </available>
    <fail unless="jndi-present">

The JNDI API is required to build ContextJNDISelector, which has
become a core log4j class. The JNDI API ships with JDK 1.3 and
later. For JDK 1.2, you can get the JNDI API from

   http://java.sun.com/products/jndi/downloads/index.html

</fail>
  </target>
  <target name="jndi" depends="jndiCheck" if="jndi-present">
    <echo message="JNDI is present."/>
  </target>

  <target name="avalonFrameworkCheck">
    <available classname="org.apache.avalon.framework.logger.Logger"
        property="avalonFramework-present">
         <classpath refid="compile.classpath"/>
    </available>
  </target>
  <target name="avalonFramework" depends="avalonFrameworkCheck" if="avalonFramework-present">
    <echo message="Avalon Framework is present."/>
  </target>

  <target name="jmxCheck" depends="jndiCheck" if="jndi-present">
    <condition property="jmxCheck">
         <and>
            <available classname="javax.management.MBeanInfo">
             <classpath refid="compile.classpath"/>
            </available>
            <available classname="com.sun.jdmk.comm.HtmlAdaptorServer">
             <classpath refid="compile.classpath"/>
            </available>
         </and>
      </condition>

  </target>
  <target name="jmx" depends="jmxCheck" if="jmx-present">
    <echo message="JMX is present."/>
  </target>

  <target name="jmsCheck" depends="jndiCheck" if="jndi-present">
    <available classname="javax.jms.Message" property="jms-present">
     <classpath refid="compile.classpath"/>
    </available>
  </target>
  <target name="jms" depends="jmsCheck" if="jms-present">
    <echo message="JMS is present."/>
  </target>

  <target name="javamailCheck">
    <available classname="javax.mail.Message" property="javamail-present">
      <classpath refid="compile.classpath"/>
    </available>
  </target>
  <target name="javamail" depends="javamailCheck" if="javamail-present">
    <echo message="JAVAMAIL is present."/>
  </target>

  <target name="servletAPICheck">
    <available classname="javax.servlet.ServletContext" property="servletAPI-present">
     <classpath refid="compile.classpath"/>
    </available>
  </target>
  <target name="servletAPI" depends="servletAPICheck" if="servletAPI-present">
    <echo message="Servlet API is present."/>
{'fraction_non_alphanumeric': 0.19772108356026946, 'fraction_numerical': 0.003368209832306149, 'mean_word_length': 3.3217714462681944, 'pattern_counts': {'":': 0, '<': 274, '<?xml version=': 0, '>': 274, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7333331', 'n_tokens_mistral': 4135, 'n_tokens_neox': 3965, 'n_words': 1039}