<commit_before><project name="Better than Arguing" basedir="" default="main">
  <property environment="env"/>

	<!-- Properties -->
	<property name="build.dir" value="build"/>
	<property name="src.dir" value="common"/>
	<property name="resources.dir" value="resources"/>
	<property name="test.dir" value="test"/>

	<property name="download.dir" value="download"/>
	<property name="files.minecraft.dir" value="jars"/>

	<property name="classes.dir" value="${build.dir}/classes"/>
	<property name="jar.dir" value="${build.dir}/dist"/>
	<property name="lib.dir" value="${build.dir}/lib"/>

	<property name="forge.dir" value="${build.dir}/forge"/>
	<property name="mcp.dir" value="${forge.dir}/mcp"/>

	<property name="clientsrc.dir" value="${mcp.dir}/src/minecraft"/>
	<property name="commonsrc.dir" value="${clientsrc.dir}"/>

	<property file="${clientsrc.dir}/fmlversion.properties" />

	<property name="mc.version" value="1.6.2"/>
	<property name="forge.version" value="9.10.0.789"/>
	<property name="mod.version" value="0"/>
  
	<!-- Let's make ant make work with git ;) -->
	<macrodef name = "git">
		<attribute name = "command" />
		<attribute name = "dir" default = "" />
		<element name = "args" optional = "true" />
		<sequential>
			<echo message = "git @{command}" />
			<exec executable = "git" dir = "@{dir}">
				<arg value = "@{command}" />
				<args/>
			</exec>
		</sequential>
	</macrodef>
	<macrodef name = "git-clone-pull">
		<attribute name = "repository" />
		<attribute name = "dest" />
		<sequential>
			<git command = "clone">
				<args>
					<arg value = "@{repository}" />
					<arg value = "@{dest}" />
				</args>
			</git>
			<git command = "pull" dir = "@{dest}" />
		</sequential>
	</macrodef>
  
	<!-- Targets -->
	<target name="init-msg">
		<echo message="Starting build for ${mod.version.full}"/>
	</target>

	<target name="clean">
		<delete dir="${build.dir}"/>
	</target>
	
	<target name="download">
		<mkdir dir="${download.dir}"/>
		<get src="http://files.minecraftforge.net/minecraftforge/minecraftforge-src-${mc.version}-${forge.version}.zip" dest="${download.dir}" usetimestamp="True"/>
		
		<echo message="Download finished"/>
	</target>

	<target name="setup">
		<unzip dest="${build.dir}" failOnEmptyArchive="true">
			<fileset dir="${download.dir}">
				<include name="minecraftforge-src-${mc.version}-${forge.version}.zip"/>
			</fileset>
		</unzip>
		
		<echo message="Unpacking forge finished"/>
		
		<!-- Install forge -->
		<exec dir="${forge.dir}" executable="cmd" osfamily="windows" failonerror="true">
			<arg line="/c install.cmd"/>
		</exec>

		<exec dir="${forge.dir}" executable="sh" osfamily="unix" failonerror="true">
			<arg value="install.sh"/>
		</exec>

		<chmod file="${mcp.dir}/updatemd5.sh" perm="+x"/>
		<chmod file="${mcp.dir}/updatemcp.sh" perm="+x"/>
		<chmod file="${mcp.dir}/recompile.sh" perm="+x"/>
		<chmod file="${mcp.dir}/reobfuscate_srg.sh" perm="+x"/>
		<chmod file="${forge.dir}/install.sh" perm="+x"/>

		<!-- if your building on OSX these 2 should be executable -->
		<chmod file="${mcp.dir}/runtime/bin/astyle-osx" perm="+x"/>
		<chmod file="${mcp.dir}/runtime/bin/jad-osx" perm="+x"/>

		<echo message="Decompile finished"/>
		
		<echo message="Copied ModStat files"/>
		
		<!-- Refresh MD5 -->
		<exec dir="${mcp.dir}" executable="cmd" osfamily="windows" failonerror="true">
			<arg line="/c updatemd5.bat -f --client"/>
		</exec>

		<exec dir="${mcp.dir}" executable="sh" osfamily="unix" failonerror="true">
			<arg line="updatemd5.sh -f --client"/>
		</exec>

		<echo message="Regenerated MD5s"/>

	</target>


	<target name="copySRC" >
		<!-- Copies this mods source and resources! -->
		
		<!-- Delete source in build space -->
		<delete dir="${commonsrc.dir}/FlowerTeenager/BetterThanArguing"/>
		
		<!-- Delete resources in build space -->
		<delete dir="${commonsrc.dir}/FlowerTeenager/BetterThanArguing"/>
		<delete file="${commonsrc.dir}/mcmod.info"/>

		<!-- Copy source -->
		<copy todir="${commonsrc.dir}">
			<fileset dir="${src.dir}"/>
		</copy>
		
		<!-- Copy resources -->
		<copy todir="${commonsrc.dir}">
			<fileset dir="${resources.dir}"/>
		</copy>
	</target>


	<target name="compile" depends="copySRC">

		<echo message="Compiling version ${mod.version.full}"/>

		<!-- Recompile -->
		<exec dir="${mcp.dir}" executable="cmd" osfamily="windows" failonerror="true">
			<arg line="/c recompile.bat --client"/>
		</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" failonerror="true"><commit_msg>Adjust the build script<commit_after><project name="Better than Arguing" basedir="" default="main">
  <property environment="env"/>

	<!-- Properties -->
	<property name="build.dir" value="build"/>
	<property name="src.dir" value="common"/>
	<property name="resources.dir" value="resources"/>
	<property name="test.dir" value="test"/>

	<property name="download.dir" value="download"/>
	<property name="files.minecraft.dir" value="jars"/>

	<property name="classes.dir" value="${build.dir}/classes"/>
	<property name="jar.dir" value="${build.dir}/dist"/>
	<property name="lib.dir" value="${build.dir}/lib"/>

	<property name="forge.dir" value="${build.dir}/forge"/>
	<property name="mcp.dir" value="${forge.dir}/mcp"/>

	<property name="clientsrc.dir" value="${mcp.dir}/src/minecraft"/>
	<property name="commonsrc.dir" value="${clientsrc.dir}"/>

	<property file="${clientsrc.dir}/fmlversion.properties" />

	<property name="mc.version" value="1.6.2"/>
	<property name="forge.version" value="9.10.0.792"/>
	<property name="mod.version" value="0"/>
  
	<!-- Let's make ant make work with git ;) -->
	<macrodef name = "git">
		<attribute name = "command" />
		<attribute name = "dir" default = "" />
		<element name = "args" optional = "true" />
		<sequential>
			<echo message = "git @{command}" />
			<exec executable = "git" dir = "@{dir}">
				<arg value = "@{command}" />
				<args/>
			</exec>
		</sequential>
	</macrodef>
	<macrodef name = "git-clone-pull">
		<attribute name = "repository" />
		<attribute name = "dest" />
		<sequential>
			<git command = "clone">
				<args>
					<arg value = "@{repository}" />
					<arg value = "@{dest}" />
				</args>
			</git>
			<git command = "pull" dir = "@{dest}" />
		</sequential>
	</macrodef>
  
	<!-- Targets -->
	<target name="init-msg">
		<echo message="Starting build for ${mod.version.full}"/>
	</target>

	<target name="clean">
		<delete dir="${build.dir}"/>
	</target>
	
	<target name="download">
		<mkdir dir="${download.dir}"/>
		<get src="http://files.minecraftforge.net/minecraftforge/minecraftforge-src-${mc.version}-${forge.version}.zip" dest="${download.dir}" usetimestamp="True"/>
		
		<echo message="Download finished"/>
	</target>

	<target name="setup">
		<unzip dest="${build.dir}" failOnEmptyArchive="true">
			<fileset dir="${download.dir}">
				<include name="minecraftforge-src-${mc.version}-${forge.version}.zip"/>
			</fileset>
		</unzip>
		
		<echo message="Unpacking forge finished"/>
		
		<!-- Install forge -->
		<exec dir="${forge.dir}" executable="cmd" osfamily="windows" failonerror="true">
			<arg line="/c install.cmd"/>
		</exec>

		<exec dir="${forge.dir}" executable="sh" osfamily="unix" failonerror="true">
			<arg value="install.sh"/>
		</exec>

		<chmod file="${mcp.dir}/updatemd5.sh" perm="+x"/>
		<chmod file="${mcp.dir}/updatemcp.sh" perm="+x"/>
		<chmod file="${mcp.dir}/recompile.sh" perm="+x"/>
		<chmod file="${mcp.dir}/reobfuscate_srg.sh" perm="+x"/>
		<chmod file="${forge.dir}/install.sh" perm="+x"/>

		<!-- if your building on OSX these 2 should be executable -->
		<chmod file="${mcp.dir}/runtime/bin/astyle-osx" perm="+x"/>
		<chmod file="${mcp.dir}/runtime/bin/jad-osx" perm="+x"/>

		<echo message="Decompile finished"/>
		
		<echo message="Copied ModStat files"/>
		
		<!-- Refresh MD5 -->
		<exec dir="${mcp.dir}" executable="cmd" osfamily="windows" failonerror="true">
			<arg line="/c updatemd5.bat -f --client"/>
		</exec>

		<exec dir="${mcp.dir}" executable="sh" osfamily="unix" failonerror="true">
			<arg line="updatemd5.sh -f --client"/>
		</exec>

		<echo message="Regenerated MD5s"/>

	</target>


	<target name="copySRC" >
		<!-- Copies this mods source and resources! -->
		
		<!-- Delete source in build space -->
		<delete dir="${commonsrc.dir}/FlowerTeenager/BetterThanArguing"/>
		
		<!-- Delete resources in build space -->
		<delete dir="${commonsrc.dir}/FlowerTeenager/BetterThanArguing"/>
		<delete file="${commonsrc.dir}/mcmod.info"/>

		<!-- Copy source -->
		<copy todir="${commonsrc.dir}">
			<fileset dir="${src.dir}"/>
		</copy>
		
		<!-- Copy resources -->
		<copy todir="${commonsrc.dir}">
			<!-- <fileset dir="${resources.dir}"/> -->
		</copy>
	</target>


	<target name="compile" depends="copySRC">

		<echo message="Compiling version ${mod.version.full}"/>

		<!-- Recompile -->
		<exec dir="${mcp.dir}" executable="cmd" osfamily="windows" failonerror="true">
			<arg line="/c recompile.bat --client"/>
		</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" failonerror="true">
{'fraction_non_alphanumeric': 0.2289544235924933, 'fraction_numerical': 0.0036461126005361932, 'mean_word_length': 3.981837606837607, 'pattern_counts': {'":': 0, '<': 240, '<?xml version=': 0, '>': 240, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 14, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6659731', 'n_tokens_mistral': 3531, 'n_tokens_neox': 3165, 'n_words': 648}