<commit_before><?xml version="1.0" encoding="UTF-8"?>
<!--
 Author: <NAME>
-->
<project name="build" default="build" basedir=".">

  <property environment="env"/>
  <property file="src/ant/build.properties"/>

  <import file="src/ant/docs.xml"/>
  <import file="src/ant/test.xml"/>

  <!-- exclude vim swap files -->
  <defaultexcludes add="**/*.swp"/>

  <!-- classpath -->
  <path id="classpath">
    <fileset dir="lib" includes="*.jar"/>
    <fileset dir="ant" includes="lib/*.jar"/>
  </path>

  <!--
    - Initialize the build.
    -->
  <target name="init">
    <mkdir dir="build/classes"/>
    <mkdir dir="build/dist"/>
  </target>

  <!--
    - Main target for building the library.
    -->
  <target name="build" depends="init"
      description="Compiles the src and builds the jar file.">

    <property name="deprecation" value="false"/>
    <javac destdir="build/classes" debug="on" optimize="false"
        target="${javac.target}" source="${javac.target}"
        deprecation="${deprecation}">
      <src path="src/java"/>
      <include name="**/*.java"/>
      <classpath refid="classpath"/>
    </javac>

    <!-- build formic jar file -->
    <jar jarfile="build/dist/formic.jar">
      <fileset dir="build/classes">
        <include name="**/*.class"/>
        <exclude name="org/apache/**/*.class"/>
        <exclude name="org/formic/bootstrap/*.class"/>
      </fileset>
      <fileset dir="src/java">
        <include name="**/*"/>
        <exclude name="org/apache/**/*"/>
        <exclude name="**/package.html"/>
        <exclude name="**/*.java"/>
      </fileset>
      <fileset dir="src">
        <include name="images/**/*"/>
      </fileset>
    </jar>

    <!-- formic windows installer boostrap jar -->
    <jar jarfile="build/dist/formic-bootstrap.jar">
      <manifest>
        <attribute name="Main-Class"
            value="org.formic.bootstrap.Launcher"/>
      </manifest>
      <fileset dir="build/classes">
        <include name="org/formic/bootstrap/**/*.class"/>
      </fileset>
      <fileset dir="src/java">
        <include name="org/formic/bootstrap/**/*"/>
        <exclude name="**/package.html"/>
        <exclude name="**/*.java"/>
      </fileset>
    </jar>

    <!-- build patched ant jar file -->
    <copy todir="build/dist" file="ant/lib/ant.jar"/>
    <jar jarfile="build/dist/ant.jar" update="true">
      <fileset dir="build/classes">
        <include name="org/apache/tools/**/*.class"/>
      </fileset>
      <fileset dir="src/java">
        <include name="org/apache/tools/**/*"/>
        <exclude name="**/package.html"/>
        <exclude name="**/*.java"/>
      </fileset>
    </jar>

    <!-- apache commons minimal jar -->
    <jar jarfile="build/dist/apache-commons-minimal.jar">
      <fileset dir="build/classes">
        <include name="org/apache/commons/**/*.class"/>
      </fileset>
      <fileset dir="src/java">
        <include name="org/apache/commons/**/*"/>
        <exclude name="**/package.html"/>
        <exclude name="**/*.java"/>
      </fileset>
    </jar>

    <!-- copy ant and formic scripts over to build dir -->
    <copy todir="build/formic">
      <fileset dir="." includes="LICENSE,NOTICE"/>
      <fileset dir="." includes="ant/**/*"/>
      <fileset dir="src" includes="samples/**/*"/>
      <fileset dir="lib" includes="license/*.license"/>
      <fileset dir="build/dist" includes="formic.jar"/>
    </copy>
    <chmod file="build/formic/ant/bin/ant" perm="755"/>

    <!-- copy formic jar(s) to ant -->
    <copy todir="build/formic/ant/lib" overwrite="true">
      <fileset dir="build/dist"
          includes="*.jar" excludes="formic-bootstrap.jar"/>
      <fileset dir="lib" includes="**/*.jar"/>
      <fileset dir="lib" includes="native/**/*"/>
    </copy>

    <!-- copy over resource files -->
    <copy todir="build/formic/ant/resources">
      <fileset dir="src/resources" includes="**/*"/>
      <fileset dir="build/dist" includes="formic-bootstrap.jar"/>
    </copy>

    <!-- set permissions on scripts -->
    <chmod perm="755">
      <fileset dir="build/formic/ant/bin" includes="**/*"/>
      <fileset dir="build/formic" includes="formic"/>
    </chmod>
  </target>

  <!--
    - Delete any generated artifacts of the build.
    -->
  <target name="clean" description="Deletes the build directory.">
    <delete dir="build"/>
    <delete dir="dist"/>
  </target>

  <!--
    - Target for creating distributable archives.
    -->
  <target name="dist" depends="clean,build,javadoc,docs"
      description="Creates the distributable jars.">
    <mkdir dir="dist"/>
    <move todir="build/doc">
      <fileset dir="build" includes="site/**/*"/>
    </move>

    <zip destfile="dist/formic-${formic.version}.zip">
      <zipfileset prefix="formic-${formic.version}/" dir=".">
        <include name="src/java/**/*"/>
        <include name="src/samples/**/*"/><commit_msg>make sure launch4j executable are made executable<commit_after><?xml version="1.0" encoding="UTF-8"?>
<!--
 Author: <NAME>
