-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
71 lines (64 loc) · 2.23 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<project name="java-multicodec" default="dist" basedir=".">
<description>
Java Implementation of multiformats/multicodec
</description>
<property name="src" location="src"/>
<property name="build" location="build"/>
<property name="dist" location="dist"/>
<path id="dep.runtime">
<fileset dir="./lib">
<include name="**/*.jar" />
</fileset>
</path>
<target name="init">
<mkdir dir="${build}"/>
</target>
<target name="compile" depends="init" description="compile the source">
<javac includeantruntime="false" srcdir="${src}" destdir="${build}" debug="true" debuglevel="lines,vars,source">
<classpath>
<fileset dir="lib">
<include name="**/*.jar" />
</fileset>
</classpath>
</javac>
</target>
<target name="dist" depends="compile" description="generate the distribution">
<mkdir dir="${dist}/lib"/>
<copy todir="${dist}/lib">
<fileset dir="lib"/>
</copy>
<manifestclasspath property="manifest_cp" jarfile="myjar.jar">
<classpath refid="dep.runtime" />
</manifestclasspath>
<jar jarfile="${dist}/multicodec.jar" basedir="${build}">
<manifest>
<attribute name="Class-Path" value="${manifest_cp}"/>
<attribute name="Implementation-Vendor" value="io.ipfs"/>
<attribute name="Implementation-Title" value="multicodec"/>
<attribute name="Implementation-Version" value="1.0"/>
</manifest>
</jar>
</target>
<target name="test" depends="compile,dist">
<junit printsummary="yes" fork="true" haltonfailure="yes">
<jvmarg value="-Xmx1g"/>
<classpath>
<pathelement location="lib/junit-4.11.jar" />
<pathelement location="lib/hamcrest-core-1.3.jar" />
<pathelement location="dist/multicodec.jar" />
</classpath>
<test name="io.ipfs.multicodec.VarIntTest" haltonfailure="yes">
<formatter type="plain"/>
<formatter type="xml"/>
</test>
<test name="io.ipfs.multicodec.MulticodecTest" haltonfailure="yes">
<formatter type="plain"/>
<formatter type="xml"/>
</test>
</junit>
</target>
<target name="clean" description="clean up">
<delete dir="${build}"/>
<delete dir="${dist}"/>
</target>
</project>