<commit_before><project name="jqPlot" default="all" basedir=".">
    
    <!-- directories for building -->
    <property description="Source directory" name="SRC_DIR" value="src"  />
    <property description="Build, work, temporary directory" name="BUILD_DIR" value="build" />
    <property description="Directory for distributable files" name="DIST_DIR" value="dist" />
    <property description="Directory for web site files" name="WEB_DIR" value="web" />

    <!-- Files names for distribution -->
    <property name="JQPLOT" value="jquery.jqplot.js" />
    <property file="dist.props" />
    
    <!-- misc. properties -->
    <property description="YUICompressor" name="YUICompressor" value="extras/yuicompressor-2.4.2.jar" />
    <loadfile description="Version to build" property="version" srcfile="version.txt" />
    <loadfile description="Copyright and license" property="copyright" srcfile="copyright.txt" />
    <condition property="ND" value="${basedir}/extras/NaturalDocs/NaturalDocs.bat" else="${basedir}/extras/NaturalDocs/NaturalDocs">
      <and>
        <os family="windows" />
      </and>
    </condition>
    <!-->
    <property description="NaturalDocs" name="ND" value="${basedir}/extras/NaturalDocs/NaturalDocs" />
    <property description="NaturalDocs" value="${basedir}/extras/NaturalDocs/NaturalDocs.bat" dir="${basedir}/extras/NaturalDocs">
    -->
    <exec executable="hg" outputproperty="HG_ID">
      <arg value="id"/>
      <arg value="-n"/>
    </exec>

    <!-- MAIN -->
       
    <target name="build" depends="clean" description="create and populate build area for making distribution">
        <echo message="Building jqPlot" />
        <mkdir dir="${BUILD_DIR}" />
        <mkdir dir="${BUILD_DIR}/plugins" />
        <mkdir dir="${BUILD_DIR}/images" />
        <mkdir dir="${BUILD_DIR}/examples" />
        <mkdir dir="${BUILD_DIR}/examples/images" />
        
        <!-- stip out top level closures, concat everything, and wrap in a closure. -->
        <!-- copy all needed files from src to build -->
        <copy todir="${BUILD_DIR}">
          <fileset dir="${SRC_DIR}">
            <include name="*" />
            <!-- for some reason version.txt not copied over -->
            <include name="version.txt" />
            <exclude name="jquery.jqplot.js" />
            <exclude name="jsl.conf" />
          </fileset>
        </copy>
        
        <copy todir="${BUILD_DIR}/images">
          <fileset dir="${SRC_DIR}/images">
          </fileset>
        </copy>
        
        <copy todir="${BUILD_DIR}/examples">
          <fileset dir="examples">
            <exclude name="_*" />
            <exclude name="~*" />
            <exclude name="bug*" />
            <exclude name="footer.inc" />
          </fileset>
        </copy>
        
        <copy todir="${BUILD_DIR}/examples/images">
          <fileset dir="examples/images" />
        </copy>
        
        <replaceregexp match='src="../src/' replace='src="../' flags="g">
          <fileset dir="${BUILD_DIR}/examples" includes="*.html" />
        </replaceregexp>
        
        <replaceregexp match='href="../src/' replace='href="../' flags="g">
          <fileset dir="${BUILD_DIR}/examples" includes="*.html" />
        </replaceregexp>
        
        
        <replace file="${BUILD_DIR}/jqPlotOptions.txt" token="{{{" value="(code)" />
        <replace file="${BUILD_DIR}/jqPlotOptions.txt" token="}}}" value="(end)" />
        <replace file="${BUILD_DIR}/jqPlotOptions.txt" token="**" value="*" />
        
        <copy todir="${BUILD_DIR}/plugins">
          <fileset dir="${SRC_DIR}/plugins" includes="*" />
        </copy>
        
        <replaceregexp match="@VERSION" flags="g" replace="${version}r${HG_ID}">
			<fileset dir="${BUILD_DIR}" includes="jqplot.*.js"/>
		</replaceregexp>
        
        <replaceregexp match="@VERSION" flags="g" replace="${version}r${HG_ID}">
			<fileset dir="${BUILD_DIR}/plugins" includes="jqplot.*.js"/>
		</replaceregexp>
                
        <!-- remove appropriate opening and closing of closures -->
        <replaceregexp match=".*?\(function\(\$\) \{" replace="" flags="s">
          <fileset dir="${BUILD_DIR}">
            <include name="jqplot.*.js" />
            <include name="jqplot.effects.*.js" />
            <include name="jsdate.js" />
            <exclude name="jqplot.core.js" />
          </fileset>
        </replaceregexp>
        
        <replaceregexp match="\}\)\(jQuery\)\;(?!.*\}\)\(jQuery\)\;)" replace="">
          <fileset dir="${BUILD_DIR}">
            <include name="jqplot.*.js" />
            <include name="jqplot.effects.*.js" />
            <include name="jsdate.js" />
            <exclude name="jqplot.sprintf.js" /><commit_msg>jqplot.sprintf.js is no longer the last file in the concatenated jquery.jqplot.js so it should have the trailing "})(jQuery);" stripped. jqplot.effects.blind.js is now the last so we don't strip from there<commit_after><project name="jqPlot" default="all" basedir=".">
    
    <!-- directories for building -->
    <property description="Source directory" name="SRC_DIR" value="src"  />
    <property description="Build, work, temporary directory" name="BUILD_DIR" value="build" />
    <property description="Directory for distributable files" name="DIST_DIR" value="dist" />
    <property description="Directory for web site files" name="WEB_DIR" value="web" />

    <!-- Files names for distribution -->
    <property name="JQPLOT" value="jquery.jqplot.js" />
    <property file="dist.props" />
    
    <!-- misc. properties -->
    <property description="YUICompressor" name="YUICompressor" value="extras/yuicompressor-2.4.2.jar" />
    <loadfile description="Version to build" property="version" srcfile="version.txt" />
    <loadfile description="Copyright and license" property="copyright" srcfile="copyright.txt" />
    <condition property="ND" value="${basedir}/extras/NaturalDocs/NaturalDocs.bat" else="${basedir}/extras/NaturalDocs/NaturalDocs">
      <and>
        <os family="windows" />
      </and>
    </condition>
    <!-->
    <property description="NaturalDocs" name="ND" value="${basedir}/extras/NaturalDocs/NaturalDocs" />
    <property description="NaturalDocs" value="${basedir}/extras/NaturalDocs/NaturalDocs.bat" dir="${basedir}/extras/NaturalDocs">
    -->
    <exec executable="hg" outputproperty="HG_ID">
      <arg value="id"/>
      <arg value="-n"/>
    </exec>

    <!-- MAIN -->
       
    <target name="build" depends="clean" description="create and populate build area for making distribution">
        <echo message="Building jqPlot" />
        <mkdir dir="${BUILD_DIR}" />
        <mkdir dir="${BUILD_DIR}/plugins" />
        <mkdir dir="${BUILD_DIR}/images" />
        <mkdir dir="${BUILD_DIR}/examples" />
        <mkdir dir="${BUILD_DIR}/examples/images" />
        
        <!-- stip out top level closures, concat everything, and wrap in a closure. -->
        <!-- copy all needed files from src to build -->
        <copy todir="${BUILD_DIR}">
          <fileset dir="${SRC_DIR}">
            <include name="*" />
            <!-- for some reason version.txt not copied over -->
            <include name="version.txt" />
            <exclude name="jquery.jqplot.js" />
            <exclude name="jsl.conf" />
          </fileset>
        </copy>
        
        <copy todir="${BUILD_DIR}/images">
          <fileset dir="${SRC_DIR}/images">
          </fileset>
        </copy>
        
        <copy todir="${BUILD_DIR}/examples">
          <fileset dir="examples">
            <exclude name="_*" />
            <exclude name="~*" />
            <exclude name="bug*" />
            <exclude name="footer.inc" />
          </fileset>
        </copy>
        
        <copy todir="${BUILD_DIR}/examples/images">
          <fileset dir="examples/images" />
        </copy>
        
        <replaceregexp match='src="../src/' replace='src="../' flags="g">
          <fileset dir="${BUILD_DIR}/examples" includes="*.html" />
        </replaceregexp>
        
        <replaceregexp match='href="../src/' replace='href="../' flags="g">
          <fileset dir="${BUILD_DIR}/examples" includes="*.html" />
        </replaceregexp>
        
        
        <replace file="${BUILD_DIR}/jqPlotOptions.txt" token="{{{" value="(code)" />
        <replace file="${BUILD_DIR}/jqPlotOptions.txt" token="}}}" value="(end)" />
        <replace file="${BUILD_DIR}/jqPlotOptions.txt" token="**" value="*" />
        
        <copy todir="${BUILD_DIR}/plugins">
          <fileset dir="${SRC_DIR}/plugins" includes="*" />
        </copy>
        
        <replaceregexp match="@VERSION" flags="g" replace="${version}r${HG_ID}">
			<fileset dir="${BUILD_DIR}" includes="jqplot.*.js"/>
		</replaceregexp>
        
        <replaceregexp match="@VERSION" flags="g" replace="${version}r${HG_ID}">
			<fileset dir="${BUILD_DIR}/plugins" includes="jqplot.*.js"/>
		</replaceregexp>
                
        <!-- remove appropriate opening and closing of closures -->
        <replaceregexp match=".*?\(function\(\$\) \{" replace="" flags="s">
          <fileset dir="${BUILD_DIR}">
            <include name="jqplot.*.js" />
            <include name="jqplot.effects.*.js" />
            <include name="jsdate.js" />
            <exclude name="jqplot.core.js" />
          </fileset>
        </replaceregexp>
        
        <replaceregexp match="\}\)\(jQuery\)\;(?!.*\}\)\(jQuery\)\;)" replace="">
          <fileset dir="${BUILD_DIR}">
            <include name="jqplot.*.js" />
            <include name="jqplot.effects.*.js" />
            <include name="jsdate.js" />
            <exclude name="jqplot.effects.blind.js" />
{'fraction_non_alphanumeric': 0.1872037914691943, 'fraction_numerical': 0.000618174325159695, 'mean_word_length': 2.450764308567366, 'pattern_counts': {'":': 0, '<': 187, '<?xml version=': 0, '>': 189, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '1000450', 'n_tokens_mistral': 3003, 'n_tokens_neox': 2765, 'n_words': 555}