<commit_before><?xml version="1.0" encoding="UTF-8"?>

<project name="kanatools-java" basedir="." default="compile">
    <description>Utilities for working with Japanese text in Java</description>

    <!-- Define relevant directories/targets -->
    <property name="src_dir"         value="src" />
    <property name="test_dir"        value="test" />
    <property name="lib_dir"         value="lib" />
    <property name="build_dir"       value="compiled" />
    <property name="classes_dir"     value="${build_dir}/classes" />
    <property name="build_test_dir"  value="${build_dir}/test" />
    <property name="report_dir"      value="${build_dir}/report-junit" />
    <property name="jar_dir"         value="${build_dir}/jar" />
    <property name="jar_name"        value="kanatools.jar" />

    <!-- Define relevant paths -->
    <path id="application" location="${jar_dir}/{$jar_name}" />
    <path id="classpath">
        <fileset dir="${lib_dir}" includes="*.jar" />
    </path>



    <!-- Clean all files produced by past build processes -->
    <target name="clean">
        <delete dir="${classes_dir}" />
        <delete dir="${build_test_dir}" />
        <delete dir="${report_dir}" />
        <delete dir="${jar_dir}" />
    </target>

    <!-- Init build process -->
    <target name="init">
        <tstamp/>
        <mkdir dir="${build_dir}" />
    </target>

    <!-- Compile Java sources files -->
    <target name="compile" depends="init">
        <mkdir dir="${classes_dir}" />
        <javac srcdir="${src_dir}" destdir="${classes_dir}" debug="on" classpathref="classpath" includeantruntime="false" />
    </target>

    <target name="compile_tests" depends="compile">
        <mkdir dir="${build_test_dir}" />
        <javac srcdir="${test_dir}" destdir="${build_test_dir}" debug="on" includeantruntime="false">
            <classpath>
                <path location="${classes_dir}" />
                <path refid="classpath" />
            </classpath>
        </javac>
    </target>

    <target name="test" depends="compile_tests">
        <mkdir dir="${report_dir}" />
        <junit fork="yes" forkmode="once" printsummary="yes" haltonfailure="yes" showoutput="yes">
            <classpath>
                <path location="${build_test_dir}" />
                <path location="${classes_dir}" />
                <path refid="classpath" />
            </classpath>

            <formatter type="plain" />
            <batchtest todir="${report_dir}">
                <fileset dir="${build_test_dir}" />
            </batchtest>
        </junit>
    </target>

    <!-- Wrap compiled file(s) into JAR -->
    <target name="jar" depends="test">
        <mkdir dir="${jar_dir}" />
        <jar destfile="${jar_dir}/${jar_name}" basedir="${classes_dir}" />
    </target>

</project><commit_msg>Output junit details to console on fail<commit_after><?xml version="1.0" encoding="UTF-8"?>

<project name="kanatools-java" basedir="." default="compile">
    <description>Utilities for working with Japanese text in Java</description>

    <!-- Define relevant directories/targets -->
    <property name="src_dir"         value="src" />
    <property name="test_dir"        value="test" />
    <property name="lib_dir"         value="lib" />
    <property name="build_dir"       value="compiled" />
    <property name="classes_dir"     value="${build_dir}/classes" />
    <property name="build_test_dir"  value="${build_dir}/test" />
    <property name="report_dir"      value="${build_dir}/report-junit" />
    <property name="jar_dir"         value="${build_dir}/jar" />
    <property name="jar_name"        value="kanatools.jar" />

    <!-- Define relevant paths -->
    <path id="application" location="${jar_dir}/{$jar_name}" />
    <path id="classpath">
        <fileset dir="${lib_dir}" includes="*.jar" />
    </path>



    <!-- Clean all files produced by past build processes -->
    <target name="clean">
        <delete dir="${classes_dir}" />
        <delete dir="${build_test_dir}" />
        <delete dir="${report_dir}" />
        <delete dir="${jar_dir}" />
    </target>

    <!-- Init build process -->
    <target name="init">
        <tstamp/>
        <mkdir dir="${build_dir}" />
    </target>

    <!-- Compile Java source files -->
    <target name="compile" depends="init">
        <mkdir dir="${classes_dir}" />
        <javac srcdir="${src_dir}" destdir="${classes_dir}" debug="on" classpathref="classpath" includeantruntime="false" />
    </target>

    <!-- Compile unit test source files -->
    <target name="compile_tests" depends="compile">
        <mkdir dir="${build_test_dir}" />
        <javac srcdir="${test_dir}" destdir="${build_test_dir}" debug="on" includeantruntime="false">
            <classpath>
                <path location="${classes_dir}" />
                <path refid="classpath" />
            </classpath>
        </javac>
    </target>

    <!-- Auto-run tests for JUnit -->
    <target name="run_junit" depends="compile_tests">
        <mkdir dir="${report_dir}" />
        <junit fork="yes" forkmode="once" printsummary="yes" showoutput="yes" failureProperty="tests_failed">
            <classpath>
                <path location="${build_test_dir}" />
                <path location="${classes_dir}" />
                <path refid="classpath" />
            </classpath>

            <formatter type="plain" />
            <batchtest todir="${report_dir}">
                <fileset dir="${build_test_dir}" />
            </batchtest>
        </junit>
    </target>

    <!-- Output test details if they fail -->
    <target name="check_for_failed_tests" if="tests_failed">
        <echo message="FAILED UNIT TEST DETAILS:${line.separator}${line.separator}" />
        <echo message="KanaConverter:" />
        <echo message="---------------------------------------------------------------------------------" />
        <exec executable="cat">
            <arg value="${report_dir}/TEST-mariten.kanatools.KanaConverterTest.txt" />
        </exec>
        <echo message="---------------------------------------------------------------------------------" />
        <fail message="Did not pass all unit tests" />
    </target>

    <!-- Perform unit tests -->
    <target name="test" depends="compile_tests,run_junit,check_for_failed_tests">
    </target>

    <!-- Wrap compiled file(s) into JAR -->
    <target name="jar" depends="test">
        <mkdir dir="${jar_dir}" />
        <jar destfile="${jar_dir}/${jar_name}" basedir="${classes_dir}" />
    </target>

</project>
{'fraction_non_alphanumeric': 0.20189226308560965, 'fraction_numerical': 0.0009156111704562796, 'mean_word_length': 2.3627501282709082, 'pattern_counts': {'":': 0, '<': 149, '<?xml version=': 2, '>': 149, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '278751', 'n_tokens_mistral': 1883, 'n_tokens_neox': 1823, 'n_words': 378}