-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbuild.xml
More file actions
125 lines (107 loc) · 5.12 KB
/
build.xml
File metadata and controls
125 lines (107 loc) · 5.12 KB
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<?xml version="1.0"?>
<!--
*************************************************************************
* Ant script for building and testing FIX Latency Meter
*
* run with -projecthelp option to obtain list of supported tasks
*************************************************************************
-->
<project name="libpcap-latency-meter" default="build" basedir=".">
<description>LIBPCAP latency meter</description>
<!-- set global properties for this script -->
<property file="build.properties"/>
<property name="debug.mode" value="false"/>
<property environment="env"/>
<!-- Sets the basic environment -->
<property name="lib" location="lib"/>
<property name="bin" location="bin"/>
<property name="data" location="data"/>
<property name="source" location="src/main/java"/>
<property name="classesdir" location="target/classes"/>
<property name="testsource" location="src/test/java"/>
<property name="testclassesdir" location="target/test-classes"/>
<target name="build" depends="init,compile,jar" description="Full build"/>
<target name="init">
<echo message="Output: ${classesdir}"/>
<echo message="java.home: ${java.home}"/>
<mkdir dir="${classesdir}"/>
<mkdir dir="${testclassesdir}"/>
</target> <!-- init -->
<target name="clean" depends="init" description="Clean up all output">
<!-- delete compiled classes -->
<delete failonerror="no">
<fileset dir="${classesdir}" includes="**/*.class"/>
<fileset dir="${testclassesdir}" includes="**/*.class"/>
<fileset dir="target/*.jar"/>
</delete>
</target> <!-- clean -->
<target name="compile" depends="init" description="Compiles sources">
<echo>Compiling all Java files from ${source} into ${classesdir}</echo>
<javac srcdir="${source}" destdir="${classesdir}" verbose="${verbose}" deprecation="true" debug="${debug.mode}" includeantruntime="false" failonerror="true">
<classpath>
<pathelement location="${lib}/jnetpcap.jar"/>
<pathelement location="${lib}/HdrHistogram.jar"/>
</classpath>
</javac>
</target> <!-- compile -->
<target name="jar" depends="compile" description="Generate jar">
<jar destfile="target\libpcap-latency-meter-${version}.jar">
<fileset dir="${classesdir}">
<include name="**/*.class"/>
</fileset>
</jar>
</target> <!-- jar -->
<target name="src" description="Builds source package">
<zip destfile="target\libpcap-latency-meter-${version}.sources.zip">
<fileset dir=".">
<include name="bin/**/*.cmd"/>
<include name="lib/**/*.jar"/>
<include name="**/*.java"/>
<include name="**/*.xml"/>
<include name="libpcap-latency-meter*.*"/>
<include name="COPYING"/>
<include name="COPYING.LESSER"/>
<include name="NOTICE"/>
<include name="README.md"/>
</fileset>
</zip>
</target> <!-- src -->
<target name="test" description="Run unit tests">
<javac srcdir="${testsource}" destdir="${testclassesdir}" verbose="${verbose}" deprecation="true" debug="${debug.mode}" includeantruntime="false" failonerror="true">
<classpath>
<pathelement location="${classesdir}"/>
<pathelement location="${lib}/jnetpcap.jar"/>
<pathelement location="${lib}/junit-4.7.jar"/>
</classpath>
</javac>
<!-- TODO... -->
</target>
<target name="hello" description="Run basic test">
<java classname="org.tinyfix.latency.Test" fork="true" maxmemory="512m" dir="${bin}">
<classpath>
<pathelement location="${lib}/jnetpcap.jar"/>
<pathelement path="${classesdir}"/>
</classpath>
<sysproperty key="java.library.path" value="${bin}"/>
<arg value="0"/>
<arg value="tcp port 8000"/>
</java>
</target> <!-- hello -->
<target name="file-test" depends="compile" description="Run test">
<java classname="org.tinyfix.latency.FiledCaptureProcessor" fork="true" maxmemory="512m" dir="${bin}">
<arg line="-in:mf -out:fix:8888 -dir:10033:5869 -pcap:${data}\feed-10K-packets.pcap"/>
<classpath>
<pathelement location="${lib}/jnetpcap.jar"/>
<pathelement path="${classesdir}"/>
</classpath>
</java>
</target> <!-- file-test -->
<target name="mf" depends="compile" description="Compiles MF protocol handler">
<javac srcdir="src/mf/java" destdir="${classesdir}" verbose="${verbose}" deprecation="true" debug="${debug.mode}" includeantruntime="false" failonerror="true">
<classpath>
<pathelement location="${lib}/jnetpcap.jar"/>
<pathelement location="${lib}/mf/MFAPI-zerogc.jar"/>
</classpath>
</javac>
</target> <!-- compile -->
</project>