-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathbuild.xml
51 lines (42 loc) · 1.47 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
<?xml version="1.0"?>
<project name="PoC" default="jar">
<!-- Project-specific configuration -->
<property name="package" value="com.mojang.escape"/>
<property name="main.class" value="${package}.EscapeComponent"/>
<property name="jar.file" value="${ant.project.name}.jar"/>
<property name="src.dir" value="src"/>
<property name="res.dir" value="res"/>
<property name="build.dir" value="build"/>
<property name="dist.dir" value="dist"/>
<!-- Targets -->
<target name="init">
<mkdir dir="${build.dir}"/>
<mkdir dir="${dist.dir}"/>
</target>
<target name="compile" depends="init"
description="Compile all source files.">
<javac srcdir="${src.dir}" destdir="${build.dir}"
optimize="on" debug="on" deprecation="on"
includeantruntime="false">
<compilerarg value="-Xlint"/>
</javac>
<copy todir="${build.dir}">
<fileset dir="${res.dir}"/>
</copy>
</target>
<target name="jar" depends="compile"
description="Generate the jarfile distributable.">
<jar destfile="${dist.dir}/${jar.file}" basedir="${build.dir}">
<manifest>
<attribute name="Main-Class" value="${main.class}"/>
</manifest>
</jar>
</target>
<target name="run" depends="jar" description="Run the application.">
<java jar="${dist.dir}/${jar.file}" fork="true"/>
</target>
<target name="clean" description="Delete all generated files.">
<delete dir="${build.dir}"/>
<delete dir="${dist.dir}"/>
</target>
</project>