<commit_before><?xml version="1.0" encoding="UTF-8"?>
<!-- FIXME: would be great to use Maven instead -->
<project name="LifestyleCoach" default="compile" basedir="." xmlns:ivy="antlib:org.apache.ivy.ant">

    <!-- PART 1: Ivy properties, download, installation and configuration -->
    <property name="ivy.install.version" value="2.4.0-rc1"/>
    <property name="ivy.jar.dir" value="${basedir}/ivy"/>
    <property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar"/>

    <!-- this target will download ivy.jar if it's not in the "ivy" folder yet -->
    <target name="download-ivy" unless="skip.download">
        <mkdir dir="${ivy.jar.dir}"/>
        <!-- download Ivy from web site so that it can be used even without any special installation -->
        <get src="http://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar"
             dest="${ivy.jar.file}" usetimestamp="true"/>
    </target>

    <!--
             =================================
                      target: install-ivy
                        this target is not necessary if you put ivy.jar in your ant lib directory
                        if you already have ivy in your ant lib, you can simply remove this
                        target and the dependency the 'init' target has on it
                     =================================
            -->
    <target name="install-ivy" depends="download-ivy" description="--> install ivy">
        <!--
             try to load ivy here from local ivy dir, in case the user has not already dropped
                          it into ant's lib dir (note that the latter copy will always take precedence).
                          We will not fail as long as local lib dir exists (it may be empty) and
                          ivy is in at least one of ant's lib dir or the local lib dir.
            -->
        <path id="ivy.lib.path">
            <fileset dir="${ivy.jar.dir}" includes="*.jar"/>
        </path>
        <taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/>
    </target>

    <!-- PART 2: General properties definitions -->
    <property name="war.file" value="assignment2.war"/>
    <property name="build.dir" value="webapp/WEB-INF/classes"/>
    <property name="src.dir" value="src"/>
    <property name="lib.dir" value="webapp/WEB-INF/lib"/>

    <!-- paths where ivy libraries will be downloaded, use them as classpathref in your compilation and running tasks  -->
    <path id="lib.path.id">
        <fileset dir="${lib.dir}"/>
    </path>

    <!-- =================================
              target: resolve downloads the dependencies to your lib folder
             ================================= -->
    <target name="resolve" depends="install-ivy" description="--> retrieve dependencies with ivy">
        <ivy:retrieve pattern="${lib.dir}/[artifact]-[type]-[revision].[ext]"/>
    </target>

    <path id="run.path.id">
        <path refid="lib.path.id"/>
        <fileset dir="${build.dir}">
            <include name="*.class"/>
            <include name="**/*.class"/>
            <exclude name="**/*Test*"/>
        </fileset>
    </path>

    <!-- PART 3: compilation and execution targets for this session -->
    <target name="clean">
        <delete file="${war.file}"/>
        <delete dir="${build.dir}"/>
        <delete dir="${lib.dir}"/>
    </target>

    <target name="compile" depends="clean, resolve">
        <mkdir dir="${build.dir}"/>
        <javac srcdir="${src.dir}" destdir="${build.dir}" classpathref="lib.path.id" includeAntRuntime="false"/>
    </target>

    <!-- PART 4: actual meat of the application -->
    <target name="create.war" depends="compile">
        <war destfile="${war.file}" webxml="webapp/WEB-INF/web.xml">
            <fileset dir="webapp">
                <include name="**/*.*"/>
            </fileset>
            <classes dir="${build.dir}"/>
        </war>
    </target>
</project><commit_msg>auto copy log4j at compile stage<commit_after><?xml version="1.0" encoding="UTF-8"?>
<!-- FIXME: would be great to use Maven instead -->
<project name="LifestyleCoach" default="compile" basedir="." xmlns:ivy="antlib:org.apache.ivy.ant">

    <!-- PART 1: Ivy properties, download, installation and configuration -->
    <property name="ivy.install.version" value="2.4.0-rc1"/>
    <property name="ivy.jar.dir" value="${basedir}/ivy"/>
    <property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar"/>

    <!-- this target will download ivy.jar if it's not in the "ivy" folder yet -->
    <target name="download-ivy" unless="skip.download">
        <mkdir dir="${ivy.jar.dir}"/>
        <!-- download Ivy from web site so that it can be used even without any special installation -->
        <get src="http://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar"
             dest="${ivy.jar.file}" usetimestamp="true"/>
    </target>

    <!--
             =================================
                      target: install-ivy
                        this target is not necessary if you put ivy.jar in your ant lib directory
                        if you already have ivy in your ant lib, you can simply remove this
                        target and the dependency the 'init' target has on it
                     =================================
            -->
    <target name="install-ivy" depends="download-ivy" description="--> install ivy">
        <!--
             try to load ivy here from local ivy dir, in case the user has not already dropped
                          it into ant's lib dir (note that the latter copy will always take precedence).
                          We will not fail as long as local lib dir exists (it may be empty) and
                          ivy is in at least one of ant's lib dir or the local lib dir.
            -->
        <path id="ivy.lib.path">
            <fileset dir="${ivy.jar.dir}" includes="*.jar"/>
        </path>
        <taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/>
    </target>

    <!-- PART 2: General properties definitions -->
    <property name="war.file" value="lifestylecoach.war"/>
    <property name="src.dir" value="src"/>
    <property name="log.file" value="${src.dir}/log4j2-test.xml"/>
    <property name="webinf.dir" value="webapp/WEB-INF"/>
    <property name="webxml.file" value="${webinf.dir}/web.xml"/>
    <property name="build.dir" value="${webinf.dir}/classes"/>
    <property name="lib.dir" value="${webinf.dir}/lib"/>

    <!-- paths where ivy libraries will be downloaded, use them as classpathref in your compilation and running tasks  -->
    <path id="lib.path.id">
        <fileset dir="${lib.dir}"/>
    </path>

    <!-- =================================
              target: resolve downloads the dependencies to your lib folder
             ================================= -->
    <target name="resolve" depends="install-ivy" description="--> retrieve dependencies with ivy">
        <ivy:retrieve pattern="${lib.dir}/[artifact]-[type]-[revision].[ext]"/>
    </target>

    <path id="run.path.id">
        <path refid="lib.path.id"/>
        <fileset dir="${build.dir}">
            <include name="*.class"/>
            <include name="**/*.class"/>
            <exclude name="**/*Test*"/>
        </fileset>
    </path>

    <!-- PART 3: compilation and execution targets for this session -->
    <target name="clean">
        <delete file="${war.file}"/>
        <delete dir="${build.dir}"/>
        <delete dir="${lib.dir}"/>
    </target>

    <target name="compile" depends="clean, resolve">
        <mkdir dir="${build.dir}"/>
        <javac srcdir="${src.dir}" destdir="${build.dir}" classpathref="lib.path.id" includeAntRuntime="false"/>
        <copy file="${log.file}" todir="${build.dir}"/>
    </target>

    <!-- PART 4: actual meat of the application -->
    <target name="create.war" depends="compile">
        <war destfile="${war.file}" webxml="${webxml.file}">
            <fileset dir="webapp">
                <include name="**/*.*"/>
            </fileset>
            <classes dir="${build.dir}"/>
        </war>
    </target>
</project>
{'fraction_non_alphanumeric': 0.1932762983491987, 'fraction_numerical': 0.003614893360645861, 'mean_word_length': 2.364410214835833, 'pattern_counts': {'":': 0, '<': 131, '<?xml version=': 2, '>': 135, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 13}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4057987', 'n_tokens_mistral': 2383, 'n_tokens_neox': 2291, 'n_words': 650}