<commit_before><?xml version="1.0" encoding="UTF-8"?>
<project name="JavaGatewayConnector" default="help">

  <target name="help">
     <echo message="To see available targets run 'ant -p' or 'ant -projecthelp' " />
     <java classname="org.apache.tools.ant.Main">
         <arg value="-projecthelp" />
     </java>
  </target>

  <!-- set global properties for this build -->
  <property name="java-lib-release" value="1.3.5"/>
  
  <property name="java-lib-src" location="${basedir}/src"/>
  <property name="java-lib-gen" location="${basedir}/gen"/>
  <property name="java-lib-build" location="${basedir}/build"/>
  <property name="java-lib-dist"  location="${basedir}/dist"/>
  <property name="java-lib-docs" location="${basedir}/docs/api"/>
  
  <condition property="isWindows">
      <os family="windows" />
    </condition>
    
    <condition property="isUnix">
      <os family="unix" />
    </condition>

  <target name="init" depends="-pre-build">
    <!-- Create the time stamp -->
    <tstamp/>
    <!-- Create the build directory structure used by compile -->
    <mkdir dir="${java-lib-build}"/>
    <mkdir dir="${java-lib-gen}"/>
  </target>
  
    <target name="-pre-build-unix" if="isUnix">
      <echo>configure ammo core libraries for ${basedir}.</echo>
        <!-- configure protobuf -->
        <mkdir dir="libs"/>
        <symlink taskname="add-protobuf-lib" action="single" overwrite="true" 
              link="${basedir}/libs/protobuf.jar" 
              resource="/usr/share/java/protobuf.jar"/>

        <fail message="Files are missing.">
           <condition>
               <not>
                   <resourcecount count="1">
                       <fileset id="simlinks" dir="libs">
                         <include name="protobuf.jar"/>
                       </fileset>
                   </resourcecount>
               </not>
           </condition>
        </fail>
    </target>
    
    <target name="-pre-build-windows" if="isWindows">
      <echo>configure ammo core libraries for ${basedir}.</echo>
        <!-- configure protobuf -->
        <mkdir dir="libs"/>
        <copy taskname="add-protobuf-lib" overwrite="true" 
              tofile="${basedir}/libs/protobuf.jar" 
              file="${basedir}/libs/protobuf-java-2.3.0.jar"/>

        <fail message="Files are missing.">
           <condition>
               <not>
                   <resourcecount count="1">
                       <fileset id="simlinks" dir="libs">
                         <include name="protobuf.jar"/>
                       </fileset>
                   </resourcecount>
               </not>
           </condition>
        </fail>
    </target>

    <target name="-pre-build" depends="-pre-build-windows,-pre-build-unix">
    
    </target>
    
    <property name="proto.dir" value="../common/protocol"/>

    <target name="protobuf">
        <echo>for running within eclipse, instead of bash script.</echo>
        <echo>Generating protocol buffers</echo>
        <mkdir dir="gen"/>
        <exec executable="protoc" taskname="pb">
            <arg value="--proto_path"/>
            <arg value="${proto.dir}"/>
            <arg value="--java_out=gen"/>
            <arg value="${proto.dir}/GatewayPrivateMessages.proto"/>
        </exec>
    </target>


  <target name="compile" depends="init,protobuf"
        description="compile the source " >
    <!-- Compile the java code from ${src} into ${build} -->
    <javac
       classpath="${basedir}/libs/protobuf.jar;${basedir}/libs/json-20090211.jar;${basedir}/libs/slf4j-api-1.6.4.jar" srcdir="${java-lib-src};${java-lib-gen}" destdir="${java-lib-build}"/>
    <!-- <javac srcdir="${gen}" destdir="${build}"/> -->
  </target>

  <target name="dist" depends="compile, document"
        description="generate the distribution" >
    <!-- Create the distribution directory -->
    <mkdir dir="${java-lib-dist}/lib"/>

    <!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file -->
    <jar jarfile="${java-lib-dist}/lib/gatewaypluginapi.jar" basedir="${java-lib-build}"/>
    <!-- rename for upload to nexus repository -->
    <copy tofile="${java-lib-dist}/lib/gatewaypluginapi-${java-lib-release}.jar" 
          file="${java-lib-dist}/lib/gatewaypluginapi.jar"/>

    <!-- Put everything in ${docs} into the MyProject-${DSTAMP}.jar file -->
    <jar jarfile="${java-lib-dist}/lib/gatewaypluginapi-${java-lib-release}-javadocs.jar" basedir="${java-lib-docs}"/>

    <jar jarfile="${java-lib-dist}/lib/gatewaypluginapi-${java-lib-release}-sources.jar">
       <fileset dir="src" defaultexcludes="yes">
          <include name="edu/vu/isis/ammo/**"/>
       </fileset>
       <fileset dir="gen" defaultexcludes="yes">
          <include name="edu/vu/isis/ammo/**"/>
       </fileset>
    </jar>
  </target>

  <target name="document" depends="init,protobuf"
        description="build the javadoc " >
    <javadoc destdir="${java-lib-docs}" author="true" version="true"
          use="true" public="true" windowtitle="Gateway Connector API">

       <packageset dir="src" defaultexcludes="yes">
          <include name="edu/vu/isis/ammo/**"/>
          <exclude name="edu/vu/isis/ammo/gateway/GatewayConfigurationManager.java"/>
          <exclude name="org/**"/>
       </packageset>

       <doctitle><![CDATA[<h1>Gateway Connector API</h1>]]></doctitle>
       <bottom><![CDATA[<i>Copyright &#169; 2012 Vanderbilt/ISIS. All Rights Reserved.</i>]]></bottom>
       <!--
       <tag name="todo" scope="all" description="To do:"/>
       <group title="Group 1 Packages" packages="com.dummy.test.a*"/>
       <group title="Group 2 Packages" packages="com.dummy.test.b*:com.dummy.test.c*"/>
       <link offline="true" href="http://download.oracle.com/javase/6/docs/api/" packagelistLoc="C:\tmp"/>
       <link href="http://developer.java.sun.com/developer/products/xml/docs/api/"/>
       -->
    </javadoc>
  </target>

  <target name="clean"
        description="clean up" >
    <!-- Delete the ${build} and ${dist} directory trees -->
    <delete dir="${java-lib-build}"/>
    <delete dir="${java-lib-dist}"/>
  </target>


  <target name="realclean" depends="clean"
        description="real clean up" >
    <!-- Delete the ${build} and ${dist} directory trees -->
    <delete dir="${java-lib-gen}"/>
  </target>


</project>
<commit_msg>Make error when protobuf lib is missing tell what's wrong.<commit_after><?xml version="1.0" encoding="UTF-8"?>
<project name="JavaGatewayConnector" default="help">

  <target name="help">
     <echo message="To see available targets run 'ant -p' or 'ant -projecthelp' " />
     <java classname="org.apache.tools.ant.Main">
         <arg value="-projecthelp" />
     </java>
  </target>

  <!-- set global properties for this build -->
  <property name="java-lib-release" value="1.3.5"/>
  
  <property name="java-lib-src" location="${basedir}/src"/>
  <property name="java-lib-gen" location="${basedir}/gen"/>
  <property name="java-lib-build" location="${basedir}/build"/>
  <property name="java-lib-dist"  location="${basedir}/dist"/>
  <property name="java-lib-docs" location="${basedir}/docs/api"/>
  
  <condition property="isWindows">
      <os family="windows" />
    </condition>
    
    <condition property="isUnix">
      <os family="unix" />
    </condition>

  <target name="init" depends="-pre-build">
    <!-- Create the time stamp -->
    <tstamp/>
    <!-- Create the build directory structure used by compile -->
    <mkdir dir="${java-lib-build}"/>
    <mkdir dir="${java-lib-gen}"/>
  </target>
  
    <target name="-pre-build-unix" if="isUnix">
      <echo>configure ammo core libraries for ${basedir}.</echo>
        <!-- configure protobuf -->
        <mkdir dir="libs"/>
        <symlink taskname="add-protobuf-lib" action="single" overwrite="true" 
              link="${basedir}/libs/protobuf.jar" 
              resource="/usr/share/java/protobuf.jar"/>

        <fail message="The Protocol Buffers library for Java is missing.  On Ubuntu, install libprotobuf-java.">
           <condition>
               <not>
                   <resourcecount count="1">
                       <fileset id="simlinks" dir="libs">
                         <include name="protobuf.jar"/>
                       </fileset>
                   </resourcecount>
               </not>
           </condition>
        </fail>
    </target>
    
    <target name="-pre-build-windows" if="isWindows">
      <echo>configure ammo core libraries for ${basedir}.</echo>
        <!-- configure protobuf -->
        <mkdir dir="libs"/>
        <copy taskname="add-protobuf-lib" overwrite="true" 
              tofile="${basedir}/libs/protobuf.jar" 
              file="${basedir}/libs/protobuf-java-2.3.0.jar"/>

        <fail message="Files are missing.">
           <condition>
               <not>
                   <resourcecount count="1">
                       <fileset id="simlinks" dir="libs">
                         <include name="protobuf.jar"/>
                       </fileset>
                   </resourcecount>
               </not>
           </condition>
        </fail>
    </target>

    <target name="-pre-build" depends="-pre-build-windows,-pre-build-unix">
    
    </target>
    
    <property name="proto.dir" value="../common/protocol"/>

    <target name="protobuf">
        <echo>for running within eclipse, instead of bash script.</echo>
        <echo>Generating protocol buffers</echo>
        <mkdir dir="gen"/>
        <exec executable="protoc" taskname="pb">
            <arg value="--proto_path"/>
            <arg value="${proto.dir}"/>
            <arg value="--java_out=gen"/>
            <arg value="${proto.dir}/GatewayPrivateMessages.proto"/>
        </exec>
    </target>


  <target name="compile" depends="init,protobuf"
        description="compile the source " >
    <!-- Compile the java code from ${src} into ${build} -->
    <javac
       classpath="${basedir}/libs/protobuf.jar;${basedir}/libs/json-20090211.jar;${basedir}/libs/slf4j-api-1.6.4.jar" srcdir="${java-lib-src};${java-lib-gen}" destdir="${java-lib-build}"/>
    <!-- <javac srcdir="${gen}" destdir="${build}"/> -->
  </target>

  <target name="dist" depends="compile, document"
        description="generate the distribution" >
    <!-- Create the distribution directory -->
    <mkdir dir="${java-lib-dist}/lib"/>

    <!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file -->
    <jar jarfile="${java-lib-dist}/lib/gatewaypluginapi.jar" basedir="${java-lib-build}"/>
    <!-- rename for upload to nexus repository -->
    <copy tofile="${java-lib-dist}/lib/gatewaypluginapi-${java-lib-release}.jar" 
          file="${java-lib-dist}/lib/gatewaypluginapi.jar"/>

    <!-- Put everything in ${docs} into the MyProject-${DSTAMP}.jar file -->
    <jar jarfile="${java-lib-dist}/lib/gatewaypluginapi-${java-lib-release}-javadocs.jar" basedir="${java-lib-docs}"/>

    <jar jarfile="${java-lib-dist}/lib/gatewaypluginapi-${java-lib-release}-sources.jar">
       <fileset dir="src" defaultexcludes="yes">
          <include name="edu/vu/isis/ammo/**"/>
       </fileset>
       <fileset dir="gen" defaultexcludes="yes">
          <include name="edu/vu/isis/ammo/**"/>
       </fileset>
    </jar>
  </target>

  <target name="document" depends="init,protobuf"
        description="build the javadoc " >
    <javadoc destdir="${java-lib-docs}" author="true" version="true"
          use="true" public="true" windowtitle="Gateway Connector API">

       <packageset dir="src" defaultexcludes="yes">
          <include name="edu/vu/isis/ammo/**"/>
          <exclude name="edu/vu/isis/ammo/gateway/GatewayConfigurationManager.java"/>
          <exclude name="org/**"/>
       </packageset>

       <doctitle><![CDATA[<h1>Gateway Connector API</h1>]]></doctitle>
       <bottom><![CDATA[<i>Copyright &#169; 2012 Vanderbilt/ISIS. All Rights Reserved.</i>]]></bottom>
       <!--
       <tag name="todo" scope="all" description="To do:"/>
       <group title="Group 1 Packages" packages="com.dummy.test.a*"/>
       <group title="Group 2 Packages" packages="com.dummy.test.b*:com.dummy.test.c*"/>
       <link offline="true" href="http://download.oracle.com/javase/6/docs/api/" packagelistLoc="C:\tmp"/>
       <link href="http://developer.java.sun.com/developer/products/xml/docs/api/"/>
       -->
    </javadoc>
  </target>

  <target name="clean"
        description="clean up" >
    <!-- Delete the ${build} and ${dist} directory trees -->
    <delete dir="${java-lib-build}"/>
    <delete dir="${java-lib-dist}"/>
  </target>


  <target name="realclean" depends="clean"
        description="real clean up" >
    <!-- Delete the ${build} and ${dist} directory trees -->
    <delete dir="${java-lib-gen}"/>
  </target>


</project>

{'fraction_non_alphanumeric': 0.18897576231430804, 'fraction_numerical': 0.00547302580140735, 'mean_word_length': 2.484336692999183, 'pattern_counts': {'":': 0, '<': 281, '<?xml version=': 2, '>': 281, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1439167', 'n_tokens_mistral': 3944, 'n_tokens_neox': 3769, 'n_words': 744}