2012-06-15 14:15:11 +02:00
|
|
|
<project name="Buildcraft" basedir="../" default="main">
|
2012-09-14 01:28:02 +02:00
|
|
|
<property environment="env" />
|
|
|
|
<!-- Properties -->
|
2012-09-11 06:18:35 +02:00
|
|
|
|
2012-09-14 01:28:02 +02:00
|
|
|
<property name="build.dir" value="build"/>
|
|
|
|
<property name="src.dir" value="BuildCraft"/>
|
|
|
|
<property name="lang.dir" value="BuildCraft-Localization"/>
|
2012-09-11 06:18:35 +02:00
|
|
|
|
2012-09-14 01:28:02 +02:00
|
|
|
<property name="download.dir" value="download"/>
|
|
|
|
<property name="files.minecraft.dir" value="jars"/>
|
2012-09-11 06:18:35 +02:00
|
|
|
|
2012-09-14 01:28:02 +02:00
|
|
|
<property name="classes.dir" value="${build.dir}/classes"/>
|
|
|
|
<property name="jar.dir" value="${build.dir}/dist"/>
|
2012-09-11 06:18:35 +02:00
|
|
|
|
2012-09-14 01:28:02 +02:00
|
|
|
<property name="mcp.dir" value="${build.dir}/mcp"/>
|
|
|
|
<property name="forge.dir" value="${mcp.dir}/forge"/>
|
2012-09-11 06:18:35 +02:00
|
|
|
|
2012-09-14 01:28:02 +02:00
|
|
|
<property name="mcpsrc.dir" value="${mcp.dir}/src/minecraft"/>
|
2012-09-11 06:18:35 +02:00
|
|
|
|
2012-09-14 01:28:02 +02:00
|
|
|
<property name="mcp.version" value="72"/>
|
|
|
|
<property name="forge.version" value="4.0.0.232"/>
|
|
|
|
<property name="bc.version" value="3.1.8"/>
|
2012-09-11 06:18:35 +02:00
|
|
|
|
2012-09-14 01:28:02 +02:00
|
|
|
<available property="forge-exists" file="${download.dir}/minecraftforge-src-${forge.version}.zip"/>
|
|
|
|
<condition property="should-download-ant-contrib">
|
|
|
|
<or>
|
|
|
|
<available file="${download.dir}/ant-contrib/ant-contrib-1.0b3.jar"/>
|
|
|
|
<available file="${download.dir}/minecraftforge-src-${forge.version}.zip"/>
|
|
|
|
</or>
|
|
|
|
</condition>
|
2012-09-13 15:35:11 +02:00
|
|
|
|
2012-09-14 01:28:02 +02:00
|
|
|
|
2012-09-13 15:35:11 +02:00
|
|
|
|
2012-09-14 01:28:02 +02:00
|
|
|
<mkdir dir="${download.dir}"/>
|
2012-09-11 06:18:35 +02:00
|
|
|
|
2012-09-14 01:28:02 +02:00
|
|
|
<!-- Targets -->
|
2012-09-11 06:18:35 +02:00
|
|
|
|
2012-09-14 01:28:02 +02:00
|
|
|
<target name="clean">
|
|
|
|
<delete dir="${build.dir}"/>
|
|
|
|
</target>
|
2012-09-11 06:18:35 +02:00
|
|
|
|
2012-09-14 01:28:02 +02:00
|
|
|
<!-- Set build number -->
|
|
|
|
<target name="initialize-version" depends="version-provided,version-not-provided">
|
|
|
|
<property name="bc.version.full" value="${bc.version}.${build.number}"/>
|
|
|
|
<echo message="Starting build for ${bc.version.full}"/>
|
|
|
|
</target>
|
2012-09-13 15:35:11 +02:00
|
|
|
|
2012-09-14 01:28:02 +02:00
|
|
|
<target name="version-not-provided" unless="env.BUILD_NUMBER">
|
|
|
|
<buildnumber/>
|
|
|
|
</target>
|
2012-09-11 06:18:35 +02:00
|
|
|
|
2012-09-14 01:28:02 +02:00
|
|
|
<target name="version-provided" if="env.BUILD_NUMBER">
|
|
|
|
<property name="build.number" value="${env.BUILD_NUMBER}"/>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<!-- Download necessary files -->
|
|
|
|
<target name="download-files" depends="download-mcp,download-forge"/>
|
|
|
|
|
|
|
|
<!-- Download ant-contrib, necessary to be able to download forge (only if neither forge zip nor ant-contrib exist) -->
|
|
|
|
<target name="download-ant-contrib" unless="should-download-ant-contrib">
|
2012-09-13 15:35:11 +02:00
|
|
|
|
2012-09-14 01:28:02 +02:00
|
|
|
<echo message="Getting: ant-contrib"/>
|
|
|
|
<mkdir dir="${download.dir}/tmp"/>
|
2012-09-11 06:18:35 +02:00
|
|
|
|
2012-09-14 01:28:02 +02:00
|
|
|
<get src="http://sourceforge.net/projects/ant-contrib/files/ant-contrib/1.0b3/ant-contrib-1.0b3-bin.zip/download" dest="${download.dir}/tmp/ant-contrib-1.0b3-bin.zip"/>
|
|
|
|
<get src="http://apache.cc.uoc.gr/commons/codec/binaries/commons-codec-1.6-bin.zip" dest="${download.dir}/tmp/commons-codec-1.6-bin.zip"/>
|
2012-09-11 06:18:35 +02:00
|
|
|
|
2012-09-14 01:28:02 +02:00
|
|
|
<unzip src="${download.dir}/tmp/ant-contrib-1.0b3-bin.zip" dest="${download.dir}"/>
|
|
|
|
<unzip src="${download.dir}/tmp/commons-codec-1.6-bin.zip" dest="${download.dir}/tmp"/>
|
2012-09-11 06:18:35 +02:00
|
|
|
|
2012-09-14 01:28:02 +02:00
|
|
|
<move todir="${download.dir}/ant-contrib/lib">
|
|
|
|
<fileset file="${download.dir}/tmp/commons-codec-1.6/commons-codec-1.6.jar"/>
|
|
|
|
</move>
|
|
|
|
|
|
|
|
<!-- Delete useless files -->
|
|
|
|
<delete dir="${download.dir}/ant-contrib/docs"/>
|
|
|
|
<delete dir="${download.dir}/tmp"/>
|
|
|
|
|
|
|
|
</target>
|
2012-09-11 06:18:35 +02:00
|
|
|
|
2012-09-14 01:28:02 +02:00
|
|
|
<!-- Download mcp -->
|
|
|
|
<target name="download-mcp">
|
|
|
|
|
|
|
|
<get src="http://mcp.ocean-labs.de/files/mcp${mcp.version}.zip" dest="${download.dir}" usetimestamp="True"/>
|
|
|
|
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<!-- Download forge (if it doesn't exist) -->
|
|
|
|
<target name="download-forge" depends="download-ant-contrib" unless="forge-exists" >
|
|
|
|
|
|
|
|
<taskdef resource="net/sf/antcontrib/antlib.xml">
|
|
|
|
<classpath>
|
|
|
|
<pathelement location="${download.dir}/ant-contrib/ant-contrib-1.0b3.jar"/>
|
|
|
|
<fileset dir="${download.dir}/ant-contrib/lib">
|
|
|
|
<include name="*.jar"/>
|
|
|
|
</fileset>
|
|
|
|
</classpath>
|
|
|
|
</taskdef>
|
|
|
|
|
|
|
|
<getMethod url="http://files.minecraftforge.net/minecraftforge-src-${forge.version}.zip"
|
|
|
|
responseDataFile="${download.dir}/minecraftforge-src-${forge.version}.zip">
|
|
|
|
<header name="User-Agent" value="Ant-${ant.version}/${ant.java.version}"/>
|
|
|
|
</getMethod>
|
|
|
|
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<!-- Setup mcp and forge -->
|
|
|
|
<target name="setup" depends="initialize-version">
|
|
|
|
|
|
|
|
<!-- Unzip them -->
|
|
|
|
<unzip dest="${mcp.dir}">
|
|
|
|
<fileset dir="${download.dir}">
|
|
|
|
<include name="mcp${mcp.version}.zip"/>
|
|
|
|
</fileset>
|
|
|
|
</unzip>
|
|
|
|
|
|
|
|
<unzip dest="${mcp.dir}">
|
|
|
|
<fileset dir="${download.dir}">
|
|
|
|
<include name="minecraftforge-src-${forge.version}.zip"/>
|
|
|
|
</fileset>
|
|
|
|
</unzip>
|
|
|
|
|
|
|
|
<!-- Copy the necessary jars -->
|
|
|
|
<copy todir="${mcp.dir}/jars">
|
|
|
|
<fileset dir="${files.minecraft.dir}"/>
|
|
|
|
</copy>
|
|
|
|
|
|
|
|
<!-- Change executables' permitions -->
|
|
|
|
<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="${mcpsrc.dir}">
|
|
|
|
<fileset dir="${src.dir}/common">
|
|
|
|
<exclude name="**/buildcraft/devel"/>
|
|
|
|
</fileset>
|
|
|
|
<filterset>
|
|
|
|
<filter token="VERSION" value="${bc.version}" />
|
|
|
|
<filter token="BUILD_NUMBER" value="${build.number}" />
|
|
|
|
</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}">
|
|
|
|
<fileset dir="${mcp.dir}/reobf/minecraft"/>
|
|
|
|
</copy>
|
|
|
|
|
|
|
|
<!-- Copy resources -->
|
|
|
|
<copy todir="${classes.dir}">
|
|
|
|
<fileset dir="${src.dir}/buildcraft_resources">
|
|
|
|
<exclude name="build.xml"/>
|
|
|
|
<exclude name="build.number"/>
|
|
|
|
</fileset>
|
|
|
|
</copy>
|
|
|
|
|
|
|
|
<!-- Copy localizations -->
|
|
|
|
<copy todir="${classes.dir}">
|
|
|
|
<fileset dir="${lang.dir}">
|
|
|
|
<exclude name="README.md"/>
|
|
|
|
</fileset>
|
|
|
|
</copy>
|
|
|
|
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<!-- Zip the compiled files -->
|
|
|
|
<target name="package" depends="compile">
|
|
|
|
|
|
|
|
<jar destfile="${jar.dir}/buildcraft-A-${bc.version.full}.jar" basedir="${classes.dir}"/>
|
|
|
|
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<!-- Default target to run -->
|
|
|
|
<target name="main" depends="initialize-version,download-files,clean,package"/>
|
2012-06-15 14:15:11 +02:00
|
|
|
|
2012-07-01 19:10:24 +02:00
|
|
|
</project>
|