|
| 1 | +<project name="java-ipfs-api" default="dist" basedir="."> |
| 2 | + <description> |
| 3 | + Java IPFS api |
| 4 | + </description> |
| 5 | + |
| 6 | + <property name="src" location="src"/> |
| 7 | + <property name="build" location="build"/> |
| 8 | + <property name="dist" location="dist"/> |
| 9 | + |
| 10 | + <path id="dep.runtime"> |
| 11 | + <fileset dir="./lib"> |
| 12 | + <include name="**/*.jar" /> |
| 13 | + </fileset> |
| 14 | + </path> |
| 15 | + |
| 16 | + <target name="init"> |
| 17 | + <mkdir dir="${build}"/> |
| 18 | + </target> |
| 19 | + |
| 20 | + <target name="compile" depends="init" description="compile the source"> |
| 21 | + <javac includeantruntime="false" srcdir="${src}" destdir="${build}" debug="true" debuglevel="lines,vars,source"> |
| 22 | + <classpath> |
| 23 | + <fileset dir="lib"> |
| 24 | + <include name="**/*.jar" /> |
| 25 | + </fileset> |
| 26 | + </classpath> |
| 27 | + </javac> |
| 28 | + </target> |
| 29 | + |
| 30 | + <target name="dist" depends="compile" description="generate the distribution"> |
| 31 | + <mkdir dir="${dist}/lib"/> |
| 32 | + <copy todir="${dist}/lib"> |
| 33 | + <fileset dir="lib"/> |
| 34 | + </copy> |
| 35 | + <manifestclasspath property="manifest_cp" jarfile="myjar.jar"> |
| 36 | + <classpath refid="dep.runtime" /> |
| 37 | + </manifestclasspath> |
| 38 | + <jar jarfile="${dist}/IPFS.jar" basedir="${build}"> |
| 39 | + <manifest> |
| 40 | + <attribute name="Class-Path" value="${manifest_cp}"/> |
| 41 | + </manifest> |
| 42 | + </jar> |
| 43 | + <copy todir="."> |
| 44 | + <fileset file="${dist}/IPFS.jar"/> |
| 45 | + </copy> |
| 46 | + </target> |
| 47 | + |
| 48 | + |
| 49 | + <target name="test" depends="compile,dist"> |
| 50 | + <junit printsummary="yes" fork="true" haltonfailure="yes"> |
| 51 | + <jvmarg value="-Xmx1g"/> |
| 52 | + <classpath> |
| 53 | + <pathelement location="lib/junit-4.11.jar" /> |
| 54 | + <pathelement location="lib/hamcrest-core-1.3.jar" /> |
| 55 | + <pathelement location="lib/Multihash.jar" /> |
| 56 | + <pathelement location="lib/Multiaddr.jar" /> |
| 57 | + <pathelement location="IPFS.jar" /> |
| 58 | + </classpath> |
| 59 | + <test name="org.ipfs.api.APITests" haltonfailure="yes"> |
| 60 | + <formatter type="plain"/> |
| 61 | + <formatter type="xml"/> |
| 62 | + </test> |
| 63 | + </junit> |
| 64 | + </target> |
| 65 | + |
| 66 | + <target name="clean" description="clean up"> |
| 67 | + <delete dir="${build}"/> |
| 68 | + <delete dir="${dist}"/> |
| 69 | + </target> |
| 70 | +</project> |
0 commit comments