<commit_before><?xml version="1.0" encoding="UTF-8"?>
<!--
	Headless materialization of Xsemantics workspace
	adapted from Headless materialization of Xtext workspace

	Author: <NAME>, <NAME>

	Properties:
		WORKSPACE  			where workspace will be generated,
							default: ${user.home}/workspaces/xsemantics-sources
		buckminster.home	Buckminster headless location
							default: ${user.home}/buckminster
							if not installed, it will be automatically installed
		git.clone.dest		where sources are (or will be) cloned
							${user.home}/git/xsemantics
-->
<project name="worskspace" default="materialize.workspace">
	<!-- Windows Maximum Path Length Limitation issue
	<condition property="git.root" value="/git" else="${user.home}/git">
		<os family="windows" />
	</condition> -->
	<property name="git.root" value="${user.home}/git" />
	<property name="git.clone.dest" location="${git.root}/xsemantics" />
	<property name="checkout.location" location="${git.clone.dest}" />

	<property name="target.platform.dir" value="target.platform" />
	<property name="eclipse.download" value="http://download.eclipse.org" />

	<property name="buckminster.home" location="${user.home}/buckminster" />

	<property name="director.install.dest" location="${user.home}" />
	<property name="director.dir" location="${director.install.dest}/director" />
	<property name="director.url" value="http://download.eclipse.org/tools/buckminster/products/director_latest.zip" />

	<property name="git.config.file" location="${git.clone.dest}/.git/config" />
	
	<property name="remote.cquery" value="https://raw.github.com/LorenzoBettini/xsemantics/master/devtools/it.xsemantics.contributor/xsemantics-contributor.cquery" />

	<target name="materialize.workspace" depends="install.buckminster.headless">
		<property name="WORKSPACE" location="${user.home}/workspaces/xsemantics-sources" />
		<property name="target.platform" location="${WORKSPACE}/${target.platform.dir}" />
		
		<echo message="output workspace     : ${WORKSPACE}" />
		<echo message="git clone repository : ${git.clone.dest}" />

		<antcall target="cleanup" />
		<antcall target="set.target.platform.path" />
		<antcall target="clone.projects" />
		<antcall target="resolve.commands" />
		<antcall target="import.workspace.settings" />

		<echo message=" " />
		<echo message="Workspace materialized in: ${WORKSPACE}" />
	</target>

	<target name="set.target.platform.path">
		<run_buckminster command='setpref targetPlatformPath="${target.platform}"' />
	</target>

	<target name="clone.projects">
		<echo message="IMPORTANT: Initial cloning of a git repository may take a while." />
		<!--		<run_buckminster command="import ${user.home}/git/org.eclipse.xtext/devtools/org.eclipse.xtext.contributor/xtext-contr.mspec" />
	-->
		<run_buckminster command="import ${remote.cquery}" />
	</target>

	<target name="import.api.baseline">
		<run_buckminster command='importtargetdefinition "${checkout.location}/releng/org.eclipse.xtext.releng/api-baseline/api-baseline.target"' />
	</target>

	<target name="set.api.baseline">
		<run_buckminster command='addbaseline -A "api-baseline"' />
	</target>

	<target name="resolve.commands" depends="copy-xtext-grammar-to-bin">
		<echo message="IMPORTANT: Populating an empty target platform may take a while." />
		<run_buckminster command='--script "${checkout.location}/releng/it.xsemantics.buckminster/headless-resolve-commands-contributor.txt"' />
	</target>

	<target name="import.workspace.settings">
		<run_buckminster command='importprefs -F "${checkout.location}/devtools/it.xsemantics.contributor/workspace.epf"' />
	</target>

	<!-- = = = = = = = = = = = = = = = = =
          macrodef: run_buckminster
          pass the commandsfile to execute      
         = = = = = = = = = = = = = = = = = -->
	<macrodef name="run_buckminster">
		<attribute name="command" default="default" />

		<sequential>
			<java fork="true" dir="${buckminster.home}" logError="true" classname="org.eclipse.core.launcher.Main" failonerror="true">
				<classpath>
					<fileset dir="${buckminster.home}/plugins">
						<include name="org.eclipse.equinox.launcher_*.jar" />
					</fileset>
				</classpath>
				<arg line='@{command}' />
				<arg line='-data "${WORKSPACE}"' />
				<arg line='-configuration "${WORKSPACE}/configuration"' />
				<!-- <arg line='-L DEBUG' /> -->
				<sysproperty key="projects.location" value="${checkout.location}" />
				<sysproperty key="git.clone.dest" value="${git.clone.dest}" />
				<sysproperty key="checkout.location" value="${checkout.location}" />
				<sysproperty key="target.platform" value="${target.platform}" />
				<sysproperty key="eclipse.download" value="${eclipse.download}" />
				<jvmarg line=" -Xms256m -Xmx512m" />
			</java>
		</sequential>
	</macrodef>

	<target name="copy-xtext-grammar-to-bin">
	  <copy todir="${checkout.location}" overwrite="true" verbose="true">
	    <fileset dir="${checkout.location}" casesensitive="true">
	      <include name="**/src/**/*.xtext" />
	    </fileset>
	    <mapper type="regexp" 
		      from="(.*)/(src)/(.*/*\.xtext)" to="\1/bin/\3" />
	  </copy>
	</target><commit_msg>updated ant target in workspace.ant<commit_after><?xml version="1.0" encoding="UTF-8"?>
