<commit_before><project name="spoofax-interpreter-library-xml" default="bundle-ctree">

	<property name="build.dir" value="target" />
	<property name="strategoxt.dir" value="${user.home}/.nix-profile" />

	<property file="version.properties" />

	
	<target
		name="compile-str"
		depends="compile-lib-to-ctree, compile-tests-to-ctree"
		description="--> compile Stratego code" />
		
	<property name="ctree-lib.target" value="${build.dir}/resources/share/lib-xml.ctree" />

	<uptodate property="compile-lib-to-ctree.notRequired" targetfile="${ctree-lib.target}" >
	    <srcfiles dir= "src/main/stratego/spoofax/bindings" includes="**/*.str"/>
	</uptodate>

	<target name="compile-lib-to-ctree" unless="${compile-lib-to-ctree.notRequired}" description="--> compile Stratego code">
		<mkdir dir="${build.dir}/resources/share" />
		<exec executable="${strategoxt.dir}/bin/strc" failonerror="true">
			<arg value="-i" />
			<arg value="src/main/stratego/spoofax/bindings/xml/sax.str" />
			<arg value="-I" />
			<arg value="src/main/stratego" />
			<arg value="-F" />
			<arg value="-c" />
			<arg value="--library" />
			<arg value="-o" />
			<arg value="${ctree-lib.target}" />
		</exec>
	</target>

	<property name="ctree-tests.target" value="${build.dir}/resources/share/sax-tests.ctree" />

	<uptodate property="compile-tests-to-ctree.notRequired" targetfile="${ctree-tests.target}">
	    <srcfiles dir="src/test/stratego" includes="**/*.str" />
	</uptodate>
	
	<target name="compile-tests-to-ctree" unless="${compile-tests-to-ctree.notRequired}">
		<exec executable="${strategoxt.dir}/bin/strc" failonerror="true">
			<arg value="-i" />
			<arg value="src/test/stratego/spoofax/bindings/xml/sax-tests.str" />
			<arg value="-I" />
			<arg value="src/main/stratego" />
			<arg value="-I" />
			<arg value="src/test/stratego" />
			<arg value="-F" />
			<arg value="-o" />
			<arg value="${ctree-tests.target}" />
		</exec>
		<copy todir="${build.dir}/resources/share" file="${strategoxt.dir}/share/stratego-lib/libstratego-lib.ctree" />
	</target>

	<target name="bundle-ctree" depends="compile-str">
		<copy todir="share/" file="${ctree-lib.target}" />
	</target>
	
</project>
<commit_msg>xml library: add ant target 'check' to run tests<commit_after><project name="spoofax-interpreter-library-xml" default="bundle-ctree">

	<property name="build.dir" value="target" />
	<property name="strategoxt.dir" value="${user.home}/.nix-profile" />

	<property file="version.properties" />

	
	<target
		name="compile-str"
		depends="compile-lib-to-ctree, compile-tests-to-ctree"
		description="--> compile Stratego code" />
		
	<property name="ctree-lib.target" value="${build.dir}/resources/share/lib-xml.ctree" />

	<uptodate property="compile-lib-to-ctree.notRequired" targetfile="${ctree-lib.target}" >
	    <srcfiles dir= "src/main/stratego/spoofax/bindings" includes="**/*.str"/>
	</uptodate>

	<target name="compile-lib-to-ctree" unless="${compile-lib-to-ctree.notRequired}" description="--> compile Stratego code">
		<mkdir dir="${build.dir}/resources/share" />
		<exec executable="${strategoxt.dir}/bin/strc" failonerror="true">
			<arg value="-i" />
			<arg value="src/main/stratego/spoofax/bindings/xml/sax.str" />
			<arg value="-I" />
			<arg value="src/main/stratego" />
			<arg value="-F" />
			<arg value="-c" />
			<arg value="--library" />
			<arg value="-o" />
			<arg value="${ctree-lib.target}" />
		</exec>
	</target>

	<property name="ctree-tests.target" value="${build.dir}/resources/share/sax-tests.ctree" />

	<uptodate property="compile-tests-to-ctree.notRequired" targetfile="${ctree-tests.target}">
	    <srcfiles dir="src/test/stratego" includes="**/*.str" />
	</uptodate>
	
	<target name="compile-tests-to-ctree" unless="${compile-tests-to-ctree.notRequired}">
		<exec executable="${strategoxt.dir}/bin/strc" failonerror="true">
			<arg value="-i" />
			<arg value="src/test/stratego/spoofax/bindings/xml/sax-tests.str" />
			<arg value="-I" />
			<arg value="src/main/stratego" />
			<arg value="-I" />
			<arg value="src/test/stratego" />
			<arg value="-F" />
			<arg value="-o" />
			<arg value="${ctree-tests.target}" />
		</exec>
		<copy todir="${build.dir}/resources/share" file="${strategoxt.dir}/share/stratego-lib/libstratego-lib.ctree" />
	</target>

	<target name="bundle-ctree" depends="compile-str">
		<copy todir="share/" file="${ctree-lib.target}" />
	</target>
	
	<target name="check" depends="compile-str">
		<junit printsummary="yes" showoutput="yes">
			<!-- FIXME: ideally the classpath is read from MANIFEST.MF -->
			<classpath>
				<pathelement path="../org.spoofax.interpreter.core/bin" />
				<pathelement path="../org.spoofax.terms/bin" />
				<pathelement path="bin" />
			</classpath>
			<test name="org.spoofax.interpreter.library.xml.test.XMLLibraryTest" />
		</junit>
	</target>

</project>

{'fraction_non_alphanumeric': 0.218073034866928, 'fraction_numerical': 0.0, 'mean_word_length': 4.060542797494781, 'pattern_counts': {'":': 0, '<': 104, '<?xml version=': 0, '>': 108, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 10}, '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': '3428007', 'n_tokens_mistral': 1914, 'n_tokens_neox': 1749, 'n_words': 252}