-
Notifications
You must be signed in to change notification settings - Fork 2
/
example.xml
134 lines (105 loc) · 4.73 KB
/
example.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
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
126
127
128
129
130
131
132
133
134
<?xml version="1.0" encoding="UTF-8"?>
<!--
See also StackUsage document on how to run an example.
To run, you need to have ANT_HOME and JAVA_HOME environment variables
set.
-->
<target name="runExample" description="Compiles and Runs an example application">
<property name="v" value="1"/>
<property name="package.name" value="uk.co.westhawk.examplev${v}"/>
<property name="package.dir" value="${src.dir}/uk/co/westhawk/examplev${v}"/>
<property name="classname" value="get_next"/>
<property name="propertiesfile" value="${package.dir}/${classname}.properties"/>
<!--
<property name="propertiesfile" value="${package.dir}/host50.properties"/>
-->
<antcall target="_runExample">
<param name="package.name" value="${package.name}"/>
<param name="package.dir" value="${package.dir}"/>
<param name="classname" value="${classname}"/>
<param name="propertiesfile" value="${propertiesfile}"/>
</antcall>
</target>
<target name="runReceiveTrap" description="Runs ReceiveTrap">
<property name="v" value="1"/>
<property name="package.name" value="uk.co.westhawk.examplev${v}"/>
<property name="package.dir" value="${src.dir}/uk/co/westhawk/examplev${v}"/>
<property name="classname" value="ReceiveTrap"/>
<property name="propertiesfile" value="${package.dir}/${classname}.properties"/>
<!--
<property name="propertiesfile" value="${package.dir}/${classname}MD5.properties"/>
<property name="propertiesfile" value="${package.dir}/${classname}MD5DES.properties"/>
<property name="propertiesfile" value="${package.dir}/${classname}SHA.properties"/>
<property name="propertiesfile" value="${package.dir}/${classname}SHADES.properties"/>
-->
<antcall target="_runExample">
<param name="package.name" value="${package.name}"/>
<param name="package.dir" value="${package.dir}"/>
<param name="classname" value="${classname}"/>
<param name="propertiesfile" value="${propertiesfile}"/>
</antcall>
</target>
<target name="runSendTrap" description="Runs SendTrap">
<property name="v" value="1"/>
<property name="package.name" value="uk.co.westhawk.examplev${v}"/>
<property name="package.dir" value="${src.dir}/uk/co/westhawk/examplev${v}"/>
<property name="classname" value="SendTrap"/>
<property name="propertiesfile" value="${package.dir}/${classname}.properties"/>
<!--
<property name="propertiesfile" value="${package.dir}/${classname}MD5.properties"/>
<property name="propertiesfile" value="${package.dir}/${classname}MD5DES.properties"/>
<property name="propertiesfile" value="${package.dir}/${classname}SHA.properties"/>
<property name="propertiesfile" value="${package.dir}/${classname}SHADES.properties"/>
-->
<antcall target="_runExample">
<param name="package.name" value="${package.name}"/>
<param name="package.dir" value="${package.dir}"/>
<param name="classname" value="${classname}"/>
<param name="propertiesfile" value="${propertiesfile}"/>
</antcall>
</target>
<target name="_runExample" description="Compiles and Runs an example application">
<!-- should not need to change the below -->
<echo message="run ${package.name}.${classname} ${propertiesfile}"/>
<tstamp/>
<mkdir dir="${classes.dir}"/>
<!-- Move one example out of the way, because it won't compile
like this -->
<property name="file"
value="${src.dir}/uk/co/westhawk/examplev1/GenericGetOne.java"/>
<available property="isFile"
file="${file}"/>
<antcall target="_moveGenericGetOne"/>
<!-- compile the example -->
<javac destdir="${classes.dir}"
debug="${javac.debug}"
deprecation="on"
verbose="false">
<src>
<pathelement path="${package.dir}"/>
<pathelement path="${src.dir}/uk/co/westhawk/visual"/>
</src>
<classpath>
<pathelement location="${table.jar}"/>
<pathelement location="${snmp.jar}"/>
<pathelement location="${prefuse.jar}"/>
<pathelement location="${classes.dir}"/>
</classpath>
</javac>
<!-- the file back -->
<move file="${file}.tmp" tofile="${file}"/>
<!-- run the example -->
<java classname="${package.name}.${classname}"
fork="true">
<classpath>
<pathelement location="${table.jar}"/>
<pathelement location="${snmp.jar}"/>
<pathelement location="${prefuse.jar}"/>
<pathelement location="${classes.dir}"/>
</classpath>
<arg value="${propertiesfile}"/>
</java>
</target>
<target name="_moveGenericGetOne" if="isFile">
<move file="${file}" tofile="${file}.tmp"/>
</target>