buildcraft/build.xml

148 lines
5.2 KiB
XML
Raw Normal View History

<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"/>
<!-- 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}">
2012-06-23 17:07:17 +02:00
<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>