-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
55 lines (50 loc) · 1.56 KB
/
Copy pathbuild.xml
File metadata and controls
55 lines (50 loc) · 1.56 KB
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
<?xml version="1.0"?>
<project name="Project" default="run">
<!-- define names of directories -->
<property name="src" location="src"/>
<property name="build" location="build"/>
<property name="classes" location="${build}/classes"/>
<!-- define all targets -->
<target name="compile">
<mkdir dir="build/classes"/>
<javac destdir="build/classes" includeantruntime="false">
<src path="src"/>
</javac>
</target>
<target name="run" depends="compile">
<java classname="HelloWorld" classpath="build/classes"/>
</target>
<target name="package" depends="compile">
<mkdir dir="distr" />
<jar destfile="distr/${ant.project.name}.jar" basedir="${classes}" excludes="Test*.class">
<manifest>
<attribute name="Main-Class" value="${ant.project.name}"/>
</manifest>
</jar>
</target>
<target name="test-compile">
<mkdir dir="build/test-classes" />
<javac srcdir="test" destdir="build/test-classes" includeantruntime="false" >
<classpath>
<pathelement path="buld/classes" />
<fileset dir="lib" includes="*.jar" />
</classpath>
</javac>
</target>
<target name="test" depends="compile">
<junit printsummary="yes" haltonfailure="yes" fork="true" forkmode="once">
<classpath>
<fileset dir="lib" includes="*.jar" />
<pathelement path="build/test-classes" />
</classpath>
<test name="com.test.UnitTest" haltonfailure="no" outfile="result">
<formatter type="plain" />
<formatter type="xml" />
</test>
</junit>
</target>
<target name="clean">
<delete dir="build"/>
<delete dir="${distr}"/>
</target>
</project>