-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.xml
61 lines (51 loc) · 1.97 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
<project name="Tic-Tac-Toe" default="run_build" basedir=".">
<!-- Define the properties used by the build -->
<property name="app.name" value="TicTacToe" />
<property name="app.version" value="0.1-dev" />
<property name="work.home" value="${basedir}/jar_tmp/work" />
<property name="dist.home" value="${basedir}/jar_tmp/dist" />
<property name="src.home" value="${basedir}/src" />
<!-- Define the CLASSPATH -->
<path id="compile.classpath">
</path>
<target name="run_build" depends="clean,compile,create_manifest,dist,release" />
<target name="clean">
<delete dir="${work.home}" />
<delete dir="${dist.home}" />
</target>
<target name="prepare" depends="clean">
<mkdir dir="${dist.home}" />
<mkdir dir="${work.home}" />
<mkdir dir="${work.home}/META-INF" />
</target>
<target name="compile" depends="prepare">
<javac srcdir="${src.home}" destdir="${work.home}" debug="on" includeantruntime="yes">
<classpath refid="compile.classpath" />
</javac>
<copy todir="${work.home}">
<fileset dir="${src.home}" excludes="**/*.java" />
</copy>
</target>
<target name="create_manifest">
<!--Ensure to include the manifest content.-->
<mkdir dir="${work.home}/META-INF"/>
<manifest file="${work.home}/META-INF/MANIFEST.MF">
<attribute name="Manifest-Version" value="1.0" />
<attribute name="Version" value="${app.version}" />
<attribute name="Company" value="Emerge Studio" />
<attribute name="Project" value="${app.name}" />
<attribute name="Java-Version" value="${java.version}" />
<attribute name="Main-Class" value="com.emergestudio.test.Main" />
</manifest>
</target>
<target name="dist" depends="compile">
<jar jarfile="${dist.home}/${app.name}.jar"
manifest="${work.home}/META-INF/MANIFEST.MF"
basedir="${work.home}" />
</target>
<target name="release" depends="dist">
<delete file="bin/${app.name}.jar" />
<copy file="${dist.home}/${app.name}.jar" todir="bin"/>
<delete dir="${basedir}/jar_tmp" />
</target>
</project>