<commit_before><?xml version="1.0"?>

<project name="common">

  <property name="src.dir" location="src/java"/>
  <property name="build.dir" location="build"/>
  <property name="build.classes.dir" location="${build.dir}/classes"/>

  <property name="test.src.dir" location="src/test"/>
  <property name="test.output.dir" location="${build.dir}/test"/>
  <property name="test.classes.dir" location="${test.output.dir}/classes"/>

  <property name="dist.dir" location="dist"/>

  <property name="dist.name" value="${ant.project.name}.jar"/>

  <property name="junit.jar" location="${ant.home}/lib/junit.jar"/>
  <dirname file="${ant.file.common}" property="common.dir"/>
  <property name="lucene.dir" location="${common.dir}/../../jakarta-lucene"/>

  <property name="build.debug" value="true"/>
  <property name="junit.fork" value="true"/>

  <!-- ========================================================== -->
  <!-- Datatype declarations                                      -->
  <!-- ========================================================== -->
  <!-- TODO: define ${lucene.jar} for easeir overriding -->
  <path id="compile.classpath">
    <fileset dir="${lucene.dir}" includes="build/lucene*.jar"/>
    <pathelement path="${project.classpath}"/>
  </path>

  <path id="test.classpath">
    <path refid="compile.classpath"/>
    <pathelement location="${junit.jar}"/>
    <pathelement location="${build.classes.dir}"/>
    <pathelement location="${test.classes.dir}"/>
  </path>


  <target name="init">
    <echo message="Building ${ant.project.name}"/>
    <tstamp/>

    <mkdir dir="${build.dir}"/>
    <mkdir dir="${build.classes.dir}"/>
    <mkdir dir="${dist.dir}"/>

    <mkdir dir="${test.output.dir}"/>
    <mkdir dir="${test.classes.dir}"/>

    <available property="has.tests" file="${test.src.dir}" type="dir"/>
  </target>

  <target name="clean"
    description="Deletes all previous build artifacts">
    <delete dir="${build.dir}"/>
    <delete dir="${build.classes.dir}"/>
    <delete dir="${dist.dir}"/>

    <delete dir="${test.output.dir}"/>
    <delete dir="${test.classes.dir}"/>
  </target>

  <target name="dist" depends="compile" description="Create JAR">
    <jar jarfile="${dist.dir}/${dist.name}"
         basedir="${build.classes.dir}"
    />
  </target>

  <target name="compile" depends="init">
    <javac destdir="${build.classes.dir}"
           debug="${build.debug}"
           includeAntRuntime="yes"
           deprecation="true"
           srcdir="${src.dir}"
           classpathref="compile.classpath"
    />
  </target>

  <target name="test-compile" depends="compile" if="has.tests">
    <javac destdir="${test.classes.dir}"
           debug="${build.debug}"
           includeAntRuntime="yes"
           srcdir="src/test"
           classpathref="test.classpath"
    />

    <copy todir="${test.classes.dir}">
      <fileset dir="src/test" excludes="**/*.java"/><commit_msg>copy non-java files so they get bundled into the JAR<commit_after><?xml version="1.0"?>

<project name="common">

  <property name="src.dir" location="src/java"/>
  <property name="build.dir" location="build"/>
  <property name="build.classes.dir" location="${build.dir}/classes"/>

  <property name="test.src.dir" location="src/test"/>
  <property name="test.output.dir" location="${build.dir}/test"/>
  <property name="test.classes.dir" location="${test.output.dir}/classes"/>

  <property name="dist.dir" location="dist"/>

  <property name="dist.name" value="${ant.project.name}.jar"/>

  <property name="junit.jar" location="${ant.home}/lib/junit.jar"/>
  <dirname file="${ant.file.common}" property="common.dir"/>
  <property name="lucene.dir" location="${common.dir}/../../jakarta-lucene"/>

  <property name="build.debug" value="true"/>
  <property name="junit.fork" value="true"/>

  <!-- ========================================================== -->
  <!-- Datatype declarations                                      -->
  <!-- ========================================================== -->
  <!-- TODO: define ${lucene.jar} for easeir overriding -->
  <path id="compile.classpath">
    <fileset dir="${lucene.dir}" includes="build/lucene*.jar"/>
    <pathelement path="${project.classpath}"/>
  </path>

  <path id="test.classpath">
    <path refid="compile.classpath"/>
    <pathelement location="${junit.jar}"/>
    <pathelement location="${build.classes.dir}"/>
    <pathelement location="${test.classes.dir}"/>
  </path>


  <target name="init">
    <echo message="Building ${ant.project.name}"/>
    <tstamp/>

    <mkdir dir="${build.dir}"/>
    <mkdir dir="${build.classes.dir}"/>
    <mkdir dir="${dist.dir}"/>

    <mkdir dir="${test.output.dir}"/>
    <mkdir dir="${test.classes.dir}"/>

    <available property="has.tests" file="${test.src.dir}" type="dir"/>
  </target>

  <target name="clean"
    description="Deletes all previous build artifacts">
    <delete dir="${build.dir}"/>
    <delete dir="${build.classes.dir}"/>
    <delete dir="${dist.dir}"/>

    <delete dir="${test.output.dir}"/>
    <delete dir="${test.classes.dir}"/>
  </target>

  <target name="dist" depends="compile" description="Create JAR">
    <jar jarfile="${dist.dir}/${dist.name}"
         basedir="${build.classes.dir}"
    />
  </target>

  <target name="compile" depends="init">
    <javac destdir="${build.classes.dir}"
           debug="${build.debug}"
           includeAntRuntime="yes"
           deprecation="true"
           srcdir="${src.dir}"
           classpathref="compile.classpath"
    />
    <copy todir="${build.classes.dir}">
      <fileset dir="${src.dir}" excludes="**/*.java"/>
    </copy>
  </target>

  <target name="test-compile" depends="compile" if="has.tests">
    <javac destdir="${test.classes.dir}"
           debug="${build.debug}"
           includeAntRuntime="yes"
           srcdir="src/test"
           classpathref="test.classpath"
    />

    <copy todir="${test.classes.dir}">
      <fileset dir="src/test" excludes="**/*.java"/>
{'fraction_non_alphanumeric': 0.2513351134846462, 'fraction_numerical': 0.0006675567423230974, 'mean_word_length': 3.4524517087667164, 'pattern_counts': {'":': 0, '<': 118, '<?xml version=': 2, '>': 118, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4101075', 'n_tokens_mistral': 1864, 'n_tokens_neox': 1777, 'n_words': 302}