<commit_before><?xml version="1.0" encoding="UTF-8"?>
<project name="module_build" default="build" xmlns:ivy="antlib:org.apache.ivy.ant">
  <property environment="env"/>

  <!-- Directories -->
  <property name="project.root.dir" value="${basedir}/../.." />
  <property name="out.dir" value="${basedir}/out" />
  <property name="module.out.dir" value="${out.dir}/production" />
  <property name="test.out.dir" value="${out.dir}/test" />
  <property name="lib.dir" value="${basedir}/lib" />
  <property name="src.dir" value="${basedir}/src" />  
  <property name="test.dir" value="${basedir}/test" />
  <property name="report.dir" value="${basedir}/report" />

  <!-- Compiler options -->
  <property name="compiler.debug" value="on"/>
  <property name="compiler.generate.no.warnings" value="off"/>
  <property name="compiler.args" value=""/>
  <property name="compiler.max.memory" value="128m"/>

  <!-- JDK -->
  <property name="jdk.home" value="${java.home}"/>
  
  <!-- Properties override --> 
  <property file="${project.root.dir}/build.properties"/>
  <property file="${basedir}/build.properties"/>

  <!-- Classpath -->
  <path id="classpath">
    <fileset dir="${lib.dir}" includes="*.jar"/>
  </path>

  <!-- Build targets -->
  <target name="build" depends="compile.production, compile.tests" description="Compile module"/>
  
  <target name="compile.production" depends="retrieve.libs" description="Compile module; production classes">
    <mkdir dir="${module.out.dir}"/>
    <!-- Build -->
    <javac destdir="${module.out.dir}" srcdir="${src.dir}" classpathref="classpath" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memorymaximumsize="${compiler.max.memory}" fork="true" includeantruntime="false">
      <compilerarg line="${compiler.args}"/>
    </javac>    
    <!-- Copy resources -->
    <copy todir="${module.out.dir}">
      <fileset dir="${src.dir}">
        <patternset> 
          <exclude name="**/?*.java"/>
          <exclude name="**/?*.class"/>
        </patternset>
        <type type="file"/>
      </fileset>
    </copy>
  </target>
  
  <target name="compile.tests" depends="compile.production" description="Compile module; test classes" unless="skip.tests">
    <mkdir dir="${test.out.dir}"/>
    <!-- Build -->
    <javac destdir="${test.out.dir}" srcdir="${test.dir}" classpathref="classpath" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memorymaximumsize="${compiler.max.memory}" fork="true" includeantruntime="false">
      <compilerarg line="${compiler.args}"/>
    </javac>    
    <!-- Copy resources -->
    <copy todir="${test.out.dir}">
      <fileset dir="${test.dir}">
        <patternset> 
          <exclude name="**/?*.java"/>
          <exclude name="**/?*.class"/>
        </patternset>
        <type type="file"/>
      </fileset>
    </copy>
  </target>

  <!-- Lib targets --> 
  <ivy:settings file="${project.root.dir}/ivysettings.xml"/>
  
  <target name="resolve.libs">
   <ivy:resolve/>
  </target>

  <target name="retrieve.libs" depends="resolve.libs">
    <ivy:retrieve pattern="${lib.dir}/[artifact]-[revision]-[type].[ext]" sync="true"/>
  </target>

  <!-- Test targets -->   
  <target name="unit.test" depends="compile.tests">
    <junit printsummary="yes" fork="no" haltonfailure="yes">
        <formatter type="plain" usefile="false" />
        <formatter type="plain" />
        <classpath refid="classpath"/>
        <classpath path="${test.out.dir}"/>
        <classpath path="${module.out.dir}"/>
        <batchtest>
          <fileset dir="${test.out.dir}" includes="**/*.class" />
        </batchtest>
    </junit>
  </target>

  <!-- Package targets -->   
