Commit 13aabe4b617657b5a59796f5eda70384016cc24f

Authored by Mumfrey
1 parent 7fce24de

Use git commit instead of svn revision in snapshot branding line

Showing 1 changed file with 369 additions and 367 deletions
ant/build_liteloader.xml
1   -<?xml version="1.0" encoding="UTF-8" ?>
2   -<project name="liteloader" basedir="." default="development">
3   -
4   - <taskdef resource="net/sf/antcontrib/antcontrib.properties" classpath="tasks/ant-contrib.jar" />
5   -
6   - <!-- Versions !!IMPORTANT -->
7   - <property name="version" value="1.8.0_00" />
8   - <property name="mcversion" value="1.8" />
9   - <property name="author" value="Mumfrey" />
10   -
11   - <!-- Project definitions and dependencies -->
12   - <property name="upstream" value="" />
13   - <property name="project" value="LiteLoader" />
14   - <property name="displayname" value="LiteLoader" />
15   - <property name="md5set" value="mcp" />
16   - <property name="outmd5set" value="liteloader" />
17   - <property name="tweakclass" value="com.mumfrey.liteloader.launch.LiteLoaderTweaker" />
18   -
19   - <property name="mcp.dir" location="../../.." />
20   - <property name="build.dir" location="${mcp.dir}/build" />
21   - <property name="eclipse.dir" location="${mcp.dir}/eclipse" />
22   - <property name="temp.dir" location="${mcp.dir}/temp" />
23   - <property name="md5.dir" location="${mcp.dir}/md5" />
24   - <property name="libs.dir" location="${mcp.dir}/lib" />
25   - <property name="src.dir" location="${build.dir}/src"/>
26   - <property name="mc.src.dir" location="${mcp.dir}/src/minecraft" />
27   - <property name="mc.bin.dir" location="${mcp.dir}/bin/minecraft" />
28   - <property name="reobf.dir" location="${mcp.dir}/reobf/minecraft" />
29   - <property name="mc.libs.dir" location="${mcp.dir}/jars/libraries" />
30   -
31   - <property name="dist.dir" location="${build.dir}/dist" />
32   - <property name="filetype" value="jar" />
33   -
34   - <property name="python_windows" location="${mcp.dir}/runtime/bin/python/python_mcp.exe" />
35   - <property name="python_linux" location="/usr/bin/python" />
36   -
37   - <property environment="env" />
38   -
39   - <target name="setup_client">
40   - <property name="clientjar" value="true" />
41   - <property name="suffix" value="" />
42   - <property name="javadocpath" value="docs" />
43   - </target>
44   -
45   - <target name="setup_core">
46   - <property name="suffix" value="-core" />
47   - <property name="javadocpath" value="coredocs" />
48   - </target>
49   -
50   - <target name="setup_development">
51   - <property name="skipremoval" value="DEV" />
52   - <property name="md5.outfile" value="${md5.dir}/client_${outmd5set}.md5" />
53   - <property name="artefact.name" value="${ant.project.name}${suffix}-${mcversion}" />
54   - <property name="stage.dir" location="${build.dir}/stage/${ant.project.name}/${version}" />
55   - <property name="meta.version" value="${version}" />
56   - </target>
57   -
58   - <target name="setup_production">
59   - <property name="skipremoval" value="" />
60   - <property name="md5.outfile" value="${md5.dir}/client_${outmd5set}_production.md5" />
61   - <property name="artefact.name" value="${ant.project.name}${suffix}-${mcversion}" />
62   - <property name="stage.dir" location="${build.dir}/stage/${ant.project.name}/${version}" />
63   - <property name="meta.version" value="${version}" />
64   - </target>
65   -
66   - <target name="setup_jenkins">
67   - <property name="skipremoval" value="" />
68   - <property name="md5.outfile" value="${md5.dir}/client_${outmd5set}_production.md5" />
69   - <property name="artefact.name" value="${ant.project.name}${suffix}-${mcversion}-SNAPSHOT" />
70   - <property name="stage.dir" location="${build.dir}/stage" />
71   - <property name="brand" value="${mcversion}-SNAPSHOT-r${env.SVN_REVISION}-b${env.BUILD_NUMBER}-${env.BUILD_ID}" />
72   - <property name="meta.version" value="${version} [${brand}]" />
73   - <property name="jenkins" value="" />
74   - </target>
75   -
76   - <!-- Main target -->
77   - <target name="development" depends="setup_client, setup_development, build" description="Entry point for MCP and upstream builds" />
78   -
79   - <target name="production" depends="setup_client, setup_production, build, javadoc, mcpjar" description="Entry point for production builds" />
80   -
81   - <target name="jenkins" depends="setup_client, setup_jenkins, build, javadoc, mcpjar" description="Entry point for CI builds" />
82   -
83   - <target name="core" depends="setup_core, setup_jenkins, build, javadoc, mcpjar" description="Entry point for CI builds" />
84   -
85   - <target name="build" description="Perform all tasks for a client build" depends="init, recompile, reobfuscate, savemd5, stage, jar" >
86   - </target>
87   -
88   - <target name="clean">
89   - <echo level="info" message="Cleaning output directories" />
90   -
91   - <delete dir="${src.dir}" />
92   - <delete dir="${mcp.dir}/reobf" />
93   - </target>
94   -
95   - <target name="contributesource" description="Contribute an upstream project source code to the source path">
96   - <echo level="info" message="Contributing project ${lib}" />
97   - <copy todir="${src.dir}" verbose="false" overwrite="true" failonerror="false">
98   - <fileset dir="${eclipse.dir}/${lib}/java${sub}">
99   - <exclude name="**/debug" />
100   - <exclude name="**/debug/*.java" />
101   - </fileset>
102   - <fileset dir="${eclipse.dir}/${lib}/src${sub}" />
103   - <filterchain>
104   - <linecontains negate="true">
105   - <contains value="@MCPONLY${skipremoval}" />
106   - </linecontains>
107   - </filterchain>
108   - </copy>
109   - </target>
110   -
111   - <target name="contributeclientsource" description="Contribute client source if building a client jar" if="clientjar">
112   - <antcall target="contributesource">
113   - <param name="lib" value="${project}" />
114   - <param name="sub" value="/client" />
115   - </antcall>
116   - </target>
117   -
118   - <target name="contributeresources" description="Contribute resources to the staging path">
119   - <echo level="info" message="Contributing project resources for ${lib}" />
120   - <copy todir="${stage.dir}" verbose="false" failonerror="false">
121   - <fileset dir="${eclipse.dir}/${lib}/resources" excludes=".svn/**">
122   - <exclude name="**/Thumbs.db" />
123   - <exclude name="**/minecraft.key" />
124   - </fileset>
125   - </copy>
126   - </target>
127   -
128   - <target name="findmd5dir">
129   - <echo level="info" message="Searching for existing MD5 directory..." />
130   - <condition property="md5dir.exists">
131   - <available file="${md5.dir}" type="dir"/>
132   - </condition>
133   - </target>
134   -
135   - <target name="findmd5" depends="findmd5dir">
136   - <echo level="info" message="Searching for existing MD5 sets..." />
137   - <condition property="md5set.exists">
138   - <available file="${md5.dir}/client_${md5set}.md5" type="file"/>
139   - </condition>
140   - </target>
141   -
142   - <target name="seedmd5" depends="findmd5" unless="md5set.exists">
143   - <echo level="info" message="MD5 sets not found, seeding..." />
144   - <ant target="genmd5" antfile="seed_md5.xml" inheritall="true" />
145   - </target>
146   -
147   - <target name="notifymd5ok" depends="findmd5" if="md5set.exists">
148   - <echo level="info" message="MD5 sets already exist, skipping MD5 set seeding" />
149   - </target>
150   -
151   - <target name="preparemd5" description="Copy patched MD5 to the temp directory" depends="seedmd5, notifymd5ok, clean">
152   - <echo level="info" message="Prepare exclusion MD5s, using exclusion set &quot;${md5set}&quot;" />
153   -
154   - <copy tofile="${temp.dir}/client.md5" file="${md5.dir}/client_${md5set}.md5" failonerror="true" verbose="true" overwrite="true" />
155   - </target>
156   -
157   - <target name="prepare" description="Prepare source for MCP" depends="preparemd5">
158   - <echo level="info" message="Prepare sources for compile" />
159   -
160   - <echo level="info" message="Contributing libs" />
161   - <copy todir="${libs.dir}" verbose="true" overwrite="true">
162   - <fileset dir="${eclipse.dir}/${project}/lib">
163   - <exclude name="**/authlib*.jar" />
164   - <exclude name="**/log4j*.jar" />
165   - </fileset>
166   - </copy>
167   -
168   - <echo level="info" message="Contributing MC source" />
169   - <copy todir="${src.dir}" verbose="false" overwrite="true">
170   - <fileset dir="${mc.src.dir}" />
171   - </copy>
172   -
173   - <echo level="info" message="Contributing upstream projects" />
174   - <foreach list="${upstream}" param="lib" target="contributesource" />
175   -
176   - <antcall target="contributesource">
177   - <param name="lib" value="${project}" />
178   - <param name="sub" value="/common" />
179   - </antcall>
180   -
181   - <antcall target="contributeclientsource" />
182   - </target>
183   -
184   - <target name="init" description="Initialize build environment" depends="prepare">
185   - <echo append="false" file="${temp.dir}/build.cfg" message="[OUTPUT]&#x0A;SrcClient = build/src" />
186   -
187   - <echo level="info" message="Cleaning old stage and dist, MCP reobf directories" />
188   -
189   - <delete dir="${stage.dir}" />
190   -
191   - <echo level="info" message="Creating stage and dist dirs" />
192   - <mkdir dir="${stage.dir}" />
193   - <mkdir dir="${dist.dir}" />
194   - <mkdir dir="${md5.dir}" />
195   - </target>
196   -
197   - <target name="recompile" description="MCP recompile">
198   - <echo level="info" message="Compiling projects" />
199   -
200   - <exec executable="${python_windows}" dir="${mcp.dir}" osfamily="windows">
201   - <arg value="runtime/recompile.py" />
202   - <arg value="--client" />
203   - <arg value="--config" />
204   - <arg value="${temp.dir}/build.cfg" />
205   - <arg value="%*" />
206   - </exec>
207   -
208   - <exec executable="${python_linux}" dir="${mcp.dir}" osfamily="unix">
209   - <arg value="runtime/recompile.py" />
210   - <arg value="--client" />
211   - <arg value="--config" />
212   - <arg value="${temp.dir}/build.cfg" />
213   - <arg value="%*" />
214   - </exec>
215   - </target>
216   -
217   - <target name="reobfuscate" description="MCP reobfuscate">
218   - <echo level="info" message="Obfuscating classes" />
219   -
220   - <exec executable="${python_windows}" dir="${mcp.dir}" osfamily="windows">
221   - <arg value="runtime/reobfuscate.py" />
222   - <arg value="--client" />
223   - <arg value="%*" />
224   - </exec>
225   -
226   - <exec executable="${python_linux}" dir="${mcp.dir}" osfamily="unix">
227   - <arg value="runtime/reobfuscate.py" />
228   - <arg value="--client" />
229   - <arg value="%*" />
230   - </exec>
231   - </target>
232   -
233   - <target name="savemd5" description="Put post-obfuscation MD5 to stored md5 set" if="outmd5set">
234   - <echo level="info" message="Storing obfuscated MD5s" />
235   -
236   - <copy file="${temp.dir}/client_reobf.md5" tofile="${md5.outfile}" overwrite="true" verbose="true" />
237   - </target>
238   -
239   - <target name="stage" description="Stage resources into staging directory">
240   - <echo level="info" message="Staging resources" />
241   -
242   - <copy todir="${stage.dir}" overwrite="true">
243   - <fileset dir="${reobf.dir}" excludes=".svn/**, *.txt">
244   - <exclude name="?.class" />
245   - <exclude name="??.class" />
246   - <exclude name="???.class" />
247   - <exclude name="/net/minecraft/**" />
248   - </fileset>
249   - </copy>
250   -
251   - <foreach list="${upstream}" param="lib" target="contributeresources" />
252   -
253   - <antcall target="contributeresources">
254   - <param name="lib" value="${project}" />
255   - </antcall>
256   -
257   - <antcall target="stamp">
258   - </antcall>
259   - </target>
260   -
261   - <target name="stamp" description="Stamp build information into staged resources" if="jenkins">
262   - <echo level="info" message="Writing branding information into artefact staging area" />
263   - <echo level="info" message="Brand: ${brand}" />
264   -
265   - <replaceregexp file="${stage.dir}/liteloader.properties" byline="true" match="^brand=.*$" replace="brand=${brand}" />
266   - </target>
267   -
268   - <target name="jar" description="Build the client jar">
269   - <echo level="info" message="Building final output" />
270   -
271   - <mkdir dir="${dist.dir}" />
272   -
273   - <jar destfile="${dist.dir}/${artefact.name}.${filetype}" duplicate="preserve" index="true" manifestencoding="UTF-8">
274   - <manifest>
275   - <attribute name="Built-By" value="MCP (http://mcp.ocean-labs.de)" />
276   - <attribute name="Implementation-Vendor" value="${author}" />
277   - <attribute name="Implementation-Title" value="${ant.project.name}" />
278   - <attribute name="Implementation-Version" value="${meta.version}" />
279   - <attribute name="TweakClass" value="${tweakclass}" />
280   - <attribute name="TweakName" value="${displayname}" />
281   - <attribute name="TweakVersion" value="${version}" />
282   - <attribute name="TweakAuthor" value="${author}" />
283   - </manifest>
284   - <fileset dir="${stage.dir}" />
285   - </jar>
286   - </target>
287   -
288   - <target name="compiledebug" description="Recompile with debug classes">
289   - <copy todir="${src.dir}" verbose="false" overwrite="true" failonerror="false">
290   - <fileset dir="${eclipse.dir}/${project}/debug" />
291   - </copy>
292   -
293   - <antcall target="recompile" />
294   - </target>
295   -
296   - <target name="mcpjar" description="Build the MCP-names jar" depends="compiledebug">
297   - <echo level="info" message="Building mcpnamesjars" />
298   -
299   - <mkdir dir="${dist.dir}" />
300   -
301   - <delete file="${dist.dir}/${artefact.name}-mcpnames.${filetype}" />
302   - <delete file="${dist.dir}/${artefact.name}-mcpnames-sources.${filetype}" />
303   -
304   - <jar destfile="${dist.dir}/${artefact.name}-mcpnames.${filetype}" duplicate="preserve" index="true" manifestencoding="UTF-8">
305   - <manifest>
306   - <attribute name="Built-By" value="MCP (http://mcp.ocean-labs.de)" />
307   - <attribute name="Implementation-Vendor" value="${author}" />
308   - <attribute name="Implementation-Title" value="${ant.project.name}" />
309   - <attribute name="Implementation-Version" value="${meta.version}" />
310   - <attribute name="TweakClass" value="${tweakclass}" />
311   - <attribute name="TweakName" value="${displayname}" />
312   - <attribute name="TweakVersion" value="${version}" />
313   - <attribute name="TweakAuthor" value="${author}" />
314   - </manifest>
315   - <fileset dir="${mc.bin.dir}">
316   - <include name="com/mumfrey/**" />
317   - <include name="net/eq2online/**" />
318   - </fileset>
319   - <fileset dir="${eclipse.dir}/${project}/resources" excludes=".svn/**" />
320   - <fileset dir="${eclipse.dir}/${project}/debug" excludes=".svn/**">
321   - <exclude name="**/*.java" />
322   - </fileset>
323   - </jar>
324   - <jar destfile="${dist.dir}/${artefact.name}-mcpnames-sources.${filetype}" duplicate="preserve" index="false" filesetmanifest="skip">
325   - <fileset dir="${eclipse.dir}/${project}/java/common" />
326   - <fileset dir="${eclipse.dir}/${project}/java/client" />
327   - <fileset dir="${eclipse.dir}/${project}/debug" />
328   - <fileset dir="${eclipse.dir}/${project}/resources" />
329   - </jar>
330   - </target>
331   -
332   - <target name="javadoc" description="Create the javadoc jar">
333   - <echo level="info" message="Generating javadoc" />
334   -
335   - <javadoc destdir="${stage.dir}/${javadocpath}" useexternalfile="true">
336   - <fileset dir="${eclipse.dir}/${project}/java">
337   - <exclude name="**/debug" />
338   - <exclude name="**/debug/*.java" />
339   - </fileset>
340   - <classpath>
341   - <fileset dir="${mc.libs.dir}">
342   - <include name="**/*.jar" />
343   - </fileset>
344   - <fileset dir="${libs.dir}">
345   - <include name="*.jar" />
346   - </fileset>
347   - <pathelement location="${mc.bin.dir}"/>
348   - </classpath>
349   - <arg value="-XDignore.symbol.file" />
350   - </javadoc>
351   - <jar destfile="${dist.dir}/${artefact.name}-javadoc.${filetype}" duplicate="preserve" index="true" manifestencoding="UTF-8">
352   - <manifest>
353   - <attribute name="Built-By" value="MCP (http://mcp.ocean-labs.de)" />
354   - <attribute name="Implementation-Vendor" value="${author}" />
355   - <attribute name="Implementation-Title" value="${ant.project.name}" />
356   - <attribute name="Implementation-Version" value="${version}" />
357   - </manifest>
358   - <fileset dir="${stage.dir}/${javadocpath}" />
359   - </jar>
360   - <copy file="${dist.dir}/${artefact.name}-javadoc.${filetype}" tofile="${dist.dir}/${artefact.name}-mcpnames-javadoc.${filetype}" />
361   - </target>
362   -
363   - <target name="deploy" depends="production" description="Deploy artifact to local minecraft installation in APPDATA">
364   - <mkdir dir="${env.APPDATA}/.minecraft/libraries/com/mumfrey/liteloader/${mcversion}"/>
365   - <copy todir="${env.APPDATA}/.minecraft/libraries/com/mumfrey/liteloader/${mcversion}" file="${dist.dir}/${artefact.name}.${filetype}" failonerror="false" overwrite="true" />
366   - <copy todir="${eclipse.dir}/LiteLoaderInstaller/src/main/resources" file="${dist.dir}/${artefact.name}.${filetype}" failonerror="false" overwrite="true" />
367   - </target>
  1 +<?xml version="1.0" encoding="UTF-8" ?>
  2 +<project name="liteloader" basedir="." default="development">
  3 +
  4 + <taskdef resource="net/sf/antcontrib/antcontrib.properties" classpath="tasks/ant-contrib.jar" />
  5 +
  6 + <!-- Versions !!IMPORTANT -->
  7 + <property name="version" value="1.8.0_00" />
  8 + <property name="mcversion" value="1.8" />
  9 + <property name="author" value="Mumfrey" />
  10 +
  11 + <!-- Project definitions and dependencies -->
  12 + <property name="upstream" value="" />
  13 + <property name="project" value="LiteLoader" />
  14 + <property name="displayname" value="LiteLoader" />
  15 + <property name="md5set" value="mcp" />
  16 + <property name="outmd5set" value="liteloader" />
  17 + <property name="tweakclass" value="com.mumfrey.liteloader.launch.LiteLoaderTweaker" />
  18 +
  19 + <property name="mcp.dir" location="../../.." />
  20 + <property name="build.dir" location="${mcp.dir}/build" />
  21 + <property name="eclipse.dir" location="${mcp.dir}/eclipse" />
  22 + <property name="temp.dir" location="${mcp.dir}/temp" />
  23 + <property name="md5.dir" location="${mcp.dir}/md5" />
  24 + <property name="libs.dir" location="${mcp.dir}/lib" />
  25 + <property name="src.dir" location="${build.dir}/src"/>
  26 + <property name="mc.src.dir" location="${mcp.dir}/src/minecraft" />
  27 + <property name="mc.bin.dir" location="${mcp.dir}/bin/minecraft" />
  28 + <property name="reobf.dir" location="${mcp.dir}/reobf/minecraft" />
  29 + <property name="mc.libs.dir" location="${mcp.dir}/jars/libraries" />
  30 +
  31 + <property name="dist.dir" location="${build.dir}/dist" />
  32 + <property name="filetype" value="jar" />
  33 +
  34 + <property name="python_windows" location="${mcp.dir}/runtime/bin/python/python_mcp.exe" />
  35 + <property name="python_linux" location="/usr/bin/python" />
  36 +
  37 + <property environment="env" />
  38 +
  39 + <propertyregex property="gitcommit" input="${env.GIT_COMMIT}" regexp="^(.{7})" select="\1" casesensitive="false" />
  40 +
  41 + <target name="setup_client">
  42 + <property name="clientjar" value="true" />
  43 + <property name="suffix" value="" />
  44 + <property name="javadocpath" value="docs" />
  45 + </target>
  46 +
  47 + <target name="setup_core">
  48 + <property name="suffix" value="-core" />
  49 + <property name="javadocpath" value="coredocs" />
  50 + </target>
  51 +
  52 + <target name="setup_development">
  53 + <property name="skipremoval" value="DEV" />
  54 + <property name="md5.outfile" value="${md5.dir}/client_${outmd5set}.md5" />
  55 + <property name="artefact.name" value="${ant.project.name}${suffix}-${mcversion}" />
  56 + <property name="stage.dir" location="${build.dir}/stage/${ant.project.name}/${version}" />
  57 + <property name="meta.version" value="${version}" />
  58 + </target>
  59 +
  60 + <target name="setup_production">
  61 + <property name="skipremoval" value="" />
  62 + <property name="md5.outfile" value="${md5.dir}/client_${outmd5set}_production.md5" />
  63 + <property name="artefact.name" value="${ant.project.name}${suffix}-${mcversion}" />
  64 + <property name="stage.dir" location="${build.dir}/stage/${ant.project.name}/${version}" />
  65 + <property name="meta.version" value="${version}" />
  66 + </target>
  67 +
  68 + <target name="setup_jenkins">
  69 + <property name="skipremoval" value="" />
  70 + <property name="md5.outfile" value="${md5.dir}/client_${outmd5set}_production.md5" />
  71 + <property name="artefact.name" value="${ant.project.name}${suffix}-${mcversion}-SNAPSHOT" />
  72 + <property name="stage.dir" location="${build.dir}/stage" />
  73 + <property name="brand" value="${mcversion}-SNAPSHOT-r${gitcommit}-b${env.BUILD_NUMBER}-${env.BUILD_ID}" />
  74 + <property name="meta.version" value="${version} [${brand}]" />
  75 + <property name="jenkins" value="" />
  76 + </target>
  77 +
  78 + <!-- Main target -->
  79 + <target name="development" depends="setup_client, setup_development, build" description="Entry point for MCP and upstream builds" />
  80 +
  81 + <target name="production" depends="setup_client, setup_production, build, javadoc, mcpjar" description="Entry point for production builds" />
  82 +
  83 + <target name="jenkins" depends="setup_client, setup_jenkins, build, javadoc, mcpjar" description="Entry point for CI builds" />
  84 +
  85 + <target name="core" depends="setup_core, setup_jenkins, build, javadoc, mcpjar" description="Entry point for CI builds" />
  86 +
  87 + <target name="build" description="Perform all tasks for a client build" depends="init, recompile, reobfuscate, savemd5, stage, jar" >
  88 + </target>
  89 +
  90 + <target name="clean">
  91 + <echo level="info" message="Cleaning output directories" />
  92 +
  93 + <delete dir="${src.dir}" />
  94 + <delete dir="${mcp.dir}/reobf" />
  95 + </target>
  96 +
  97 + <target name="contributesource" description="Contribute an upstream project source code to the source path">
  98 + <echo level="info" message="Contributing project ${lib}" />
  99 + <copy todir="${src.dir}" verbose="false" overwrite="true" failonerror="false">
  100 + <fileset dir="${eclipse.dir}/${lib}/java${sub}">
  101 + <exclude name="**/debug" />
  102 + <exclude name="**/debug/*.java" />
  103 + </fileset>
  104 + <fileset dir="${eclipse.dir}/${lib}/src${sub}" />
  105 + <filterchain>
  106 + <linecontains negate="true">
  107 + <contains value="@MCPONLY${skipremoval}" />
  108 + </linecontains>
  109 + </filterchain>
  110 + </copy>
  111 + </target>
  112 +
  113 + <target name="contributeclientsource" description="Contribute client source if building a client jar" if="clientjar">
  114 + <antcall target="contributesource">
  115 + <param name="lib" value="${project}" />
  116 + <param name="sub" value="/client" />
  117 + </antcall>
  118 + </target>
  119 +
  120 + <target name="contributeresources" description="Contribute resources to the staging path">
  121 + <echo level="info" message="Contributing project resources for ${lib}" />
  122 + <copy todir="${stage.dir}" verbose="false" failonerror="false">
  123 + <fileset dir="${eclipse.dir}/${lib}/resources" excludes=".svn/**">
  124 + <exclude name="**/Thumbs.db" />
  125 + <exclude name="**/minecraft.key" />
  126 + </fileset>
  127 + </copy>
  128 + </target>
  129 +
  130 + <target name="findmd5dir">
  131 + <echo level="info" message="Searching for existing MD5 directory..." />
  132 + <condition property="md5dir.exists">
  133 + <available file="${md5.dir}" type="dir"/>
  134 + </condition>
  135 + </target>
  136 +
  137 + <target name="findmd5" depends="findmd5dir">
  138 + <echo level="info" message="Searching for existing MD5 sets..." />
  139 + <condition property="md5set.exists">
  140 + <available file="${md5.dir}/client_${md5set}.md5" type="file"/>
  141 + </condition>
  142 + </target>
  143 +
  144 + <target name="seedmd5" depends="findmd5" unless="md5set.exists">
  145 + <echo level="info" message="MD5 sets not found, seeding..." />
  146 + <ant target="genmd5" antfile="seed_md5.xml" inheritall="true" />
  147 + </target>
  148 +
  149 + <target name="notifymd5ok" depends="findmd5" if="md5set.exists">
  150 + <echo level="info" message="MD5 sets already exist, skipping MD5 set seeding" />
  151 + </target>
  152 +
  153 + <target name="preparemd5" description="Copy patched MD5 to the temp directory" depends="seedmd5, notifymd5ok, clean">
  154 + <echo level="info" message="Prepare exclusion MD5s, using exclusion set &quot;${md5set}&quot;" />
  155 +
  156 + <copy tofile="${temp.dir}/client.md5" file="${md5.dir}/client_${md5set}.md5" failonerror="true" verbose="true" overwrite="true" />
  157 + </target>
  158 +
  159 + <target name="prepare" description="Prepare source for MCP" depends="preparemd5">
  160 + <echo level="info" message="Prepare sources for compile" />
  161 +
  162 + <echo level="info" message="Contributing libs" />
  163 + <copy todir="${libs.dir}" verbose="true" overwrite="true">
  164 + <fileset dir="${eclipse.dir}/${project}/lib">
  165 + <exclude name="**/authlib*.jar" />
  166 + <exclude name="**/log4j*.jar" />
  167 + </fileset>
  168 + </copy>
  169 +
  170 + <echo level="info" message="Contributing MC source" />
  171 + <copy todir="${src.dir}" verbose="false" overwrite="true">
  172 + <fileset dir="${mc.src.dir}" />
  173 + </copy>
  174 +
  175 + <echo level="info" message="Contributing upstream projects" />
  176 + <foreach list="${upstream}" param="lib" target="contributesource" />
  177 +
  178 + <antcall target="contributesource">
  179 + <param name="lib" value="${project}" />
  180 + <param name="sub" value="/common" />
  181 + </antcall>
  182 +
  183 + <antcall target="contributeclientsource" />
  184 + </target>
  185 +
  186 + <target name="init" description="Initialize build environment" depends="prepare">
  187 + <echo append="false" file="${temp.dir}/build.cfg" message="[OUTPUT]&#x0A;SrcClient = build/src" />
  188 +
  189 + <echo level="info" message="Cleaning old stage and dist, MCP reobf directories" />
  190 +
  191 + <delete dir="${stage.dir}" />
  192 +
  193 + <echo level="info" message="Creating stage and dist dirs" />
  194 + <mkdir dir="${stage.dir}" />
  195 + <mkdir dir="${dist.dir}" />
  196 + <mkdir dir="${md5.dir}" />
  197 + </target>
  198 +
  199 + <target name="recompile" description="MCP recompile">
  200 + <echo level="info" message="Compiling projects" />
  201 +
  202 + <exec executable="${python_windows}" dir="${mcp.dir}" osfamily="windows">
  203 + <arg value="runtime/recompile.py" />
  204 + <arg value="--client" />
  205 + <arg value="--config" />
  206 + <arg value="${temp.dir}/build.cfg" />
  207 + <arg value="%*" />
  208 + </exec>
  209 +
  210 + <exec executable="${python_linux}" dir="${mcp.dir}" osfamily="unix">
  211 + <arg value="runtime/recompile.py" />
  212 + <arg value="--client" />
  213 + <arg value="--config" />
  214 + <arg value="${temp.dir}/build.cfg" />
  215 + <arg value="%*" />
  216 + </exec>
  217 + </target>
  218 +
  219 + <target name="reobfuscate" description="MCP reobfuscate">
  220 + <echo level="info" message="Obfuscating classes" />
  221 +
  222 + <exec executable="${python_windows}" dir="${mcp.dir}" osfamily="windows">
  223 + <arg value="runtime/reobfuscate.py" />
  224 + <arg value="--client" />
  225 + <arg value="%*" />
  226 + </exec>
  227 +
  228 + <exec executable="${python_linux}" dir="${mcp.dir}" osfamily="unix">
  229 + <arg value="runtime/reobfuscate.py" />
  230 + <arg value="--client" />
  231 + <arg value="%*" />
  232 + </exec>
  233 + </target>
  234 +
  235 + <target name="savemd5" description="Put post-obfuscation MD5 to stored md5 set" if="outmd5set">
  236 + <echo level="info" message="Storing obfuscated MD5s" />
  237 +
  238 + <copy file="${temp.dir}/client_reobf.md5" tofile="${md5.outfile}" overwrite="true" verbose="true" />
  239 + </target>
  240 +
  241 + <target name="stage" description="Stage resources into staging directory">
  242 + <echo level="info" message="Staging resources" />
  243 +
  244 + <copy todir="${stage.dir}" overwrite="true">
  245 + <fileset dir="${reobf.dir}" excludes=".svn/**, *.txt">
  246 + <exclude name="?.class" />
  247 + <exclude name="??.class" />
  248 + <exclude name="???.class" />
  249 + <exclude name="/net/minecraft/**" />
  250 + </fileset>
  251 + </copy>
  252 +
  253 + <foreach list="${upstream}" param="lib" target="contributeresources" />
  254 +
  255 + <antcall target="contributeresources">
  256 + <param name="lib" value="${project}" />
  257 + </antcall>
  258 +
  259 + <antcall target="stamp">
  260 + </antcall>
  261 + </target>
  262 +
  263 + <target name="stamp" description="Stamp build information into staged resources" if="jenkins">
  264 + <echo level="info" message="Writing branding information into artefact staging area" />
  265 + <echo level="info" message="Brand: ${brand}" />
  266 +
  267 + <replaceregexp file="${stage.dir}/liteloader.properties" byline="true" match="^brand=.*$" replace="brand=${brand}" />
  268 + </target>
  269 +
  270 + <target name="jar" description="Build the client jar">
  271 + <echo level="info" message="Building final output" />
  272 +
  273 + <mkdir dir="${dist.dir}" />
  274 +
  275 + <jar destfile="${dist.dir}/${artefact.name}.${filetype}" duplicate="preserve" index="true" manifestencoding="UTF-8">
  276 + <manifest>
  277 + <attribute name="Built-By" value="MCP (http://mcp.ocean-labs.de)" />
  278 + <attribute name="Implementation-Vendor" value="${author}" />
  279 + <attribute name="Implementation-Title" value="${ant.project.name}" />
  280 + <attribute name="Implementation-Version" value="${meta.version}" />
  281 + <attribute name="TweakClass" value="${tweakclass}" />
  282 + <attribute name="TweakName" value="${displayname}" />
  283 + <attribute name="TweakVersion" value="${version}" />
  284 + <attribute name="TweakAuthor" value="${author}" />
  285 + </manifest>
  286 + <fileset dir="${stage.dir}" />
  287 + </jar>
  288 + </target>
  289 +
  290 + <target name="compiledebug" description="Recompile with debug classes">
  291 + <copy todir="${src.dir}" verbose="false" overwrite="true" failonerror="false">
  292 + <fileset dir="${eclipse.dir}/${project}/debug" />
  293 + </copy>
  294 +
  295 + <antcall target="recompile" />
  296 + </target>
  297 +
  298 + <target name="mcpjar" description="Build the MCP-names jar" depends="compiledebug">
  299 + <echo level="info" message="Building mcpnamesjars" />
  300 +
  301 + <mkdir dir="${dist.dir}" />
  302 +
  303 + <delete file="${dist.dir}/${artefact.name}-mcpnames.${filetype}" />
  304 + <delete file="${dist.dir}/${artefact.name}-mcpnames-sources.${filetype}" />
  305 +
  306 + <jar destfile="${dist.dir}/${artefact.name}-mcpnames.${filetype}" duplicate="preserve" index="true" manifestencoding="UTF-8">
  307 + <manifest>
  308 + <attribute name="Built-By" value="MCP (http://mcp.ocean-labs.de)" />
  309 + <attribute name="Implementation-Vendor" value="${author}" />
  310 + <attribute name="Implementation-Title" value="${ant.project.name}" />
  311 + <attribute name="Implementation-Version" value="${meta.version}" />
  312 + <attribute name="TweakClass" value="${tweakclass}" />
  313 + <attribute name="TweakName" value="${displayname}" />
  314 + <attribute name="TweakVersion" value="${version}" />
  315 + <attribute name="TweakAuthor" value="${author}" />
  316 + </manifest>
  317 + <fileset dir="${mc.bin.dir}">
  318 + <include name="com/mumfrey/**" />
  319 + <include name="net/eq2online/**" />
  320 + </fileset>
  321 + <fileset dir="${eclipse.dir}/${project}/resources" excludes=".svn/**" />
  322 + <fileset dir="${eclipse.dir}/${project}/debug" excludes=".svn/**">
  323 + <exclude name="**/*.java" />
  324 + </fileset>
  325 + </jar>
  326 + <jar destfile="${dist.dir}/${artefact.name}-mcpnames-sources.${filetype}" duplicate="preserve" index="false" filesetmanifest="skip">
  327 + <fileset dir="${eclipse.dir}/${project}/java/common" />
  328 + <fileset dir="${eclipse.dir}/${project}/java/client" />
  329 + <fileset dir="${eclipse.dir}/${project}/debug" />
  330 + <fileset dir="${eclipse.dir}/${project}/resources" />
  331 + </jar>
  332 + </target>
  333 +
  334 + <target name="javadoc" description="Create the javadoc jar">
  335 + <echo level="info" message="Generating javadoc" />
  336 +
  337 + <javadoc destdir="${stage.dir}/${javadocpath}" useexternalfile="true">
  338 + <fileset dir="${eclipse.dir}/${project}/java">
  339 + <exclude name="**/debug" />
  340 + <exclude name="**/debug/*.java" />
  341 + </fileset>
  342 + <classpath>
  343 + <fileset dir="${mc.libs.dir}">
  344 + <include name="**/*.jar" />
  345 + </fileset>
  346 + <fileset dir="${libs.dir}">
  347 + <include name="*.jar" />
  348 + </fileset>
  349 + <pathelement location="${mc.bin.dir}"/>
  350 + </classpath>
  351 + <arg value="-XDignore.symbol.file" />
  352 + </javadoc>
  353 + <jar destfile="${dist.dir}/${artefact.name}-javadoc.${filetype}" duplicate="preserve" index="true" manifestencoding="UTF-8">
  354 + <manifest>
  355 + <attribute name="Built-By" value="MCP (http://mcp.ocean-labs.de)" />
  356 + <attribute name="Implementation-Vendor" value="${author}" />
  357 + <attribute name="Implementation-Title" value="${ant.project.name}" />
  358 + <attribute name="Implementation-Version" value="${version}" />
  359 + </manifest>
  360 + <fileset dir="${stage.dir}/${javadocpath}" />
  361 + </jar>
  362 + <copy file="${dist.dir}/${artefact.name}-javadoc.${filetype}" tofile="${dist.dir}/${artefact.name}-mcpnames-javadoc.${filetype}" />
  363 + </target>
  364 +
  365 + <target name="deploy" depends="production" description="Deploy artifact to local minecraft installation in APPDATA">
  366 + <mkdir dir="${env.APPDATA}/.minecraft/libraries/com/mumfrey/liteloader/${mcversion}"/>
  367 + <copy todir="${env.APPDATA}/.minecraft/libraries/com/mumfrey/liteloader/${mcversion}" file="${dist.dir}/${artefact.name}.${filetype}" failonerror="false" overwrite="true" />
  368 + <copy todir="${eclipse.dir}/LiteLoaderInstaller/src/main/resources" file="${dist.dir}/${artefact.name}.${filetype}" failonerror="false" overwrite="true" />
  369 + </target>
368 370 </project>
369 371 \ No newline at end of file
... ...