forked from BuildCraft/BuildCraft
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
151 lines (115 loc) · 5.4 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
<project name="Buildcraft" basedir="../" default="main">
<!-- Properties -->
<property name="build.dir" value="build"/>
<property name="src.dir" value="src"/>
<property name="download.dir" value="download"/>
<property name="files.minecraft.dir" value="jars"/>
<property name="classes.dir" value="${build.dir}/classes"/>
<property name="jar.dir" value="${build.dir}/dist"/>
<property name="mcp.dir" value="${build.dir}/mcp"/>
<property name="forge.dir" value="${mcp.dir}/forge"/>
<property name="clientsrc.dir" value="${mcp.dir}/src/minecraft"/>
<property name="serversrc.dir" value="${mcp.dir}/src/minecraft_server"/>
<property name="mcp.version" value="62"/>
<property name="forge.version" value="3.3.8.152"/>
<property name="bc.version" value="3.1.6"/>
<property name="bc.version.full" value="${bc.version}.${BUILD_NUMBER}"/>
<echo message="Starting build for ${bc.version.full}"/>
<!-- Targets -->
<target name="clean">
<delete dir="${build.dir}"/>
</target>
<target name="setup">
<mkdir dir="${download.dir}"/>
<get src="http://mcp.ocean-labs.de/files/mcp${mcp.version}.zip" dest="${download.dir}" usetimestamp="True"/>
<get src="https://dl.dropbox.com/u/28221422/MinecraftForge/forge-${forge.version}/minecraftforge-src-${forge.version}.zip"
dest="${download.dir}" usetimestamp="True"/>
<unzip dest="${mcp.dir}">
<fileset dir="${download.dir}">
<include name="mcp*.zip"/>
</fileset>
</unzip>
<unzip dest="${mcp.dir}">
<fileset dir="${download.dir}">
<include name="minecraftforge-src-*.zip"/>
</fileset>
</unzip>
<copy todir="${mcp.dir}/jars">
<fileset dir="${files.minecraft.dir}"/>
</copy>
<chmod file="${mcp.dir}/updatemd5.sh" perm="+x"/>
<chmod file="${mcp.dir}/recompile.sh" perm="+x"/>
<chmod file="${mcp.dir}/reobfuscate.sh" perm="+x"/>
<chmod file="${forge.dir}/install.sh" perm="+x"/>
<!-- if your building on OSX these 2 should be executable -->
<chmod file="${mcp.dir}/runtime/bin/astyle-osx" perm="+x" />
<chmod file="${mcp.dir}/runtime/bin/jad-osx" perm="+x" />
<!-- Install forge -->
<exec dir="${forge.dir}" executable="cmd" osfamily="windows">
<arg line="/c install.cmd"/>
</exec>
<exec dir="${forge.dir}" executable="sh" osfamily="unix">
<arg value="install.sh" />
</exec>
<!-- Copy BC source -->
<copy todir="${clientsrc.dir}">
<fileset dir="${src.dir}/buildcraft_client"/>
</copy>
<copy todir="${clientsrc.dir}">
<fileset dir="${src.dir}/common">
<exclude name="**/buildcraft/devel"/>
</fileset>
<filterset>
<filter token="VERSION" value="${bc.version}" />
</filterset>
</copy>
<copy todir="${serversrc.dir}">
<fileset dir="${src.dir}/buildcraft_server"/>
</copy>
<copy todir="${serversrc.dir}">
<fileset dir="${src.dir}/common">
<exclude name="**/buildcraft/devel"/>
</fileset>
<filterset>
<filter token="VERSION" value="${bc.version}" />
</filterset>
</copy>
</target>
<target name="compile" depends="setup">
<!-- Recompile -->
<exec dir="${mcp.dir}" executable="cmd" osfamily="windows">
<arg line="/c recompile.bat"/>
</exec>
<exec dir="${mcp.dir}" executable="sh" osfamily="unix">
<arg value="recompile.sh" />
</exec>
<!-- Reobf -->
<exec dir="${mcp.dir}" executable="cmd" osfamily="windows">
<arg line="/c reobfuscate.bat"/>
</exec>
<exec dir="${mcp.dir}" executable="sh" osfamily="unix">
<arg value="reobfuscate.sh" />
</exec>
<!-- Copy BC classes -->
<copy todir="${classes.dir}/client">
<fileset dir="${mcp.dir}/reobf/minecraft"/>
</copy>
<copy todir="${classes.dir}/server">
<fileset dir="${mcp.dir}/reobf/minecraft_server"/>
</copy>
<!-- Copy resoucres -->
<copy todir="${classes.dir}/client">
<fileset dir="${src.dir}/buildcraft_resources"/>
</copy>
<copy todir="${classes.dir}/server">
<fileset dir="${src.dir}/buildcraft_resources">
<exclude name="gfx/*"/>
</fileset>
</copy>
</target>
<target name="package" depends="compile">
<jar destfile="${jar.dir}/buildcraft-client-${bc.version.full}.jar" basedir="${classes.dir}/client"/>
<jar destfile="${jar.dir}/buildcraft-server-${bc.version.full}.jar" basedir="${classes.dir}/server"/>
</target>
<target name="main" depends="clean,package"/>
</project>