equivalent-exchange-3/build.xml
pahimar 0da12d018f Expose build.properties build property file, show an example of the
environment properties file, update .gitignore
2013-09-17 20:32:35 -04:00

142 lines
6 KiB
XML

<?xml version="1.0" ?>
<project name="Equivalent Exchange 3" default="build">
<!-- Public property files-->
<property file="build.properties" prefix="build" />
<property file="environment.properties" prefix="environment" />
<!-- Private property files
private.properties only contains the following properties;
fingerprint_signature
keystore_location
keystore_user_alias
keystore_user_password
These properties are used to properly sign the compiled jar in the 'release' target
For the majority of you this is not a concern and you will not need values for these - just use the 'build' target
-->
<property file="private.properties" prefix="private" />
<!-- Minecraft Forge -->
<property name="minecraftforge_src_archive" value="minecraftforge-src-${build.minecraft_version}-${build.forge_version}.zip" />
<property name="minecraftforge_src_archive_location" value="http://files.minecraftforge.net/minecraftforge/${minecraftforge_src_archive}" />
<target name="forge-clean">
<delete dir="${environment.base_location}/forge" />
</target>
<target name="forge-download">
<mkdir dir="${environment.base_location}/temp" />
<get src="${minecraftforge_src_archive_location}" dest="${environment.base_location}/temp/" verbose="true" usetimestamp="true" />
</target>
<target name="forge-uncompress" depends="forge-download, forge-clean">
<unzip src="${environment.base_location}/temp/${minecraftforge_src_archive}" dest="${environment.base_location}" />
<delete dir="${environment.base_location}/temp" />
</target>
<target name="forge-install" depends="forge-uncompress">
<exec dir="${environment.base_location}/forge/" executable="cmd.exe" osfamily="windows" failonerror="true">
<arg value="/c" />
<arg value="${environment.base_location}\forge\install.cmd" />
</exec>
<exec dir="${environment.base_location}/forge/" executable="bash" osfamily="unix" failonerror="true">
<arg line="install.sh" />
</exec>
</target>
<target name="forge-clean-install" depends="forge-clean, forge-install" />
<target name="clean">
<delete dir="${environment.base_location}/temp" />
<delete file="${environment.mcp_location}/src/minecraft/mcmod.info" />
<delete file="${environment.mcp_location}/src/minecraft/pack.mcmeta" />
<delete dir="${environment.mcp_location}/src/minecraft/com/pahimar" />
<delete dir="${environment.mcp_location}/reobf/minecraft" />
</target>
<target name="increment_build_number">
<propertyfile file="build.properties">
<entry key="build_number" type="int" operation="+" default="1" />
</propertyfile>
</target>
<target name="prep">
<copy todir="${environment.mcp_location}/src/minecraft">
<fileset dir="${environment.source_location}/common/" />
</copy>
</target>
<target name="replace_tokens">
<replace dir="${environment.mcp_location}/src/minecraft/com/pahimar" token="@VERSION@" value="${build.mod_version}" />
<replace dir="${environment.mcp_location}/src/minecraft/com/pahimar" token="@FINGERPRINT@" value="${private.fingerprint_signature}" />
<replace dir="${environment.mcp_location}/src/minecraft/com/pahimar" token="@BUILD_NUMBER@" value="${build.build_number}" />
</target>
<target name="recompile">
<exec dir="${environment.mcp_location}" executable="cmd" osfamily="windows">
<arg line="/c recompile.bat" />
</exec>
<exec dir="${environment.mcp_location}" executable="bash" osfamily="unix">
<arg line="recompile.sh" />
</exec>
</target>
<target name="reobfuscate">
<exec dir="${environment.mcp_location}" executable="cmd" osfamily="windows">
<arg line="/c reobfuscate_srg.bat" />
</exec>
<exec dir="${environment.mcp_location}" executable="bash" osfamily="unix">
<arg line="reobfuscate_srg.sh" />
</exec>
</target>
<target name="sign_jar">
<signjar jar="${environment.release_location}/MC ${build.minecraft_version}/${build.mod_version}/ee3-universal-${build.mod_version}-${build.build_number}.jar" keystore="${private.keystore_location}" alias="${private.keystore_user_alias}" storepass="${private.keystore_user_password}" />
</target>
<target name="build">
<!-- Prep for the build -->
<antcall target="clean" />
<antcall target="increment_build_number" />
<antcall target="prep" />
<antcall target="recompile" />
<antcall target="reobfuscate" />
<!-- Build the jar -->
<mkdir dir="${environment.release_location}/MC ${build.minecraft_version}/${build.mod_version}" />
<jar destfile="${environment.release_location}/MC ${build.minecraft_version}/${build.mod_version}/ee3-universal-${build.mod_version}-${build.build_number}.jar">
<fileset dir="${environment.mcp_location}/src/minecraft/" includes="mcmod.info" />
<fileset dir="${environment.mcp_location}/src/minecraft/" includes="pack.mcmeta" />
<fileset dir="${environment.mcp_location}/reobf/minecraft" />
<fileset dir="${environment.source_location}/resources" excludes="**/xcf/**" />
</jar>
<!-- Clean up the MCP source now that we are done -->
<antcall target="clean" />
</target>
<target name="release">
<!-- Prep for the build -->
<antcall target="clean" />
<antcall target="increment_build_number" />
<antcall target="prep" />
<antcall target="replace_tokens" />
<antcall target="recompile" />
<antcall target="reobfuscate" />
<!-- Build the jar -->
<mkdir dir="${environment.release_location}/MC ${build.minecraft_version}/${build.mod_version}" />
<jar destfile="${environment.release_location}/MC ${build.minecraft_version}/${build.mod_version}/ee3-universal-${build.mod_version}-${build.build_number}.jar">
<fileset dir="${environment.mcp_location}/src/minecraft/" includes="mcmod.info" />
<fileset dir="${environment.mcp_location}/src/minecraft/" includes="pack.mcmeta" />
<fileset dir="${environment.mcp_location}/reobf/minecraft" />
<fileset dir="${environment.source_location}/resources" excludes="**/xcf/**" />
</jar>
<!-- Sign the finished jar -->
<antcall target="sign_jar" />
<!-- Clean up the MCP source now that we are done -->
<antcall target="clean" />
</target>
</project>