<commit_before><project name="clojure-protobuf" default="package">

  <property name="repository.clojure" value="http://clojure.googlecode.com/files"/>
  <property name="dep.clojure" value="clojure-1.1.0"/>
  <property name="clojure.jar" value="lib/clojure.jar"/>

  <property name="repository.protobuf" value="http://protobuf.googlecode.com/files"/>
  <property name="dep.protobuf" value="protobuf-2.3.0"/>
  <property name="protobuf" value="lib/${dep.protobuf}"/>

  <property name="install_prefix" value="/usr/local"/>

  <target name="init">
    <mkdir dir="lib"/>
    <mkdir dir="classes"/>
  </target>

  <target name="distclean">
    <delete file="${protobuf}/Makefile"/>
  </target>

  <target name="clean">
    <delete>
      <fileset dir="." includes="*.jar"/>
    </delete>
    <delete dir="lib"/>
    <delete dir="classes"/>
  </target>

  <available file="${protobuf}" property="has_protobuf"/>
  <target name="fetch_protobuf" depends="init" unless="has_protobuf">
    <get src="${repository.protobuf}/${dep.protobuf}.tar.gz"
         dest="lib/${dep.protobuf}.tar.gz" usetimestamp="true"/>
    <gunzip src="lib/${dep.protobuf}.tar.gz"/>
    <untar src="lib/${dep.protobuf}.tar" dest="lib"/>
    <delete file="lib/${dep.protobuf}.tar"/>
  </target>

  <available file="${protobuf}/Makefile" property="configured_protobuf"/>
  <target name="config_protobuf" depends="fetch_protobuf" unless="configured_protobuf">
    <chmod file="${protobuf}/configure" perm="+x"/>
    <exec dir="${protobuf}" executable="./configure">
      <arg value="--prefix=${basedir}/lib/install"/>
    </exec>
  </target>

  <available file="${protobuf}/src/protoc" property="has_protoc"/>
  <target name="make_protobuf" depends="config_protobuf" unless="has_protoc">
    <chmod file="${protobuf}/install-sh" perm="+x"/>
    <exec dir="${protobuf}" executable="make" failonerror="true"/>
    <exec dir="${protobuf}" executable="make" failonerror="true">
      <arg value="install"/>
    </exec>
  </target>

  <path id="classpath">
    <pathelement location="${clojure.jar}"/>
    <pathelement location="src/clj"/>
    <pathelement location="src"/>
    <pathelement location="classes"/>
  </path>

  <available file="classes/com/google/protobuf/DescriptorProtos.class" property="proto_compiled"/>
  <target name="compile_protobuf" depends="make_protobuf" unless="proto_compiled">
    <exec dir="${protobuf}/java" executable="../src/protoc">
      <arg value="--java_out=src/main/java"/>
      <arg value="-I../src"/>
      <arg value="../src/google/protobuf/descriptor.proto"/>
    </exec>
    <javac srcdir="${protobuf}/java/src/main" destdir="classes"/>
  </target>

  <available file="src/jvm/clojure/protobuf/Collections.java" property="collections_proto_compiled"/>
  <target name="compile_collections_proto" depends="compile_protobuf" unless="collections_proto_compiled">
    <exec dir="src/jvm" executable="../../${protobuf}/src/protoc">
      <arg value="--java_out=."/>
      <arg value="-I."/>
      <arg value="-I../../${protobuf}/src"/>
      <arg value="clojure/protobuf/collections.proto"/>
    </exec>
  </target>

  <available file="${clojure.jar}" property="has_clojure"/>
  <target name="fetch_clojure" depends="init" unless="has_clojure">
    <get src="${repository.clojure}/${dep.clojure}.zip"
         dest="lib/${dep.clojure}.zip" usetimestamp="true"/>
    <unzip src="lib/${dep.clojure}.zip" dest="lib"/>
    <copy file="lib/${dep.clojure}/clojure.jar" todir="lib"/>
  </target>

  <target name="compile" depends="compile_protobuf,compile_collections_proto,fetch_clojure">
    <javac srcdir="src/jvm" destdir="classes" classpathref="classpath" debug="true"/>
    <java classname="clojure.lang.Compile" classpathref="classpath" failonerror="true">
      <sysproperty key="clojure.compile.path" value="classes"/>
      <arg value="protobuf"/>
    </java>
  </target>

  <target name="package" depends="compile">
    <jar destfile="clojure-protobuf.jar" basedir="classes"/>

    <exec executable="mkdir" failonerror="true">
      <arg value="-p"/>
      <arg line="lib/install/var/java lib/install/include/clojure/protobuf"/>
    </exec>
    <exec executable="cp" failonerror="true">
      <arg line="src/protoclj lib/install/bin"/>
    </exec>
    <chmod file="${install_prefix}/bin/protoclj" perm="+x"/>
    <exec executable="cp" failonerror="true">
      <arg line="src/jvm/clojure/protobuf/collections.proto lib/install/include/clojure/protobuf"/>
    </exec>
    <exec executable="cp" failonerror="true">
      <arg line="clojure-protobuf.jar lib/install/var/java"/>
    </exec>
  </target>

  <target name="install" depends="package">
    <echo message="Installing to ${install_prefix}/"/>
    <exec executable="cp" failonerror="true">
      <arg line="-Rf ${basedir}/lib/install/ ${install_prefix}"/>
    </exec>
  </target>

  <target name="compile_test_proto" depends="compile">
    <exec dir="src" executable="../${protobuf}/src/protoc">
      <arg value="--java_out=."/>
      <arg value="-I."/>
      <arg value="-Ijvm/"/>
      <arg value="-I../${protobuf}/src/"/>
      <arg value="test/test.proto"/>
    </exec>
    <javac srcdir="src" classpathref="classpath">
      <include name="test/protobuf/Proto.java"/>
    </javac>
  </target>

  <target name="test" depends="compile_test_proto">
    <java classname="clojure.main" classpathref="classpath" failonerror="true" fork="true">
      <arg value="src/test.clj"/>
    </java>
  </target>
