<commit_before><?xml version="1.0"?>
<project name="gcs" default="build_jar" xmlns:if="ant:if" xmlns:unless="ant:unless">
	<condition property="platform.mac" else="false">
		<os family="mac"/>
	</condition>
	<condition property="platform.windows" else="false">
		<os family="windows"/>
	</condition>
	<condition property="platform.linux" else="false">
		<and>
			<os family="unix"/>
			<not>
				<os family="mac"/>
			</not>
		</and>
	</condition>
	<property if:true="${platform.mac}" name="platform" value="mac"/>
	<property if:true="${platform.windows}" name="platform" value="windows"/>
	<property if:true="${platform.linux}" name="platform" value="linux"/>
	<condition property="platformWithBits" value="${platform}-32" else="${platform}">
		<and>
			<os family="unix"/>
			<os name="i386"/>
		</and>
	</condition>

	<property name="app" value="gcs"/>
	<property if:true="${platform.windows}" name="app.exe" value="${app}.exe"/>
	<property unless:true="${platform.windows}" name="app.exe" value="${app}"/>
	<property if:true="${platform.mac}" name="app.signature" value="RWGS"/>
	<property name="src" value="src"/>
	<property name="lib" value="libraries"/>
	<property name="toolkit" value="toolkit-4.0.0.jar"/>
	<property name="toolkit_lib" value="../toolkit/libraries"/>
	<property name="toolkit_path" value="${toolkit_lib}/${toolkit}"/>
	<property name="apple_stubs" value="apple_stubs.jar"/>
	<property name="apple_stubs_path" value="../apple_stubs/${apple_stubs}"/>
	<property name="trove" value="trove-3.0.3.jar"/>
	<property name="trove_path" value="${toolkit_lib}/trove-3.0.3.jar"/>
	<property name="iText" value="iText-2.1.7.jar"/>
	<property name="iText_path" value="${lib}/${iText}"/>
	<property name="build_root" value="ant_build"/>
	<property name="gcs_build" value="${build_root}/${app}"/>
	<property name="dist.build" value="${build_root}/dist"/>
	<property name="annotations_src" value="${build_root}/annotations"/>
	<property name="min_jdk" value="1.8"/>
	<property name="app_name" value="GURPS Character Sheet"/>
	<property name="copyright_owner" value="<NAME>"/>
	<property name="primary_version" value="4.0.0"/>
	<property name="dist_name" value="GCS-${primary_version}"/>
	<property name="dist_root" value="${dist.build}/${dist_name}"/>
	<property name="build_app_bundle" value="${dist_root}/${app_name}.app/Contents"/>
	<property name="bundle_res" value="${build_app_bundle}/Resources"/>
	<property name="java_bundle_dir" value="${build_app_bundle}/Java"/>

	<tstamp>
		<format property="version" pattern="${primary_version}.yyyyMMddHHmmss"/>
	</tstamp>
	<tstamp>
		<format property="year" pattern="yyyy"/>
	</tstamp>

	<target name="clean" description="Clean up after a GCS jar build">
		<delete dir="${build_root}"/>
		<delete>
			<fileset dir="${lib}" includes="${app}-*.jar"/>
		</delete>
	</target>

	<target name="build_jar" description="Build the GCS jar" depends="clean">
		<mkdir dir="${gcs_build}"/>
		<mkdir dir="${annotations_src}"/>

		<!-- Compile the code. -->
		<javac srcdir="${src}" destdir="${gcs_build}" debug="no" optimize="yes"
			target="${min_jdk}" source="${min_jdk}" deprecation="true"
			includeantruntime="no" fork="yes">
			<classpath>
				<pathelement location="${toolkit_path}"/>
				<pathelement location="${trove_path}"/>
				<pathelement location="${iText_path}"/>
				<pathelement location="${apple_stubs_path}"/>
			</classpath>
			<compilerarg value="-Xlint:all"/>
			<compilerarg value="-Xlint:-serial"/>
			<compilerarg value="-processorpath"/>
			<compilerarg value="${toolkit_lib}/toolkit_annotation_processors.jar"/>
			<compilerarg value="-s"/>
			<compilerarg value="${annotations_src}"/>
			<compilerarg value="-implicit:class"/>
		</javac>

		<!-- Copy the resources over. -->
		<copy todir="${gcs_build}">
			<fileset dir="${src}" includes="**/*.txt,**/*.png"/>
		</copy>

		<!-- Create the jar file. -->
		<jar destfile="${lib}/${app}-${primary_version}.jar" basedir="${gcs_build}" duplicate="fail">
			<manifest>
				<attribute name="Class-Path" value="${toolkit} ${trove} ${iText} ${apple_stubs}"/>
				<attribute name="Main-Class" value="com.trollworks.gcs.app.GCS"/>
				<attribute name="bundle-name" value="${app_name}"/>
				<attribute name="bundle-version" value="${version}"/>
				<attribute name="bundle-license" value="Mozilla Public License 2.0"/>
				<attribute name="bundle-copyright-owner" value="${copyright_owner}"/>
				<attribute name="bundle-copyright-years" value="1998-${year}"/>
				<attribute name="bundle-executable" value="${app.exe}"/>
				<attribute name="bundle-id" value="com.trollworks.gcs"/>
				<attribute name="bundle-signature" value="${app.signature}"/>
				<attribute name="bundle-category" value="public.app-category.role-playing-games"/>
			</manifest>
		</jar>
	</target>

	<target name="clean_bundle" description="Cleans up after a bundle build">
		<delete dir="${build_root}"/>
		<delete>
			<fileset dir="." includes="${app}-*-${platformWithBits}.zip"/>
		</delete>
	</target>
	
	<target name="bundle" description="Create a distribution bundle" depends="clean_bundle">
		<property name="dist.name" value="${app}-${primary_version}-${platformWithBits}"/>
		<property name="dist.root" value="${dist.build}/${dist.name}"/>
		<property if:true="${platform.mac}" name="mac.bundle" value="${dist.root}/${app_name}.app/Contents"/>
		<property if:true="${platform.mac}" name="app.dir" value="${mac.bundle}/MacOS"/>
		<property unless:true="${platform.mac}" name="app.dir" value="${dist.root}"/>
		<property name="support" value="${app.dir}/support"/>
		<property if:true="${platform.mac}" name="app.icons" value="${mac.bundle}/Resources"/>
		<property unless:true="${platform.mac}" name="app.icons" value="${support}"/>
		<property name="app.jre" value="${support}/jre"/>
		<property name="app.jars" value="${support}/jars"/>
		<property name="data" value="${dist.root}/Library"/>

		<!-- Copy the launcher. -->
		<mkdir dir="${app.dir}"/>
		<copy file="launcher/${platformWithBits}/${app.exe}" todir="${app.dir}"/>
		<chmod file="${app.dir}/${app.exe}" perm="+x"/>

		<!-- Copy the jars. -->
		<mkdir dir="${app.jars}"/>
		<copy file="${lib}/${app}-${primary_version}.jar" todir="${app.jars}"/>
		<copy file="${toolkit_path}" todir="${app.jars}"/>
		<copy file="${trove_path}" todir="${app.jars}"/>
		<copy file="${iText_path}" todir="${app.jars}"/>
		<copy file="${apple_stubs_path}" todir="${app.jars}"/>

		<!-- Create the icons. -->
		<mkdir dir="${app.icons}"/>
		<java classpath="${app.jars}/${app}-${primary_version}.jar" classname="com.trollworks.gcs.app.GCSImages">
			<arg if:true="${platform.mac}" value="-icns"/>
			<arg if:true="${platform.windows}" value="-ico"/>
			<arg if:true="${platform.linux}" value="-app"/>
			<arg value="-dir"/>
			<arg value="${app.icons}"/>
		</java>

		<!-- Create the Info.plist and PkgInfo files. -->
		<mkdir if:true="${platform.mac}" dir="${mac.bundle}"/>
		<java if:true="${platform.mac}" classpath="${app.jars}/${app}-${primary_version}.jar" classname="com.trollworks.gcs.app.GCSInfoPlistCreator">
			<arg value="${mac.bundle}/Info.plist"/>
		</java>
		<echo if:true="${platform.mac}" message="APPL${app.signature}" file="${mac.bundle}/PkgInfo"/>

		<!-- Extract the JRE. -->
		<ant dir="../toolkit" target="jre" inheritall="no">
			<property name="platform.mac" value="${platform.mac}"/>
			<property name="platform.windows" value="${platform.windows}"/>
			<property name="platform.linux" value="${platform.linux}"/>
			<property name="support" location="${support}"/>
		</ant>

		<!-- Copy the license. -->
		<copy file="license.html" todir="${dist.root}"/>

		<!-- Copy the database. -->
		<mkdir dir="${data}"/>
		<copy todir="${data}">
			<fileset dir="Library"/>
		</copy>

		<!-- Create the zip file. Using native implementation to preserve execution bits on unix-like OS's. -->
		<exec unless:true="${platform.windows}" executable="/usr/bin/zip" dir="${dist.build}">
			<arg value="-r"/>
			<arg value="-y"/>
			<arg value="-9"/>
			<arg file="${dist.name}.zip"/>
			<arg value="${dist.name}"/>
		</exec>
		<zip if:true="${platform.windows}" destfile="${dist.name}.zip" basedir="${dist.build}" level="9"
			includes="${dist.name}/**"/>
	</target>

	<target name="build_launcher_exe" description="Build the native launcher">
		<ant dir="../toolkit" target="launcher" inheritall="false">
			<property name="platform.mac" value="${platform.mac}"/>
			<property name="platform.windows" value="${platform.windows}"/>
			<property name="platform.linux" value="${platform.linux}"/>
			<property name="app.dir" location="launcher/${platformWithBits}"/>
			<property name="app.name" value="${app_name}"/>
			<property name="app.exe" value="${app.exe}"/>
			<property if:true="${platform.windows}" name="app.icon.dir" location="${app.icons}"/>
			<property if:true="${platform.linux}" name="app.categories" value="Game;Roleplaying;Utility"/>
			<property if:true="${platform.linux}" name="app.keywords" value="Roleplaying"/>
		</ant>
	</target>
	
	<target name="bundle_all" description="Create distribution bundles for all platforms">
		<antcall target="bundle" inheritall="no">
			<param name="platform.mac" value="true"/>
			<param name="platform.windows" value="false"/>
			<param name="platform.linux" value="false"/>
		</antcall>
		<antcall target="bundle" inheritall="no">
			<param name="platform.mac" value="false"/>
			<param name="platform.windows" value="false"/>
			<param name="platform.linux" value="true"/>
		</antcall>
		<antcall target="bundle" inheritall="no">
			<param name="platform.mac" value="false"/>
			<param name="platform.windows" value="true"/>
			<param name="platform.linux" value="false"/>
		</antcall>
	</target>
