<commit_before><!--
 Copyright (c) 2007 Mockito contributors 
 This program is made available under the terms of the MIT License.
-->
<project name="mockito" basedir="." default="all">

  <loadproperties srcfile="version.properties" />
    
  <property name="src.dir" value="src" />
  <property name="test.src.dir" value="test" />
  <property name="target.dir" value="target" />
  <property name="snapshots" value="${target.dir}/snapshots" />
  <property name="src.classes.dir" value="${target.dir}/classes" />
  <property name="test.classes.dir" value="${target.dir}/test-classes" />
  <property name="test.reports.dir" value="${target.dir}/reports/junit" />
  <property name="test.reports.dir.html" value="${target.dir}/reports/junit.html" />
	
  <property name="javadoc.dir" value="${target.dir}/javadoc" />

  <property name="lib.dir" value="lib" />
  <property name="lib.dir.build" value="${lib.dir}/build" />
  <property name="lib.dir.run" value="${lib.dir}/run" />
  <property name="lib.dir.compile" value="${lib.dir}/compile" />
  <property name="lib.dir.test" value="${lib.dir}/test" />
  <property name="lib.dir.repackaged" value="${lib.dir}/repackaged" />
  <property name="lib.dir.sources" value="${lib.dir}/sources" />
    
  <property name="jar.core" value="mockito-core-${version}.jar" />
  <property name="jar.core.javadoc" value="mockito-core-${version}-javadoc.jar" />
  <property name="jar.core.sources" value="mockito-core-${version}-sources.jar" />
	
  <property name="jar.all" value="mockito-all-${version}.jar" />
  <property name="jar.all.javadoc" value="mockito-all-${version}-javadoc.jar" />
  <property name="jar.all.sources" value="mockito-all-${version}-sources.jar" />
	
  <property name="jar.core.osgified" value="${jar.core}-osgified" />
  <property name="jar.all.osgified" value="${jar.all}-osgified" />
	
  <property name="jar.tests" value="mockito-tests.jar" />
  <property name="zip" value="mockito-${version}.zip" />
	
  <property name="maven.repository.dir" value="${basedir}/maven/repository" />
  
  <path id="compile.classpath">
    <fileset dir="${lib.dir.run}" includes="*.jar" />
    <fileset dir="${lib.dir.compile}" includes="*.jar" />
    <fileset dir="${lib.dir.repackaged}" includes="*.jar" />
  </path>

  <path id="test.compile.classpath">
  	<fileset dir="${lib.dir.test}" includes="*.jar" />
    <path refid="compile.classpath" />
    <pathelement location="${src.classes.dir}" />
  </path>

  <path id="test.classpath">
    <path refid="test.compile.classpath" />
    <pathelement location="${test.classes.dir}" />
  </path>

  <path id="ant.classpath">
    <fileset dir="${lib.dir.build}" includes="*.jar" />
  </path>

  <target name="prepare">
    <mkdir dir="${src.classes.dir}" />
    <mkdir dir="${test.classes.dir}" />
    <mkdir dir="${test.reports.dir}" />
  </target>

  <target name="clean" description="Cleans out the build directories">
    <delete includeemptydirs="true" quiet="true">
      <fileset dir="${target.dir}">
        <exclude name="eclipse-*/**" />
      </fileset>
    </delete>
  </target>

  <target name="compile" depends="clean, prepare">
    <javac srcdir="src" destdir="${src.classes.dir}" source="1.5" target="1.5" debug="true" deprecation="true" nowarn="true">
      <classpath refid="compile.classpath" />
    </javac>
  </target>

  <target name="compile.test" depends="compile">
    <javac srcdir="test" destdir="${test.classes.dir}" source="1.5" target="1.5" debug="true" deprecation="true" nowarn="true">
      <classpath refid="test.compile.classpath" />
    </javac>
  </target>

  <target name="test" depends="compile.test, pmd" description="Executes the unit tests">
    <junit fork="true" forkmode="once" printsummary="on" haltonfailure="false" failureproperty="mockito.tests.failed">
      <formatter type="xml"/>
      <classpath refid="test.classpath" />
      <jvmarg value="-ea" />

      <batchtest todir="${test.reports.dir}">
        <fileset dir="${test.classes.dir}" includes="**/*Test.class" />
      </batchtest>
    </junit>	
	
	<antcall target="junit.report" />
   
    <fail if="mockito.tests.failed" message="Tests failed."/>
  </target>
  
  <target name="junit.report">
    <mkdir dir="${test.reports.dir.html}" />
	<junitreport todir="${test.reports.dir.html}">
	  <fileset dir="${test.reports.dir}">
		<include name="*.xml"/>
	  </fileset>
	  <report format="frames" todir="${test.reports.dir.html}"/>
	</junitreport>
  </target>

  <target name="pmd" depends="prepare">

    <taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask" classpathref="ant.classpath" />

    <pmd shortFilenames="true" failonruleviolation="true" rulesetfiles="conf/pmd-rules.xml">
      <ruleset>Mockito</ruleset>
      <formatter type="text" toConsole="true" />

      <fileset dir="${src.dir}">
        <include name="**/*.java" />
      </fileset>

      <fileset dir="${test.src.dir}">
        <include name="**/*.java" />
      </fileset>
    </pmd>

  </target>

  <target name="jar.all" depends="test">
    <taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask" classpathref="ant.classpath" />
    <jarjar jarfile="${target.dir}/${jar.all}">
        <manifest>
          <attribute name="Built-By" value="${user.name}"/>
          <attribute name="Implementation-Version" value="${version}"/>
        </manifest>
      <fileset dir="." file="LICENSE" />
      <fileset dir="." file="NOTICE" />
      <fileset dir="${src.classes.dir}" />
      <zipfileset dir="${src.dir}" />
	  <fileset dir="${lib.dir.run}" excludes="*.jar" />
      <fileset dir="${lib.dir.repackaged}" excludes="*.jar" />
      <zipfileset src="${lib.dir.run}/com.springsource.org.objenesis-1.0.0.jar">
        <exclude name="META-INF/maven/**"/>
      </zipfileset>
      <zipfileset src="${lib.dir.run}/com.springsource.org.hamcrest.core-1.1.0.jar">
        <exclude name="LICENSE.txt" />
      </zipfileset>
      <zipfileset src="${lib.dir.repackaged}/cglib-and-asm-1.0.jar" />
    </jarjar>
  </target>
	
