Skip to content

Commit

Permalink
Final touches to making the build to produce also jars with sources
Browse files Browse the repository at this point in the history
--HG--
extra : convert_revision : svn%3Aaa2aecf3-ea3e-0410-9d70-716747e7c967/trunk%401441
  • Loading branch information
mockitoguy committed May 14, 2009
1 parent 217e1fc commit 6155665
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 4 deletions.
3 changes: 3 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,8 @@ Libraries used:

Cglib - Apache License 2.0
ASM - BSD license

Mockito all distribution:

Objenesis - MIT license
Hamcrest - BSD license
46 changes: 43 additions & 3 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,14 @@
<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.sources" value="${lib.dir}/sources" />

<property name="jar.core" value="mockito-core-${version}.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.sources" value="mockito-all-${version}-sources.jar" />

<property name="jar.tests" value="mockito-tests.jar" />
<property name="zip" value="mockito-${version}.zip" />

Expand Down Expand Up @@ -121,12 +126,11 @@
</zipfileset>
<zipfileset src="${lib.dir.run}/hamcrest-core-1.1.jar">
<exclude name="LICENSE.txt" />
<exclude name="**/*.java" />
</zipfileset>
<zipfileset src="${lib.dir.run}/${cglib-and-asm.jar}"/>
</jarjar>
</target>


<target name="jar" depends="jar.all">
<jarjar jarfile="${target.dir}/${jar.core}">
<manifest>
Expand All @@ -145,7 +149,39 @@
</jarjar>
</target>

<target name="prepare.package" depends="jar, javadoc">
<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="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}/objenesis-1.0-sources.jar" />
<zipfileset src="${lib.dir.sources}/hamcrest-core-1.1-sources.jar" />
</jar>
</target>

<target name="prepare.package" depends="jar, javadoc, sources-all">
<mkdir dir="${target.dir}/mockito.zip.tmp/separate-jars" />
<copy todir="${target.dir}/mockito.zip.tmp/separate-jars">
<fileset dir="${lib.dir.run}">
Expand All @@ -163,6 +199,10 @@
<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>

Expand Down
3 changes: 2 additions & 1 deletion doc/jars-info.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ To use mockito either:
- put 'mockito-all-x.jar' on your path (all jars are expanded into single jar)
- or put all jars from 'separate-jars' folder on your path

All jars (even the dependencies) contain java source inside.
All jars (even the dependencies) contain java source inside.
However, for convenience of some IDEs there are also source distributions in sources folder
Binary file added lib/sources/cglib-and-asm-1.0-sources.jar
Binary file not shown.

0 comments on commit 6155665

Please sign in to comment.