-
Notifications
You must be signed in to change notification settings - Fork 22
/
build.xml
59 lines (51 loc) · 1.82 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
<project name="InjectionAttackFilter" default="all">
<property name="version" value="0.7"/>
<path id="classpath">
<fileset dir="lib">
<include name="*.jar"/>
</fileset>
</path>
<property name="classpath" refid="classpath"/>
<path id="test.classpath">
<fileset dir="lib">
<include name="*.jar"/>
</fileset>
<pathelement location="classes"/>
<pathelement location="testclasses"/>
</path>
<property name="test.classpath" refid="test.classpath"/>
<target name="compile">
<mkdir dir="jars"/>
<mkdir dir="junit"/>
<mkdir dir="classes"/>
<mkdir dir="testclasses"/>
<javac srcdir="src" destdir="classes" fork="true" classpath="${classpath}" debug="true" debuglevel="lines,vars,source"/>
<javac srcdir="test" destdir="testclasses" fork="true" classpath="${test.classpath}"/>
</target>
<target name="test" depends="compile">
<junit fork="yes" forkmode="once" printsummary="true" failureProperty="${test.failed}">
<classpath>
<path refid="test.classpath"/>
</classpath>
<formatter type="plain" usefile="true"/>
<batchtest filtertrace="on" fork="yes" todir="junit">
<fileset dir="test" includes="**/*Test.java"/>
</batchtest>
</junit>
</target>
<target name="jar" depends="compile">
<jar destfile="jars/injectionAttackFilter-${version}.jar">
<fileset dir="classes" includes="**/*.*"/>
</jar>
</target>
<target name="clean">
<delete dir="classes" includes="**/*.*"/>
<delete dir="testclasses" includes="**/*.*"/>
<delete dir="junit" includes="**/*.*"/>
<delete dir="jars" includes="*.jar" failonerror="false"/>
</target>
<target name="fail" if="${test.failed}" unless="nofail">
<fail message="JUnit tests failed!"/>
</target>
<target name="all" depends="clean, compile, test, fail, jar"/>
</project>