This repository has been archived by the owner on Dec 2, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
297 lines (273 loc) · 14.3 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="JukeboxReloaded" default="reobfuscate">
<target name="download-forge" depends="setupvars" unless="forge.downloaded">
<echo>Downloading Minecraft Forge...</echo>
<delete dir="${forge.base}" />
<delete>
<fileset dir="${mod.base}" includes="minecraftforge-src-*.zip" />
</delete>
<get src="http://files.minecraftforge.net/minecraftforge/minecraftforge-src-${minecraft.version}-${forge.version}.zip" dest="${mod.base}/minecraftforge-src-${minecraft.version}-${forge.version}.zip" />
</target>
<target name="setup-forge" depends="download-forge" unless="forge.installed">
<!--<echo>Installing AccessTransformers</echo>
<copy file="${mod.base}\..\CodeChickenCore\codechickencore_at.cfg" todir="${forge.accesstransformers}" />-->
<echo>Installing Minecraft Forge...</echo>
<unzip src="${mod.base}/minecraftforge-src-${minecraft.version}-${forge.version}.zip" dest="${mod.base}" />
<exec executable="${python.exe}" dir="${forge.base}" failonerror="true">
<arg value="${forge.base}/install.py" />
</exec>
</target>
<target name="build-forge" depends="setup-forge" unless="forge.built">
<delete dir="${mcp.base}/bin" />
<delete file="${forge.jar.built}" />
<mkdir dir="${mcp.bin}" />
<echo>Building Minecraft and Minecraft Forge.</echo>
<javac encoding="UTF-8" compiler="modern" source="1.6" target="1.6" deprecation="false"
destdir="${mcp.bin}" includeantruntime="false" includejavaruntime="true" debug="true">
<compilerarg value="-Xlint:-options" />
<classpath>
<pathelement location="${mcp.lib}\argo-3.2-src.jar" />
<pathelement location="${mcp.lib}\asm-debug-all-4.1.jar" />
<pathelement location="${mcp.lib}\bcprov-debug-jdk15on-148.jar" />
<pathelement location="${mcp.lib}\guava-14.0-rc3.jar" />
<pathelement location="${mcp.jars}\bin\minecraft.jar" />
<pathelement location="${mcp.jars}\bin\jinput.jar" />
<pathelement location="${mcp.jars}\bin\lwjgl.jar" />
<pathelement location="${mcp.jars}\bin\lwjgl_util.jar" />
</classpath>
<src path="${mcp.src}" />
</javac>
<jar destfile="${forge.jar.built}">
<fileset dir="${mcp.bin}" includes="**/*.class" />
</jar>
</target>
<target name="build" depends="setup-workdir">
<delete file="VERSION" />
<delete dir="${mcp.bin}" />
<!--<copy todir="${mcp.src}\minecraft">
<fileset dir="${mod.base}\..\CodeChickenCore\codechicken\" />
<fileset dir="${mod.base}\..\CodeChickenCore\net\" />
</copy>-->
<echo>Building ${modname}.</echo>
<unzip src="${forge.jar.built}" dest="${mcp.bin}">
<patternset><exclude name="MANIFEST.MF" /></patternset>
</unzip>
<javac encoding="UTF-8" compiler="modern" source="1.6" target="1.6" deprecation="false"
destdir="${mcp.bin}" includeantruntime="false" includejavaruntime="true" debug="true">
<compilerarg value="-Xlint:-options" />
<compilerarg value="-Xlint:deprecation" />
<compilerarg value="-Xlint:unchecked" />
<classpath>
<pathelement location="${mod.base}\minecraftforge-built.jar" />
<pathelement location="${mcp.lib}\argo-3.2-src.jar" />
<pathelement location="${mcp.lib}\asm-debug-all-4.1.jar" />
<pathelement location="${mcp.lib}\bcprov-debug-jdk15on-148.jar" />
<pathelement location="${mcp.lib}\guava-14.0-rc3.jar" />
<pathelement location="${mcp.jars}\bin\minecraft.jar" />
<pathelement location="${mcp.jars}\bin\jinput.jar" />
<pathelement location="${mcp.jars}\bin\lwjgl.jar" />
<pathelement location="${mcp.jars}\bin\lwjgl_util.jar" />
<pathelement location="${mcp.jars}\bin\minecraft.jar" />
<!--<dirset dir="${mod.base}\..\CodeChickenCore\">
<include name="codechicken\**"/>
<include name="net\**"/>
</dirset>-->
</classpath>
<src path="${temp.src}" />
<!--<src path="${mod.src}" />-->
</javac>
</target>
<target name="reobfuscate" depends="build">
<unzip src="${forge.jar.built}" dest="${mcp.bin}" />
<echo message="Reobfuscating ${modname}." level="info" />
<exec executable="${python.exe}" dir="${mcp.base}" failonerror="true">
<arg value="${mcp.base}/runtime/reobfuscate.py" />
<arg value="--srgnames" />
</exec>
<echo message="Building a release jar." />
<jar destfile="${mod.jar.release}">
<fileset dir="${mcp.reobf}" includes="cazzar/" />
<fileset dir="${mod.src}">
<exclude name="mcmod.info"/>
<exclude name="**/*.java"/>
<exclude name="com/" />
</fileset>
<fileset dir="${mod.base}/resources">
<exclude name="mcmod.info"/>
<exclude name="**/*.java"/>
<exclude name="com/" />
</fileset>
<mappedresources>
<concat>
<fileset dir="${mod.src}" includes="mcmod.info" />
<filterchain>
<replacetokens>
<token key="NAME" value="${modname}" />
<token key="VERSION" value="${version}" />
<token key="MCVERSION" value="${mcversion}" />
</replacetokens>
</filterchain>
</concat>
<mergemapper to="mcmod.info" />
</mappedresources>
</jar>
<echo file="VERSION">${minecraft.version} -- v${version}</echo>
</target>
<target name="setup-workdir" depends="build-forge">
<delete dir="${temp.dir}" />
<copy todir="${temp.src}">
<fileset dir="${mod.src}" />
</copy>
<replace dir="${temp.src}" token="@VERSION@" value="${version}" />
<replace dir="${temp.src}" token="@BUILD_NUMBER@" value="${build_number.build_number}" />
</target>
<target name="setupvars" unless="vars.setup">
<property name="vars.setup" value="true" />
<echo>Setting up values...</echo>
<property environment="env" />
<property name="modname" value="JukeboxReloaded" />
<property name="mod.base" location="${basedir}" />
<property name="mod.src" location="${mod.base}/src" />
<property name="mod.bin" location="${mod.base}/bin" />
<property name="temp.dir" location= "${mod.base}/tmp" />
<property name="temp.src" location= "${temp.dir}/src" />
<property name="forge.base" location="${mod.base}/forge" />
<property name="forge.jar.built" location="${mod.base}/minecraftforge-built.jar" />
<property name="forge.accesstransformers" location="${forge.base}/accesstransformers" />
<property name="mcp.base" location="${forge.base}/mcp" />
<property name="mcp.bin" location="${mcp.base}/bin/minecraft" />
<property name="mcp.src" location="${mcp.base}/src/minecraft" />
<property name="mcp.conf" location="${mcp.base}/conf" />
<property name="mcp.jars" location="${mcp.base}/jars" />
<property name="mcp.lib" location="${mcp.base}/lib" />
<property name="mcp.reobf" location="${mcp.base}/reobf/minecraft" />
<property name="bon.jar" location="${env.BON_HOME}/bon.jar" />
<condition property="python.exe" value="${forge.base}/fml/python/python_fml" else="python">
<os family="Windows" />
</condition>
<condition property="version.build" value="${env.BUILD_NUMBER}" else="dev">
<isset property="env.BUILD_NUMBER" />
</condition>
<property file="${mod.src}/version.properties" />
<property name="build.version" value="${mod.build.major.number}.${mod.build.minor.number}.${mod.build.revision.number}" />
<property name="version.minecraft" value="${build.mcversion}" />
<property name="version.major" value="${build.major.number}" />
<property name="version.minor" value="${build.minor.number}" />
<property name="version.rev" value="${build.revision.number}" />
<!--<property name="version" value="${version.major}.${version.minor}.${version.rev}.${version.build}" />-->
<condition property="version" value="${version.major}.${version.minor}.${version.rev}" else="${version.major}.${version.minor}.${version.rev}.${version.build}">
<isset property="release" />
</condition>
<property name="minecraft.version" value="${build.mcversion}" />
<!--<propertyfile file="${mod.src}/version.properties">
<entry key="build.build.number" type="int" value="${version.build}" />
<entry key="version" type="string" value="${version}" />
</propertyfile>-->
<property name="forge.version" value="${build.forgeversion}" />
<property name="mod.jar.release" location="${mod.base}/${modname}-universal-${minecraft.version}-${version}-Forge-${build.forgeversion}.jar" />
<condition property="forge.downloaded" value="true">
<resourceexists>
<file file="${mod.base}/minecraftforge-src-${minecraft.version}-${forge.version}.zip" />
</resourceexists>
</condition>
<condition property="forge.installed" value="true">
<and>
<isset property="forge.downloaded" />
<resourceexists>
<file file="${mod.base}/forge"/>
</resourceexists>
</and>
</condition>
<condition property="forge.built" value="true">
<and>
<isset property="forge.installed" />
<resourceexists>
<file file="${forge.jar.built}"/>
</resourceexists>
</and>
</condition>
<property file="build_number.properties" prefix="build_number"/>
</target>
<target name="release">
<property name="release" value="true" />
<!--Increase the release number in the config-->
<propertyfile file="build_number.properties">
<entry key="build_number" type="int" operation="+" default="1"/>
</propertyfile>
<antcall target="setupvars" />
<antcall target="reobfuscate" />
</target>
<target name="build-jenkins" depends="setup-workdir">
<delete file="VERSION" />
<delete dir="${mcp.bin}" />
<!--<copy todir="${mcp.src}\minecraft">
<fileset dir="${mod.base}\..\CodeChickenCore\codechicken\" />
<fileset dir="${mod.base}\..\CodeChickenCore\net\" />
</copy>-->
<echo>Building ${modname}.</echo>
<unzip src="${forge.jar.built}" dest="${mcp.bin}">
<patternset><exclude name="MANIFEST.MF" /></patternset>
</unzip>
<javac encoding="UTF-8" compiler="modern" source="1.6" target="1.6" deprecation="false"
destdir="${mcp.bin}" includeantruntime="false" includejavaruntime="true" debug="true">
<compilerarg value="-Xlint:-options" />
<compilerarg value="-Xlint:deprecation" />
<compilerarg value="-Xlint:unchecked" />
<classpath>
<pathelement location="${mod.base}\minecraftforge-built.jar" />
<pathelement location="${mcp.lib}\argo-3.2-src.jar" />
<pathelement location="${mcp.lib}\asm-debug-all-4.1.jar" />
<pathelement location="${mcp.lib}\bcprov-debug-jdk15on-148.jar" />
<pathelement location="${mcp.lib}\guava-14.0-rc3.jar" />
<pathelement location="${mcp.jars}\bin\minecraft.jar" />
<pathelement location="${mcp.jars}\bin\jinput.jar" />
<pathelement location="${mcp.jars}\bin\lwjgl.jar" />
<pathelement location="${mcp.jars}\bin\lwjgl_util.jar" />
<pathelement location="${mcp.jars}\bin\minecraft.jar" />
<pathelement location="${basedir}\jenkinslib\CerberusCore-universal-api.jar" />
<!--<dirset dir="${mod.base}\..\CodeChickenCore\">
<include name="codechicken\**"/>
<include name="net\**"/>
</dirset>-->
</classpath>
<src path="${temp.src}" />
<!--<src path="${mod.src}" />-->
</javac>
</target>
<target name="reobfuscate-jenkins" depends="build-jenkins">
<unzip src="${forge.jar.built}" dest="${mcp.bin}" />
<echo message="Reobfuscating ${modname}." level="info" />
<exec executable="${python.exe}" dir="${mcp.base}" failonerror="true">
<arg value="${mcp.base}/runtime/reobfuscate.py" />
<arg value="--srgnames" />
</exec>
<echo message="Building a release jar." />
<jar destfile="${mod.jar.release}">
<fileset dir="${mcp.reobf}" includes="cazzar/" />
<fileset dir="${mod.src}">
<exclude name="mcmod.info"/>
<exclude name="**/*.java"/>
<exclude name="com/" />
</fileset>
<fileset dir="${mod.base}/resources">
<exclude name="mcmod.info"/>
<exclude name="**/*.java"/>
<exclude name="com/" />
</fileset>
<mappedresources>
<concat>
<fileset dir="${mod.src}" includes="mcmod.info" />
<filterchain>
<replacetokens>
<token key="NAME" value="${modname}" />
<token key="VERSION" value="${version}" />
<token key="MCVERSION" value="${mcversion}" />
</replacetokens>
</filterchain>
</concat>
<mergemapper to="mcmod.info" />
</mappedresources>
</jar>
<echo file="VERSION">${minecraft.version} -- v${version}</echo>
</target>
</project>