Add in a setupenvironment ant target specifically for setting up an FML environment from scratch

This commit is contained in:
Christian 2012-07-02 15:16:40 -04:00
parent 0418f01886
commit 6c99b80b73

View file

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- ====================================================================== <!-- ======================================================================
30 Mar 2012 13:35:40 30 Mar 2012 13:35:40
FML FML
The Forge Mod Loader The Forge Mod Loader
cpw cpw
====================================================================== --> ====================================================================== -->
<project name="FML" default="build"> <project name="FML" default="build">
<description>The Forge Mod Loader</description> <description>The Forge Mod Loader</description>
@ -26,10 +26,10 @@
<target name="writeversion" depends="buildenvsetup"> <target name="writeversion" depends="buildenvsetup">
<exec executable="${python.exe}" dir="${basedir}" failonerror="true"> <exec executable="${python.exe}" dir="${basedir}" failonerror="true">
<arg value="${basedir}/getversion.py" /> <arg value="${basedir}/getversion.py" />
<arg value="${mcp.home}"/> <arg value="${mcp.home}" />
</exec> </exec>
<propertyfile file="fmlversion.properties"> <propertyfile file="fmlversion.properties">
<entry key="fmlbuild.build.number" type="int" value="${version.build}"/> <entry key="fmlbuild.build.number" type="int" value="${version.build}" />
</propertyfile> </propertyfile>
</target> </target>
@ -68,7 +68,6 @@
<antcall target="writeversion" /> <antcall target="writeversion" />
<property file="fmlversion.properties" /> <property file="fmlversion.properties" />
<property name="build.number" value="${fmlbuild.major.number}.${fmlbuild.minor.number}.${fmlbuild.revision.number}" /> <property name="build.number" value="${fmlbuild.major.number}.${fmlbuild.minor.number}.${fmlbuild.revision.number}" />
<property name="version.minecraft" value="${fmlbuild.mcversion}" />
<property name="version.major" value="${fmlbuild.major.number}" /> <property name="version.major" value="${fmlbuild.major.number}" />
<property name="version.minor" value="${fmlbuild.minor.number}" /> <property name="version.minor" value="${fmlbuild.minor.number}" />
<property name="version.rev" value="${fmlbuild.revision.number}" /> <property name="version.rev" value="${fmlbuild.revision.number}" />
@ -91,23 +90,23 @@
<exec executable="${python.exe}" dir="${mcp.home}" failonerror="true"> <exec executable="${python.exe}" dir="${mcp.home}" failonerror="true">
<arg value="${mcp.home}/runtime/recompile.py" /> <arg value="${mcp.home}/runtime/recompile.py" />
</exec> </exec>
<fail message="Compilation failed"> <fail message="Compilation failed">
<condition> <condition>
<not> <not>
<and> <and>
<available file="${mcp.home}/bin/minecraft/net/minecraft/client/Minecraft.class"/> <available file="${mcp.home}/bin/minecraft/net/minecraft/client/Minecraft.class" />
<available file="${mcp.home}/bin/minecraft_server/net/minecraft/server/MinecraftServer.class"/> <available file="${mcp.home}/bin/minecraft_server/net/minecraft/server/MinecraftServer.class" />
</and> </and>
</not> </not>
</condition> </condition>
</fail> </fail>
<exec executable="${python.exe}" dir="${mcp.home}"> <exec executable="${python.exe}" dir="${mcp.home}">
<arg value="${mcp.home}/runtime/reobfuscate.py" /> <arg value="${mcp.home}/runtime/reobfuscate.py" />
</exec> </exec>
<exec executable="${python.exe}" dir="${mcp.home}"> <exec executable="${python.exe}" dir="${mcp.home}">
<arg value="${basedir}/generatechangedfilelist.py"/> <arg value="${basedir}/generatechangedfilelist.py" />
<arg value="${mcp.home}"/> <arg value="${mcp.home}" />
<arg value="${basedir}/difflist.txt"/> <arg value="${basedir}/difflist.txt" />
</exec> </exec>
</target> </target>
@ -151,9 +150,9 @@
<mkdir dir="${basedir}/target" /> <mkdir dir="${basedir}/target" />
<zip destfile="${basedir}/target/${jarname}.zip"> <zip destfile="${basedir}/target/${jarname}.zip">
<fileset dir="${output}" includes="**/*.class" /> <fileset dir="${output}" includes="**/*.class" />
<zipfileset dir="${basedir}" includes="fmlversion.properties"/> <zipfileset dir="${basedir}" includes="fmlversion.properties" />
<zipfileset dir="${basedir}" includes="LICENSE-fml.txt" /> <zipfileset dir="${basedir}" includes="LICENSE-fml.txt" />
<zipfileset dir="${basedir}" includes="install/CREDITS-fml.txt" fullpath="CREDITS-fml.txt"/> <zipfileset dir="${basedir}" includes="install/CREDITS-fml.txt" fullpath="CREDITS-fml.txt" />
<mappedresources> <mappedresources>
<concat> <concat>
<fileset dir="${basedir}/install" includes="README.txt" /> <fileset dir="${basedir}/install" includes="README.txt" />
@ -214,4 +213,44 @@
</target> </target>
<target name="setupenvironment" depends="buildenvsetup">
<input message="This will clean the mcp environment at ${mcp.home} and backup any src-work folder there (src-base will be erased). Continue?" validargs="y,n" addproperty="do.continue" />
<condition property="do.not.continue">
<equals arg1="n" arg2="${do.continue}" />
</condition>
<fail if="do.not.continue">You have decided not to continue. This script will stop now.</fail>
<echo>Preparing the MCP environment at ${mcp.home}</echo>
<exec executable="${python.exe}" dir="${mcp.home}">
<arg value="${mcp.home}/runtime/cleanup.py" />
<arg value="-f" />
</exec>
<exec executable="${python.exe}" dir="${mcp.home}">
<arg value="${mcp.home}/runtime/decompile.py" />
<arg value="-d" />
<arg value="-n" />
<arg value="-r" />
</exec>
<exec executable="${python.exe}" dir="${mcp.home}">
<arg value="${mcp.home}/runtime/updatemd5.py" />
<arg value="-f" />
</exec>
<echo>Moving old patched sources at ${mcp.home}/src-work out of the way</echo>
<move todir="${mcp.home}/src-work${timestamp}" failonerror="false" verbose="true">
<fileset dir="${mcp.home}/src-work"/>
</move>
<echo>Deleting old patch references at ${mcp.home}/src-base</echo>
<delete dir="${mcp.home}/src-base" failonerror="false"/>
<echo>Creating new patch references at ${mcp.home}/src-base</echo>
<copy todir="${mcp.home}/src-base">
<fileset dir="${mcp.home}/src"/>
</copy>
<echo>Creating clean patch references at ${mcp.home}/src-work</echo>
<copy todir="${mcp.home}/src-work">
<fileset dir="${mcp.home}/src"/>
</copy>
<antcall target="patch"/>
<antcall target="writeversion"/>
<echo>Setup complete! You should now be able to open ${basedir}/eclipse as a workspace in eclipse and import/refresh the FML-Server and FML-Client projects</echo>
</target>
</project> </project>