-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
84 lines (74 loc) · 2.93 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<project name="minecraft" default="build">
<property file="project.properties"/>
<property name="src" location="src/main"/>
<property name="src.java" location="${src}/java"/>
<property name="lib" location="lib"/>
<property name="target" location="target"/>
<property name="classes" location="${target}/classes"/>
<property name="target.client.jar" location="${target}/1.7.10.jar"/>
<property name="server.jar" value="server-1.7.10.jar"/>
<property name="server.dist" location="${target}/dist/server"/>
<path id="java.library.path">
<fileset dir="${lib}/natives">
<include name="**/*.dll"/>
</fileset>
</path>
<path id="lib.runtime">
<fileset dir="${lib}">
<include name="**/*.jar"/>
</fileset>
</path>
<path id="project.class.path">
<pathelement location="${classes}"/>
<path refid="lib.runtime"/>
<pathelement path="${java.class.path}"/>
</path>
<pathconvert targetos="unix" pathsep=" " property="lib.runtime.jars" refid="lib.runtime">
<map from="${basedir}/lib/" to=""/>
</pathconvert>
<target name="init">
<tstamp/>
<mkdir dir="${target}"/>
<mkdir dir="${classes}"/>
<mkdir dir="${server.dist}"/>
</target>
<target name="compile" description="compile the source" depends="init">
<javac destdir="${classes}" srcdir="${src.java}"
debug="true"
debuglevel="lines,source"
includeantruntime="true"
encoding="utf-8">
<!-- <classpath refid="dev.class.path" />-->
<classpath refid="project.class.path"/>
</javac>
</target>
<target name="client" depends="compile">
<jar destfile="${target.client.jar}">
<fileset dir="${classes}"/>
<fileset dir="${src}/resources"/>
</jar>
</target>
<target name="server" depends="compile">
<jar destfile="${target}/${server.jar}">
<fileset dir="${classes}"/>
<fileset dir="${src}/resources"/>
<manifest>
<attribute name="Main-Class" value="net.minecraft.server.MinecraftServer"/>
<attribute name="Class-Path" value="${lib.runtime.jars}"/>
</manifest>
</jar>
<copy file="${target}/${server.jar}" todir="${server.dist}"/>
<copy todir="${server.dist}">
<path refid="lib.runtime"/>
<!-- <fileset refid="lib.runtime" />-->
</copy>
</target>
<target name="clean">
<delete dir="${classes}"/>
<delete file="${target.client.jar}"/>
<delete file="${target}/${server.jar}"/>
<delete file="${server.dist}"/>
</target>
<target name="build" depends="compile, client, server"/>
<target name="rebuild" depends="clean, build"/>
</project>