</project>
<commit_msg>Use os.arch, not os.name.<commit_after><?xml version="1.0"?>
<project name="gcs" default="build_jar" xmlns:if="ant:if" xmlns:unless="ant:unless">
	<condition property="platform.mac" else="false">
		<os family="mac"/>
	</condition>
	<condition property="platform.windows" else="false">
		<os family="windows"/>
	</condition>
	<condition property="platform.linux" else="false">
		<and>
			<os family="unix"/>
			<not>
				<os family="mac"/>
			</not>
		</and>
	</condition>
	<property if:true="${platform.mac}" name="platform" value="mac"/>
	<property if:true="${platform.windows}" name="platform" value="windows"/>
	<property if:true="${platform.linux}" name="platform" value="linux"/>
	<condition property="platformWithBits" value="${platform}-32" else="${platform}">
		<and>
			<os family="unix"/>
			<os arch="i386"/>
		</and>
	</condition>

	<property name="app" value="gcs"/>
	<property if:true="${platform.windows}" name="app.exe" value="${app}.exe"/>
	<property unless:true="${platform.windows}" name="app.exe" value="${app}"/>
	<property if:true="${platform.mac}" name="app.signature" value="RWGS"/>
	<property name="src" value="src"/>
	<property name="lib" value="libraries"/>
	<property name="toolkit" value="toolkit-4.0.0.jar"/>
	<property name="toolkit_lib" value="../toolkit/libraries"/>
	<property name="toolkit_path" value="${toolkit_lib}/${toolkit}"/>
	<property name="apple_stubs" value="apple_stubs.jar"/>
	<property name="apple_stubs_path" value="../apple_stubs/${apple_stubs}"/>
	<property name="trove" value="trove-3.0.3.jar"/>
	<property name="trove_path" value="${toolkit_lib}/trove-3.0.3.jar"/>
	<property name="iText" value="iText-2.1.7.jar"/>
	<property name="iText_path" value="${lib}/${iText}"/>
	<property name="build_root" value="ant_build"/>
	<property name="gcs_build" value="${build_root}/${app}"/>
	<property name="dist.build" value="${build_root}/dist"/>
	<property name="annotations_src" value="${build_root}/annotations"/>
	<property name="min_jdk" value="1.8"/>
	<property name="app_name" value="GURPS Character Sheet"/>
	<property name="copyright_owner" value="<NAME>"/>
	<property name="primary_version" value="4.0.0"/>
	<property name="dist_name" value="GCS-${primary_version}"/>
	<property name="dist_root" value="${dist.build}/${dist_name}"/>
	<property name="build_app_bundle" value="${dist_root}/${app_name}.app/Contents"/>
	<property name="bundle_res" value="${build_app_bundle}/Resources"/>
	<property name="java_bundle_dir" value="${build_app_bundle}/Java"/>

	<tstamp>
		<format property="version" pattern="${primary_version}.yyyyMMddHHmmss"/>
	</tstamp>
	<tstamp>
		<format property="year" pattern="yyyy"/>
	</tstamp>

	<target name="clean" description="Clean up after a GCS jar build">
		<delete dir="${build_root}"/>
		<delete>
			<fileset dir="${lib}" includes="${app}-*.jar"/>
		</delete>
	</target>

	<target name="build_jar" description="Build the GCS jar" depends="clean">
		<mkdir dir="${gcs_build}"/>
		<mkdir dir="${annotations_src}"/>

		<!-- Compile the code. -->
		<javac srcdir="${src}" destdir="${gcs_build}" debug="no" optimize="yes"
			target="${min_jdk}" source="${min_jdk}" deprecation="true"
			includeantruntime="no" fork="yes">
			<classpath>
				<pathelement location="${toolkit_path}"/>
				<pathelement location="${trove_path}"/>
				<pathelement location="${iText_path}"/>
				<pathelement location="${apple_stubs_path}"/>
			</classpath>
			<compilerarg value="-Xlint:all"/>
			<compilerarg value="-Xlint:-serial"/>
			<compilerarg value="-processorpath"/>
			<compilerarg value="${toolkit_lib}/toolkit_annotation_processors.jar"/>
			<compilerarg value="-s"/>
			<compilerarg value="${annotations_src}"/>
			<compilerarg value="-implicit:class"/>
		</javac>

		<!-- Copy the resources over. -->
		<copy todir="${gcs_build}">
			<fileset dir="${src}" includes="**/*.txt,**/*.png"/>
		</copy>

		<!-- Create the jar file. -->
		<jar destfile="${lib}/${app}-${primary_version}.jar" basedir="${gcs_build}" duplicate="fail">
			<manifest>
				<attribute name="Class-Path" value="${toolkit} ${trove} ${iText} ${apple_stubs}"/>
				<attribute name="Main-Class" value="com.trollworks.gcs.app.GCS"/>
				<attribute name="bundle-name" value="${app_name}"/>
				<attribute name="bundle-version" value="${version}"/>
				<attribute name="bundle-license" value="Mozilla Public License 2.0"/>
				<attribute name="bundle-copyright-owner" value="${copyright_owner}"/>
				<attribute name="bundle-copyright-years" value="1998-${year}"/>
				<attribute name="bundle-executable" value="${app.exe}"/>
				<attribute name="bundle-id" value="com.trollworks.gcs"/>
				<attribute name="bundle-signature" value="${app.signature}"/>
				<attribute name="bundle-category" value="public.app-category.role-playing-games"/>
			</manifest>
		</jar>
	</target>

	<target name="clean_bundle" description="Cleans up after a bundle build">
		<delete dir="${build_root}"/>
		<delete>
			<fileset dir="." includes="${app}-*-${platformWithBits}.zip"/>
		</delete>
	</target>
	
	<target name="bundle" description="Create a distribution bundle" depends="clean_bundle">
		<property name="dist.name" value="${app}-${primary_version}-${platformWithBits}"/>
		<property name="dist.root" value="${dist.build}/${dist.name}"/>
		<property if:true="${platform.mac}" name="mac.bundle" value="${dist.root}/${app_name}.app/Contents"/>
		<property if:true="${platform.mac}" name="app.dir" value="${mac.bundle}/MacOS"/>
		<property unless:true="${platform.mac}" name="app.dir" value="${dist.root}"/>
		<property name="support" value="${app.dir}/support"/>
		<property if:true="${platform.mac}" name="app.icons" value="${mac.bundle}/Resources"/>
		<property unless:true="${platform.mac}" name="app.icons" value="${support}"/>
		<property name="app.jre" value="${support}/jre"/>
		<property name="app.jars" value="${support}/jars"/>
		<property name="data" value="${dist.root}/Library"/>

		<!-- Copy the launcher. -->
		<mkdir dir="${app.dir}"/>
		<copy file="launcher/${platformWithBits}/${app.exe}" todir="${app.dir}"/>
		<chmod file="${app.dir}/${app.exe}" perm="+x"/>

		<!-- Copy the jars. -->
		<mkdir dir="${app.jars}"/>
		<copy file="${lib}/${app}-${primary_version}.jar" todir="${app.jars}"/>
		<copy file="${toolkit_path}" todir="${app.jars}"/>
		<copy file="${trove_path}" todir="${app.jars}"/>
		<copy file="${iText_path}" todir="${app.jars}"/>
		<copy file="${apple_stubs_path}" todir="${app.jars}"/>

		<!-- Create the icons. -->
		<mkdir dir="${app.icons}"/>
		<java classpath="${app.jars}/${app}-${primary_version}.jar" classname="com.trollworks.gcs.app.GCSImages">
			<arg if:true="${platform.mac}" value="-icns"/>
			<arg if:true="${platform.windows}" value="-ico"/>
			<arg if:true="${platform.linux}" value="-app"/>
			<arg value="-dir"/>
			<arg value="${app.icons}"/>
		</java>

		<!-- Create the Info.plist and PkgInfo files. -->
		<mkdir if:true="${platform.mac}" dir="${mac.bundle}"/>
		<java if:true="${platform.mac}" classpath="${app.jars}/${app}-${primary_version}.jar" classname="com.trollworks.gcs.app.GCSInfoPlistCreator">
			<arg value="${mac.bundle}/Info.plist"/>
		</java>
		<echo if:true="${platform.mac}" message="APPL${app.signature}" file="${mac.bundle}/PkgInfo"/>

		<!-- Extract the JRE. -->
		<ant dir="../toolkit" target="jre" inheritall="no">
			<property name="platform.mac" value="${platform.mac}"/>
			<property name="platform.windows" value="${platform.windows}"/>
			<property name="platform.linux" value="${platform.linux}"/>
			<property name="support" location="${support}"/>
		</ant>

		<!-- Copy the license. -->
		<copy file="license.html" todir="${dist.root}"/>

		<!-- Copy the database. -->
		<mkdir dir="${data}"/>
		<copy todir="${data}">
			<fileset dir="Library"/>
		</copy>

		<!-- Create the zip file. Using native implementation to preserve execution bits on unix-like OS's. -->
		<exec unless:true="${platform.windows}" executable="/usr/bin/zip" dir="${dist.build}">
			<arg value="-r"/>
			<arg value="-y"/>
			<arg value="-9"/>
			<arg file="${dist.name}.zip"/>
			<arg value="${dist.name}"/>
		</exec>
		<zip if:true="${platform.windows}" destfile="${dist.name}.zip" basedir="${dist.build}" level="9"
			includes="${dist.name}/**"/>
	</target>

	<target name="build_launcher_exe" description="Build the native launcher">
		<ant dir="../toolkit" target="launcher" inheritall="false">
			<property name="platform.mac" value="${platform.mac}"/>
			<property name="platform.windows" value="${platform.windows}"/>
			<property name="platform.linux" value="${platform.linux}"/>
			<property name="app.dir" location="launcher/${platformWithBits}"/>
			<property name="app.name" value="${app_name}"/>
			<property name="app.exe" value="${app.exe}"/>
			<property if:true="${platform.windows}" name="app.icon.dir" location="${app.icons}"/>
			<property if:true="${platform.linux}" name="app.categories" value="Game;Roleplaying;Utility"/>
			<property if:true="${platform.linux}" name="app.keywords" value="Roleplaying"/>
		</ant>
	</target>
	
	<target name="bundle_all" description="Create distribution bundles for all platforms">
		<antcall target="bundle" inheritall="no">
			<param name="platform.mac" value="true"/>
			<param name="platform.windows" value="false"/>
			<param name="platform.linux" value="false"/>
		</antcall>
		<antcall target="bundle" inheritall="no">
			<param name="platform.mac" value="false"/>
			<param name="platform.windows" value="false"/>
			<param name="platform.linux" value="true"/>
		</antcall>
		<antcall target="bundle" inheritall="no">
			<param name="platform.mac" value="false"/>
			<param name="platform.windows" value="true"/>
			<param name="platform.linux" value="false"/>
		</antcall>
	</target>
</project>

{'fraction_non_alphanumeric': 0.2344055081697667, 'fraction_numerical': 0.003288459562223821, 'mean_word_length': 5.337675024422013, 'pattern_counts': {'":': 0, '<': 413, '<?xml version=': 2, '>': 413, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '37984', 'n_tokens_mistral': 6909, 'n_tokens_neox': 6280, 'n_words': 1157}