-
Notifications
You must be signed in to change notification settings - Fork 111
/
build.xml
228 lines (204 loc) · 8.65 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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
<?xml version="1.0"?>
<project name="MagicSpells" default="build" basedir=".">
<property name="core.version" value="3.5"/>
<property name="core.src.dir" location="src"/>
<property name="core.build.dir" location="bin"/>
<property name="teams.version" value="1.0"/>
<property name="teams.src.dir" location="src_teams"/>
<property name="teams.build.dir" location="bin_teams"/>
<property name="memory.version" value="1.2"/>
<property name="memory.src.dir" location="src_memory"/>
<property name="memory.build.dir" location="bin_memory"/>
<property name="shop.version" value="1.6"/>
<property name="shop.src.dir" location="src_shop"/>
<property name="shop.build.dir" location="bin_shop"/>
<property name="towny.version" value="1.3"/>
<property name="towny.src.dir" location="src_towny"/>
<property name="towny.build.dir" location="bin_towny"/>
<property name="factions.version" value="1.0"/>
<property name="factions.src.dir" location="src_factions"/>
<property name="factions.build.dir" location="bin_factions"/>
<property name="dist.dir" location="dist"/>
<property name="lib.dir" location="lib"/>
<property name="doc.dir" location="doc"/>
<tstamp><format property="datestamp" pattern="yyMMddHHmm"/></tstamp>
<target name="build" depends="build-version, clean, core-jar, teams-jar, memory-jar, shop-jar, towny-jar, factions-jar, zip"/>
<target name="build-version">
<property name="version.suffix" value="dev-${datestamp}"/>
</target>
<target name="release" depends="release-version, clean, core-jar, teams-jar, memory-jar, shop-jar, towny-jar, factions-jar, zip"/>
<target name="release-version">
<property name="version.suffix" value="release"/>
</target>
<!-- Delete the existing build and dist folders -->
<target name="clean">
<delete dir="${core.build.dir}"/>
<delete dir="${teams.build.dir}"/>
<delete dir="${memory.build.dir}"/>
<delete dir="${shop.build.dir}"/>
<delete dir="${towny.build.dir}"/>
<delete dir="${factions.build.dir}"/>
<delete dir="${doc.dir}"/>
<delete dir="${dist.dir}"/>
<mkdir dir="${dist.dir}"/>
</target>
<!-- Compile the core -->
<target name="core-compile" depends="clean">
<mkdir dir="${core.build.dir}"/>
<javac srcdir="${core.src.dir}" destdir="${core.build.dir}" debug="true" source="1.6" target="1.6">
<classpath>
<fileset dir="${lib.dir}">
<include name="spigot-1.9.jar"/>
</fileset>
<fileset dir="${lib.dir}">
<include name="spigot-1.8*.jar"/>
</fileset>
<fileset dir="${lib.dir}">
<include name="bukkit*.jar"/>
<include name="*.jar"/>
</fileset>
</classpath>
</javac>
<copy todir="${core.build.dir}">
<fileset dir="${core.src.dir}">
<include name="*.yml"/>
</fileset>
</copy>
<replace file="${core.build.dir}\plugin.yml" token="VERSION_STRING" value="${core.version}-${version.suffix}"/>
</target>
<!-- Create the core jar file -->
<target name="core-jar" depends="core-compile">
<jar destfile="${dist.dir}\MagicSpells-${core.version}-${version.suffix}.jar" basedir="${core.build.dir}"/>
<copy file="${dist.dir}\MagicSpells-${core.version}-${version.suffix}.jar" tofile="${dist.dir}\MagicSpells.jar"/>
</target>
<!-- Compile teams addon -->
<target name="teams-compile" depends="core-jar">
<mkdir dir="${teams.build.dir}"/>
<javac srcdir="${teams.src.dir}" destdir="${teams.build.dir}" debug="true" source="1.6" target="1.6">
<classpath>
<fileset dir="${lib.dir}">
<include name="bukkit*.jar"/>
</fileset>
<filelist dir="${dist.dir}" files="MagicSpells.jar"/>
</classpath>
</javac>
<copy todir="${teams.build.dir}">
<fileset dir="${teams.src.dir}">
<include name="*.yml"/>
</fileset>
</copy>
<replace file="${teams.build.dir}\plugin.yml" token="VERSION_STRING" value="${teams.version}-${version.suffix}"/>
</target>
<!-- Create the teams jar file -->
<target name="teams-jar" depends="teams-compile">
<jar destfile="${dist.dir}\MagicSpellsTeams-${teams.version}-${version.suffix}.jar" basedir="${teams.build.dir}"/>
<copy file="${dist.dir}\MagicSpellsTeams-${teams.version}-${version.suffix}.jar" tofile="${dist.dir}\MagicSpellsTeams.jar"/>
</target>
<!-- Compile memory addon -->
<target name="memory-compile" depends="core-jar">
<mkdir dir="${memory.build.dir}"/>
<javac srcdir="${memory.src.dir}" destdir="${memory.build.dir}" debug="true" source="1.6" target="1.6">
<classpath>
<fileset dir="${lib.dir}">
<include name="bukkit*.jar"/>
</fileset>
<filelist dir="${dist.dir}" files="MagicSpells.jar"/>
</classpath>
</javac>
<copy todir="${memory.build.dir}">
<fileset dir="${memory.src.dir}">
<include name="*.yml"/>
</fileset>
</copy>
<replace file="${memory.build.dir}\plugin.yml" token="VERSION_STRING" value="${memory.version}-${version.suffix}"/>
</target>
<!-- Create the teams jar file -->
<target name="memory-jar" depends="memory-compile">
<jar destfile="${dist.dir}\MagicSpellsMemory-${memory.version}-${version.suffix}.jar" basedir="${memory.build.dir}"/>
<copy file="${dist.dir}\MagicSpellsMemory-${memory.version}-${version.suffix}.jar" tofile="${dist.dir}\MagicSpellsMemory.jar"/>
</target>
<!-- Compile shop addon -->
<target name="shop-compile" depends="core-jar">
<mkdir dir="${shop.build.dir}"/>
<javac srcdir="${shop.src.dir}" destdir="${shop.build.dir}" debug="true" source="1.6" target="1.6">
<classpath>
<fileset dir="${lib.dir}">
<include name="bukkit*.jar"/>
<include name="Vault.jar"/>
</fileset>
<filelist dir="${dist.dir}" files="MagicSpells.jar"/>
</classpath>
</javac>
<copy todir="${shop.build.dir}">
<fileset dir="${shop.src.dir}">
<include name="*.yml"/>
</fileset>
</copy>
<replace file="${shop.build.dir}\plugin.yml" token="VERSION_STRING" value="${shop.version}-${version.suffix}"/>
</target>
<!-- Create the shop jar file -->
<target name="shop-jar" depends="shop-compile">
<jar destfile="${dist.dir}\MagicSpellsShop-${shop.version}-${version.suffix}.jar" basedir="${shop.build.dir}"/>
<copy file="${dist.dir}\MagicSpellsShop-${shop.version}-${version.suffix}.jar" tofile="${dist.dir}\MagicSpellsShop.jar"/>
</target>
<!-- Compile towny addon -->
<target name="towny-compile" depends="core-jar">
<mkdir dir="${towny.build.dir}"/>
<javac srcdir="${towny.src.dir}" destdir="${towny.build.dir}" debug="true" source="1.6" target="1.6">
<classpath>
<fileset dir="${lib.dir}">
<include name="bukkit*.jar"/>
<include name="Towny.jar"/>
</fileset>
<filelist dir="${dist.dir}" files="MagicSpells.jar"/>
</classpath>
</javac>
<copy todir="${towny.build.dir}">
<fileset dir="${towny.src.dir}">
<include name="*.yml"/>
</fileset>
</copy>
<replace file="${towny.build.dir}\plugin.yml" token="VERSION_STRING" value="${towny.version}-${version.suffix}"/>
</target>
<!-- Create the towny jar file -->
<target name="towny-jar" depends="towny-compile">
<jar destfile="${dist.dir}\MagicSpellsTowny-${towny.version}-${version.suffix}.jar" basedir="${towny.build.dir}"/>
<copy file="${dist.dir}\MagicSpellsTowny-${towny.version}-${version.suffix}.jar" tofile="${dist.dir}\MagicSpellsTowny.jar"/>
</target>
<!-- Compile factions addon -->
<target name="factions-compile" depends="core-jar">
<mkdir dir="${factions.build.dir}"/>
<javac srcdir="${factions.src.dir}" destdir="${factions.build.dir}" debug="true" source="1.6" target="1.6">
<classpath>
<fileset dir="${lib.dir}">
<include name="bukkit*.jar"/>
<include name="Factions.jar"/>
<include name="mcore.jar"/>
</fileset>
<filelist dir="${dist.dir}" files="MagicSpells.jar"/>
</classpath>
</javac>
<copy todir="${factions.build.dir}">
<fileset dir="${factions.src.dir}">
<include name="*.yml"/>
</fileset>
</copy>
<replace file="${factions.build.dir}\plugin.yml" token="VERSION_STRING" value="${factions.version}-${version.suffix}"/>
</target>
<!-- Create the factions jar file -->
<target name="factions-jar" depends="factions-compile">
<jar destfile="${dist.dir}\MagicSpellsFactions-${factions.version}-${version.suffix}.jar" basedir="${factions.build.dir}"/>
<copy file="${dist.dir}\MagicSpellsFactions-${factions.version}-${version.suffix}.jar" tofile="${dist.dir}\MagicSpellsFactions.jar"/>
</target>
<!-- Zip everything -->
<target name="zip" depends="core-jar, memory-jar, shop-jar, teams-jar, towny-jar, factions-jar">
<zip destfile="${dist.dir}\MagicSpells.zip" basedir="${dist.dir}">
<include name="MagicSpells.jar"/>
<include name="MagicSpellsMemory.jar"/>
<include name="MagicSpellsTeams.jar"/>
<include name="MagicSpellsShop.jar"/>
<include name="MagicSpellsTowny.jar"/>
<include name="MagicSpellsFactions.jar"/>
</zip>
</target>
</project>