2013-02-18 06:25:32 +01:00
|
|
|
|
|
|
|
|
2013-02-18 05:00:39 +01:00
|
|
|
<project name="DimensionalDoors" default="install" basedir=".">
|
|
|
|
|
|
|
|
<property environment="env" />
|
|
|
|
|
|
|
|
<property name="build.dir" value="build" />
|
|
|
|
<property name="classes.dir" value="${build.dir}/packaging" />
|
|
|
|
<property name="src.dir" value="src" />
|
2013-05-09 23:21:21 +02:00
|
|
|
<property name="forge.version" value="1.5.2-7.8.0.691" />
|
2013-02-18 05:00:39 +01:00
|
|
|
<property name="forge.url" value="http://files.minecraftforge.net/minecraftforge/minecraftforge-src-${forge.version}.zip" />
|
2013-05-09 23:21:21 +02:00
|
|
|
<property name="mcp.version" value="751" />
|
2013-02-18 05:00:39 +01:00
|
|
|
<property name="forge.dir" value="${build.dir}/forge" />
|
|
|
|
<property name="mcp.dir" value="${forge.dir}/mcp" />
|
|
|
|
<property name="mcpsrc.dir" value="${mcp.dir}/src/minecraft" />
|
|
|
|
<property name="resources.dir" value="resources" />
|
|
|
|
|
|
|
|
<property name="package.meta-inf" value="META-INF" />
|
2013-05-09 23:21:21 +02:00
|
|
|
<property name="build.ver" value="1.5.2" />
|
2013-02-18 05:00:39 +01:00
|
|
|
<property name="dist.dir" value="${build.dir}/dist" />
|
|
|
|
|
|
|
|
<property name="download.dir" value="downloads" />
|
|
|
|
|
|
|
|
<property name="lib.dir" value="${mcp.dir}/lib" />
|
|
|
|
|
|
|
|
<property file="${forge.dir}/forgeversion.properties" />
|
|
|
|
<condition property="forge.already.installed">
|
2013-05-09 23:21:21 +02:00
|
|
|
<equals arg1="${forge.build.number}" arg2="691" />
|
2013-02-18 05:00:39 +01:00
|
|
|
</condition>
|
|
|
|
|
2013-02-18 06:25:32 +01:00
|
|
|
<property name="verclass.dir" value="${mcpsrc.dir}/StevenDimDoors/mod_pocketDim/" />
|
2013-02-18 05:00:39 +01:00
|
|
|
<property name="verclass.name" value="mod_pocketDim.java"/>
|
|
|
|
|
|
|
|
|
|
|
|
<mkdir dir="${download.dir}"/>
|
|
|
|
<mkdir dir="${build.dir}" />
|
|
|
|
|
|
|
|
<target name="get-version" depends="setup-forge">
|
|
|
|
<mkdir dir="${mcpsrc.dir}/StevenDimDoors" />
|
2013-02-18 06:25:32 +01:00
|
|
|
<copy todir="${mcpsrc.dir}/StevenDimDoors" overwrite="true">
|
|
|
|
<fileset dir="StevenDimDoors" />
|
|
|
|
</copy>
|
2013-03-11 00:13:54 +01:00
|
|
|
|
2013-02-18 07:01:47 +01:00
|
|
|
|
2013-02-18 05:00:39 +01:00
|
|
|
|
|
|
|
<exec dir="${verclass.dir}" executable="sh" osfamily="unix" outputproperty="grep.out">
|
|
|
|
<arg value="-c"/>
|
|
|
|
<arg value="grep -o -P '[0-9.]+R[0-9.]+(RC[0-9]+)?(B[0-9]+)?' ${verclass.name}"/>
|
|
|
|
</exec>
|
|
|
|
<exec executable="python" osfamily="unix">
|
|
|
|
<arg value="versionscript.py" />
|
|
|
|
<arg value="${grep.out}" />
|
|
|
|
</exec>
|
|
|
|
<echo message="Grepped version: ${grep.out}"/>
|
2013-02-18 07:01:47 +01:00
|
|
|
<copy todir="${classes.dir}" file="mcmod.info" overwrite="true"/>
|
2013-02-18 05:00:39 +01:00
|
|
|
</target>
|
|
|
|
|
|
|
|
<available property="forge-exists" file="${download.dir}/minecraftforge-src-${forge.version}.zip" />
|
|
|
|
<available property="already-compiled" file="${classes.dir}/deathrat" />
|
|
|
|
<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>
|
|
|
|
|
|
|
|
<target name="install" depends="build">
|
2013-02-18 06:51:35 +01:00
|
|
|
<copy todir="${classes.dir}/schematics" overwrite="true">
|
2013-02-18 05:00:39 +01:00
|
|
|
<fileset dir="schematics" />
|
|
|
|
</copy>
|
2013-02-18 06:45:44 +01:00
|
|
|
<zip destfile="${dist.dir}/DimensionalDoors-${grep.out}-${build.number}.zip" basedir="${classes.dir}"/>
|
2013-02-18 05:00:39 +01:00
|
|
|
<delete dir="${classes.dir}" />
|
|
|
|
<delete dir="${mcp.dir}/reobf"/>
|
2013-02-18 06:25:32 +01:00
|
|
|
<delete dir="${mcpsrc}/StevenDimDoors" />
|
|
|
|
<delete dir="${mcpsrc}/Steven" />
|
2013-02-18 05:00:39 +01:00
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="build" depends="get-version" unless="already-compiled">
|
|
|
|
<!-- Recompile -->
|
|
|
|
<exec dir="${mcp.dir}" executable="cmd" osfamily="windows" failonerror="true">
|
|
|
|
<arg line="/c recompile.bat"/>
|
|
|
|
</exec>
|
|
|
|
|
|
|
|
<exec dir="${mcp.dir}" executable="sh" osfamily="unix" failonerror="true">
|
|
|
|
<arg value="recompile.sh" />
|
|
|
|
</exec>
|
|
|
|
|
|
|
|
<!-- Reobf -->
|
|
|
|
<exec dir="${mcp.dir}" executable="cmd" osfamily="windows">
|
2013-05-08 21:52:38 +02:00
|
|
|
<arg line="/c reobfuscate_srg.bat"/>
|
2013-02-18 05:00:39 +01:00
|
|
|
</exec>
|
|
|
|
|
|
|
|
<exec dir="${mcp.dir}" executable="sh" osfamily="unix">
|
2013-05-08 21:52:38 +02:00
|
|
|
<arg value="reobfuscate_srg.sh" />
|
2013-02-18 05:00:39 +01:00
|
|
|
</exec>
|
|
|
|
|
|
|
|
<copy todir="${classes.dir}">
|
|
|
|
<fileset dir="${mcp.dir}/reobf/minecraft"/>
|
|
|
|
</copy>
|
|
|
|
<copy todir="${classes.dir}">
|
|
|
|
<fileset dir="${resources.dir}"/>
|
|
|
|
</copy>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="build-number-there" if="env.BUILD_NUMBER" >
|
|
|
|
<echo message="Using build number ${env.BUILD_NUMBER}..." />
|
|
|
|
<property name="build.number" value="${env.BUILD_NUMBER}" />
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="build-number-not-there" unless="env.BUILD_NUMBER" >
|
|
|
|
<echo message="!! No build number set !!" />
|
|
|
|
<property name="build.number" value="CUSTOM_BUILD" />
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="setup-forge" depends="download-forge,build-number-there,build-number-not-there" unless="forge.already.installed">
|
|
|
|
|
|
|
|
<property name="build.full" value="${build.number}" />
|
|
|
|
<unzip dest="${build.dir}">
|
|
|
|
<fileset dir="${download.dir}">
|
|
|
|
<include name="minecraftforge-src-${forge.version}.zip"/>
|
|
|
|
</fileset>
|
|
|
|
</unzip>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- Change executables' permitions -->
|
|
|
|
|
|
|
|
<chmod file="${forge.dir}/install.sh" perm="+x"/>
|
|
|
|
|
|
|
|
<!-- if your building on OSX these 2 should be executable -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- Install forge -->
|
|
|
|
<delete dir="${mcp.dir}" failonerror="no"/>
|
|
|
|
<exec dir="${forge.dir}" executable="cmd" osfamily="windows" inputstring="Yes\n">
|
|
|
|
<arg line="/c install.cmd"/>
|
|
|
|
</exec>
|
|
|
|
|
|
|
|
<exec dir="${forge.dir}" executable="sh" osfamily="unix" inputstring="Yes\n">
|
|
|
|
<arg value="install.sh" />
|
|
|
|
|
|
|
|
</exec>
|
|
|
|
|
|
|
|
|
|
|
|
<chmod file="${mcp.dir}/updatemd5.sh" perm="+x"/>
|
|
|
|
<chmod file="${mcp.dir}/recompile.sh" perm="+x"/>
|
2013-05-08 21:52:38 +02:00
|
|
|
<chmod file="${mcp.dir}/reobfuscate_srg.sh" perm="+x"/>
|
2013-02-18 05:00:39 +01:00
|
|
|
<chmod file="${mcp.dir}/runtime/bin/astyle-osx" perm="+x" />
|
|
|
|
<chmod file="${mcp.dir}/runtime/bin/jad-osx" perm="+x" />
|
|
|
|
<!-- Copy libraries -->
|
|
|
|
<!-- <copy todir="${mcp.dir}/lib" >
|
|
|
|
<fileset dir="lib" >
|
|
|
|
<patternset includes="*.jar" />
|
|
|
|
</fileset>
|
|
|
|
</copy> -->
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<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>
|
|
|
|
<echo message="Downloading forge... " />
|
|
|
|
<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>
|
|
|
|
|
|
|
|
<target name="download-ant-contrib" unless="should-download-ant-contrib">
|
|
|
|
<echo message="Getting: ant-contrib"/>
|
|
|
|
<mkdir dir="${download.dir}/tmp"/>
|
|
|
|
<mkdir dir="${download.dir}/ant-contrib/lib" />
|
|
|
|
<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://archive.apache.org/dist/commons/codec/binaries/commons-codec-1.6-bin.zip" dest="${download.dir}/tmp/commons-codec-1.6-bin.zip"/>
|
|
|
|
|
|
|
|
<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"/>
|
|
|
|
|
|
|
|
<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>
|
|
|
|
|
|
|
|
<target name="clean" >
|
|
|
|
<delete dir="${build.dir}" />
|
|
|
|
</target>
|
|
|
|
|
|
|
|
|
|
|
|
</project>
|
2013-02-18 06:25:32 +01:00
|
|
|
|