BiomesOPlenty/build.xml

337 lines
13 KiB
XML
Raw Normal View History

2013-09-13 12:48:41 +00:00
<project name="Biomes O Plenty" basedir="./" default="build">
2013-09-13 08:30:04 +00:00
<property environment="env" />
<property file="buildspecs.properties" prefix="buildspecs" />
2013-09-23 23:48:01 +00:00
<property name="mod.minecraftversion" value="1" />
2013-10-18 07:45:19 +00:00
<property name="mod.majorversion" value="1" />
<property name="mod.tweakversion" value="3" />
<property name="mod.version" value="${mod.minecraftversion}.${mod.majorversion}.${mod.tweakversion}" />
2013-09-22 07:04:48 +00:00
<condition property="mod.build" value="${env.BUILD_NUMBER}" else="0">
<isset property="env.BUILD_NUMBER" />
2013-09-13 08:30:04 +00:00
</condition>
<property name="mc.version" value="1.6.4" />
2013-11-15 06:30:54 +00:00
<property name="forge.version" value="9.11.1.952" />
2013-11-07 06:08:54 +00:00
<property name="ccc.version" value="0.9.0.7" />
2013-11-22 10:40:34 +00:00
<property name="worldcore.version" value="1.1.0.17" />
2013-09-22 04:58:13 +00:00
<property name="fmp.version" value="1.0.0.182" />
2013-09-13 08:30:04 +00:00
2013-09-13 12:57:15 +00:00
<property name="src.dir" value="" />
2013-09-13 08:30:04 +00:00
<property name="build.dir" value="build" />
<property name="download.dir" value="download" />
<property name="dist.dir" value="dist" />
2013-09-13 08:30:04 +00:00
<property name="forge.dir" value="${build.dir}/forge" />
<property name="fmp.dir" value="${build.dir}/fmp" />
2013-11-06 19:39:26 +00:00
<property name="ccc.dir" value="${build.dir}/ccc" />
2013-11-22 09:25:21 +00:00
<property name="worldcore.dir" value="${build.dir}/worldcore" />
2013-09-13 08:30:04 +00:00
<property name="mcp.dir" value="${forge.dir}/mcp" />
2013-09-22 07:04:48 +00:00
<property name="mod.name" value="BiomesOPlenty-universal-${mc.version}-${mod.version}.${mod.build}.jar" />
2013-09-22 11:20:19 +00:00
<property name="dev.name" value="BiomesOPlenty-dev-${mc.version}-${mod.version}.${mod.build}.jar" />
<property name="api.name" value="BiomesOPlenty-api-${mc.version}-${mod.version}.${mod.build}.zip" />
2013-09-22 08:51:04 +00:00
<property name="changelog.name" value="BiomesOPlenty-changelog-${mc.version}-${mod.version}.${mod.build}.txt" />
2013-09-13 08:30:04 +00:00
<property name="forge.name" value="minecraftforge-src-${mc.version}-${forge.version}.zip" />
2013-11-07 05:17:02 +00:00
<property name="ccc.name" value="CodeChickenCore-dev%20${ccc.version}.jar" />
2013-11-22 09:25:21 +00:00
<property name="worldcore.name" value="WorldCore-dev-${mc.version}-${worldcore.version}.jar" />
2013-09-22 04:58:13 +00:00
<property name="fmp.name" value="ForgeMultipart-dev-${mc.version}-${fmp.version}.jar" />
2013-09-13 08:30:04 +00:00
<!-- Check downloaded dependencies -->
<available property="forge-downloaded" file="${download.dir}/${forge.name}" />
2013-11-07 05:17:02 +00:00
<available property="ccc-downloaded" file="${download.dir}/${ccc.name}" />
2013-11-22 09:25:21 +00:00
<available property="worldcore-downloaded" file="${download.dir}/${worldcore.name}" />
2013-09-13 08:30:04 +00:00
<available property="fmp-downloaded" file="${download.dir}/${fmp.name}" />
<!-- Check installed dependencies -->
<property name="build.dependencies.file" value="${build.dir}/dependencies.properties" />
<property prefix="build.dependencies" file="${build.dependencies.file}" />
<condition property="forge-installed">
<equals arg1="${build.dependencies.forge}" arg2="${forge.version}" />
</condition>
<condition property="fmp-installed">
<and>
<isset property="forge-installed" />
<equals arg1="${build.dependencies.fmp}" arg2="${fmp.version}" />
</and>
</condition>
2013-11-22 09:25:21 +00:00
<condition property="worldcore-installed">
<and>
<isset property="forge-installed" />
<equals arg1="${build.dependencies.worldcore}" arg2="${worldcore.version}" />
</and>
</condition>
2013-09-13 08:30:04 +00:00
<!-- Make directories -->
<mkdir dir="${build.dir}" />
<mkdir dir="${download.dir}" />
<mkdir dir="${dist.dir}" />
2013-09-13 08:30:04 +00:00
<!-- Targets for downloading dependencies -->
<target name="download-forge" unless="forge-downloaded">
<get src="http://files.minecraftforge.net/${forge.name}" dest="${download.dir}" usetimestamp="true" />
</target>
2013-11-06 19:08:50 +00:00
<target name="download-ccc" unless="ccc-downloaded">
<get src="http://www.chickenbones.craftsaddle.org/Files/New_Versions/${mc.version}/${ccc.name}" dest="${download.dir}" usetimestamp="true" />
</target>
2013-11-22 09:25:21 +00:00
<target name="download-worldcore" unless="worldcore-downloaded">
<get src="http://files.minecraftforge.net/WorldCore/${worldcore.name}" dest="${download.dir}" usetimestamp="true" />
</target>
2013-09-13 08:30:04 +00:00
<target name="download-fmp" unless="fmp-downloaded">
<get src="http://files.minecraftforge.net/ForgeMultipart/${fmp.name}" dest="${download.dir}" usetimestamp="true" />
</target>
<!-- Targets for installing dependencies -->
<target name="install-forge" depends="download-forge" unless="forge-installed">
<echo message="Deleting old Forge" />
<delete dir="${forge.dir}" />
<condition property="installargs" value=" --no-assets" else="">
<or>
<isset property="env.BUILD_ID" />
</or>
</condition>
<echo message="Installing Forge with args '${installargs}'." />
<unzip src="${download.dir}/${forge.name}" dest="${forge.dir}/.." />
<property name="fml.python.exe" location="${forge.dir}/fml/python/python_fml.exe" />
<exec dir="${forge.dir}" executable="${fml.python.exe}" osfamily="windows" failonerror="true">
<arg line="install.py${installargs}" />
</exec>
<exec dir="${forge.dir}" executable="python" osfamily="unix" failonerror="true">
<arg line="install.py${installargs}" />
</exec>
<echo message="Updating build.dependencies" />
<delete file="${build.dependencies.file}" />
<propertyfile file="${build.dependencies.file}">
<entry key="forge" value="${forge.version}" />
</propertyfile>
</target>
2013-11-06 19:08:50 +00:00
<target name="install-ccc" depends="install-forge,download-ccc" unless="ccc-installed">
<echo message="Deleting old CodeChickenCore" />
<delete file="${mcp.dir}/lib/${build.dependencies.ccc.name}" />
<echo message="Installing CodeChickenCore" />
<copy file="${download.dir}/${ccc.name}" todir="${mcp.dir}/lib" />
<unzip src="${download.dir}/${ccc.name}" dest="${ccc.dir}">
<patternset>
<include name="**/*.class" />
</patternset>
</unzip>
<echo message="Updating build.dependencies" />
<propertyfile file="${build.dependencies.file}">
<entry key="ccc" value="${ccc.version}" />
<entry key="ccc.name" value="${ccc.name}" />
</propertyfile>
</target>
2013-11-22 09:25:21 +00:00
<target name="install-worldcore" depends="download-worldcore" unless="worldcore-installed">
<echo message="Deleting old WorldCore" />
<delete file="${mcp.dir}/lib/${build.dependencies.worldcore.name}" />
<delete dir="${fmp.dir}" />
<echo message="Installing WorldCore" />
<copy file="${download.dir}/${worldcore.name}" todir="${mcp.dir}/lib" />
<unzip src="${download.dir}/${worldcore.name}" dest="${worldcore.dir}">
<patternset>
<include name="**/*.class" />
</patternset>
</unzip>
<echo message="Updating build.dependencies" />
<propertyfile file="${build.dependencies.file}">
<entry key="worldcore" value="${worldcore.version}" />
<entry key="worldcore.name" value="${worldcore.name}" />
</propertyfile>
</target>
2013-11-06 19:08:50 +00:00
2013-11-22 09:25:21 +00:00
<target name="install-fmp" depends="download-fmp" unless="fmp-installed">
2013-09-13 08:30:04 +00:00
<echo message="Deleting old ForgeMultipart" />
<delete file="${mcp.dir}/lib/${build.dependencies.fmp.name}" />
<delete dir="${fmp.dir}" />
<echo message="Installing ForgeMultipart" />
<copy file="${download.dir}/${fmp.name}" todir="${mcp.dir}/lib" />
<unzip src="${download.dir}/${fmp.name}" dest="${fmp.dir}">
<patternset>
<include name="**/*.class" />
</patternset>
</unzip>
<echo message="Updating build.dependencies" />
<propertyfile file="${build.dependencies.file}">
<entry key="fmp" value="${fmp.version}" />
<entry key="fmp.name" value="${fmp.name}" />
</propertyfile>
</target>
2013-11-22 09:25:21 +00:00
<target name="install-dependencies" depends="install-forge,install-worldcore,install-fmp,install-ccc" />
2013-09-13 08:30:04 +00:00
<!-- Targets for building -->
<target name="recompile">
<!-- Copy source -->
<echo message="Copying source" />
<copy todir="${mcp.dir}/src/minecraft">
2013-09-13 12:57:15 +00:00
<fileset dir="common" />
2013-09-13 08:30:04 +00:00
</copy>
<copy todir="${mcp.dir}/src/minecraft">
2013-09-13 12:57:15 +00:00
<fileset dir="apis" />
2013-09-13 08:30:04 +00:00
</copy>
<copy todir="${mcp.dir}/reobf/resources">
2013-09-13 12:57:15 +00:00
<fileset dir="resources" />
2013-09-13 08:30:04 +00:00
</copy>
<!-- Replace Tokens-->
<replace dir="${mcp.dir}/src/minecraft/biomesoplenty" token="@VERSION@" value="${mod.version}" />
<replace dir="${mcp.dir}/src/minecraft/biomesoplenty" token="@BUILD_NUMBER@" value="${mod.build}" />
<replace dir="${mcp.dir}/src/minecraft/biomesoplenty" token="@MC_VERSION@" value="${mc.version}" />
2013-09-24 22:19:09 +00:00
<replace dir="${mcp.dir}/src/minecraft/biomesoplenty" token="1.42.666.42.1" value="9.10.1.871" />
2013-09-13 08:30:04 +00:00
<replace dir="${mcp.dir}/reobf/resources" token="@VERSION@" value="${mod.version}" />
<replace dir="${mcp.dir}/reobf/resources" token="@BUILD_NUMBER@" value="${mod.build}" />
<replace dir="${mcp.dir}/reobf/resources" token="@MC_VERSION@" value="${mc.version}" />
2013-09-22 05:54:48 +00:00
<replace dir="${mcp.dir}/reobf/resources" token="@FORGE_VERSION@" value="${forge.version}" />
2013-11-10 05:15:40 +00:00
<replace dir="${mcp.dir}/reobf/resources" token="@WORLDCORE_VERSION@" value="${worldcore.version}" />
2013-09-24 01:13:41 +00:00
2013-09-24 01:18:36 +00:00
<replace dir="" token="@BUILD_NUMBER@" value="${mod.build}" />
2013-09-13 08:30:04 +00:00
<echo message="Recompiling" />
<property name="mcp.python.exe" location="${mcp.dir}/runtime/bin/python/python_mcp.exe" />
<exec dir="${mcp.dir}" executable="${mcp.python.exe}" osfamily="windows" resultproperty="recompile.code">
<arg line="runtime/recompile.py" />
</exec>
<exec dir="${mcp.dir}" executable="python" osfamily="unix" resultproperty="recompile.code">
<arg line="runtime/recompile.py" />
</exec>
<echo message="Removing source" />
<delete includeemptydirs="true">
<fileset dir="${mcp.dir}/src/minecraft">
2013-09-13 12:57:15 +00:00
<present present="both" targetdir="common" />
<present present="both" targetdir="apis" />
2013-09-13 08:30:04 +00:00
</fileset>
</delete>
<fail message="Failed to recompile">
<condition>
<isfailure code="${recompile.code}" />
</condition>
</fail>
</target>
<target name="reobfuscate">
<echo message="Copying ForgeMultipart" />
<copy todir="${mcp.dir}/bin/minecraft">
<fileset dir="${fmp.dir}" />
</copy>
2013-11-06 19:08:50 +00:00
2013-11-22 09:25:21 +00:00
<echo message="Copying WorldCore" />
<copy todir="${mcp.dir}/bin/minecraft">
<fileset dir="${worldcore.dir}" />
</copy>
2013-11-06 19:08:50 +00:00
<echo message="Copying CodeChickenCore" />
<copy todir="${mcp.dir}/bin/minecraft">
<fileset dir="${ccc.dir}" />
</copy>
2013-09-13 08:30:04 +00:00
<echo message="Reobfuscating" />
<property name="mcp.python.exe" location="${mcp.dir}/runtime/bin/python/python_mcp.exe" />
<exec dir="${mcp.dir}" executable="${mcp.python.exe}" osfamily="windows" resultproperty="reobfuscate.code">
<arg line="runtime/reobfuscate.py --srgnames" />
</exec>
<exec dir="${mcp.dir}" executable="python" osfamily="unix" resultproperty="reobfuscate.code">
<arg line="runtime/reobfuscate.py --srgnames" />
</exec>
<echo message="Removing ForgeMultipart" />
<delete includeemptydirs="true">
<fileset dir="${mcp.dir}/bin/minecraft">
<present present="both" targetdir="${fmp.dir}" />
</fileset>
<fileset dir="${mcp.dir}/reobf/minecraft">
<present present="both" targetdir="${fmp.dir}" />
</fileset>
</delete>
2013-11-06 19:08:50 +00:00
2013-11-22 09:25:21 +00:00
<echo message="Removing WorldCore" />
<delete includeemptydirs="true">
<fileset dir="${mcp.dir}/bin/minecraft">
<present present="both" targetdir="${worldcore.dir}" />
</fileset>
<fileset dir="${mcp.dir}/reobf/minecraft">
<present present="both" targetdir="${worldcore.dir}" />
</fileset>
</delete>
2013-11-06 19:08:50 +00:00
<echo message="Removing CodeChickenCore" />
<delete includeemptydirs="true">
<fileset dir="${mcp.dir}/bin/minecraft">
<present present="both" targetdir="${ccc.dir}" />
</fileset>
<fileset dir="${mcp.dir}/reobf/minecraft">
<present present="both" targetdir="${ccc.dir}" />
</fileset>
</delete>
<echo message="Copying DepLoader.class from CCC" />
<copy todir="${mcp.dir}/reobf/minecraft/codechicken/core/launch/">
<fileset dir="${ccc.dir}/codechicken/core/launch/" includes="DepLoader*.class" />
</copy>
2013-09-13 08:30:04 +00:00
<fail message="Failed to reobfuscate">
<condition>
<isfailure code="${reobfuscate.code}" />
</condition>
</fail>
</target>
<target name="package">
<echo message="Building Jar" />
<mkdir dir="${dist.dir}" />
2013-09-13 08:30:04 +00:00
<echo message="Packaging BiomesOPlenty Universal" />
<jar destfile="${dist.dir}/${mod.name}" manifest="${mcp.dir}/reobf/resources/MANIFEST.MF">
2013-11-07 06:16:32 +00:00
<fileset dir="${mcp.dir}/reobf/minecraft" includes="**/biomesoplenty/**, codechicken/core/launch/DepLoader**" />
2013-09-13 08:30:04 +00:00
<fileset dir="${mcp.dir}/reobf/resources" excludes="MANIFEST.MF">
</fileset>
</jar>
2013-09-22 11:20:19 +00:00
<copy todir="tmp/src">
2013-11-06 09:24:35 +00:00
<fileset dir="${mcp.dir}/src/minecraft" includes="**/biomesoplenty/**"/>
2013-09-22 11:20:19 +00:00
</copy>
2013-09-13 08:30:04 +00:00
<echo message="Packaging BiomesOPlenty Dev" />
<jar destfile="${dist.dir}/${dev.name}" manifest="${mcp.dir}/reobf/resources/MANIFEST.MF">
2013-09-22 11:24:51 +00:00
<fileset dir="tmp" includes="**/src/**" />
2013-11-07 06:34:11 +00:00
<fileset dir="${mcp.dir}/bin/minecraft" includes="**/biomesoplenty/**, codechicken/core/launch/DepLoader**" />
<fileset dir="${mcp.dir}/reobf/resources" excludes="MANIFEST.MF">
</fileset>
</jar>
<echo message="Packaging BiomesOPlenty Api" />
<zip destfile="${dist.dir}/${api.name}">
<fileset dir="${mcp.dir}/src/minecraft" includes="**/biomesoplenty/api/**" />
</zip>
2013-09-23 23:59:47 +00:00
<echo message="Renaming BiomesOPlenty Changelog" />
<move file="changelog.txt" tofile="${dist.dir}/${changelog.name}"/>
2013-09-13 08:30:04 +00:00
</target>
<target name="build">
<antcall target="install-dependencies" />
<antcall target="recompile" />
<antcall target="reobfuscate" />
<antcall target="package" />
</target>
2013-09-22 04:58:13 +00:00
</project>