-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
executable file
·53 lines (46 loc) · 2.04 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
<project default="build">
<property name="src.dir" value="src"/>
<property name="lib.dir" value="lib"/>
<property name="build.dir" value="build"/>
<property name="classes.dir" value="${build.dir}/classes"/>
<property name="jars.dir" value="${build.dir}/jars"/>
<property name="dist.name" value="classproject.jar"/>
<!--This is the name of our distribution file -->
<property name="junit.jar" value="${lib.dir}/junit4.8.2/junit-4.8.2.jar"/>
<property name="commonslang.jar" value="${lib.dir}/commons-lang-2.6.jar"/>
<property name="classpath" value="${commonslang.jar};${junit.jar}"/>
<target name="clean" description="Erase all generated files">
<delete dir="${build.dir}" failonerror="true"/>
</target>
<target name="compile">
<mkdir dir="${classes.dir}"/>
<javac srcdir="${src.dir}" destdir="${classes.dir}" classpath="${classpath}"/>
</target>
<target name="test" depends="compile">
<junit haltonfailure="true">
<classpath path="${junit.jar};${classes.dir};${commonslang.jar}"/>
<formatter type="brief" usefile="false"/>
<batchtest>
<fileset dir="${src.dir}">
<include name="**/*Test*.java"/>
</fileset>
</batchtest>
</junit>
</target>
<target name="build" depends="test" description="Full build and test">
</target>
<target name="jar" depends="build">
<mkdir dir="${jars.dir}"/>
<jar destfile="${dist.name}" basedir="${classes.dir}">
<manifest>
<attribute name="Main-Class"
value="com.example.classproject.HelloWorld"/>
<attribute name="Class-Path" value="commons-lang-2.6.jar" />
</manifest>
</jar>
<copy file="${commonslang.jar}" tofile="commons-lang-2.6.jar" />
</target>
<target name="release" depends="clean, jar" description="Create release package">
<copy file="${dist.name}" todir="${build.dir}"/>
</target>
</project>