forked from MatchlighterMods/Boxes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
159 lines (135 loc) · 5.24 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="Boxes" default="build">
<description>Boxes</description>
<target name="buildenvsetup">
<tstamp>
<format pattern="yyMMddHHmmss" property="timestamp" />
</tstamp>
<property environment="env" />
<property file="build.properties" />
<property name="modname" value="Boxes" />
<condition property="build.env" value="${env.WORKSPACE}" else="${default}">
<isset property="env.WORKSPACE" />
</condition>
<property name="ext" location="${build.env}/../../../userContent" />
<property name="forge.src" location="${ext}/forge" />
<property name="forge.home" location="${build.env}/forge" />
<property name="mcp.home" location="${forge.home}/mcp" />
<property name="mcp.lib" location="${mcp.home}/lib" />
<condition property="python.exe" value="${mcp.home}/runtime/bin/python/python_mcp" else="python">
<os family="Windows" />
</condition>
<property name="mcp.binoutput" location="${mcp.home}/bin" />
<property name="mcp.binoutput.classes" location="${mcp.binoutput}/minecraft" />
<property name="mcp.obfoutput" location="${mcp.home}/reobf" />
<property name="mcp.obfoutput.classes" location="${mcp.obfoutput}/minecraft" />
<property name="mcp.srcdir" location="${mcp.home}/src" />
<property name="code.src.dir" location="${build.env}/src" />
<property name="res.dir" location="${build.env}/res" />
<property name="build.dest" location="${build.env}/build" />
<!--<property name="resource.dir" location="${build.env}/resources" />-->
<condition property="version.build" value="${env.BUILD_NUMBER}" else="1">
<isset property="env.BUILD_NUMBER" />
</condition>
<property file="version.properties" />
<property name="version" value="${Boxes.version}.${version.build}" />
</target>
<target name="clean" depends="buildenvsetup">
<delete includeemptydirs="true" failonerror="false">
<fileset dir="${build.dest}"/>
</delete>
<delete includeemptydirs="true" failonerror="false">
<fileset dir="${forge.home}"/>
</delete>
</target>
<target name="loadForge">
<copy todir="${forge.home}" overwrite="true">
<fileset dir="${forge.src}" includes="**/*" />
</copy>
</target>
<target name="loadMLCore" depends="">
<unzip dest="${build.env}/MLCore">
<fileset dir="${build.env}" includes="MLCore*.zip" />
<patternset>
<include name="src/**/*.java" />
</patternset>
</unzip>
<copy todir="${mcp.srcdir}" overwrite="true">
<fileset dir="${build.env}/MLCore/src" includes="**/*.java" />
</copy>
</target>
<target name="merge" depends="">
<copy todir="${mcp.srcdir}" overwrite="true" verbose="true">
<fileset dir="${code.src.dir}" includes="**/*.java" />
</copy>
</target>
<target name="instLibs" depends="">
<copy todir="${mcp.lib}" overwrite="true" verbose="true">
<fileset dir="libs" includes="**/*" />
</copy>
</target>
<target name="recompile" depends="">
<exec executable="${python.exe}" dir="${mcp.home}" failonerror="true">
<arg value="${mcp.home}/runtime/recompile.py" />
</exec>
</target>
<target name="reobfuscate" depends="">
<exec executable="${python.exe}" dir="${mcp.home}">
<arg value="${mcp.home}/runtime/reobfuscate.py" />
<arg value="--srgnames"/>
</exec>
</target>
<target name="build" depends="clean,loadForge,loadMLCore,instLibs,merge,recompile,reobfuscate">
<antcall target="extract-built-jar"/>
</target>
<target name="extract-built-jar">
<property name="jarname" value="${modname}-${minecraft.version}-${version}" />
<mkdir dir="${build.dest}" />
<jar destfile="${build.dest}/${jarname}.jar">
<fileset dir="${mcp.obfoutput.classes}" includes="**/ml/boxes/**/*.class" />
<fileset dir="${mcp.obfoutput.classes}" includes="**/buildcraft/api/**/*" />
<fileset dir="${mcp.obfoutput.classes}" includes="**/invtweaks/api/**/*" />
<fileset dir="${res.dir}" includes="**" />
<mappedresources>
<concat>
<fileset dir="${build.env}" includes="mcmod.info" />
<filterchain>
<replacetokens>
<token key="VERSION" value="${version}" />
</replacetokens>
<replacetokens>
<token key="MCVERSION" value="${minecraft.version}" />
</replacetokens>
<replacetokens>
<token key="MLCORE_VERSION" value="${MLCore.version}" />
</replacetokens>
</filterchain>
</concat>
<mergemapper to="mcmod.info" />
</mappedresources>
</jar>
<jar destfile="${build.dest}/${jarname}-dev.jar">
<fileset dir="${mcp.binoutput.classes}" includes="**/ml/boxes/**/*.class" />
<!--<fileset dir="${mcp.binoutput.classes}" includes="**/buildcraft/api/**/*" />-->
<!--<fileset dir="${mcp.binoutput.classes}" includes="**/invtweaks/api/**/*" />-->
<fileset dir="${res.dir}" includes="**" />
<mappedresources>
<concat>
<fileset dir="${build.env}" includes="mcmod.info" />
<filterchain>
<replacetokens>
<token key="VERSION" value="${version}" />
</replacetokens>
<replacetokens>
<token key="MCVERSION" value="${minecraft.version}" />
</replacetokens>
<replacetokens>
<token key="MLCORE_VERSION" value="${MLCore.version}" />
</replacetokens>
</filterchain>
</concat>
<mergemapper to="mcmod.info" />
</mappedresources>
</jar>
</target>
</project>