-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
75 lines (75 loc) · 2.63 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="Lab4" default="build">
<property file="build.properties"/>
<path id="classpath.test">
<pathelement location="${junit.lib}" />
<pathelement location="${hamcrest-core}" />
<pathelement location="${ant.junit.lib}" />
</path>
<target name="compile">
<mkdir dir="${compiled.classes}"/>
<mkdir dir="${compiled.tests}"/>
<javac destdir="${compiled.classes}" includeantruntime="false">
<src path="${src}"/>
<classpath>
<pathelement location="${compiled.classes}"/>
<path refid="classpath.test"/>
</classpath>
</javac>
<javac destdir="${compiled.tests}" includeantruntime="false">
<src path="${test}"/>
<classpath>
<pathelement location="${compiled.classes}"/>
<path refid="classpath.test"/>
</classpath>
</javac>
</target>
<target name="build" depends="compile">
<jar destfile="${jar}" basedir="${compiled.classes}" compress="false" index="true">
<manifest>
<attribute name="Main-Class" value="Main"/>
</manifest>
</jar>
</target>
<target name="clean">
<delete dir="${compiled}"/>
</target>
<target name="music" depends="build" description="Play music when build">
<sound>
<success source="${succes}"/>
<fail source="${succes}"/>
</sound>
</target>
<target name="test" depends="build">
<junit fork="true" printsummary="on">
<formatter type="xml"/>
<classpath>
<path refid="classpath.test" />
<pathelement location="${compiled.classes}"/>
<pathelement location="${compiled.tests}"/>
</classpath>
<batchtest todir="reports">
<fileset dir="test" includes="*Test*.java" />
</batchtest>
</junit>
</target>
<target name="report" depends="test">
<junitreport todir="reports">
<fileset dir="reports">
<include name="TEST-*.xml"/>
</fileset>
<report format="noframes" todir="./report/html"/>
</junitreport>
<exec executable="git">
<arg value="add"/>
<arg value="reports/*"/>
</exec>
<input message="Please enter commit message:"
addproperty="msg"/>
<exec executable="git">
<arg value="commit"/>
<arg value="-m"/>
<arg value="${msg}"/>
</exec>
</target>
</project>