-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
47 lines (36 loc) · 1.42 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
<?xml version="1.0"?>
<project name="${project.name}" default="main">
<!--- Including properties file here-->
<property file="build.properties"/>
<target name="init">
<!-- Create the time stamp -->
<tstamp />
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build.dir}" />
</target>
<target name="compile" depends="init" description="Compile all the Java source files ">
<!-- Compile the java code from ${src.dir} and put it into ${build.dir} -->
<javac includeantruntime="false" srcdir="${src.dir}" destdir="${build.dir}" />
</target>
<target name="jar" description="Creating the package and put into to ${dist.dir}">
<!-- Create the distribution directory -->
<mkdir dir="${dist.dir}" />
<!-- Put everything in ${build} into the {$project.name}-${DSTAMP}.jar file -->
<jar jarfile="${dist.dir}/${project.name}-${DSTAMP}.jar" basedir="${build.dir}" >
<manifest>
<attribute name="Main-Class" value="com.mt.general.HelloWorld" />
</manifest>
</jar>
</target>
<target name="clean" description="This target will deletes all previous build files">
<delete dir="${build.dir}" />
<delete dir="${dist.dir}" />
</target>
<!-- Default, run this target -->
<target name="main" depends="clean, compile, jar,run" >
<echo> Build is done </echo>
</target>
<target name="run">
<java jar="${dist.dir}/${project.name}-${DSTAMP}.jar" fork="true"/>
</target>
</project>