<commit_msg>Add module to class path when building tests. (i.e. tests for a module should actually test the module!). Also move junit report files into report dir.<commit_after><?xml version="1.0" encoding="UTF-8"?>
<project name="module_build" default="build" xmlns:ivy="antlib:org.apache.ivy.ant">
  <property environment="env"/>

  <!-- Directories -->
  <property name="project.root.dir" value="${basedir}/../.." />
  <property name="out.dir" value="${basedir}/out" />
  <property name="module.out.dir" value="${out.dir}/production" />
  <property name="test.out.dir" value="${out.dir}/test" />
  <property name="lib.dir" value="${basedir}/lib" />
  <property name="src.dir" value="${basedir}/src" />  
  <property name="test.dir" value="${basedir}/test" />
  <property name="report.dir" value="${basedir}/report" />

  <!-- Compiler options -->
  <property name="compiler.debug" value="on"/>
  <property name="compiler.generate.no.warnings" value="off"/>
  <property name="compiler.args" value=""/>
  <property name="compiler.max.memory" value="128m"/>

  <!-- JDK -->
  <property name="jdk.home" value="${java.home}"/>
  
  <!-- Properties override --> 
  <property file="${project.root.dir}/build.properties"/>
  <property file="${basedir}/build.properties"/>

  <!-- Classpath -->
  <path id="classpath">
    <fileset dir="${lib.dir}" includes="*.jar"/>
  </path>

  <!-- Build targets -->
  <target name="build" depends="compile.production, compile.tests" description="Compile module"/>
  
  <target name="compile.production" depends="retrieve.libs" description="Compile module; production classes">
    <mkdir dir="${module.out.dir}"/>
    <!-- Build -->
    <javac destdir="${module.out.dir}" srcdir="${src.dir}" classpathref="classpath" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memorymaximumsize="${compiler.max.memory}" fork="true" includeantruntime="false">
      <compilerarg line="${compiler.args}"/>
    </javac>    
    <!-- Copy resources -->
    <copy todir="${module.out.dir}">
      <fileset dir="${src.dir}">
        <patternset> 
          <exclude name="**/?*.java"/>
          <exclude name="**/?*.class"/>
        </patternset>
        <type type="file"/>
      </fileset>
    </copy>
  </target>
  
  <target name="compile.tests" depends="compile.production" description="Compile module; test classes" unless="skip.tests">
    <mkdir dir="${test.out.dir}"/>
    <!-- Build -->
    <javac destdir="${test.out.dir}" srcdir="${test.dir}" classpathref="classpath" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memorymaximumsize="${compiler.max.memory}" fork="true" includeantruntime="false">
      <classpath path="${module.out.dir}"/>
      <compilerarg line="${compiler.args}"/>
    </javac>    
    <!-- Copy resources -->
    <copy todir="${test.out.dir}">
      <fileset dir="${test.dir}">
        <patternset> 
          <exclude name="**/?*.java"/>
          <exclude name="**/?*.class"/>
        </patternset>
        <type type="file"/>
      </fileset>
    </copy>
  </target>

  <!-- Lib targets --> 
  <ivy:settings file="${project.root.dir}/ivysettings.xml"/>
  
  <target name="resolve.libs">
   <ivy:resolve/>
  </target>

  <target name="retrieve.libs" depends="resolve.libs">
    <ivy:retrieve pattern="${lib.dir}/[artifact]-[revision]-[type].[ext]" sync="true"/>
  </target>

  <!-- Test targets -->   
  <target name="unit.test" depends="compile.tests">
    <junit printsummary="yes" fork="no" haltonfailure="yes">
        <formatter type="plain" usefile="false" />
        <formatter type="plain" />
        <classpath refid="classpath"/>
        <classpath path="${test.out.dir}"/>
        <classpath path="${module.out.dir}"/>
        <batchtest todir="${report.dir}">
          <fileset dir="${test.out.dir}" includes="**/*.class" />
        </batchtest>
    </junit>
  </target>

  <!-- Package targets -->   

{'fraction_non_alphanumeric': 0.22356973372001054, 'fraction_numerical': 0.0015818613234906407, 'mean_word_length': 3.4161816065192085, 'pattern_counts': {'":': 0, '<': 172, '<?xml version=': 2, '>': 172, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '618476', 'n_tokens_mistral': 2381, 'n_tokens_neox': 2297, 'n_words': 420}