-
Notifications
You must be signed in to change notification settings - Fork 86
/
Copy pathbuild.xml
115 lines (96 loc) · 3.7 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
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
<project name="orchid" default="all">
<exec executable="git" outputproperty="orchid.gittag" logError="true" failifexecutionfails="false">
<arg value="rev-parse"/>
<arg value="--short"/>
<arg value="HEAD"/>
</exec>
<property name="orchid.version" value="0.9.1" />
<condition property="orchid.basename" value="orchid-${orchid.version}.${orchid.gittag}">
<isset property="orchid.gittag"/>
</condition>
<property name="orchid.basename" value="orchid-${orchid.version}" />
<property name="orchid.jarfile" value="${orchid.basename}.jar" />
<property name="orchid.sourcefile" value="${orchid.basename}-src.zip" />
<path id="compile.classpath">
<fileset dir="lib">
<include name="*.jar"/>
</fileset>
</path>
<path id="test.classpath">
<fileset dir="lib/testing">
<include name="*.jar"/>
</fileset>
</path>
<path id="bin">
<pathelement location="${basedir}/bin"/>
</path>
<condition property="xmlrpc.present">
<and>
<available classname="org.apache.xmlrpc.client.XmlRpcTransportFactory" classpathref="compile.classpath"/>
<available classname="org.apache.xmlrpc.XmlRpcException" classpathref="compile.classpath"/>
</and>
</condition>
<target name="all" depends="write-revision,compile,compile-xmlrpc,package,source"/>
<target name="clean">
<delete dir="${basedir}/bin" />
</target>
<target name="write-revision">
<echo message="${orchid.gittag}${line.separator}" file="build-revision" />
</target>
<target name="init">
<mkdir dir="${basedir}/bin" />
</target>
<target name="compile" depends="init">
<javac source="1.5" target="1.5" destdir="${basedir}/bin" includeantruntime="false">
<src path="${basedir}/src" />
<classpath refid="compile.classpath"/>
</javac>
</target>
<target name="compile-xmlrpc" depends="init" if="xmlrpc.present">
<echo message="compiling optional xmlrpc classes"/>
<javac source="1.5" target="1.5" srcdir="opt/xmlrpc" destdir="bin" classpathref="compile.classpath" includeantruntime="false"/>
</target>
<target name="package">
<jar destfile="${orchid.jarfile}">
<manifest>
<attribute name="Main-Class" value="com.subgraph.orchid.TorClient"/>
</manifest>
<fileset dir="${basedir}/bin" />
<zipfileset dir="${basedir}/data" includes="GeoIP.dat" fullpath="data/GeoIP.dat" />
<zipfileset dir="${basedir}" includes="build-revision" />
</jar>
</target>
<target name="source">
<zip destfile="${orchid.sourcefile}">
<zipfileset dir="src" prefix="${orchid.basename}/src" />
</zip>
</target>
<target name="compile-test" depends="compile">
<javac source="1.5" target="1.5" destdir="${basedir}/bin" includeantruntime="false">
<src path="${basedir}/test"/>
<classpath>
<path refid="compile.classpath"/>
<path refid="test.classpath"/>
</classpath>
</javac>
</target>
<target name="test" depends="compile-test">
<junit printsummary="on" fork="yes" forkmode="once">
<assertions>
<enable/>
</assertions>
<classpath>
<path refid="compile.classpath"/>
<path refid="test.classpath"/>
<path refid="bin"/>
</classpath>
<test name="com.subgraph.orchid.TorConfigTest"/>
<test name="com.subgraph.orchid.circuits.TorInputStreamTest"/>
<test name="com.subgraph.orchid.circuits.path.ConfigNodeFilterTest"/>
<test name="com.subgraph.orchid.circuits.path.ConfigNodeFilterTest"/>
<test name="com.subgraph.orchid.crypto.ASN1ParserTest"/>
<test name="com.subgraph.orchid.crypto.RSAKeyEncoderTest"/>
<test name="com.subgraph.orchid.geoip.CountryCodeServiceTest"/>
</junit>
</target>
</project>