forked from garbagemule/MobArena
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
146 lines (119 loc) · 5.77 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<?xml version="1.0" encoding="UTF-8"?>
<!--
###########################################################################
### ###
### MobArena Build File ###
### ###
###########################################################################
To build MobArena, you need the following dependencies, which can all be
found on their respective websites/Bukkit pages/whatever:
- Craftbukkit
- Vault by Sleaker
- Heroes by the HeroCraft team
- SpoutPlugin by the Spout team
- MagicSpells by nisovin
The dependencies (jar-files) should be placed in a lib-folder at the root
of the project file structure, i.e. in the same folder as 'src'.
-->
<project name="MobArena" default="build-package-distribute" basedir=".">
<!--
###########################################################################
### ###
### Properties File ###
### ###
###########################################################################
The properties file (build.properties) is optional. It can contain the
following properties, which can provide compilation convenience:
- server.dir A path to a location that the MobArena.jar file will be
copied to, upon packaging. This is useful for paths to
a server's plugins-folder for easy testing.
-->
<property file="build.properties"/>
<!-- Folders -->
<property name="src" location="src"/>
<property name="bin" location="build"/>
<property name="lib" location="lib"/>
<property name="res" location="resources"/>
<!-- Classpath -->
<path id="classpath">
<fileset dir="${lib}" includes="*.jar"/>
<pathelement location="${bin}" />
</path>
<!--
###########################################################################
### ###
### Distribution targets ###
### ###
###########################################################################
-->
<!-- Copy MobArena.jar to the server.dir folder from the properties file -->
<target name="copy-to-server" if="server.dir">
<copy file="${ant.project.name}.jar" tofile="${server.dir}/${ant.project.name}.jar" />
</target>
<!-- Copy MobArena.jar to the dropbox.dir folder from the properties file -->
<target name="copy-to-dropbox" if="dropbox.dir">
<copy file="${ant.project.name}.jar" tofile="${dropbox.dir}/${ant.project.name}.jar" />
</target>
<!-- Copy MobArena.jar to the remote.dir folder from the properties file -->
<target name="copy-to-remote" if="remote.dir">
<scp file="${ant.project.name}.jar" todir="${remote.usr}:${remote.pwd}@${remote.host}:${remote.dir}" />
</target>
<!--
###########################################################################
### ###
### Build targets ###
### ###
###########################################################################
-->
<!-- Build the project files -->
<target name="build">
<antcall target="clean-bin"/>
<mkdir dir="${bin}"/>
<javac target="1.6" source="1.6"
srcdir="${src}" destdir="${bin}"
debug="on" debuglevel="lines,vars,source"
includeantruntime="no" classpathref="classpath">
<compilerarg value="-Xlint:deprecation"/>
</javac>
</target>
<!-- Build and package the project -->
<target name="build-package">
<antcall target="build"/>
<delete file="${ant.project.name}.jar" />
<jar jarfile="${ant.project.name}.jar">
<!-- Include the class-files (bin) and the resources (res) -->
<fileset dir="${bin}" />
<fileset dir="${res}" />
</jar>
<antcall target="clean-bin"/>
</target>
<!-- Build, package and distribute the project -->
<target name="build-package-distribute">
<antcall target="build-package"/>
<antcall target="copy-to-server"/>
<antcall target="copy-to-dropbox"/>
</target>
<!-- Build, package and distribute the project (includes remote) -->
<target name="build-package-distribute-remote">
<antcall target="build-package"/>
<antcall target="copy-to-server"/>
<antcall target="copy-to-dropbox"/>
<antcall target="copy-to-remote"/>
</target>
<!--
###########################################################################
### ###
### Clean targets ###
### ###
###########################################################################
-->
<!-- Delete the bin folder -->
<target name="clean-bin">
<delete dir="${bin}"/>
</target>
<!-- Delete the bin folder and the jar-file -->
<target name="clean">
<antcall target="clean-bin"/>
<delete file="${ant.project.name}.jar"/>
</target>
</project>