<taskdef resource="aQute/bnd/ant/taskdef.properties" classpathref="ant.classpath"/> 
  <target name="bnd-core" depends="jar" > 
    <bnd
         classpath="${target.dir}/${jar.core}"
         eclipse="false"
         failok="false"
         exceptions="true"
         sourcepath="${src.dir}"
         destfile="${target.dir}/${jar.core.osgified}"
         files="conf/mockito-core.bnd"/>
  </target>
	
  <target name="bnd-all" depends="jar" > 
    <bnd
         classpath="${target.dir}/${jar.all}"
         eclipse="false"
         failok="false"
         exceptions="true"
         sourcepath="${src.dir}"
         destfile="${target.dir}/${jar.all.osgified}"
         files="conf/mockito-all.bnd"/>
  </target>	
	
    <target name="osgify.manifests" depends="bnd-core, bnd-all"> 
        <zip update="true" destfile="${target.dir}/${jar.core}" >
          <zipfileset src="${target.dir}/${jar.core.osgified}" >
            <include name="META-INF/MANIFEST.MF"/>
          </zipfileset>
    	</zip>
        <zip update="true" destfile="${target.dir}/${jar.all}">
          <zipfileset src="${target.dir}/${jar.all.osgified}" >
            <include name="META-INF/MANIFEST.MF"/>
          </zipfileset>
    	</zip>
        <zip update="true" destfile="${target.dir}/${jar.core.sources}">
          <zipfileset src="${target.dir}/${jar.core.osgified}" >
            <include name="META-INF/MANIFEST.MF"/>
          </zipfileset>
    	</zip>
        <zip update="true" destfile="${target.dir}/${jar.all.sources}">
          <zipfileset src="${target.dir}/${jar.all.osgified}" >
            <include name="META-INF/MANIFEST.MF"/>
          </zipfileset>
    	</zip>
    	<delete file="${target.dir}/${jar.all.osgified}" />
    	<delete file="${target.dir}/${jar.core.osgified}" />
  </target>
	
  <target name="jar" depends="jar.all">
    <jarjar jarfile="${target.dir}/${jar.core}">
      <manifest>
        <attribute name="Built-By" value="${user.name}"/>
        <attribute name="Implementation-Version" value="${version}"/>
      </manifest>
      <fileset dir="${lib.dir.repackaged}" includes="*.txt" />
      <fileset dir="." file="LICENSE" />
      <fileset dir="." file="NOTICE" />
      <fileset dir="${src.classes.dir}" />
      <fileset dir="${src.dir}" />
      <zipfileset src="${lib.dir.repackaged}/cglib-and-asm-1.0.jar"/>
    </jarjar>
  </target>
	
  <target name="sources" >
    <jar jarfile="${target.dir}/${jar.core.sources}">
        <manifest>
          <attribute name="Built-By" value="${user.name}"/>
          <attribute name="Implementation-Version" value="${version}"/>
        </manifest>
      <fileset dir="." file="LICENSE" />
      <fileset dir="." file="NOTICE" />
      <fileset dir="${src.dir}" />
      <zipfileset src="${lib.dir.sources}/cglib-and-asm-1.0-sources.jar" />
    </jar>
  </target>
	
  <target name="javadoc.jar" depends="javadoc">
    <jar jarfile="${target.dir}/${jar.core.javadoc}">
      <manifest>
        <attribute name="Built-By" value="${user.name}"/>
        <attribute name="Implementation-Version" value="${version}"/>
      </manifest>
      <fileset dir="${javadoc.dir}" />
    </jar>
  </target>
	
  <target name="sources-all" depends="sources" >
    <jar jarfile="${target.dir}/${jar.all.sources}">
        <manifest>
          <attribute name="Built-By" value="${user.name}"/>
          <attribute name="Implementation-Version" value="${version}"/>
        </manifest>
      <fileset dir="." file="LICENSE" />
      <fileset dir="." file="NOTICE" />
        <fileset dir="${lib.dir.run}" >
          <include name="hamcrest-license*"/>
          <include name="objenesis-license*"/>
        </fileset>
      <fileset dir="${src.dir}" />
      <zipfileset src="${lib.dir.sources}/cglib-and-asm-1.0-sources.jar" />
      <zipfileset src="${lib.dir.sources}/com.springsource.org.hamcrest.core-1.1.0-sources.jar" >
      	<exclude name="LICENSE.txt" />
      </zipfileset>
      <zipfileset src="${lib.dir.sources}/com.springsource.org.objenesis-1.0.0-sources.jar" />
    </jar>
  </target>

  <target name="javadoc-all.jar" depends="javadoc">
    <jar jarfile="${target.dir}/${jar.all.javadoc}">
      <manifest>
        <attribute name="Built-By" value="${user.name}"/>
        <attribute name="Implementation-Version" value="${version}"/>
      </manifest>
      <fileset dir="${javadoc.dir}" />
    </jar>
  </target>
	
  <target name="prepare.package" depends="jar, javadoc, javadoc.jar, javadoc-all.jar, sources-all, osgify.manifests">
    <mkdir dir="${target.dir}/mockito.zip.tmp/separate-jars" />
    <copy todir="${target.dir}/mockito.zip.tmp/separate-jars">
      <fileset dir="${lib.dir.run}" />
      <fileset dir="${lib.dir.repackaged}" includes="*.txt" />
      <fileset dir="${target.dir}" includes="${jar.core}" />
    </copy>
    <mkdir dir="${target.dir}/mockito.zip.tmp/javadoc" />
    <copy todir="${target.dir}/mockito.zip.tmp/javadoc">
      <fileset dir="${javadoc.dir}" />
    </copy>
    <copy todir="${target.dir}/mockito.zip.tmp">
      <fileset dir="." includes="LICENSE" />
      <fileset dir="." includes="NOTICE" />
      <fileset dir="doc" includes="jars-info.txt" />
      <fileset dir="${target.dir}" includes="${jar.all}" />
    </copy>
  	<mkdir dir="${target.dir}/mockito.zip.tmp/sources" />
    <copy todir="${target.dir}/mockito.zip.tmp/sources">
      <fileset dir="${target.dir}" includes="*-sources.jar" />
    </copy>
  </target>

  <target name="zip" depends="prepare.package">
    <zip destfile="${target.dir}/${zip}">
      <fileset dir="${target.dir}/mockito.zip.tmp"/>
    </zip>
  </target>

  <target name="javadoc">
    <javadoc sourcepath="${src.dir}" destdir="${javadoc.dir}" 
      author="true" version="true" use="true" windowtitle="Mockito API">
      <doctitle>
        <![CDATA[
          <h1><a href="org/mockito/Mockito.html">Click to see examples</a>. Mockito API.</h1>
        ]]>
      </doctitle>
      <group title="Main package" packages="org.mockito"/>
      <classpath refid="compile.classpath" />
    </javadoc>
  	<copy todir="${javadoc.dir}/org/mockito" file="img/logo.jpg" />
  </target>

  <target name="repackage-tests">
    <jarjar jarfile="${target.dir}/${jar.tests}">
      <fileset dir="${test.classes.dir}"/>
      <rule pattern="net.sf.**" result="org.mockito.@1" />
      <rule pattern="org.objectweb.**" result="org.mockito.@1" />
    </jarjar>
  </target>  
  
  <target name="test.zip.release" depends="zip, repackage-tests" >
    <delete dir="${target.dir}/tmp"/>
    <unzip dest="${target.dir}/tmp" src="${target.dir}/${zip}" />
      <junit fork="true" forkmode="once" haltonfailure="true">
        <formatter type="plain" usefile="false"/>      	
        <classpath>
          <fileset dir="${target.dir}/tmp" includes="${jar.all}" />
          <fileset dir="${lib.dir.test}" includes="*.jar" />
          <fileset dir="${lib.dir.compile}" includes="*junit*.jar" />
          <pathelement location="${target.dir}/${jar.tests}"/>
        </classpath>
        <jvmarg value="-ea" />
        <batchtest>
          <fileset dir="${test.classes.dir}" includes="**/*Test.class" />
        </batchtest>
      </junit>
  </target>
  
  <target name="test.zip.release.separate.jars" depends="zip, repackage-tests" >
    <delete dir="${target.dir}/tmp2"/>
    <unzip dest="${target.dir}/tmp2" src="${target.dir}/${zip}" />
    <junit fork="true" forkmode="once" haltonfailure="true">
      <formatter type="plain" usefile="false" />
      <classpath>
        <fileset dir="${target.dir}/tmp2/separate-jars" includes="*.jar" />
      	<fileset dir="${lib.dir.test}" includes="*.jar" />
      	<fileset dir="${lib.dir.compile}" includes="*junit*.jar" /><commit_msg>Removed some no longer needed logic (the package rewriting). Added explicit task dependency.<commit_after><!--
 Copyright (c) 2007 Mockito contributors 
 This program is made available under the terms of the MIT License.
