Skip to content

Instantly share code, notes, and snippets.

@simon816
Last active August 29, 2015 14:04
Show Gist options
  • Save simon816/32106dcb529fa18a461b to your computer and use it in GitHub Desktop.
Save simon816/32106dcb529fa18a461b to your computer and use it in GitHub Desktop.
Modified ProjectRed MC1.6.4 ANT buildscript
<project name="Project: Red" basedir="../" default="test">
<property environment="env"/>
<property file="ProjectRed/build.properties"/>
<condition property="mod.build" value="${env.BUILD_NUMBER}" else="0">
<isset property="env.BUILD_NUMBER"/>
</condition>
<property name="src.dir" value="ProjectRed"/>
<property name="build.dir" value="build"/>
<property name="scala.dir" value="${build.dir}/scala"/>
<property name="download.dir" value="download"/>
<property name="jar.dir" value="dist"/>
<property name="forge.dir" value="${build.dir}/forge"/>
<property name="mcp.dir" value="${forge.dir}/mcp"/>
<property name="mod.name.base" value="ProjectRedBase-${mc.version}-${mod.version}.${mod.build}.jar"/>
<property name="mod.name.integration" value="ProjectRedIntegration-${mc.version}-${mod.version}.${mod.build}.jar"/>
<property name="mod.name.lighting" value="ProjectRedLighting-${mc.version}-${mod.version}.${mod.build}.jar"/>
<property name="mod.name.mechanical" value="ProjectRedMechanical-BETA-${mc.version}-${mod.version}.${mod.build}.jar"/>
<property name="mod.name.world" value="ProjectRedWorld-${mc.version}-${mod.version}.${mod.build}.jar"/>
<property name="mod.name.compat" value="ProjectRedCompat-${mc.version}-${mod.version}.${mod.build}.jar"/>
<property name="forge.name" value="forge-${mc.version}-${forge.version}-src.zip"/>
<property name="scala.name" value="scala.zip"/>
<property name="forgeuni.name" value="forge-${mc.version}-${forge.version}-universal.jar"/>
<property name="ccl.name" value="CodeChickenLib-dev-${mc.version}-${ccl.version}.jar"/>
<property name="ccobf.name" value="CCObfuscator-all-${ccobf.version}.jar"/>
<property name="ccc.mc+ver" value="${mc.version}-${ccc.version}"/>
<property name="ccc.name" value="CodeChickenCore-${ccc.mc+ver}-dev.jar"/>
<property name="fmp.name" value="ForgeMultipart-dev-${mc.version}-${fmp.version}.jar"/>
<property name="nei.mc+ver" value="${mc.version}-${nei.version}"/>
<property name="nei.name" value="NotEnoughItems-${nei.mc+ver}-dev.jar"/>
<property name="tcons.name" value="TConstruct_mc${mc.version}_${tcons.version}.jar"/>
<property name="texpan.name" value="ThermalExpansion-${texpan.version}.jar"/>
<property name="cofh.name" value="CoFHCore-${cofh.version}.jar"/>
<property name="ccraft.name" value="ComputerCraft${ccraft.version}.jar"/>
<!-- Check downloaded dependencies -->
<available property="forge-downloaded" file="${download.dir}/${forge.name}"/>
<available property="scala-downloaded" file="${download.dir}/${scala.name}"/>
<available property="forgeuni-downloaded" file="${download.dir}/${forgeuni.name}"/>
<available property="ccl-downloaded" file="${download.dir}/${ccl.name}"/>
<available property="ccobf-downloaded" file="${download.dir}/${ccobf.name}"/>
<available property="ccc-downloaded" file="${download.dir}/${ccc.name}"/>
<available property="fmp-downloaded" file="${download.dir}/${fmp.name}"/>
<available property="nei-downloaded" file="${download.dir}/${nei.name}"/>
<available property="tcons-downloaded" file="${download.dir}/${tcons.name}"/>
<available property="texpan-downloaded" file="${download.dir}/${texpan.name}"/>
<available property="cofh-downloaded" file="${download.dir}/${cofh.name}"/>
<available property="ccraft-downloaded" file="${download.dir}/${ccraft.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="scala-installed">
<equals arg1="${build.dependencies.scala}" arg2="${scala.version}"/>
</condition>
<condition property="ccl-installed">
<and>
<isset property="forge-installed"/>
<equals arg1="${build.dependencies.ccl}" arg2="${ccl.version}"/>
</and>
</condition>
<condition property="ccobf-installed">
<and>
<isset property="forge-installed"/>
<equals arg1="${build.dependencies.ccobf}" arg2="${ccobf.version}"/>
</and>
</condition>
<condition property="ccc-installed">
<and>
<isset property="forge-installed"/>
<equals arg1="${build.dependencies.ccc}" arg2="${ccc.version}"/>
</and>
</condition>
<condition property="fmp-installed">
<and>
<isset property="forge-installed"/>
<equals arg1="${build.dependencies.fmp}" arg2="${fmp.version}"/>
</and>
</condition>
<condition property="nei-installed">
<and>
<isset property="forge-installed"/>
<equals arg1="${build.dependencies.nei}" arg2="${nei.version}"/>
</and>
</condition>
<condition property="tcons-installed">
<and>
<isset property="forge-installed"/>
<equals arg1="${build.dependencies.tcons}" arg2="${tcons.version}"/>
</and>
</condition>
<condition property="texpan-installed">
<and>
<isset property="forge-installed"/>
<equals arg1="${build.dependencies.texpan}" arg2="${texpan.version}"/>
</and>
</condition>
<condition property="cofh-installed">
<and>
<isset property="forge-installed"/>
<equals arg1="${build.dependencies.cofh}" arg2="${cofh.version}"/>
</and>
</condition>
<condition property="ccraft-installed">
<and>
<isset property="forge-installed"/>
<equals arg1="${build.dependencies.ccraft}" arg2="${ccraft.version}"/>
</and>
</condition>
<condition property="runnung-in-ci">
<isset property="env.TRAVIS"/>
</condition>
<!-- Make directories -->
<mkdir dir="${build.dir}"/>
<mkdir dir="${download.dir}"/>
<mkdir dir="${jar.dir}"/>
<!-- Targets for downloading dependencies -->
<target name="download-forge" unless="forge-downloaded">
<get src="http://files.minecraftforge.net/maven/net/minecraftforge/forge/${mc.version}-${forge.version}/${forge.name}" dest="${download.dir}" usetimestamp="true"/>
</target>
<target name="download-scala" unless="scala-downloaded">
<get src="http://dl.dropboxusercontent.com/u/46144650/${scala.name}" dest="${download.dir}" usetimestamp="true"/>
</target>
<target name="download-forgeuni" unless="forgeuni-downloaded">
<get src="http://files.minecraftforge.net/maven/net/minecraftforge/forge/${mc.version}-${forge.version}/${forgeuni.name}" dest="${download.dir}" usetimestamp="true"/>
</target>
<target name="download-ccl" unless="ccl-downloaded">
<get src="http://files.minecraftforge.net/CodeChickenLib/${ccl.name}" dest="${download.dir}" usetimestamp="true"/>
</target>
<target name="download-ccobf" unless="ccobf-downloaded">
<get src="http://files.minecraftforge.net/CCObfuscator/${ccobf.name}" dest="${download.dir}" usetimestamp="true"/>
</target>
<target name="download-ccc" unless="ccc-downloaded">
<get src="http://chickenbones.net/maven/codechicken/CodeChickenCore/${ccc.mc+ver}/${ccc.name}" dest="${download.dir}" usetimestamp="true"/>
</target>
<target name="download-fmp" unless="fmp-downloaded">
<get src="http://files.minecraftforge.net/ForgeMultipart/${fmp.name}" dest="${download.dir}" usetimestamp="true"/>
</target>
<target name="download-nei" unless="nei-downloaded">
<get src="http://chickenbones.net/maven/codechicken/NotEnoughItems/${nei.mc+ver}/${nei.name}" dest="${download.dir}" usetimestamp="true"/>
</target>
<target name="download-tcons" unless="tcons-downloaded">
<get src="http://www.curseforge.com/media/files/${tcons.cf}/${tcons.name}" dest="${download.dir}" usetimestamp="true"/>
</target>
<target name="download-texpan" unless="texpan-downloaded">
<get src="http://www.curseforge.com/media/files/${texpan.cf}/${texpan.name}" dest="${download.dir}" usetimestamp="true"/>
</target>
<target name="download-cofh" unless="cofh-downloaded">
<get src="http://www.curseforge.com/media/files/${cofh.cf}/${cofh.name}" dest="${download.dir}" usetimestamp="true"/>
</target>
<target name="download-ccraft" unless="ccraft-downloaded">
<get src="http://www.curseforge.com/media/files/${ccraft.cf}/${ccraft.name}" dest="${download.dir}/${ccraft.name}" 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.TRAVIS"/>
<isset property="env.BUILD_ID"/>
</or>
</condition>
<echo message="Installing Forge with args '${installargs}'."/>
<unzip src="${download.dir}/${forge.name}" dest="${forge.dir}/.."/>
<replace file="${forge.dir}/fml/mc_versions.cfg" token="ba3145656b1480122bd8759cecd7b7a1" value="abcf286a14f7aee82e8bf89270433509" />
<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>
<target name="install-scala" depends="install-forge,download-scala" unless="scala-installed">
<echo message="Deleting old Scala"/>
<delete file="${build.dir}/${build.dependencies.scala.name}"/>
<echo message="Installing Scala"/>
<unzip src="${download.dir}/${scala.name}" dest="${scala.dir}"/>
<echo message="Updating build.dependencies"/>
<propertyfile file="${build.dependencies.file}">
<entry key="scala" value="${scala.version}"/>
<entry key="scala.name" value="${scala.name}"/>
</propertyfile>
</target>
<target name="install-ccl" depends="install-forge,download-ccl" unless="ccl-installed">
<echo message="Deleting old CodeChickenLib"/>
<delete file="${mcp.dir}/lib/${build.dependencies.ccl.name}"/>
<echo message="Installing CodeChickenLib"/>
<copy file="${download.dir}/${ccl.name}" todir="${mcp.dir}/lib"/>
<echo message="Updating build.dependencies"/>
<propertyfile file="${build.dependencies.file}">
<entry key="ccl" value="${ccl.version}"/>
<entry key="ccl.name" value="${ccl.name}"/>
</propertyfile>
</target>
<target name="install-ccobf" depends="install-forge,download-ccobf" unless="ccobf-installed">
<echo message="Deleting old CCObfuscator"/>
<delete file="${mcp.dir}/${build.dependencies.ccobf.name}"/>
<echo message="Installing CCObfuscator"/>
<copy file="${download.dir}/${ccobf.name}" todir="${mcp.dir}"/>
<echo message="Updating build.dependencies"/>
<propertyfile file="${build.dependencies.file}">
<entry key="ccobf" value="${ccobf.version}"/>
<entry key="ccobf.name" value="${ccobf.name}"/>
</propertyfile>
</target>
<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"/>
<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>
<target name="install-fmp" depends="install-forge,download-fmp" unless="fmp-installed">
<echo message="Deleting old ForgeMultipart"/>
<delete file="${mcp.dir}/lib/${build.dependencies.fmp.name}"/>
<echo message="Installing ForgeMultipart"/>
<copy file="${download.dir}/${fmp.name}" todir="${mcp.dir}/lib"/>
<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>
<target name="install-nei" depends="install-forge,download-nei" unless="nei-installed">
<echo message="Deleting old NotEnoughItems"/>
<delete file="${mcp.dir}/lib/${build.dependencies.nei.name}"/>
<echo message="Installing NotEnoughItems"/>
<copy file="${download.dir}/${nei.name}" todir="${mcp.dir}/lib"/>
<echo message="Updating build.dependencies"/>
<propertyfile file="${build.dependencies.file}">
<entry key="nei" value="${nei.version}"/>
<entry key="nei.name" value="${nei.name}"/>
</propertyfile>
</target>
<target name="install-tcons" depends="install-forge,download-forgeuni,install-ccobf,download-tcons" unless="tcons-installed">
<echo message="Deleting old Tinkers Construct"/>
<delete file="${mcp.dir}/lib/${build.dependencies.tcons.name}"/>
<echo message="Installing Tinkers Construct"/>
<java jar="${mcp.dir}/${ccobf.name}" fork="true">
<arg value="-d"/>
<arg value="-l"/>
<arg value="${download.dir}/${forgeuni.name},${mcp.dir}/jars/libraries,${mcp.dir}/temp/minecraft_rg.jar"/>
<arg value="-i"/>
<arg value="${download.dir}/${tcons.name}"/>
<arg value="-o"/>
<arg value="${mcp.dir}/lib"/>
<arg value="-m"/>
<arg value="${mcp.dir}/conf"/>
<arg value="--noclean"/>
<arg value="-q"/>
</java>
<echo message="Updating build.dependencies"/>
<propertyfile file="${build.dependencies.file}">
<entry key="tcons" value="${tcons.version}"/>
<entry key="tcons.name" value="${tcons.name}"/>
</propertyfile>
</target>
<target name="install-texpan" depends="install-forge,download-forgeuni,install-ccobf,download-texpan" unless="texpan-installed">
<echo message="Deleting old Thermal Expansion"/>
<delete file="${mcp.dir}/lib/${build.dependencies.texpan.name}"/>
<echo message="Installing Thermal Expansion"/>
<java jar="${mcp.dir}/${ccobf.name}" fork="true">
<arg value="-d"/>
<arg value="-l"/>
<arg value="${download.dir}/${forgeuni.name},${mcp.dir}/jars/libraries,${mcp.dir}/temp/minecraft_rg.jar"/>
<arg value="-i"/>
<arg value="${download.dir}/${texpan.name}"/>
<arg value="-o"/>
<arg value="${mcp.dir}/lib"/>
<arg value="-m"/>
<arg value="${mcp.dir}/conf"/>
<arg value="--noclean"/>
<arg value="-q"/>
</java>
<echo message="Updating build.dependencies"/>
<propertyfile file="${build.dependencies.file}">
<entry key="texpan" value="${texpan.version}"/>
<entry key="texpan.name" value="${texpan.name}"/>
</propertyfile>
</target>
<target name="install-cofh" depends="install-forge,download-forgeuni,install-ccobf,download-cofh" unless="cofh-installed">
<echo message="Deleting old CoFHCore"/>
<delete file="${mcp.dir}/lib/${build.dependencies.cofh.name}"/>
<echo message="Installing CoFHCore"/>
<java jar="${mcp.dir}/${ccobf.name}" fork="true">
<arg value="-d"/>
<arg value="-l"/>
<arg value="${download.dir}/${forgeuni.name},${mcp.dir}/jars/libraries,${mcp.dir}/temp/minecraft_rg.jar"/>
<arg value="-i"/>
<arg value="${download.dir}/${cofh.name}"/>
<arg value="-o"/>
<arg value="${mcp.dir}/lib"/>
<arg value="-m"/>
<arg value="${mcp.dir}/conf"/>
<arg value="--noclean"/>
<arg value="-q"/>
</java>
<echo message="Updating build.dependencies"/>
<propertyfile file="${build.dependencies.file}">
<entry key="cofh" value="${cofh.version}"/>
<entry key="cofh.name" value="${cofh.name}"/>
</propertyfile>
</target>
<target name="install-ccraft" depends="install-forge,download-ccraft" unless="ccraft-installed">
<echo message="Deleting old ComputerCraft"/>
<delete file="${mcp.dir}/lib/${build.dependencies.ccraft.name}"/>
<echo message="Installing ComputerCraft"/>
<copy file="${download.dir}/${ccraft.name}" todir="${mcp.dir}/lib"/>
<echo message="Updating build.dependencies"/>
<propertyfile file="${build.dependencies.file}">
<entry key="ccraft" value="${ccraft.version}"/>
<entry key="ccraft.name" value="${ccraft.name}"/>
</propertyfile>
</target>
<target name="install-dependencies" depends="install-forge,install-scala,install-ccl,install-ccobf,install-ccc,install-fmp,install-nei,install-tcons,install-texpan,install-cofh,install-ccraft"/>
<target name="init-comp">
<!-- check for required tools -->
<fail message="Missing SCALA_HOME variable in OS environment">
<condition>
<isset property="${env.SCALA_HOME}"/>
</condition>
</fail>
<!-- variables for paths and files -->
<!--<property name="scala.dir" location="${env.SCALA_HOME}"/>-->
<property name="scala-library.jar" location="${scala.dir}/lib/scala-library.jar"/>
<property name="scala-reflect.jar" location="${scala.dir}/lib/scala-reflect.jar"/>
<property name="scala-compiler.jar" location="${scala.dir}/lib/scala-compiler.jar"/>
<!-- used during recompilation -->
<path id="scala.classpath">
<pathelement location="${scala-compiler.jar}"/>
<pathelement location="${scala-reflect.jar}"/>
<pathelement location="${scala-library.jar}"/>
</path>
<!-- load scala's ant tasks -->
<taskdef resource="scala/tools/ant/antlib.xml" classpathref="scala.classpath"/>
<!-- print where this project will get scala from -->
<echo message="Init compiler with scala.dir = ${scala.dir}"/>
<property name="comp.out" location="${mcp.dir}/bin/minecraft"/>
<property name="comp.in" location="${mcp.dir}/src/minecraft"/>
<path id="comp.classpath">
<pathelement location="${comp.out}"/>
<pathelement location="${mcp.dir}/jars/versions/1.6.4/1.6.4.jar"/>
<pathelement location="${mcp.dir}/jars/libraries/argo/argo/2.25_fixed/argo-2.25_fixed.jar"/>
<pathelement location="${mcp.dir}/jars/libraries/org/ow2/asm/asm-debug-all/4.1/asm-debug-all-4.1.jar"/>
<pathelement location="${mcp.dir}/jars/libraries/org/bouncycastle/bcprov-jdk15on/1.47/bcprov-jdk15on-1.47.jar"/>
<pathelement location="${mcp.dir}/jars/libraries/com/paulscode/codecjorbis/20101023/codecjorbis-20101023.jar"/>
<pathelement location="${mcp.dir}/jars/libraries/com/paulscode/codecwav/20101023/codecwav-20101023.jar"/>
<pathelement location="${mcp.dir}/jars/libraries/commons-io/commons-io/2.4/commons-io-2.4.jar"/>
<pathelement location="${mcp.dir}/jars/libraries/org/apache/commons/commons-lang3/3.1/commons-lang3-3.1.jar"/>
<pathelement location="${mcp.dir}/jars/libraries/com/google/code/gson/gson/2.2.2/gson-2.2.2.jar"/>
<pathelement location="${mcp.dir}/jars/libraries/com/google/guava/guava/14.0/guava-14.0.jar"/>
<pathelement location="${mcp.dir}/jars/libraries/net/java/jinput/jinput/2.0.5/jinput-2.0.5.jar"/>
<pathelement location="${mcp.dir}/jars/libraries/net/sf/jopt-simple/jopt-simple/4.5/jopt-simple-4.5.jar"/>
<pathelement location="${mcp.dir}/jars/libraries/net/java/jutils/jutils/1.0.0/jutils-1.0.0.jar"/>
<pathelement location="${mcp.dir}/jars/libraries/net/minecraft/launchwrapper/1.8/launchwrapper-1.8.jar"/>
<pathelement location="${mcp.dir}/jars/libraries/com/paulscode/libraryjavasound/20101123/libraryjavasound-20101123.jar"/>
<pathelement location="${mcp.dir}/jars/libraries/com/paulscode/librarylwjglopenal/20100824/librarylwjglopenal-20100824.jar"/>
<pathelement location="${mcp.dir}/jars/libraries/org/lwjgl/lwjgl/lwjgl/2.9.0/lwjgl-2.9.0.jar"/>
<pathelement location="${mcp.dir}/jars/libraries/org/lwjgl/lwjgl/lwjgl_util/2.9.0/lwjgl_util-2.9.0.jar"/>
<pathelement location="${mcp.dir}/jars/libraries/lzma/lzma/0.0.1/lzma-0.0.1.jar"/>
<pathelement location="${mcp.dir}/jars/libraries/org/scala-lang/scala-library/2.10.2/scala-library-2.10.2.jar"/>
<pathelement location="${mcp.dir}/jars/libraries/com/paulscode/soundsystem/20120107/soundsystem-20120107.jar"/>
<fileset dir="${mcp.dir}/lib"/>
</path>
</target>
<!-- Targets for building -->
<target name="recompile" depends="init-comp">
<echo message="Cleaning"/>
<echo message="Removing source"/>
<delete includeemptydirs="true">
<fileset dir="${comp.in}">
<present present="both" targetdir="${src.dir}/common"/>
</fileset>
</delete>
<delete includeemptydirs="true">
<fileset dir="${comp.out}">
<include name="**/*.class"/>
</fileset>
</delete>
<!--<delete includeemptydirs="true">-->
<!--<fileset dir="${mcp.dir}/bin"/>-->
<!--</delete>-->
<!-- Copy PR source -->
<echo message="Copying source"/>
<copy todir="${mcp.dir}/src/minecraft">
<fileset dir="${src.dir}/common"/>
</copy>
<!-- Replace Tokens (Sources) -->
<replace dir="${mcp.dir}/src/minecraft/mrtjp/projectred" token="@VERSION@" value="${mod.version}"/>
<replace dir="${mcp.dir}/src/minecraft/mrtjp/projectred" token="@BUILD_NUMBER@" value="${mod.build}"/>
<replace dir="${mcp.dir}/src/minecraft/mrtjp/projectred" token="@MC_VERSION@" value="${mc.version}"/>
<!-- Recompile -->
<echo message="Recompiling"/>
<scalac destdir="${comp.out}" classpathref="comp.classpath" target="jvm-1.6">
<include name="**/*.scala"/>
<include name="**/*.java"/>
<src>
<pathelement location="${comp.in}"/>
</src>
</scalac>
<javac destdir="${comp.out}" classpathref="comp.classpath" target="1.6">
<include name="**/*.java"/>
<src>
<pathelement location="${comp.in}"/>
</src>
</javac>
<echo message="Removing source"/>
<delete includeemptydirs="true">
<fileset dir="${comp.in}">
<present present="both" targetdir="${src.dir}/common"/>
</fileset>
</delete>
</target>
<target name="reobfuscate">
<echo message="Copying ASM assets"/>
<copy todir="${mcp.dir}/bin/minecraft/assets">
<fileset dir="${src.dir}/resources/assets">
<include name="**/asm/**"/>
</fileset>
</copy>
<echo message="Reobfuscating"/>
<java jar="${mcp.dir}/${ccobf.name}" fork="true" failonerror="true" resultproperty="reobfuscate.code">
<arg value="--mcp"/>
<arg value="${mcp.dir}"/>
<arg value="-q"/>
</java>
<echo message="Copying DepLoader.class from CCC"/>
<unzip src="${download.dir}/${ccc.name}" dest="${mcp.dir}/reobf/minecraft/">
<patternset>
<include name="codechicken/core/launch/DepLoader*.class"/>
</patternset>
</unzip>
<echo message="Copying Resources"/>
<delete dir="${mcp.dir}/reobf/resources"/>
<!-- Bring asm resources back-->
<move todir="${mcp.dir}/reobf/resources/assets">
<fileset dir="${mcp.dir}/reobf/minecraft/assets"/>
</move>
<copy todir="${mcp.dir}/reobf/resources">
<fileset dir="${src.dir}/resources"/>
</copy>
<!-- Replace Tokens (Resources) -->
<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}"/>
<replace dir="${mcp.dir}/reobf/resources" token="@FORGE_VERSION@" value="${forge.version}"/>
<replace dir="${mcp.dir}/reobf/resources" token="@FMP_VERSION@" value="${fmp.version}"/>
<replace dir="${mcp.dir}/reobf/resources" token="@CCL_VERSION@" value="${ccl.version}"/>
<fail message="Failed to reobfuscate">
<condition>
<isfailure code="${reobfuscate.code}"/>
</condition>
</fail>
</target>
<target name="package">
<echo message="Cleaning output"/>
<delete includeemptydirs="true">
<fileset dir="${jar.dir}"/>
</delete>
<mkdir dir="${jar.dir}"/>
<echo message="Building Jar"/>
<mkdir dir="${jar.dir}"/>
<!-- ProjectRed Base -->
<echo message="Packaging ProjectRed Base"/>
<jar destfile="${jar.dir}/${mod.name.base}">
<fileset dir="${mcp.dir}/reobf/minecraft" includes="**/ProjectRedCore*.class, **/mrtjp/projectred/core/**, **/mrtjp/projectred/api/**, codechicken/core/launch/DepLoader**"/>
<fileset dir="${mcp.dir}/reobf/resources"/>
<manifest>
<attribute name="FMLCorePlugin" value="codechicken.core.launch.DepLoader"/>
<attribute name="FMLCorePluginContainsFMLMod" value="true"/>
</manifest>
</jar>
<!-- ProjectRed Integration -->
<echo message="Packaging ProjectRed Integration"/>
<jar destfile="${jar.dir}/${mod.name.integration}">
<fileset dir="${mcp.dir}/reobf/minecraft" includes="**/ProjectRedIntegration*.class, **/ProjectRedTransmission*.class, **/mrtjp/projectred/integration/**, **/mrtjp/projectred/transmission/**"/>
<fileset file="${mcp.dir}/reobf/resources/mcmod.info"/>
</jar>
<!-- ProjectRed Lighting -->
<echo message="Packaging ProjectRed Lighting"/>
<jar destfile="${jar.dir}/${mod.name.lighting}">
<fileset dir="${mcp.dir}/reobf/minecraft" includes="**/ProjectRedIllumination*.class, **/mrtjp/projectred/illumination/**"/>
<fileset file="${mcp.dir}/reobf/resources/mcmod.info"/>
</jar>
<!-- ProjectRed Mechanical -->
<echo message="Packaging ProjectRed Mechanical"/>
<jar destfile="${jar.dir}/${mod.name.mechanical}">
<fileset dir="${mcp.dir}/reobf/minecraft" includes="**/ProjectRedExpansion*.class, **/mrtjp/projectred/expansion/**, **/ProjectRedTransportation*.class, **/mrtjp/projectred/transportation/**"/>
<fileset file="${mcp.dir}/reobf/resources/mcmod.info"/>
</jar>
<!-- ProjectRed World -->
<echo message="Packaging ProjectRed World"/>
<jar destfile="${jar.dir}/${mod.name.world}">
<fileset dir="${mcp.dir}/reobf/minecraft" includes="**/ProjectRedExploration*.class, **/mrtjp/projectred/exploration/**"/>
<fileset file="${mcp.dir}/reobf/resources/mcmod.info"/>
</jar>
<!-- ProjectRed Compat -->
<echo message="Packaging ProjectRed Compat"/>
<jar destfile="${jar.dir}/${mod.name.compat}">
<fileset dir="${mcp.dir}/reobf/minecraft" includes="**/ProjectRedCompatibility*.class, **/mrtjp/projectred/compatibility/**"/>
<fileset file="${mcp.dir}/reobf/resources/mcmod.info"/>
<manifest>
<attribute name="FMLCorePlugin" value="mrtjp.projectred.compatibility.CompatibilityCorePlugin"/>
<attribute name="FMLCorePluginContainsFMLMod" value="true"/>
</manifest>
</jar>
</target>
<target name="test">
<antcall target="install-dependencies"/>
<antcall target="recompile"/>
<antcall target="reobfuscate"/>
<antcall target="package"/>
</target>
</project>
@@ -24,13 +24,15 @@
<property name="forge.name" value="forge-${mc.version}-${forge.version}-src.zip"/>
<property name="scala.name" value="scala.zip"/>
<property name="forgeuni.name" value="forge-${mc.version}-${forge.version}-universal.jar"/>
<property name="ccl.name" value="CodeChickenLib-dev-${mc.version}-${ccl.version}.jar"/>
<property name="ccobf.name" value="CCObfuscator-all-${ccobf.version}.jar"/>
- <property name="ccc.name" value="CodeChickenCore-dev%20${ccc.version}.jar"/>
+ <property name="ccc.mc+ver" value="${mc.version}-${ccc.version}"/>
+ <property name="ccc.name" value="CodeChickenCore-${ccc.mc+ver}-dev.jar"/>
<property name="fmp.name" value="ForgeMultipart-dev-${mc.version}-${fmp.version}.jar"/>
- <property name="nei.name" value="NotEnoughItems-dev%20${nei.version}.jar"/>
+ <property name="nei.mc+ver" value="${mc.version}-${nei.version}"/>
+ <property name="nei.name" value="NotEnoughItems-${nei.mc+ver}-dev.jar"/>
<property name="tcons.name" value="TConstruct_mc${mc.version}_${tcons.version}.jar"/>
<property name="texpan.name" value="ThermalExpansion-${texpan.version}.jar"/>
<property name="cofh.name" value="CoFHCore-${cofh.version}.jar"/>
<property name="ccraft.name" value="ComputerCraft${ccraft.version}.jar"/>
@@ -146,19 +148,19 @@
<target name="download-ccobf" unless="ccobf-downloaded">
<get src="http://files.minecraftforge.net/CCObfuscator/${ccobf.name}" dest="${download.dir}" usetimestamp="true"/>
</target>
<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"/>
+ <get src="http://chickenbones.net/maven/codechicken/CodeChickenCore/${ccc.mc+ver}/${ccc.name}" dest="${download.dir}" usetimestamp="true"/>
</target>
<target name="download-fmp" unless="fmp-downloaded">
<get src="http://files.minecraftforge.net/ForgeMultipart/${fmp.name}" dest="${download.dir}" usetimestamp="true"/>
</target>
<target name="download-nei" unless="nei-downloaded">
- <get src="http://www.chickenbones.craftsaddle.org/Files/New_Versions/${mc.version}/${nei.name}" dest="${download.dir}" usetimestamp="true"/>
+ <get src="http://chickenbones.net/maven/codechicken/NotEnoughItems/${nei.mc+ver}/${nei.name}" dest="${download.dir}" usetimestamp="true"/>
</target>
<target name="download-tcons" unless="tcons-downloaded">
<get src="http://www.curseforge.com/media/files/${tcons.cf}/${tcons.name}" dest="${download.dir}" usetimestamp="true"/>
</target>
@@ -187,10 +189,11 @@
</or>
</condition>
<echo message="Installing Forge with args '${installargs}'."/>
<unzip src="${download.dir}/${forge.name}" dest="${forge.dir}/.."/>
+ <replace file="${forge.dir}/fml/mc_versions.cfg" token="ba3145656b1480122bd8759cecd7b7a1" value="abcf286a14f7aee82e8bf89270433509" />
<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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment