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

<!--
    | Exhibit 3.0 build tasks
     -->

<project name="exhibit3" basedir=".">

  <property name="tools" value="tools"/>
  <property name="src" value="src"/>
  <property name="tests" value="tests"/>
  <property name="lib" value="lib"/>
  <property name="build" value="build"/>
  <property name="docs" value="${build}/docs"/>
  <property name="demos" value="${build}/demos"/>
  <property name="demosSrc" value="demos"/>
  <property name="testsOutput" value="${build}/tests"/>
  <property name="instrument" value="${build}/instrument"/>
  <property name="coverage" value="${build}/coverage"/>
  <property name="dist" value="dist"/>

  <property name="modules" value=""/>

  <property name="jscoverage.dir" value="/usr/local/bin"/>
  <property name="jscoverage.port" value="9876"/>
  <property file="local.build.properties"/>

  <condition property="jscoverage.exists">
    <and>
      <resourceexists>
        <file file="${jscoverage.dir}/jscoverage-server"/>
      </resourceexists>
      <resourceexists>
        <file file="${jscoverage.dir}/jscoverage"/>
      </resourceexists>
    </and>
  </condition>

  <condition property="jscoverage.report.exists">
    <resourceexists>
      <file file="${lib}/jscoverage-report.js"/>
    </resourceexists>
  </condition>

  <taskdef
     name="yui-compressor"
     classname="net.noha.tools.ant.yuicompressor.tasks.YuiCompressorTask"
     classpath="${tools}/yuicompressor-ant/yui-compressor-ant-task.jar;${tools}/rhino/js.jar"
     />

  <taskdef
     name="jsdoctoolkit"
     classname="uk.co.darrenhurley.ant.tasks.JsDocToolkit"
     classpath="${tools}/jsdoc-toolkit-ant/jsdoc-toolkit-ant-task.jar;${tools}/rhino/js.jar"
     />

  <taskdef
     name="jslint"
     classname="com.googlecode.jslint4java.ant.JSLintTask"
     classpath="${tools}/jslint4java/jslint4java.jar"
     />





  <!-- Code compressor -->
  <target name="compress" description="Combine and compress source files">
    <concat destfile="${build}/exhibit-bundle.js" force="no">
      <fileset dir="${src}/" includes="*.js,**/*.js" excludes="lib/*.js"/>
    </concat>

    <yui-compressor
       munge="true"
       fromdir="${build}/"
       todir="${dist}/">
      <include name="${build}/exhibit-bundle.js"/>
    </yui-compressor>
  </target>




  <!-- Demo builder -->
  <target name="demos" description="Build demos">
    <copy todir="${demos}">
      <fileset dir="${demosSrc}"/>
    </copy>
    <copy todir="${demos}/src">
      <fileset dir="${src}"/>
    </copy>
  </target>





  <!-- Documentation generator -->
  <target name="docs" description="Generate code documentation">
    <mkdir dir="${docs}"/>
    <jsdoctoolkit
       jsdochome="${tools}/jsdoc-toolkit/"
       template="jsdoc"
       outputdir="${docs}/">
      <fileset dir="${src}/" includes="*.js,**/*.js" excludes="lib/*.js" />
    </jsdoctoolkit>
  </target>





  <!-- Coverage reporting -->
  <target name="coverage" description="Generate code coverage report">
    <fail unless="${jscoverage.exists}"
          message="The JSCoverage server and instrumentation programs could not be located, check the jscoverage.dir setting"/>
    <fail unless="${jscoverage.report.exists}"
          message="The JSCoverage report script could not be located at lib/jscoverage-report.js"/>
    <mkdir dir="${instrument}"/>
    <mkdir dir="${coverage}"/>
    <exec dir="." executable="${jscoverage.dir}/jscoverage-server" spawn="true">
      <arg line="--port=${jscoverage.port} --report-dir=${coverage} --no-instrument=${instrument}/lib/ --no-instrument=${instrument}/tests/ --no-instrument=${instrument}/src/"/>
    </exec>
    <exec dir="." executable="${jscoverage.dir}/jscoverage">
      <arg line="--no-instrument=lib/ ${src} ${instrument}/src"/>
    </exec>
    <copy todir="${instrument}/tests">
      <fileset dir="${tests}"/>
    </copy>
    <copy todir="${instrument}/lib">
      <fileset dir="${lib}"/>
    </copy>
    <java
       classpath="${tools}/rhino/js.jar"
       classname="org.mozilla.javascript.tools.shell.Main">
      <arg line="-opt -1 ${lib}/coverage-runner.js ${jscoverage.port}"/>
    </java>
    <exec dir="." executable="${jscoverage.dir}/jscoverage-server">
      <arg line="--port=${jscoverage.port} --shutdown"/>
    </exec>
  </target>





  <!-- Tests -->
  <target name="lint">
    <!-- see http://happygiraffe.github.com/jslint4java/ant.html -->
    <jslint haltOnFailure="false" options="onevar,sub">
      <predef>jQuery, $$</predef>
      <formatter type="plain" />
      <fileset dir="${src}/" includes="*.js,**/*.js" excludes="lib/*.js,exhibit.js" />
    </jslint>
  </target>

  <target name="qunit">
    <mkdir dir="${testsOutput}"/>
    <!-- the magic starts in lib/test-runner.js -->
    <java
       classpath="${tools}/rhino/js.jar"
       classname="org.mozilla.javascript.tools.shell.Main">
      <arg line="-opt -1 ${lib}/test-runner.js ${modules}"/>
    </java>
  </target>

  <target name="test" depends="lint,qunit" description="Run all tests"/>





  <!-- Cleanup -->
  <target name="clean-demos">
    <delete dir="${demos}/" quiet="true"/>
  </target>

  <target name="clean-docs">
    <delete dir="${docs}/" quiet="true"/>
  </target>

  <target name="clean-coverage">
    <delete dir="${coverage}/" quiet="true"/>
  </target>

  <target name="clean-instrument">
    <delete dir="${instrument}/" quiet="true"/>
  </target>

  <target name="clean-jscoverage" depends="clean-coverage,clean-instrument"/>

  <target name="clean-tests">
    <delete dir="${testsOutput}/" quiet="true"/>
  </target>

  <target name="clean" depends="clean-demos,clean-docs,clean-jscoverage,clean-tests" description="Remove build artificats"/>

</project><commit_msg>separated bundle and compress tasks<commit_after><?xml version="1.0" encoding="UTF-8"?>

<!--
    | Exhibit 3.0 build tasks
     -->

<project name="exhibit3" basedir=".">

  <property name="tools" value="tools"/>
  <property name="src" value="src"/>
  <property name="tests" value="tests"/>
  <property name="lib" value="lib"/>
  <property name="build" value="build"/>
  <property name="docs" value="${build}/docs"/>
  <property name="demos" value="${build}/demos"/>
  <property name="bundle" value="${build}/bundle"/>
  <property name="demosSrc" value="demos"/>
  <property name="testsOutput" value="${build}/tests"/>
  <property name="instrument" value="${build}/instrument"/>
  <property name="coverage" value="${build}/coverage"/>
  <property name="dist" value="dist"/>

  <property name="modules" value=""/>

  <property name="jscoverage.dir" value="/usr/local/bin"/>
  <property name="jscoverage.port" value="9876"/>
  <property file="local.build.properties"/>

  <condition property="jscoverage.exists">
    <and>
      <resourceexists>
        <file file="${jscoverage.dir}/jscoverage-server"/>
      </resourceexists>
      <resourceexists>
        <file file="${jscoverage.dir}/jscoverage"/>
      </resourceexists>
    </and>
  </condition>

  <condition property="jscoverage.report.exists">
    <resourceexists>
      <file file="${lib}/jscoverage-report.js"/>
    </resourceexists>
  </condition>

  <taskdef
     name="yui-compressor"
     classname="net.noha.tools.ant.yuicompressor.tasks.YuiCompressorTask"
     classpath="${tools}/yuicompressor-ant/yui-compressor-ant-task.jar;${tools}/rhino/js.jar"
     />

  <taskdef
     name="jsdoctoolkit"
     classname="uk.co.darrenhurley.ant.tasks.JsDocToolkit"
     classpath="${tools}/jsdoc-toolkit-ant/jsdoc-toolkit-ant-task.jar;${tools}/rhino/js.jar"
     />

  <taskdef
     name="jslint"
     classname="com.googlecode.jslint4java.ant.JSLintTask"
     classpath="${tools}/jslint4java/jslint4java.jar"
     />





  <!-- Code compressor -->
  <target name="bundle" description="Combine source files in the right order">
    <mkdir dir="${bundle}"/>

    <concat destfile="${bundle}/exhibit-bundle.js" force="no">
      <filelist dir="${src}/"
                files="exhibit.js"/>
      <filelist dir="${src}/"
                files="util/util.js"/>
      <fileset dir="${src}/">
        <exclude name="lib/*.js"/>
        <exclude name="exhibit.js"/>
        <exclude name="util/util.js"/>
        <include name="**/*.js"/>
      </fileset>
    </concat>
  </target>




  <!-- Code compressor -->
  <target name="compress" depends="bundle" description="Compress source files">
    <mkdir dir="${dist}"/>

    <yui-compressor
       munge="true"
       fromdir="${bundle}/"
       todir="${dist}/"/>
  </target>




  <!-- Demo builder -->
  <target name="demos" description="Build demos">
    <copy todir="${demos}">
      <fileset dir="${demosSrc}"/>
    </copy>
    <copy todir="${demos}/src">
      <fileset dir="${src}"/>
    </copy>
  </target>





  <!-- Documentation generator -->
  <target name="docs" description="Generate code documentation">
    <mkdir dir="${docs}"/>
    <jsdoctoolkit
       jsdochome="${tools}/jsdoc-toolkit/"
       template="jsdoc"
       outputdir="${docs}/">
      <fileset dir="${src}/" includes="*.js,**/*.js" excludes="lib/*.js" />
    </jsdoctoolkit>
  </target>





  <!-- Coverage reporting -->
  <target name="coverage" description="Generate code coverage report">
    <fail unless="${jscoverage.exists}"
          message="The JSCoverage server and instrumentation programs could not be located, check the jscoverage.dir setting"/>
    <fail unless="${jscoverage.report.exists}"
          message="The JSCoverage report script could not be located at lib/jscoverage-report.js"/>
    <mkdir dir="${instrument}"/>
    <mkdir dir="${coverage}"/>
    <exec dir="." executable="${jscoverage.dir}/jscoverage-server" spawn="true">
      <arg line="--port=${jscoverage.port} --report-dir=${coverage} --no-instrument=${instrument}/lib/ --no-instrument=${instrument}/tests/ --no-instrument=${instrument}/src/"/>
    </exec>
    <exec dir="." executable="${jscoverage.dir}/jscoverage">
      <arg line="--no-instrument=lib/ ${src} ${instrument}/src"/>
    </exec>
    <copy todir="${instrument}/tests">
      <fileset dir="${tests}"/>
    </copy>
    <copy todir="${instrument}/lib">
      <fileset dir="${lib}"/>
    </copy>
    <java
       classpath="${tools}/rhino/js.jar"
       classname="org.mozilla.javascript.tools.shell.Main">
      <arg line="-opt -1 ${lib}/coverage-runner.js ${jscoverage.port}"/>
    </java>
    <exec dir="." executable="${jscoverage.dir}/jscoverage-server">
      <arg line="--port=${jscoverage.port} --shutdown"/>
    </exec>
  </target>





  <!-- Tests -->
  <target name="lint">
    <!-- see http://happygiraffe.github.com/jslint4java/ant.html -->
    <jslint haltOnFailure="false" options="onevar,sub">
      <predef>jQuery, $$</predef>
      <formatter type="plain" />
      <fileset dir="${src}/" includes="*.js,**/*.js" excludes="lib/*.js,exhibit.js" />
    </jslint>
  </target>

  <target name="qunit">
    <mkdir dir="${testsOutput}"/>
    <!-- the magic starts in lib/test-runner.js -->
    <java
       classpath="${tools}/rhino/js.jar"
       classname="org.mozilla.javascript.tools.shell.Main">
      <arg line="-opt -1 ${lib}/test-runner.js ${modules}"/>
    </java>
  </target>

  <target name="test" depends="lint,qunit" description="Run all tests"/>





  <!-- Cleanup -->
  <target name="clean-demos">
    <delete dir="${demos}/" quiet="true"/>
  </target>

  <target name="clean-docs">
    <delete dir="${docs}/" quiet="true"/>
  </target>

  <target name="clean-bundle">
    <delete file="${build}/exhibit-bundle.js" quiet="true"/>
  </target>

  <target name="clean-compress">
    <delete dir="${dist}/" quiet="true"/>
  </target>

  <target name="clean-coverage">
    <delete dir="${coverage}/" quiet="true"/>
  </target>

  <target name="clean-instrument">
    <delete dir="${instrument}/" quiet="true"/>
  </target>

  <target name="clean-jscoverage" depends="clean-coverage,clean-instrument"/>

  <target name="clean-tests">
    <delete dir="${testsOutput}/" quiet="true"/>
  </target>

  <target name="clean" depends="clean-demos,clean-bundle,clean-compress,clean-docs,clean-jscoverage,clean-tests" description="Remove build artificats"/>

</project>
{'fraction_non_alphanumeric': 0.20927174091731054, 'fraction_numerical': 0.0026302811112937697, 'mean_word_length': 3.390833634067124, 'pattern_counts': {'":': 0, '<': 268, '<?xml version=': 2, '>': 268, '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': '6674423', 'n_tokens_mistral': 4094, 'n_tokens_neox': 3929, 'n_words': 683}