-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
62 lines (52 loc) · 1.96 KB
/
build.xml
File metadata and controls
62 lines (52 loc) · 1.96 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
56
57
58
59
60
61
62
<project name="hello" default="dist" basedir=".">
<property name="src.dir" value="."/>
<property name="build.dir" value="build"/>
<property name="dist.dir" value="dist"/>
<property name="junit.dir" value="/var/lib/jenkins/workspace/Helloworld/Reports"/>
<property name="junit.jar" location="/usr/local/share/java/classes/junit.jar"/>
<property name="test.class" value="TestHello"/>
<path id="classpath">
<pathelement location="${build.dir}" />
<pathelement location="${junit.jar}" />
</path>
<target name="init">
<mkdir dir="${build.dir}"/>
<mkdir dir="${dist.dir}"/>
<mkdir dir="${junit.dir}"/>
</target>
<target name="build" depends="init" description="build everything under ${src.dir}" >
<javac srcdir="${src.dir}" destdir="${build.dir}">
<classpath refid="classpath"/>
</javac>
</target>
<target name="test" depends="build" description="unit test" >
<junit errorProperty="test.failed" failureProperty="test.failed">
<test name="${test.class}" todir="${junit.dir}" />
<formatter type="brief" usefile="false" />
<formatter type="xml" />
<classpath refid="classpath" />
</junit>
<fail message="Tests failed: check test reports." if="test.failed" />
</target>
<target name="dist" depends="build" description="generate the distribution" >
<jar jarfile="${dist.dir}/hello.jar" basedir="${build.dir}">
<manifest>
<attribute name="Main-Class" value="Hello"/>
</manifest>
</jar>
</target>
<target name="chmod_task" depends="dist">
<exec executable="chmod">
<arg value="755"/>
<arg value="/home/jagrat/git_repo/hello_world_java/dist/hello.jar"/>
</exec>
</target>
<target name="run" depends="chmod_task">
<java jar="${dist.dir}/hello.jar" fork="true" />
</target>
<target name="clean" description="clean up" >
<delete dir="${build.dir}"/>
<delete dir="${dist.dir}"/>
<delete dir="${junit.dir}"/>
</target>
</project>