forked from powercrystals/NetherOres
-
Notifications
You must be signed in to change notification settings - Fork 14
/
build.xml
556 lines (480 loc) · 21.7 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
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
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
<project name="NetherOres" default="install" basedir=".">
<property environment="env"/>
<!-- Basic directories -->
<property name="src.dir" value="src"/>
<property name="resources.dir" value="resources"/>
<property name="build.dir" value="build"/>
<property name="download.dir" value="${build.dir}/downloads"/>
<!-- Project information -->
<property name="build.name" value="${ant.project.name}"/>
<property name="class.pckg" value="powercrystals/netherores"/>
<!-- Version file -->
<property name="verclass.dir" value="${src.dir}/${class.pckg}" />
<property name="verclass.name" value="NetherOresCore.java"/>
<!-- Forge version -->
<property name="mc.version" value="1.7.10"/>
<property name="forge.major" value="10"/>
<property name="forge.minor" value="13"/>
<property name="forge.patch" value="4"/>
<property name="forge.build" value="1448"/>
<!-- Packaging -->
<property name="dist.dir" value="${build.dir}/dist"/>
<property name="classes.dir" value="${build.dir}/packaging"/>
<property name="apiclasses.dir" value="${build.dir}/api-packaging"/>
<!-- Forge paths -->
<property name="forge.version" value="${mc.version}-${forge.major}.${forge.minor}.${forge.patch}.${forge.build}-${mc.version}"/>
<property name="forge.dir" value="${build.dir}/forge"/>
<property name="forgebuild.dir" value="${forge.dir}/build"/>
<property name="compile.dir" value="${forgebuild.dir}/tmp/compile"/>
<property name="lib.dir" value="${forgebuild.dir}/libs"/>
<property name="sources.dir" value="${forgebuild.dir}/sources/minecraft"/>
<property name="transformers.dir" value="${forge.dir}/src/main/resources/"/>
<property name="forge.stsh" value="${build.dir}/.gradle/caches/minecraft/net/minecraftforge/forge/${forge.version}"/>
<property name="forge.jar" value="${forge.stsh}/forgeSrc-${forge.version}.jar"/>
<property name="reobf.cmd" value="${download.dir}/bon.jar"/>
<property name="forge.url" value="http://files.minecraftforge.net/maven/net/minecraftforge/forge/${forge.version}/forge-${forge.version}-src.zip"/>
<!-- Classpaths -->
<path id="mcp.classpath">
<pathelement location="${forge.jar}"/>
<fileset dir="${lib.dir}">
<include name="*.jar"/>
<include name="**/*.jar"/>
<exclude name="${reobf.jar}"/>
</fileset>
<fileset dir="${build.dir}/.gradle/caches">
<include name="modules*/files*/**/*.jar"/>
<exclude name="modules*/files*/commons-io/commons-io/1.4/**/*.jar"/>
<exclude name="modules*/files*/com.google.guava/guava/14*/**/*.jar"/>
<exclude name="modules*/files*/com.google.guava/guava/15*/**/*.jar"/>
<exclude name="modules*/files*/org.ow2.asm/asm-debug-all/4*/**/*.jar"/>
</fileset>
</path>
<path id="gson">
<fileset dir="${build.dir}/.gradle/caches">
<include name="modules*/files*/com.google.code.gson/**/*.jar"/>
</fileset>
</path>
<!-- Task skipping -->
<target name="properties">
<!-- Enforce some paths -->
<mkdir dir="${build.dir}"/>
<mkdir dir="${download.dir}"/>
<!-- Set properties -->
<available property="has.api" file="${src.dir}/${class.pckg}/api"/>
<available property="bon.exists" file="${reobf.cmd}"/>
<available property="forge.exists" file="${download.dir}/forge-${forge.version}-src.zip"/>
<condition property="forge.already.installed">
<available file="${forge.dir}/build/dirtyArtifacts/forgeSrc-${forge.version}.jar" type="file"/>
</condition>
<condition property="have.libs">
<and>
<istrue value="${forge.exists}"/>
<available file="${lib.dir}/CoFHLib.jar" type="file"/>
<available file="${lib.dir}/CoFHCore.jar" type="file"/>
<available file="${lib.dir}/industrialcraft-2-api.jar" type="file"/>
<available file="${lib.dir}/AppEng.jar" type="file"/>
</and>
</condition>
</target>
<!-- Dependency downloading -->
<target name="download-core" depends="properties" unless="forge.exists">
<echo message="Downloading CoFHCore... "/>
<get src="https://github.com/CoFH/CoFHCore/archive/master.zip" dest="${download.dir}/CoFHCore.zip"/>
<delete dir="${download.dir}/CoFHCore-master" failonerror="false"/>
<unzip src="${download.dir}/CoFHCore.zip" dest="${download.dir}"/>
</target>
<target name="get-dependencies" depends="get-version" unless="have.libs">
<delete dir="${lib.dir}/"/>
<mkdir dir="${lib.dir}/"/>
<echo message="Downloading CoFHLib... "/>
<get src="https://github.com/CoFH/CoFHLib/archive/master.zip" dest="${download.dir}/CoFHLib.zip"/>
<!-- Begin hack -->
<unzip src="${download.dir}/CoFHLib.zip" dest="${download.dir}"/>
<delete dir="${compile.dir}" failonerror="false"/>
<mkdir dir="${compile.dir}"/>
<javac srcdir="${download.dir}/CoFHLib-master/src/main/java" destdir="${compile.dir}"
target="1.7" source="1.7"
classpathref="mcp.classpath" debug="true" debuglevel="lines,source" includeAntRuntime="false">
<include name="**/*.java"/>
</javac>
<jar destfile="${download.dir}/CoFHLib.jar" compress="true" level="9" basedir="${compile.dir}"/>
<delete dir="${compile.dir}" failonerror="false"/>
<delete dir="${download.dir}/CoFHLib-master"/>
<!-- End hack -->
<echo message="Downloading NEI API... "/>
<get src="http://chickenbones.net/maven/codechicken/NotEnoughItems/1.7.10-1.0.2.15/NotEnoughItems-1.7.10-1.0.2.15-dev.jar" dest="${download.dir}/NEI.jar"/>
<echo message="Compiling CoFHCore... "/>
<!-- Begin hack -->
<delete dir="${compile.dir}" failonerror="false"/>
<mkdir dir="${compile.dir}"/>
<javac srcdir="${download.dir}/CoFHCore-master/src/main/java" destdir="${compile.dir}"
target="1.7" source="1.7"
classpathref="mcp.classpath" debug="true" debuglevel="lines,source" includeAntRuntime="false">
<include name="**/*.java"/>
<classpath>
<fileset file="${download.dir}/NEI.jar"/>
<fileset file="${download.dir}/CoFHLib.jar"/>
</classpath>
</javac>
<jar destfile="${download.dir}/CoFHCore.jar" compress="true" level="9" basedir="${compile.dir}"/>
<delete dir="${compile.dir}" failonerror="false"/>
<!-- End hack -->
<echo message="Downloading IC2 API... "/>
<get src="http://jenkins.ic2.player.to/job/IC2_experimental/477/artifact/build/libs/industrialcraft-2-2.1.477-experimental-dev.jar" dest="${download.dir}/industrialcraft-2-api.jar"/>
<echo message="Downloading AppEng API..." />
<get src="http://ae-mod.info/builds/appliedenergistics2-rv1-stable-1-dev.jar" dest="${download.dir}/AppEng.jar"/>
</target>
<target name="extract-dependencies" depends="setup-forge,get-dependencies" unless="have.libs">
<echo message="Extracting CoFHLib..."/>
<copy file="${download.dir}/CoFHLib.jar" todir="${lib.dir}"/>
<echo message="Extracting CoFHCore..."/>
<copy file="${download.dir}/CoFHCore.jar" todir="${lib.dir}"/>
<echo message="Extracting IC2 API... "/>
<copy file="${download.dir}/industrialcraft-2-api.jar" todir="${lib.dir}"/>
<echo message="Extracting AppEng API... " />
<copy file="${download.dir}/AppEng.jar" todir="${lib.dir}"/>
</target>
<macrodef name="move-transformers"><sequential>
<copy file="${download.dir}/CoFHCore-master/src/main/resources/CoFH_at.cfg" tofile="${transformers.dir}/z_CoFH_at.cfg"/>
</sequential></macrodef>
<!-- Building process -->
<target name="install" depends="upload">
<!-- Cleanup -->
<delete dir="${apiclasses.dir}"/>
<delete dir="${classes.dir}"/>
<delete>
<fileset dir="${dist.dir}">
<exclude name="${build.name}${build.full}${build.number}.jar"/>
<exclude name="${build.name}${build.full}${build.number}-dev.jar"/>
<exclude name="${build.name}${build.full}${build.number}-API.zip"/>
</fileset>
</delete>
</target>
<macrodef name="install-lite">
<attribute name="build"/>
<attribute name="classes" default="${compile.dir}"/>
<sequential>
<copy todir="${classes.dir}" preservelastmodified="true">
<fileset dir="@{classes}">
<include name="**/*.class"/>
</fileset>
<fileset dir="${resources.dir}"/>
</copy>
<update-languages/>
<echo file="${classes.dir}/vers.prop">${build.full}${build.number}</echo>
<jar destfile="${dist.dir}/${build.name}${build.full}@{build}.jar"
compress="true" level="9" basedir="${classes.dir}"/>
</sequential>
</macrodef>
<target name="build" depends="extract-dependencies,get-build-number,copy-sources">
<!-- Recompile -->
<echo message="Compiling..."/>
<mkdir dir="${compile.dir}"/>
<depend srcdir="${sources.dir}" destdir="${compile.dir}"
cache="${forgebuild.dir}/tmp/depcache" closure="true">
<include name="**/*.java"/>
</depend>
<javac srcdir="${sources.dir}" destdir="${compile.dir}" target="1.7" source="1.7"
classpathref="mcp.classpath" debug="true" debuglevel="lines,source" includeAntRuntime="false">
<include name="**/*.java"/>
</javac>
<!-- Dev jar -->
<echo message="Building jar..."/>
<local name="build"/><property name="build" value="${build.number}-dev"/>
<install-lite build="${build}"/>
<!-- Reobf -->
<echo message="Reobfuscating..."/>
<java classpath="${reobf.cmd}" classname="immibis.bon.cui.MCPRemap">
<arg line="-q -m"/>
<arg value="-to SRG"/>
<arg value="-from MCP"/>
<arg value="-mcp ${forge.stsh}/unpacked"/>
<arg value="-in ${dist.dir}/${build.name}${build.full}${build}.jar"/>
<arg value="-out ${dist.dir}/${build.name}${build.full}${build.number}.jar"/>
<arg value="-ref ${forge.jar}"/>
<arg value="-jref ${lib.dir}"/>
</java>
</target>
<target name="copy-sources" depends="package-api">
<!-- Copy source -->
<mkdir dir="${sources.dir}"/>
<sync todir="${sources.dir}">
<fileset dir="${src.dir}"/>
</sync>
</target>
<target name="package-api" depends="get-version" if="has.api">
<!-- Copy & package API -->
<copy todir="${apiclasses.dir}/${class.pckg}/api">
<fileset dir="${src.dir}/${class.pckg}/api"/>
</copy>
<zip destfile="${dist.dir}/${build.name}${build.full}${build.number}-API.zip" basedir="${apiclasses.dir}"/>
</target>
<target name="setup-forge" depends="download-forge" unless="forge.already.installed">
<delete dir="${forge.dir}" failonerror="false"/>
<mkdir dir="${forge.dir}"/>
<unzip dest="${forge.dir}">
<fileset dir="${download.dir}">
<include name="forge-${forge.version}-src.zip"/>
</fileset>
</unzip>
<!-- Cleanup -->
<delete>
<fileset dir="${forge.dir}">
<include name="*.txt"/>
<include name="src/**/*.info"/>
</fileset>
</delete>
<delete dir="${forge.dir}/eclipse" failonerror="false"/>
<delete dir="${forge.dir}/src/main/java" failonerror="false"/>
<delete dir="${build.dir}/.gradle/caches/minecraft/net/minecraftforge/forge/${forge.version}/srgs" failonerror="false"/>
<!-- Change executables' permissions -->
<chmod file="${forge.dir}/gradlew" perm="+x"/>
<!-- Install forge -->
<exec executable="./gradlew" failonerror="true" dir="${forge.dir}/" vmlauncher="false">
<arg line="-g ../.gradle"/>
<arg line="extractMinecraftSrc"/>
<arg line="eclipseClasspath"/>
</exec>
<mkdir dir="${compile.dir}"/>
<mkdir dir="${lib.dir}"/>
<javac srcdir="${forgebuild.dir}/tmp/recompSrc" destdir="${compile.dir}" target="1.7" source="1.7"
classpathref="mcp.classpath" debug="true" debuglevel="lines,source" includeAntRuntime="false"/>
<jar destfile="${forge.jar}1" compress="true" level="9" basedir="${compile.dir}"/>
<echo message="Reobfuscating..."/>
<move-transformers/>
<java classpath="${reobf.cmd}" classname="immibis.bon.cui.MCPRemap">
<arg line="-q -m"/>
<arg value="-to SRG"/>
<arg value="-from MCP"/>
<arg value="-mcp ${forge.stsh}/unpacked"/>
<arg value="-in ${forge.jar}1"/>
<arg value="-out ${forge.jar}2"/>
<arg value="-jref ${lib.dir}"/>
</java>
<java classpath="${reobf.cmd}" classname="immibis.bon.cui.MCPRemap">
<arg line="-q -m"/>
<arg value="-to MCP"/>
<arg value="-from SRG"/>
<arg value="-mcp ${forge.stsh}/unpacked"/>
<arg value="-in ${forge.jar}2"/>
<arg value="-out ${forge.jar}"/>
<arg value="-jref ${lib.dir}"/>
<arg value="-at ${transformers.dir}"/>
</java>
<delete file="${forge.jar}1" failonerror="false"/>
<delete file="${forge.jar}2" failonerror="false"/>
<copy file="${forge.jar}" todir="${forgebuild.dir}/dirtyArtifacts/"/>
<delete dir="${compile.dir}"/>
</target>
<target name="download-forge" depends="setup-bon,download-core" unless="forge.exists">
<echo message="Downloading forge... "/>
<get src="${forge.url}" dest="${download.dir}/forge-${forge.version}-src.zip"/>
</target>
<target name="setup-bon" depends="properties" unless="bon.exists">
<echo message="Downloading BON..."/>
<get src="https://github.com/skyboy/bearded-octo-nemesis/releases/download/1.3/BON.jar" dest="${reobf.cmd}"/>
</target>
<target name="upload" depends="build" if="CF_API_TOKEN">
<echo message="Uploading to CurseForge..."/><local name="fileout"/>
<script language="javascript" classpathref="gson"><![CDATA[
var token = project.getProperty("CF_API_TOKEN");
var modid = project.getProperty("CF_MOD_ID");
var gameVersion = null;
var parser = new com.google.gson.JsonParser();
var path = project.getProperty("dist.dir");
var file = new java.lang.StringBuilder(path).append("/").append(project.getProperty("build.name"));
file.append(project.getProperty("build.full")).append(project.getProperty("build.number"));
var fileMain = new java.lang.StringBuilder(file).append(".jar");
var fileDev = new java.lang.StringBuilder(file).append("-dev.jar");
var fileApi = new java.lang.StringBuilder(file).append("-API.zip");
// version ids
var version = project.getProperty("mcv");
var t = new java.lang.StringBuilder("https://minecraft.curseforge.com/api/game/versions?token=");
t.append(token);
var con = new java.net.URL(t.toString()).openConnection();
con = new java.io.InputStreamReader(con.getInputStream());
var data = parser.parse(con).getAsJsonArray();
for (var i = 0, e = data.size(); i < e; ++i) {
var element = data.get(i).getAsJsonObject();
if (version.equals(element.get("name").getAsString())) {
gameVersion = element.get("id").getAsString();
break;
}
}
if (gameVersion == null) throw "Unable to find game version " + version + "!";
var httpConn;
function sendFile(requestURL, uploadFile, metadata) {
var LINE_FEED = "\r\n";
var boundary = "===" + java.lang.System.currentTimeMillis() + "===";
var url = new java.net.URL(requestURL);
httpConn = url.openConnection();
httpConn.setUseCaches(false);
httpConn.setDoOutput(true);
httpConn.setDoInput(true);
var t = new java.lang.StringBuilder("multipart/form-data; boundary=").append(boundary);
httpConn.setRequestProperty("Content-Type", t.toString());
httpConn.setRequestProperty("X-Api-Token", token);
var outputStream = httpConn.getOutputStream();
var writer = new java.io.PrintWriter(new java.io.OutputStreamWriter(outputStream, "UTF-8"), true);
writer.append("--").append(boundary).append(LINE_FEED);
writer.append("Content-Disposition: form-data; name=\"metadata\"").append(LINE_FEED);
writer.append("Content-Type: text/plain; charset=UTF-8").append(LINE_FEED);
writer.append(LINE_FEED);
writer.append(metadata).append(LINE_FEED);
writer.flush();
var fileName = uploadFile.getName();
writer.append("--").append(boundary).append(LINE_FEED);
writer.append("Content-Disposition: form-data; name=\"file\"; filename=\"").append(fileName).append("\"");
writer.append(LINE_FEED);
writer.append("Content-Type: application/octet-stream").append(LINE_FEED);
writer.append("Content-Transfer-Encoding: binary").append(LINE_FEED);
writer.append(LINE_FEED);
writer.flush();
var inputStream = new java.io.FileInputStream(uploadFile);
var buffer = java.lang.reflect.Array.newInstance(java.lang.Byte.TYPE, 4096);
var bytesRead = -1;
while ((bytesRead = inputStream.read(buffer)) != -1) {
outputStream.write(buffer, 0, bytesRead);
}
outputStream.flush();
inputStream.close();
writer.flush();
writer.append(LINE_FEED).flush();
writer.append("--").append(boundary).append("--").append(LINE_FEED);
writer.close();
return httpConn.getInputStream();
}
// main file
var t = new java.lang.StringBuilder("https://minecraft.curseforge.com/api/projects/");
path = t.append(modid).append("/upload-file").toString();
t = new java.lang.StringBuilder("{changelog:").append('"",');
t.append("releaseType:\"alpha\",").append("gameVersions:[");
t.append(gameVersion).append("]}");
try {
con = new java.io.InputStreamReader(sendFile(path, file = new java.io.File(fileMain), t.toString()));
var data = parser.parse(con).getAsJsonObject();
fileMain = data.get("id").getAsString();
t = new java.lang.StringBuilder("Uploaded to CurseForge! File ID: ");
t.append(fileMain);
project.setProperty("fileout", t.toString());
t = new java.lang.StringBuilder("{changelog:").append('"",');
t.append("releaseType:\"alpha\",").append("parentFileID:");
t.append(fileMain).append("}");
sendFile(path, file = new java.io.File(fileDev), t.toString());
file = new java.io.File(fileApi);
if (file.exists()) sendFile(path, file, t.toString());
} catch(_) {
t = new java.lang.StringBuilder("Error uploading ").append(file.getName());
t.append(" to CurseForge! ").append(httpConn.getResponseCode()).append(": ");
t.append(httpConn.getResponseMessage());
if (fileMain == null) {
project.setProperty("fileout", t.toString());
} else {
java.lang.System.err.println(t.toString());
}
}
]]></script>
<echo message="${fileout}"/>
</target>
<macrodef name="update-languages">
<sequential>
<script language="javascript"><![CDATA[
var path = "/assets/cofh/language/";
var languages = new java.io.File(project.getProperty("resources.dir") + path);
if (languages.exists() && languages.isDirectory()) {
var out = "";
for each(var i in languages.list()) {
if (i != null && i.length() > 5 && i.indexOf(".lang") == i.length() - 5) {
out += i.substring(0, i.length() - 5) + ", ";
}
}
if (out.length > 0) {
var os = new java.io.PrintWriter(project.getProperty("classes.dir") + path + ".languages");
os.write("["+out.substring(0, out.length - 2)+"]");
os.flush();
os.close();
}
}
]]></script>
</sequential>
</macrodef>
<target name="verify-version">
<script language="javascript"><![CDATA[
var name = project.getProperty("build.full");
if (name == null || name == "") {
name = project.getProperty("verclass.name");
if (name == null || name == "") {
project.setProperty("build.full", "-");
}
}
]]></script>
</target>
<target name="get-version" depends="verify-version,setup-forge" unless="build.full">
<local name="grep.out"/><local name="mfrv"/>
<!-- Read version out of file -->
<script language="javascript"><![CDATA[
var mainClass = new java.io.File(project.getProperty("verclass.dir"), project.getProperty("verclass.name"));
mainClass = new java.util.Scanner(mainClass, "UTF-8").useDelimiter("\\Z");
var text = mainClass.next();
mainClass.close();
var matches = /[0-9.]+R[0-9.]+((RC|B)[0-9]+)?/.exec(text);
project.setProperty("grep.out", matches[0]);
]]></script>
<!-- Split mod&mc version, update mcmod -->
<script language="javascript" classpathref="gson"><![CDATA[
versionlist = project.getProperty("grep.out");
mcversion = versionlist.substring(0, versionlist.indexOf('R'));
mfrversion = versionlist.substring(versionlist.indexOf('R') + 1);
project.setProperty("mfrv", mfrversion);
project.setProperty("mcv", mcversion);
var c = project.getProperty("build.channel");
if (c == null || c == "")
project.setProperty("build.channel", mfrversion.indexOf("B") > 0 ? "alpha" : (
mfrversion.indexOf("RC") > 0 ? "beta" : "release"));
// open file and parse JSON structure
var file = new java.io.File(project.getProperty("resources.dir") + "/mcmod.info");
if (file.exists())
{
var mcmod = new java.util.Scanner(file, "UTF-8").useDelimiter("\\Z");
var data = new com.google.gson.JsonParser().parse(mcmod.next()).getAsJsonArray();
mcmod.close();
// update all version elements
for (var i = 0, e = data.size(); i < e; ++i) {
var element = data.get(i).getAsJsonObject();
element.addProperty("version", mfrversion);
element.addProperty("mcversion", mcversion);
}
// write file back, pretty-printed
var output = new com.google.gson.stream.JsonWriter(new java.io.FileWriter(file));
output.setIndent(" ");
new com.google.gson.Gson().toJson(data, output);
output.close();
}
]]></script>
<echo message="Version: ${mfrv} Channel: ${build.channel}"/>
<property name="build.full" value="-[${mcv}]${mfrv}-"/>
</target>
<target name="get-build-number" depends="build-number-there" unless="build.number">
<echo message="!! No build number set !!"/>
<property name="build.number" value="CUSTOM_BUILD"/>
</target>
<target name="build-number-there" depends="get-version" if="env.BUILD_NUMBER" unless="build.number">
<echo message="Using build number ${env.BUILD_NUMBER}..."/>
<property name="build.number" value="${env.BUILD_NUMBER}"/>
</target>
<target name="clean">
<delete dir="${build.dir}"/>
</target>
<target name="rebuild">
<delete file="${forge.jar}" failonerror="false"/>
<delete dir="${forge.dir}"/>
<delete dir="${download.dir}"/>
<antcall target="install"/>
</target>
<target name="refresh-deps">
<delete dir="${lib.dir}"/>
<delete dir="${download.dir}"/>
<antcall target="install"/>
</target>
<target name="jar" depends="install"/>
</project>