-
Notifications
You must be signed in to change notification settings - Fork 20
/
build.xml
157 lines (132 loc) · 5 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<?xml version="1.0"?>
<!-- build file for MIT Kerberos Java GSS-API bindings" -->
<project name="kerberos-java-gssapi" default="build" basedir=".">
<!-- default value useful for dev environment-->
<property name="lib.dir" value="lib/"/>
<property name="src.dir" value="src/java/"/>
<property name="build.dir" value="build"/>
<property name="examples.dir" value="examples/"/>
<property name="examples.build.dir" value="examples/build"/>
<property name="swiggen.dir" value="src/java/edu/mit/jgss/swig"/>
<property name="swignative.dir" value="native"/>
<property name="test.dir" value="src/test/"/>
<property name="test.build.dir" value="build/test"/>
<path id="classpath">
<fileset dir="${lib.dir}" includes="*.jar">
<include name="kerberos-java-gssapi.jar"/>
</fileset>
<fileset dir="${test.dir}" includes="*.jar">
<include name="junit-4.10.jar"/>
</fileset>
<fileset dir="/usr/share/java/" includes="ant-junit.jar" />
</path>
<target name="init" depends="clean, default-javac-flags">
<mkdir dir="${build.dir}"/>
<mkdir dir="${lib.dir}"/>
<mkdir dir="${examples.build.dir}"/>
<mkdir dir="${test.build.dir}"/>
</target>
<target name="clean">
<delete dir="${test.build.dir}"/>
<delete dir="${build.dir}"/>
<delete dir="${lib.dir}"/>
<delete dir="${examples.build.dir}"/>
<delete>
<fileset dir="." includes="TEST-*" />
</delete>
</target>
<target name="swig">
<mkdir dir="${swiggen.dir}" />
<exec
executable="swig"
failonerror="true" >
<arg value="-java" />
<arg value="-package" />
<arg value="edu.mit.jgss.swig" />
<arg value="-outdir" />
<arg value="${swiggen.dir}" />
<arg value="-o" />
<arg value="./native/gsswrapper_wrap.c" />
<arg value="./gsswrapper.i" />
</exec>
<echo message="Wrapper generated."/>
</target>
<target name="cleanswig">
<delete>
<fileset dir="${swiggen.dir}" includes="*.java"/>
<fileset dir="${swignative.dir}" includes="gsswrapper_wrap.o,gsswrapper_wrap.c,libgsswrapper.so,libgsswrapper.dylib"/>
</delete>
</target>
<target name="build" depends="init, swig, compile, jar, examples, test"/>
<target name="compile">
<javac
srcdir="${src.dir}"
destdir="${build.dir}"
debug="${java.debug}"
debuglevel="${java.debuglevel}"
deprecation="${java.deprecation}"
optimize="${java.optimize}"
source="${java.source}"
target="${java.target}"
classpathref="classpath"
includeantruntime="false" />
</target>
<target name="default-javac-flags"
description="Set the javac flags that will produce a debug jar with no compiler optimisation and all debug symbols" >
<property name="java.debug" value="true"/>
<property name="java.debuglevel" value="source,lines,vars"/>
<property name="java.deprecation" value="false"/>
<property name="java.optimize" value="false"/>
<property name="java.source" value="1.5"/>
<property name="java.target" value="1.5"/>
</target>
<target name="jar">
<jar jarfile="${lib.dir}/kerberos-java-gssapi.jar" basedir="${build.dir}">
</jar>
</target>
<target name="examples">
<javac
srcdir="${examples.dir}"
destdir="${examples.build.dir}"
debug="${java.debug}"
debuglevel="${java.debuglevel}"
deprecation="${java.deprecation}"
optimize="${java.optimize}"
source="${java.source}"
target="${java.target}"
classpathref="classpath"
includeantruntime="false" />
</target>
<target name="build-test">
<javac
srcdir="${test.dir}"
destdir="${test.build.dir}"
debug="${java.debug}"
debuglevel="${java.debuglevel}"
deprecation="${java.depreciation}"
optimize="${java.optimize}"
source="${java.source}"
target="${java.target}"
classpathref="classpath"
includeantruntime="false" />
</target>
<target name="test" depends="build-test">
<property name="bootclasspath" refid="classpath" />
<junit printsummary="yes" showoutput="yes" haltonfailure="yes">
<formatter type="plain"/>
<classpath>
<pathelement location="test/junit-4.10.jar" />
<pathelement location="build/" />
<pathelement location="build/test" />
</classpath>
<jvmarg value="-Xbootclasspath/p:${lib.dir}kerberos-java-gssapi.jar" />
<sysproperty key="sun.boot.library.path" value="$JAVA_HOME/bin:${swignative.dir}" />
<env key="LD_LIBRARY_PATH" path="$LD_LIBRARY_PATH:{swignative.dir}:/usr/local/lib" />
<batchtest fork="yes">
<fileset dir="${test.dir}">
<include name="**/*Test*.java"/>
</fileset>
</batchtest>
</junit>
</target>
</project>