<commit_before><?xml version="1.0" encoding="ISO-8859-1"?>
<project name="coffee-brew" default="install-rubymine">

    <!-- Define build properties -->

    <loadfile property="version" srcfile="VERSION">
        <filterchain>
            <striplinebreaks/>
        </filterchain>
    </loadfile>

    <property file="build.properties"/>
    <property name="idea.codename" value="ideax"/>
              
    <!-- Reference the IDEA classpath from the local IDE installation -->

    <path id="idea.classpath">
        <fileset dir="${idea.home}">
            <include name="lib/*.jar"/>
            <include name="redist/*.jar"/>
        </fileset>
        <fileset dir="/Applications/IntelliJ IDEA 10 CE.app/lib/">
            <include name="*.jar"/>
        </fileset>
    </path>

    <!-- Define the java compiler task -->

    <taskdef name="javac2" classname="com.intellij.ant.Javac2">
        <classpath refid="idea.classpath"/>
    </taskdef>

    <!-- Define the jflex compiler task -->

    <taskdef name="jflex" classname="JFlex.anttask.JFlexTask">
        <classpath location="${idea.home}/tools/lexer/jflex-1.4/lib/JFlex.jar"/>
    </taskdef>

    <!-- Clean up generated files -->

    <target name="clean">
        <delete dir="target"/>
    </target>

    <!-- Create target directories -->

    <target name="init" depends="clean">
        <mkdir dir="target/classes/META-INF"/>
        <mkdir dir="target/junit"/>
        <mkdir dir="target/test-classes"/>
        <mkdir dir="target/test-reports"/>
        <mkdir dir="target/coffee-script"/>
        <mkdir dir="target/jar"/>
    </target>

    <!-- Copy compilation resources -->

    <target name="resources" depends="init">
        <copy todir="target/classes">
            <fileset dir="resources" excludes="coffee-script/**"/>
        </copy>
    </target>

    <!-- Generate the tokens from the CoffeeScript resources for testing the plugion -->

    <target name="generate-original-tokens" depends="init"
            description="Generate the CoffeeScript tokens within resources/coffee-script">
        <apply executable="/usr/local/bin/node">
            <arg value="/usr/local/share/npm/bin/coffee"/>
            <arg value="-t"/>
            <fileset dir="resources/coffee-script" includes="*.coffee"/>
            <redirector>
                <outputmapper type="glob" from="*.coffee" to="resources/coffee-script/*.tokens"/>
            </redirector>
        </apply>
    </target>

    <!-- Generate the lexer class -->

    <target name="generate-lexer" description="Generate the CoffeeScriptLexer class from the flex definition">
        <jflex skeleton="${idea.home}/tools/lexer/idea-flex.skeleton" nobak="true"
               file="src/org/coffeebrew/lang/lexer/coffee-script.flex"
               destdir="src"
               charat="true"/>
    </target>

    <!-- Compile the plugin -->

    <target name="compile" depends="resources, generate-lexer">
        <javac2 srcdir="src" destdir="target/classes" source="1.5" target="1.5" includeantruntime="yes">
            <classpath refid="idea.classpath"/>
        </javac2>
        <javac2 srcdir="test" destdir="target/test-classes" source="1.5" target="1.5" includeantruntime="yes">
            <classpath refid="idea.classpath"/>
            <classpath location="target/classes"/>
        </javac2>
    </target><commit_msg>Add a target that ensures where on the right idea branch<commit_after><?xml version="1.0" encoding="ISO-8859-1"?>
<project name="coffee-brew" default="install-rubymine">

    <!-- Define build properties -->

    <loadfile property="version" srcfile="VERSION">
        <filterchain>
            <striplinebreaks/>
        </filterchain>
    </loadfile>

    <property file="build.properties"/>
    <property name="idea.codename" value="ideax"/>
              
    <!-- Reference the IDEA classpath from the local IDE installation -->

    <path id="idea.classpath">
        <fileset dir="${idea.home}">
            <include name="lib/*.jar"/>
            <include name="redist/*.jar"/>
        </fileset>
        <fileset dir="/Applications/IntelliJ IDEA 10 CE.app/lib/">
            <include name="*.jar"/>
        </fileset>
    </path>

    <!-- Define the java compiler task -->

    <taskdef name="javac2" classname="com.intellij.ant.Javac2">
        <classpath refid="idea.classpath"/>
    </taskdef>

    <!-- Define the jflex compiler task -->

    <taskdef name="jflex" classname="JFlex.anttask.JFlexTask">
        <classpath location="${idea.home}/tools/lexer/jflex-1.4/lib/JFlex.jar"/>
    </taskdef>

    <!-- Clean up generated files -->

    <target name="clean">
        <delete dir="target"/>
    </target>

    <!-- Create target directories -->

    <target name="init" depends="clean">
        <mkdir dir="target/classes/META-INF"/>
        <mkdir dir="target/junit"/>
        <mkdir dir="target/test-classes"/>
        <mkdir dir="target/test-reports"/>
        <mkdir dir="target/coffee-script"/>
        <mkdir dir="target/jar"/>
    </target>

    <!-- Copy compilation resources -->

    <target name="resources" depends="init">
        <copy todir="target/classes">
            <fileset dir="resources" excludes="coffee-script/**"/>
        </copy>
    </target>

    <!-- Generate the tokens from the CoffeeScript resources for testing the plugin -->

    <target name="generate-original-tokens" depends="init"
            description="Generate the CoffeeScript tokens within resources/coffee-script">
        <apply executable="/usr/local/bin/node">
            <arg value="/usr/local/share/npm/bin/coffee"/>
            <arg value="-t"/>
            <fileset dir="resources/coffee-script" includes="*.coffee"/>
            <redirector>
                <outputmapper type="glob" from="*.coffee" to="resources/coffee-script/*.tokens"/>
            </redirector>
        </apply>
    </target>

    <!-- Generate the lexer class -->

    <target name="generate-lexer" description="Generate the CoffeeScriptLexer class from the flex definition">
        <jflex skeleton="${idea.home}/tools/lexer/idea-flex.skeleton" nobak="true"
               file="src/org/coffeebrew/lang/lexer/coffee-script.flex"
               destdir="src"
               charat="true"/>
    </target>

    <!-- Ensure the right idea branch is checked out -->

    <target name="ensure-idea">
      <exec dir="${idea.home}" executable="git checkout -f maia"/>   
    </target>

    <!-- Compile the plugin -->

    <target name="compile" depends="ensure-idea, resources, generate-lexer">
        <javac2 srcdir="src" destdir="target/classes" source="1.5" target="1.5" includeantruntime="yes">
            <classpath refid="idea.classpath"/>
        </javac2>
        <javac2 srcdir="test" destdir="target/test-classes" source="1.5" target="1.5" includeantruntime="yes">
            <classpath refid="idea.classpath"/>
            <classpath location="target/classes"/>
        </javac2>
    </target>
{'fraction_non_alphanumeric': 0.16604424016087332, 'fraction_numerical': 0.007181844297615628, 'mean_word_length': 2.447029702970297, 'pattern_counts': {'":': 0, '<': 151, '<?xml version=': 2, '>': 151, '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': '1906730', 'n_tokens_mistral': 2100, 'n_tokens_neox': 1972, 'n_words': 421}