build_liteloader.xml
5.56 KB
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
<?xml version="1.0" encoding="UTF-8" ?>
<project name="liteloader" basedir="." default="rebuild">
<taskdef resource="net/sf/antcontrib/antcontrib.properties"/>
<!-- Versions !!IMPORTANT -->
<property name="version" value="1.6.2" />
<property name="mcversion" value="1.6.2" />
<property name="author" value="Mumfrey" />
<!-- Project definitions and dependencies -->
<property name="upstream" value="LiteLoader,LegacyLauncher" />
<property name="project" value="LiteLoaderLauncher" />
<property name="md5set" value="legacylauncher" />
<property name="outmd5set" value="liteloader" />
<property name="mcp.dir" location="../../.." />
<property name="build" location="${mcp.dir}/build" />
<property name="eclipse" location="${mcp.dir}/eclipse" />
<property name="src" location="${mcp.dir}/src/minecraft" />
<property name="temp" location="${mcp.dir}/temp" />
<property name="md5.dir" location="${mcp.dir}/md5" />
<property name="mc.src" location="${mcp.dir}/src/mcp" />
<property name="dist.dir" location="${build}/dist" />
<property name="stage.dir" location="${build}/stage/${ant.project.name}/${version}" />
<property name="filetype" value="jar" />
<property name="python" location="${mcp.dir}/runtime/bin/python/python_mcp.exe" />
<!-- Main target -->
<target name="rebuild" description="Perform all tasks for a build" depends="init, recompile, reobfuscate, savemd5, stage, zip" />
<target name="clean">
<delete dir="${src}" />
<delete dir="${mcp.dir}/reobf" />
</target>
<target name="contributesource" description="Contribute an upstream project source code to the source path">
<echo level="info" message="Contributing project ${lib}" />
<copy todir="${src}" verbose="false" overwrite="true" failonerror="false">
<fileset dir="${eclipse}/${lib}/java" />
<fileset dir="${eclipse}/${lib}/src" />
</copy>
</target>
<target name="contributeresources" description="Contribute resources to the staging path">
<echo level="info" message="Contributing project resources for ${lib}" />
<copy todir="${stage.dir}" verbose="false" failonerror="false">
<fileset dir="${eclipse}/${lib}/res" excludes=".svn/**">
<exclude name="**/Thumbs.db" />
</fileset>
</copy>
</target>
<target name="preparemd5" description="Copy patched MD5 to the temp directory" depends="clean">
<echo level="info" message="Prepare exclusion MD5s, using exclusion set "${md5set}"" />
<copy tofile="${temp}/client.md5" file="${md5.dir}/client_${md5set}.md5" failonerror="true" verbose="true" overwrite="true" />
</target>
<target name="prepare" description="Prepare source for MCP" depends="preparemd5">
<echo level="info" message="Prepare sources for compile" />
<copy todir="${src}" verbose="false" overwrite="true">
<fileset dir="${mc.src}" />
</copy>
<foreach list="${upstream}" param="lib" target="contributesource" />
<antcall target="contributesource">
<param name="lib" value="${project}" />
</antcall>
</target>
<target name="init" description="Initialize build environment" depends="prepare">
<echo level="info" message="Cleaning old stage and dist, MCP reobf directories" />
<delete dir="${stage.dir}" />
<echo level="info" message="Creating stage and dist dirs" />
<mkdir dir="${stage.dir}" />
<mkdir dir="${dist.dir}" />
<mkdir dir="${md5.dir}" />
</target>
<target name="recompile" description="MCP recompile">
<echo level="info" message="Compiling projects" />
<exec executable="${python}" dir="${mcp.dir}">
<arg value="runtime/recompile.py" />
<arg value="--client" />
<arg value="%*" />
</exec>
</target>
<target name="reobfuscate" description="MCP reobfuscate">
<echo level="info" message="Obfuscating classes" />
<exec executable="${python}" dir="${mcp.dir}">
<arg value="runtime/reobfuscate.py" />
<arg value="--client" />
<arg value="%*" />
</exec>
</target>
<target name="savemd5" description="Put post-obfuscation MD5 to stored md5 set" if="outmd5set">
<echo level="info" message="Storing obfuscated MD5s" />
<copy file="${temp}/client_reobf.md5" tofile="${md5.dir}/client_${outmd5set}.md5" overwrite="true" verbose="true" />
</target>
<target name="stage" description="Stage resources into staging directory">
<echo level="info" message="Staging resources" />
<copy todir="${stage.dir}">
<fileset dir="${mcp.dir}/reobf/minecraft" excludes=".svn/**, *.txt" />
</copy>
<foreach list="${upstream}" param="lib" target="contributeresources" />
<antcall target="contributeresources">
<param name="lib" value="${project}" />
</antcall>
</target>
<target name="zip" description="Build the output zip file">
<echo level="info" message="Building final output" />
<mkdir dir="${dist.dir}" />
<jar destfile="${dist.dir}/${ant.project.name}-${mcversion}.${filetype}" duplicate="preserve" index="true" manifestencoding="UTF-8">
<manifest>
<attribute name="Built-By" value="MCP (http://mcp.ocean-labs.de)" />
<attribute name="Implementation-Vendor" value="${author}" />
<attribute name="Implementation-Title" value="${ant.project.name}" />
<attribute name="Implementation-Version" value="${version}" />
</manifest>
<fileset dir="${stage.dir}" />
</jar>
</target>
</project>