<!--
	Headless materialization of Xsemantics workspace
	adapted from Headless materialization of Xtext workspace

	Author: <NAME>, <NAME>

	Properties:
		WORKSPACE  			where workspace will be generated,
							default: ${user.home}/workspaces/xsemantics-sources
		buckminster.home	Buckminster headless location
							default: ${user.home}/buckminster
							if not installed, it will be automatically installed
		git.clone.dest		where sources are (or will be) cloned
							${user.home}/git/xsemantics
-->
<project name="worskspace" default="materialize.workspace">
	<!-- Windows Maximum Path Length Limitation issue
	<condition property="git.root" value="/git" else="${user.home}/git">
		<os family="windows" />
	</condition> -->
	<property name="git.root" value="${user.home}/git" />
	<property name="git.clone.dest" location="${git.root}/xsemantics" />
	<property name="checkout.location" location="${git.clone.dest}" />

	<property name="target.platform.dir" value="target.platform" />
	<property name="eclipse.download" value="http://download.eclipse.org" />

	<property name="buckminster.home" location="${user.home}/buckminster" />

	<property name="director.install.dest" location="${user.home}" />
	<property name="director.dir" location="${director.install.dest}/director" />
	<property name="director.url" value="http://download.eclipse.org/tools/buckminster/products/director_latest.zip" />

	<property name="git.config.file" location="${git.clone.dest}/.git/config" />
	
	<property name="remote.cquery" value="https://raw.github.com/LorenzoBettini/xsemantics/master/devtools/it.xsemantics.contributor/xsemantics-contributor.cquery" />

	<target name="materialize.workspace" depends="install.buckminster.headless">
		<property name="WORKSPACE" location="${user.home}/workspaces/xsemantics-sources" />
		<property name="target.platform" location="${WORKSPACE}/${target.platform.dir}" />
		
		<echo message="output workspace     : ${WORKSPACE}" />
		<echo message="git clone repository : ${git.clone.dest}" />

		<antcall target="cleanup" />
		<antcall target="set.target.platform.path" />
		<antcall target="clone.projects" />
		<antcall target="resolve.commands" />
		<antcall target="import.workspace.settings" />

		<echo message=" " />
		<echo message="Workspace materialized in: ${WORKSPACE}" />
	</target>

	<target name="set.target.platform.path">
		<run_buckminster command='setpref targetPlatformPath="${target.platform}"' />
	</target>

	<target name="clone.projects">
		<echo message="IMPORTANT: Initial cloning of a git repository may take a while." />
		<!--		<run_buckminster command="import ${user.home}/git/org.eclipse.xtext/devtools/org.eclipse.xtext.contributor/xtext-contr.mspec" />
	-->
		<run_buckminster command="import ${remote.cquery}" />
	</target>

	<target name="import.api.baseline">
		<run_buckminster command='importtargetdefinition "${checkout.location}/releng/org.eclipse.xtext.releng/api-baseline/api-baseline.target"' />
	</target>

	<target name="set.api.baseline">
		<run_buckminster command='addbaseline -A "api-baseline"' />
	</target>

	<target name="resolve.commands" depends="copy-xtext-grammar-to-bin">
		<echo message="IMPORTANT: Populating an empty target platform may take a while." />
		<run_buckminster command='--script "${checkout.location}/releng/it.xsemantics.buckminster/headless-resolve-commands-contributor.txt"' />
	</target>

	<target name="import.workspace.settings">
		<run_buckminster command='importprefs -F "${checkout.location}/devtools/it.xsemantics.contributor/workspace.epf"' />
	</target>

	<!-- = = = = = = = = = = = = = = = = =
          macrodef: run_buckminster
          pass the commandsfile to execute      
         = = = = = = = = = = = = = = = = = -->
	<macrodef name="run_buckminster">
		<attribute name="command" default="default" />

		<sequential>
			<java fork="true" dir="${buckminster.home}" logError="true" classname="org.eclipse.core.launcher.Main" failonerror="true">
				<classpath>
					<fileset dir="${buckminster.home}/plugins">
						<include name="org.eclipse.equinox.launcher_*.jar" />
					</fileset>
				</classpath>
				<arg line='@{command}' />
				<arg line='-data "${WORKSPACE}"' />
				<arg line='-configuration "${WORKSPACE}/configuration"' />
				<!-- <arg line='-L DEBUG' /> -->
				<sysproperty key="projects.location" value="${checkout.location}" />
				<sysproperty key="git.clone.dest" value="${git.clone.dest}" />
				<sysproperty key="checkout.location" value="${checkout.location}" />
				<sysproperty key="target.platform" value="${target.platform}" />
				<sysproperty key="eclipse.download" value="${eclipse.download}" />
				<jvmarg line=" -Xms256m -Xmx512m" />
			</java>
		</sequential>
	</macrodef>

	<target name="copy-xtext-grammar-to-bin">
	  <copy todir="${checkout.location}" overwrite="true" verbose="true">
	    <fileset dir="${checkout.location}" casesensitive="true">
	      <include name="**/src/**/*.xtext" />
	    </fileset>
	  	<regexpmapper from="(.*)/(src)/(.*/*\.xtext)" to="\1/bin/\3" casesensitive="yes" handledirsep="yes"/>
	  </copy>
	</target>
{'fraction_non_alphanumeric': 0.18546511627906978, 'fraction_numerical': 0.002131782945736434, 'mean_word_length': 4.3867432150313155, 'pattern_counts': {'":': 0, '<': 177, '<?xml version=': 2, '>': 177, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 18, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1208768', 'n_tokens_mistral': 3617, 'n_tokens_neox': 3188, 'n_words': 558}