-->
<project name="build" default="build" basedir=".">

  <property environment="env"/>
  <property file="src/ant/build.properties"/>

  <import file="src/ant/docs.xml"/>
  <import file="src/ant/test.xml"/>

  <!-- exclude vim swap files -->
  <defaultexcludes add="**/*.swp"/>

  <!-- classpath -->
  <path id="classpath">
    <fileset dir="lib" includes="*.jar"/>
    <fileset dir="ant" includes="lib/*.jar"/>
  </path>

  <!--
    - Initialize the build.
    -->
  <target name="init">
    <mkdir dir="build/classes"/>
    <mkdir dir="build/dist"/>
  </target>

  <!--
    - Main target for building the library.
    -->
  <target name="build" depends="init"
      description="Compiles the src and builds the jar file.">

    <property name="deprecation" value="false"/>
    <javac destdir="build/classes" debug="on" optimize="false"
        target="${javac.target}" source="${javac.target}"
        deprecation="${deprecation}">
      <src path="src/java"/>
      <include name="**/*.java"/>
      <classpath refid="classpath"/>
    </javac>

    <!-- build formic jar file -->
    <jar jarfile="build/dist/formic.jar">
      <fileset dir="build/classes">
        <include name="**/*.class"/>
        <exclude name="org/apache/**/*.class"/>
        <exclude name="org/formic/bootstrap/*.class"/>
      </fileset>
      <fileset dir="src/java">
        <include name="**/*"/>
        <exclude name="org/apache/**/*"/>
        <exclude name="**/package.html"/>
        <exclude name="**/*.java"/>
      </fileset>
      <fileset dir="src">
        <include name="images/**/*"/>
      </fileset>
    </jar>

    <!-- formic windows installer boostrap jar -->
    <jar jarfile="build/dist/formic-bootstrap.jar">
      <manifest>
        <attribute name="Main-Class"
            value="org.formic.bootstrap.Launcher"/>
      </manifest>
      <fileset dir="build/classes">
        <include name="org/formic/bootstrap/**/*.class"/>
      </fileset>
      <fileset dir="src/java">
        <include name="org/formic/bootstrap/**/*"/>
        <exclude name="**/package.html"/>
        <exclude name="**/*.java"/>
      </fileset>
    </jar>

    <!-- build patched ant jar file -->
    <copy todir="build/dist" file="ant/lib/ant.jar"/>
    <jar jarfile="build/dist/ant.jar" update="true">
      <fileset dir="build/classes">
        <include name="org/apache/tools/**/*.class"/>
      </fileset>
      <fileset dir="src/java">
        <include name="org/apache/tools/**/*"/>
        <exclude name="**/package.html"/>
        <exclude name="**/*.java"/>
      </fileset>
    </jar>

    <!-- apache commons minimal jar -->
    <jar jarfile="build/dist/apache-commons-minimal.jar">
      <fileset dir="build/classes">
        <include name="org/apache/commons/**/*.class"/>
      </fileset>
      <fileset dir="src/java">
        <include name="org/apache/commons/**/*"/>
        <exclude name="**/package.html"/>
        <exclude name="**/*.java"/>
      </fileset>
    </jar>

    <!-- copy ant and formic scripts over to build dir -->
    <copy todir="build/formic">
      <fileset dir="." includes="LICENSE,NOTICE"/>
      <fileset dir="." includes="ant/**/*"/>
      <fileset dir="src" includes="samples/**/*"/>
      <fileset dir="lib" includes="license/*.license"/>
      <fileset dir="build/dist" includes="formic.jar"/>
    </copy>
    <chmod file="build/formic/ant/bin/ant" perm="755"/>

    <!-- copy formic jar(s) to ant -->
    <copy todir="build/formic/ant/lib" overwrite="true">
      <fileset dir="build/dist"
          includes="*.jar" excludes="formic-bootstrap.jar"/>
      <fileset dir="lib" includes="**/*.jar"/>
      <fileset dir="lib" includes="native/**/*"/>
    </copy>

    <!-- copy over resource files -->
    <copy todir="build/formic/ant/resources">
      <fileset dir="src/resources" includes="**/*"/>
      <fileset dir="build/dist" includes="formic-bootstrap.jar"/>
    </copy>

    <!-- set permissions on scripts -->
    <chmod perm="755">
      <fileset dir="build/formic/ant/bin" includes="**/*"/>
      <fileset dir="build/formic/ant/resources/launch4j/bin"
          includes="ld,windres"/>
    </chmod>
  </target>

  <!--
    - Delete any generated artifacts of the build.
    -->
  <target name="clean" description="Deletes the build directory.">
    <delete dir="build"/>
    <delete dir="dist"/>
  </target>

  <!--
    - Target for creating distributable archives.
    -->
  <target name="dist" depends="clean,build,javadoc,docs"
      description="Creates the distributable jars.">
    <mkdir dir="dist"/>
    <move todir="build/doc">
      <fileset dir="build" includes="site/**/*"/>
    </move>

    <zip destfile="dist/formic-${formic.version}.zip">
      <zipfileset prefix="formic-${formic.version}/" dir=".">
        <include name="src/java/**/*"/>
        <include name="src/samples/**/*"/>
{'fraction_non_alphanumeric': 0.2144235652615541, 'fraction_numerical': 0.002031488065007618, 'mean_word_length': 2.586885245901639, 'pattern_counts': {'":': 0, '<': 249, '<?xml version=': 2, '>': 249, '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': '2031172', 'n_tokens_mistral': 3154, 'n_tokens_neox': 3058, 'n_words': 617}