forked from skeeto/Minicraft
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
58 lines (50 loc) · 1.88 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
<?xml version="1.0"?>
<project name="Minicraft" default="jar">
<!-- Project configuration -->
<property name="main.class" value="com.mojang.ld22.Game"/>
<property name="base.name" value="minicraft"/>
<!-- Directory Layout -->
<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="compile" description="Compile all sources.">
<mkdir dir="${dist.dir}"/>
<mkdir dir="${build.dir}/classes"/>
<javac srcdir="${src.dir}" destdir="${build.dir}/classes"
optimize="on" debug="on" deprecation="on" includeantruntime="no">
<compilerarg value="-Xlint"/>
</javac>
<copy todir="${build.dir}/classes">
<fileset dir="${res.dir}"/>
</copy>
</target>
<target name="jar" depends="compile" description="Create the distributables.">
<jar destfile="${dist.dir}/${base.name}.jar"
basedir="${build.dir}/classes">
<manifest>
<attribute name="Main-Class" value="${main.class}"/>
</manifest>
</jar>
</target>
<target name="run" depends="compile"
description="Run the application in hotswap mode.">
<java classname="${main.class}" classpath="${build.dir}/classes"
fork="true">
<jvmarg line="-Xdebug -Xrunjdwp:transport=dt_socket,address=9000,server=y,suspend=n"/>
</java>
</target>
<target name="hotswap" depends="compile" description="Replace running code.">
<taskdef name="hotswap" classname="dak.ant.taskdefs.Hotswap"/>
<hotswap verbose="true" port="9000">
<fileset dir="${build.dir}/classes" includes="**/*.class">
<modified/>
</fileset>
</hotswap>
</target>
<target name="clean" description="Delete all generated files.">
<delete dir="${build.dir}"/>
<delete dir="${dist.dir}"/>
</target>
</project>