forked from TheComputerGeek2/MagicSpells
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathold.build.xml
271 lines (243 loc) · 10.5 KB
/
old.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
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
<?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"/>
<!-- Java versions-->
<property name="java.core.version" value="1.8" />
<property name="java.teams.version" value="1.8" />
<property name="java.memory.version" value="1.8" />
<property name="java.shop.version" value="1.8" />
<property name="java.towny.version" value="1.8" />
<property name="java.factions.version" value="1.8" />
<tstamp><format property="datestamp" pattern="yyMMddHHmm"/></tstamp>
<!-- Resource retrieving -->
<property name="resource.residence.url" value="http://nexus.hc.to/content/repositories/pub_releases/com/bekvon/bukkit/residence/Residence/4.5.3.0/Residence-4.5.3.0.jar"/>
<property name="resource.ncp.url" value="https://ci.md-5.net/job/NoCheatPlus/lastSuccessfulBuild/artifact/target/NoCheatPlus.jar"/>
<property name="resource.placeholderapi.url" value="http://repo.extendedclip.com/content/repositories/placeholderapi/me/clip/placeholderapi/2.8.2/placeholderapi-2.8.2.jar"/>
<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>
<!-- This just runs an echo for now, but will be used for ensuring resources -->
<target name="get-resources">
<echo>
Running the get resources phase
</echo>
<!-- Get Residence -->
<get src="${resource.residence.url}"
dest="${lib.dir}/Residence.jar"
skipexisting="true"/>
<get src="${resource.ncp.url}"
dest="${lib.dir}/NoCheatPlus.jar"
skipexisting="true"/>
<get src="${resource.placeholderapi.url}"
dest="${lib.dir}/PlaceholderAPI.jar"
skipexisting="true"/>
<echo>
Finished running the get resources phase
</echo>
</target>
<!-- Compile the core -->
<target name="core-compile" depends="get-resources, clean">
<mkdir dir="${core.build.dir}"/>
<javac srcdir="${core.src.dir}" destdir="${core.build.dir}" debug="true" source="${java.core.version}" target="${java.core.version}">
<classpath>
<fileset dir="${lib.dir}">
<include name="spigot-1.11.2.jar"/>
</fileset>
<fileset dir="${lib.dir}">
<include name="spigot-1.10.2.jar"/>
</fileset>
<fileset dir="${lib.dir}">
<include name="spigot-1.9.4.jar"/>
</fileset>
<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="${java.teams.version}" target="${java.teams.version}">
<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="${java.memory.version}" target="${java.memory.version}">
<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="${java.shop.version}" target="${java.shop.version}">
<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="${java.towny.version}" target="${java.towny.version}">
<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="${java.factions.version}" target="${java.factions.version}">
<classpath>
<fileset dir="${lib.dir}">
<include name="bukkit*.jar"/>
<include name="Factions.jar"/>
<include name="MassiveCore.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>