-->
<project name="mockito" basedir="." default="all">

  <loadproperties srcfile="version.properties" />
    
  <property name="src.dir" value="src" />
  <property name="test.src.dir" value="test" />
  <property name="target.dir" value="target" />
  <property name="snapshots" value="${target.dir}/snapshots" />
  <property name="src.classes.dir" value="${target.dir}/classes" />
  <property name="test.classes.dir" value="${target.dir}/test-classes" />
  <property name="test.reports.dir" value="${target.dir}/reports/junit" />
  <property name="test.reports.dir.html" value="${target.dir}/reports/junit.html" />
	
  <property name="javadoc.dir" value="${target.dir}/javadoc" />

  <property name="lib.dir" value="lib" />
  <property name="lib.dir.build" value="${lib.dir}/build" />
  <property name="lib.dir.run" value="${lib.dir}/run" />
  <property name="lib.dir.compile" value="${lib.dir}/compile" />
  <property name="lib.dir.test" value="${lib.dir}/test" />
  <property name="lib.dir.repackaged" value="${lib.dir}/repackaged" />
  <property name="lib.dir.sources" value="${lib.dir}/sources" />
    
  <property name="jar.core" value="mockito-core-${version}.jar" />
  <property name="jar.core.javadoc" value="mockito-core-${version}-javadoc.jar" />
  <property name="jar.core.sources" value="mockito-core-${version}-sources.jar" />
	
  <property name="jar.all" value="mockito-all-${version}.jar" />
  <property name="jar.all.javadoc" value="mockito-all-${version}-javadoc.jar" />
  <property name="jar.all.sources" value="mockito-all-${version}-sources.jar" />
	
  <property name="jar.core.osgified" value="${jar.core}-osgified" />
  <property name="jar.all.osgified" value="${jar.all}-osgified" />
	
  <property name="jar.tests" value="mockito-tests.jar" />
  <property name="zip" value="mockito-${version}.zip" />
	
  <property name="maven.repository.dir" value="${basedir}/maven/repository" />
  
  <path id="compile.classpath">
    <fileset dir="${lib.dir.run}" includes="*.jar" />
    <fileset dir="${lib.dir.compile}" includes="*.jar" />
    <fileset dir="${lib.dir.repackaged}" includes="*.jar" />
  </path>

  <path id="test.compile.classpath">
  	<fileset dir="${lib.dir.test}" includes="*.jar" />
    <path refid="compile.classpath" />
    <pathelement location="${src.classes.dir}" />
  </path>

  <path id="test.classpath">
    <path refid="test.compile.classpath" />
    <pathelement location="${test.classes.dir}" />
  </path>

  <path id="ant.classpath">
    <fileset dir="${lib.dir.build}" includes="*.jar" />
  </path>

  <target name="prepare">
    <mkdir dir="${src.classes.dir}" />
    <mkdir dir="${test.classes.dir}" />
    <mkdir dir="${test.reports.dir}" />
  </target>

  <target name="clean" description="Cleans out the build directories">
    <delete includeemptydirs="true" quiet="true">
      <fileset dir="${target.dir}">
        <exclude name="eclipse-*/**" />
      </fileset>
    </delete>
  </target>

  <target name="compile" depends="clean, prepare">
    <javac srcdir="src" destdir="${src.classes.dir}" source="1.5" target="1.5" debug="true" deprecation="true" nowarn="true">
      <classpath refid="compile.classpath" />
    </javac>
  </target>

  <target name="compile.test" depends="compile">
    <javac srcdir="test" destdir="${test.classes.dir}" source="1.5" target="1.5" debug="true" deprecation="true" nowarn="true">
      <classpath refid="test.compile.classpath" />
    </javac>
  </target>

  <target name="test" depends="compile.test, pmd" description="Executes the unit tests">
    <junit fork="true" forkmode="once" printsummary="on" haltonfailure="false" failureproperty="mockito.tests.failed">
      <formatter type="xml"/>
      <classpath refid="test.classpath" />
      <jvmarg value="-ea" />

      <batchtest todir="${test.reports.dir}">
        <fileset dir="${test.classes.dir}" includes="**/*Test.class" />
      </batchtest>
    </junit>	
	
	<antcall target="junit.report" />
   
    <fail if="mockito.tests.failed" message="Tests failed."/>
  </target>
  
  <target name="junit.report">
    <mkdir dir="${test.reports.dir.html}" />
	<junitreport todir="${test.reports.dir.html}">
	  <fileset dir="${test.reports.dir}">
		<include name="*.xml"/>
	  </fileset>
	  <report format="frames" todir="${test.reports.dir.html}"/>
	</junitreport>
  </target>

  <target name="pmd" depends="prepare">

    <taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask" classpathref="ant.classpath" />

    <pmd shortFilenames="true" failonruleviolation="true" rulesetfiles="conf/pmd-rules.xml">
      <ruleset>Mockito</ruleset>
      <formatter type="text" toConsole="true" />

      <fileset dir="${src.dir}">
        <include name="**/*.java" />
      </fileset>

      <fileset dir="${test.src.dir}">
        <include name="**/*.java" />
      </fileset>
    </pmd>

  </target>

  <target name="jar.all" depends="test">
    <taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask" classpathref="ant.classpath" />
    <jarjar jarfile="${target.dir}/${jar.all}">
        <manifest>
          <attribute name="Built-By" value="${user.name}"/>
          <attribute name="Implementation-Version" value="${version}"/>
        </manifest>
      <fileset dir="." file="LICENSE" />
      <fileset dir="." file="NOTICE" />
      <fileset dir="${src.classes.dir}" />
      <zipfileset dir="${src.dir}" />
	  <fileset dir="${lib.dir.run}" excludes="*.jar" />
      <fileset dir="${lib.dir.repackaged}" excludes="*.jar" />
      <zipfileset src="${lib.dir.run}/com.springsource.org.objenesis-1.0.0.jar">
        <exclude name="META-INF/maven/**"/>
      </zipfileset>
      <zipfileset src="${lib.dir.run}/com.springsource.org.hamcrest.core-1.1.0.jar">
        <exclude name="LICENSE.txt" />
      </zipfileset>
      <zipfileset src="${lib.dir.repackaged}/cglib-and-asm-1.0.jar" />
    </jarjar>
  </target>
	