</project><commit_msg>make cp work on mac and linux<commit_after><project name="clojure-protobuf" default="package">

  <property name="repository.clojure" value="http://clojure.googlecode.com/files"/>
  <property name="dep.clojure" value="clojure-1.1.0"/>
  <property name="clojure.jar" value="lib/clojure.jar"/>

  <property name="repository.protobuf" value="http://protobuf.googlecode.com/files"/>
  <property name="dep.protobuf" value="protobuf-2.3.0"/>
  <property name="protobuf" value="lib/${dep.protobuf}"/>

  <property name="install_prefix" value="/usr/local"/>

  <condition property="copy_flags" value="-Rf">
    <and><os family="unix"/><os family="mac"/></and>
  </condition>
  <property name="copy_flags" value="-RTf"/>

  <target name="init">
    <mkdir dir="lib"/>
    <mkdir dir="classes"/>
  </target>

  <target name="distclean">
    <delete file="${protobuf}/Makefile"/>
  </target>

  <target name="clean">
    <delete>
      <fileset dir="." includes="*.jar"/>
    </delete>
    <delete dir="lib"/>
    <delete dir="classes"/>
  </target>

  <available file="${protobuf}" property="has_protobuf"/>
  <target name="fetch_protobuf" depends="init" unless="has_protobuf">
    <get src="${repository.protobuf}/${dep.protobuf}.tar.gz"
         dest="lib/${dep.protobuf}.tar.gz" usetimestamp="true"/>
    <gunzip src="lib/${dep.protobuf}.tar.gz"/>
    <untar src="lib/${dep.protobuf}.tar" dest="lib"/>
    <delete file="lib/${dep.protobuf}.tar"/>
  </target>

  <available file="${protobuf}/Makefile" property="configured_protobuf"/>
  <target name="config_protobuf" depends="fetch_protobuf" unless="configured_protobuf">
    <chmod file="${protobuf}/configure" perm="+x"/>
    <exec dir="${protobuf}" executable="./configure">
      <arg value="--prefix=${basedir}/lib/install"/>
    </exec>
  </target>

  <available file="${protobuf}/src/protoc" property="has_protoc"/>
  <target name="make_protobuf" depends="config_protobuf" unless="has_protoc">
    <chmod file="${protobuf}/install-sh" perm="+x"/>
    <exec dir="${protobuf}" executable="make" failonerror="true"/>
    <exec dir="${protobuf}" executable="make" failonerror="true">
      <arg value="install"/>
    </exec>
  </target>

  <path id="classpath">
    <pathelement location="${clojure.jar}"/>
    <pathelement location="src/clj"/>
    <pathelement location="src"/>
    <pathelement location="classes"/>
  </path>

  <available file="classes/com/google/protobuf/DescriptorProtos.class" property="proto_compiled"/>
  <target name="compile_protobuf" depends="make_protobuf" unless="proto_compiled">
    <exec dir="${protobuf}/java" executable="../src/protoc">
      <arg value="--java_out=src/main/java"/>
      <arg value="-I../src"/>
      <arg value="../src/google/protobuf/descriptor.proto"/>
    </exec>
    <javac srcdir="${protobuf}/java/src/main" destdir="classes"/>
  </target>

  <available file="src/jvm/clojure/protobuf/Collections.java" property="collections_proto_compiled"/>
  <target name="compile_collections_proto" depends="compile_protobuf" unless="collections_proto_compiled">
    <exec dir="src/jvm" executable="../../${protobuf}/src/protoc">
      <arg value="--java_out=."/>
      <arg value="-I."/>
      <arg value="-I../../${protobuf}/src"/>
      <arg value="clojure/protobuf/collections.proto"/>
    </exec>
  </target>

  <available file="${clojure.jar}" property="has_clojure"/>
  <target name="fetch_clojure" depends="init" unless="has_clojure">
    <get src="${repository.clojure}/${dep.clojure}.zip"
         dest="lib/${dep.clojure}.zip" usetimestamp="true"/>
    <unzip src="lib/${dep.clojure}.zip" dest="lib"/>
    <copy file="lib/${dep.clojure}/clojure.jar" todir="lib"/>
  </target>

  <target name="compile" depends="compile_protobuf,compile_collections_proto,fetch_clojure">
    <javac srcdir="src/jvm" destdir="classes" classpathref="classpath" debug="true"/>
    <java classname="clojure.lang.Compile" classpathref="classpath" failonerror="true">
      <sysproperty key="clojure.compile.path" value="classes"/>
      <arg value="protobuf"/>
    </java>
  </target>

  <target name="package" depends="compile">
    <jar destfile="clojure-protobuf.jar" basedir="classes"/>

    <exec executable="mkdir" failonerror="true">
      <arg value="-p"/>
      <arg line="lib/install/var/java lib/install/include/clojure/protobuf"/>
    </exec>
    <exec executable="cp" failonerror="true">
      <arg line="src/protoclj lib/install/bin"/>
    </exec>
    <chmod file="${install_prefix}/bin/protoclj" perm="+x"/>
    <exec executable="cp" failonerror="true">
      <arg line="src/jvm/clojure/protobuf/collections.proto lib/install/include/clojure/protobuf"/>
    </exec>
    <exec executable="cp" failonerror="true">
      <arg line="clojure-protobuf.jar lib/install/var/java"/>
    </exec>
  </target>

  <target name="install" depends="package">
    <echo message="Installing to ${install_prefix}/"/>
    <exec executable="cp" failonerror="true">
      <arg line="${copy_flags} ${basedir}/lib/install/ ${install_prefix}"/>
    </exec>
  </target>

  <target name="compile_test_proto" depends="compile">
    <exec dir="src" executable="../${protobuf}/src/protoc">
      <arg value="--java_out=."/>
      <arg value="-I."/>
      <arg value="-Ijvm/"/>
      <arg value="-I../${protobuf}/src/"/>
      <arg value="test/test.proto"/>
    </exec>
    <javac srcdir="src" classpathref="classpath">
      <include name="test/protobuf/Proto.java"/>
    </javac>
  </target>

  <target name="test" depends="compile_test_proto">
    <java classname="clojure.main" classpathref="classpath" failonerror="true" fork="true">
      <arg value="src/test.clj"/>
    </java>
  </target>
</project>
{'fraction_non_alphanumeric': 0.20615136298421807, 'fraction_numerical': 0.0010760401721664275, 'mean_word_length': 4.1682113067655235, 'pattern_counts': {'":': 0, '<': 254, '<?xml version=': 0, '>': 254, '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': '6973130', 'n_tokens_mistral': 3617, 'n_tokens_neox': 3566, 'n_words': 591}