<taskdef resource="aQute/bnd/ant/taskdef.properties" classpathref="ant.classpath"/> 
  <target name="bnd-core" depends="jar" > 
    <bnd
         classpath="${target.dir}/${jar.core}"
         eclipse="false"
         failok="false"
         exceptions="true"
         sourcepath="${src.dir}"
         destfile="${target.dir}/${jar.core.osgified}"
         files="conf/mockito-core.bnd"/>
  </target>
	
  <target name="bnd-all" depends="jar" > 
    <bnd
         classpath="${target.dir}/${jar.all}"
         eclipse="false"
         failok="false"
         exceptions="true"
         sourcepath="${src.dir}"
         destfile="${target.dir}/${jar.all.osgified}"
         files="conf/mockito-all.bnd"/>
  </target>	
	
    <target name="osgify.manifests" depends="bnd-core, bnd-all"> 
        <zip update="true" destfile="${target.dir}/${jar.core}" >
          <zipfileset src="${target.dir}/${jar.core.osgified}" >
            <include name="META-INF/MANIFEST.MF"/>
          </zipfileset>
    	</zip>
        <zip update="true" destfile="${target.dir}/${jar.all}">
          <zipfileset src="${target.dir}/${jar.all.osgified}" >
            <include name="META-INF/MANIFEST.MF"/>
          </zipfileset>
    	</zip>
        <zip update="true" destfile="${target.dir}/${jar.core.sources}">
          <zipfileset src="${target.dir}/${jar.core.osgified}" >
            <include name="META-INF/MANIFEST.MF"/>
          </zipfileset>
    	</zip>
        <zip update="true" destfile="${target.dir}/${jar.all.sources}">
          <zipfileset src="${target.dir}/${jar.all.osgified}" >
            <include name="META-INF/MANIFEST.MF"/>
          </zipfileset>
    	</zip>
    	<delete file="${target.dir}/${jar.all.osgified}" />
    	<delete file="${target.dir}/${jar.core.osgified}" />
  </target>
	
  <target name="jar" depends="jar.all">
    <jarjar jarfile="${target.dir}/${jar.core}">
      <manifest>
        <attribute name="Built-By" value="${user.name}"/>
        <attribute name="Implementation-Version" value="${version}"/>
      </manifest>
      <fileset dir="${lib.dir.repackaged}" includes="*.txt" />
      <fileset dir="." file="LICENSE" />
      <fileset dir="." file="NOTICE" />
      <fileset dir="${src.classes.dir}" />
      <fileset dir="${src.dir}" />
      <zipfileset src="${lib.dir.repackaged}/cglib-and-asm-1.0.jar"/>
    </jarjar>
  </target>
	
  <target name="sources" >
    <jar jarfile="${target.dir}/${jar.core.sources}">
        <manifest>
          <attribute name="Built-By" value="${user.name}"/>
          <attribute name="Implementation-Version" value="${version}"/>
        </manifest>
      <fileset dir="." file="LICENSE" />
      <fileset dir="." file="NOTICE" />
      <fileset dir="${src.dir}" />
      <zipfileset src="${lib.dir.sources}/cglib-and-asm-1.0-sources.jar" />
    </jar>
  </target>
	
  <target name="javadoc.jar" depends="javadoc">
    <jar jarfile="${target.dir}/${jar.core.javadoc}">
      <manifest>
        <attribute name="Built-By" value="${user.name}"/>
        <attribute name="Implementation-Version" value="${version}"/>
      </manifest>
      <fileset dir="${javadoc.dir}" />
    </jar>
  </target>
	
  <target name="sources-all" depends="sources" >
    <jar jarfile="${target.dir}/${jar.all.sources}">
        <manifest>
          <attribute name="Built-By" value="${user.name}"/>
          <attribute name="Implementation-Version" value="${version}"/>
        </manifest>
      <fileset dir="." file="LICENSE" />
      <fileset dir="." file="NOTICE" />
        <fileset dir="${lib.dir.run}" >
          <include name="hamcrest-license*"/>
          <include name="objenesis-license*"/>
        </fileset>
      <fileset dir="${src.dir}" />
      <zipfileset src="${lib.dir.sources}/cglib-and-asm-1.0-sources.jar" />
      <zipfileset src="${lib.dir.sources}/com.springsource.org.hamcrest.core-1.1.0-sources.jar" >
      	<exclude name="LICENSE.txt" />
      </zipfileset>
      <zipfileset src="${lib.dir.sources}/com.springsource.org.objenesis-1.0.0-sources.jar" />
    </jar>
  </target>

  <target name="javadoc-all.jar" depends="javadoc">
    <jar jarfile="${target.dir}/${jar.all.javadoc}">
      <manifest>
        <attribute name="Built-By" value="${user.name}"/>
        <attribute name="Implementation-Version" value="${version}"/>
      </manifest>
      <fileset dir="${javadoc.dir}" />
    </jar>
  </target>
	
  <target name="prepare.package" depends="jar, javadoc, javadoc.jar, javadoc-all.jar, sources-all, osgify.manifests">
    <mkdir dir="${target.dir}/mockito.zip.tmp/separate-jars" />
    <copy todir="${target.dir}/mockito.zip.tmp/separate-jars">
      <fileset dir="${lib.dir.run}" />
      <fileset dir="${lib.dir.repackaged}" includes="*.txt" />
      <fileset dir="${target.dir}" includes="${jar.core}" />
    </copy>
    <mkdir dir="${target.dir}/mockito.zip.tmp/javadoc" />
    <copy todir="${target.dir}/mockito.zip.tmp/javadoc">
      <fileset dir="${javadoc.dir}" />
    </copy>
    <copy todir="${target.dir}/mockito.zip.tmp">
      <fileset dir="." includes="LICENSE" />
      <fileset dir="." includes="NOTICE" />
      <fileset dir="doc" includes="jars-info.txt" />
      <fileset dir="${target.dir}" includes="${jar.all}" />
    </copy>
  	<mkdir dir="${target.dir}/mockito.zip.tmp/sources" />
    <copy todir="${target.dir}/mockito.zip.tmp/sources">
      <fileset dir="${target.dir}" includes="*-sources.jar" />
    </copy>
  </target>

  <target name="zip" depends="prepare.package">
    <zip destfile="${target.dir}/${zip}">
      <fileset dir="${target.dir}/mockito.zip.tmp"/>
    </zip>
  </target>

  <target name="javadoc">
    <javadoc sourcepath="${src.dir}" destdir="${javadoc.dir}" 
      author="true" version="true" use="true" windowtitle="Mockito API">
      <doctitle>
        <![CDATA[
          <h1><a href="org/mockito/Mockito.html">Click to see examples</a>. Mockito API.</h1>
        ]]>
      </doctitle>
      <group title="Main package" packages="org.mockito"/>
      <classpath refid="compile.classpath" />
    </javadoc>
  	<copy todir="${javadoc.dir}/org/mockito" file="img/logo.jpg" />
  </target>

  <target name="repackage-tests" depends="compile.test">
    <jar jarfile="${target.dir}/${jar.tests}">
      <fileset dir="${test.classes.dir}"/>
    </jar>
  </target>

  <target name="test.zip.release" depends="zip, repackage-tests" >
    <delete dir="${target.dir}/tmp"/>
    <unzip dest="${target.dir}/tmp" src="${target.dir}/${zip}" />
      <junit fork="true" forkmode="once" haltonfailure="true">
        <formatter type="plain" usefile="false"/>      	
        <classpath>
          <fileset dir="${target.dir}/tmp" includes="${jar.all}" />
          <fileset dir="${lib.dir.test}" includes="*.jar" />
          <fileset dir="${lib.dir.compile}" includes="*junit*.jar" />
          <pathelement location="${target.dir}/${jar.tests}"/>
        </classpath>
        <jvmarg value="-ea" />
        <batchtest>
          <fileset dir="${test.classes.dir}" includes="**/*Test.class" />
        </batchtest>
      </junit>
  </target>
  
  <target name="test.zip.release.separate.jars" depends="zip, repackage-tests" >
    <delete dir="${target.dir}/tmp2"/>
    <unzip dest="${target.dir}/tmp2" src="${target.dir}/${zip}" />
    <junit fork="true" forkmode="once" haltonfailure="true">
      <formatter type="plain" usefile="false" />
      <classpath>
        <fileset dir="${target.dir}/tmp2/separate-jars" includes="*.jar" />
      	<fileset dir="${lib.dir.test}" includes="*.jar" />
      	<fileset dir="${lib.dir.compile}" includes="*junit*.jar" />
{'fraction_non_alphanumeric': 0.21866900302997117, 'fraction_numerical': 0.0027744314240864456, 'mean_word_length': 3.1893255849518276, 'pattern_counts': {'":': 0, '<': 591, '<?xml version=': 0, '>': 591, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, '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': '2385722', 'n_tokens_mistral': 9381, 'n_tokens_neox': 9087, 'n_words': 1387}