<commit_before><?xml version="1.0"?>
<project name="org.strategoxt.StrategoXT" default="all">


	<property name="sdf2bundle" value="${user.home}/.nix-profile" />
	<property name="nativepath" value="${sdf2bundle}/bin/" />

	<property name="version" value="0" />
	<property name="revision" value="0" />

	<!-- Import Ant contrib -->
	<taskdef resource="net/sf/antcontrib/antlib.xml" />

	<!-- Import Stratego/XT Ant contributions -->
	<available property="contrib.available" resource="strategoxt-antlib.xml" />
	<typedef resource="strategoxt-antlib.xml" />

	<!-- Import the properties file, containing e.g. the version number -->
	<property file="build.properties" />

	<!-- Location of the syntax folder -->
	<property name="syntax-dir" value="syntax" />

	<!-- Location of libraries folder -->
	<property name="libraries-dir" value="stratego-libraries" />

	<!-- Destination of files -->
	<property name="lib" location="lib/" />
	<property name="bin" location="bin/" />
	<property name="test-gen" location="generated/" />

	<!-- For CI builds -->
	<!--<property name="java-front" location="syntax/java-front" />-->
	<property name="install-prefix" location="dist" />
	<property name="install-location" location="${install-prefix}/share/strategoxt" />
	<property name="jar.name" value="strategoxt.jar" />

	<!-- Import syntax builder -->
	<include file="${syntax-dir}/build.xml" as="syntax" />

	<!-- Import the libraries builder -->
	<include file="${libraries-dir}/build.xml" as="libraries" />

	<target name="test" depends="create-dirs">
		<for param="deffile">
			<path>
				<fileset dir="${libraries-dir}" includes="sglr/tests/*.def" excludes="sglr/tests/List.def" />
			</path>
			<sequential>
				<basename file="@{deffile}" property="@{deffile}.basename" suffix=".def" />
				<dirname file="@{deffile}" property="@{deffile}.dirname" />
				<property name="@{deffile}.rel.in" value="@{deffile}" relative="yes" />
				<property name="@{deffile}.rel.out" value="${test-gen}/${@{deffile}.basename}" relative="yes" />

				<sdf2rtg input="${@{deffile}.rel.in}" output="${@{deffile}.rel.out}.rtg" main="Main" />
				<rtg2sig input="${@{deffile}.rel.out}.rtg" output="${@{deffile}.rel.out}.str" main="Main" />
				<sdf2table input="@{deffile}" output="${test-gen}/${@{deffile}.basename}.tbl" main="Main" />
			</sequential>
		</for>

		<for param="strfile">
			<path>
				<fileset dir="${libraries-dir}" includes="*/tests/*.str" />
				<fileset dir="${syntax-dir}/java-front" includes="test/*.str" />
			</path>
			<sequential>
				<trycatch>
					<try>
						<strj-test input="@{strfile}" synaterm="${syntax-dir}/${syn.aterm}" synbox="${syntax-dir}/${syn.box}" generated="${test-gen}" compiler="${install-location}/${jar.name}" />
					</try>
					<catch>
						<echo message="FAILURE: Test @{strfile} failed" />
					</catch>
				</trycatch>
			</sequential>
		</for>
	</target>

	<target name="all" depends="
		ant-contrib-local,							
		create-dirs,
		syntax,
		generate-java,
		compile-java,
		jar,
		install" />

	<target name="create-dirs">
		<mkdir dir="${lib}" />
		<mkdir dir="${bin}" />
		<mkdir dir="${test-gen}" />
		<mkdir dir="${install-location}" />
	</target>

	<target name="install" depends="jar">
		<copy file="${jar.name}" tofile="${install-location}/${jar.name}" overwrite="true" verbose="true" />
		<mkdir dir="${install-prefix}/bin" />
		<copy todir="${install-prefix}/bin" verbose="true">
			<fileset dir="wrapper-scripts/unix/" includes="*" />
		</copy>
		<chmod dir="${install-prefix}/bin" includes="*" perm="a+rx" />
		<echo file="${install-prefix}/nix-support/hydra-build-products" append="true">nix-build out ${install-location}</echo>
		<echo file="${install-prefix}/nix-support/hydra-build-products" append="true">file jar ${install-location}/${jar.name}</echo>
	</target>

	<target name="clean">
		<delete dir="${lib}" />
		<delete dir="${bin}" />
		<delete dir="${test-gen}" />
		<delete dir="${install-prefix}" />
		<delete file="${jar.name}" />
		<!-- Clean the syntax -->
		<antcall target="syntax.clean">
			<param name="basedir" value="${syntax-dir}" />
		</antcall>
		<antcall target="libraries.clean">
			<param name="basedir" value="${syntax-dir}" />
		</antcall>
	</target>

	<target name="syntax">
		<!-- Build the syntax -->
		<antcall target="syntax.all">
			<param name="basedir" value="${syntax-dir}" />
		</antcall>
	</target>

	<target name="generate-java" depends="syntax">
		<!-- Compile libraries to Java -->
		<antcall target="libraries.part-1">
			<param name="basedir" value="${libraries-dir}" />
		</antcall>
		<antcall target="syntax.java-front-java">
			<param name="basedir" value="${syntax-dir}" />
		</antcall>
		<antcall target="libraries.part-2">
			<param name="basedir" value="${libraries-dir}" />
		</antcall>
	</target>

	<target name="compile-java" depends="generate-java">
		<javac srcdir="${lib}" destdir="${bin}" classpath="${libraries-dir}/java-backend/java/spoofax-libs.jar:${libraries-dir}/java-backend/java/runtime:${bin}" source="1.5" target="1.5" nowarn="on" debug="true" debuglevel="source" />
		<javac srcdir="${libraries-dir}/java-backend/java/runtime" destdir="${bin}" classpath="${libraries-dir}/java-backend/java/spoofax-libs.jar:${libraries-dir}/java-backend/java/runtime:${bin}" source="1.5" target="1.5" nowarn="on" debug="true" debuglevel="source" />
	</target>

	<target name="jar">
		<jar destfile="${jar.name}" manifest="${libraries-dir}/java-backend/java/META-INF/MANIFEST.MF" update="true">
			<fileset dir="ant-contrib" includes="**/*.xml" />
			<fileset dir="." includes="COPYING" />
			<fileset dir="${bin}" includes="**/*.class" />
			<fileset dir="${lib}" includes="**/*.rtree" />
			<fileset dir="${lib}" includes="**/*.af" />
			<fileset dir="${lib}" includes="**/*.tbl" />
			<zipfileset includes="**/*" src="${libraries-dir}/java-backend/java/spoofax-libs.jar" />
		</jar>
	</target>

	<target name="ant-contrib-local" unless="${contrib.available}">
		<echo>Import local definition of StrategoXT-antlib</echo>
		<typedef file="ant-contrib/strategoxt-antlib.xml" />
	</target>

</project><commit_msg>Don't update the jar file<commit_after><?xml version="1.0"?>
<project name="org.strategoxt.StrategoXT" default="all">


	<property name="sdf2bundle" value="${user.home}/.nix-profile" />
	<property name="nativepath" value="${sdf2bundle}/bin/" />

	<property name="version" value="0" />
	<property name="revision" value="0" />

	<!-- Import Ant contrib -->
	<taskdef resource="net/sf/antcontrib/antlib.xml" />

	<!-- Import Stratego/XT Ant contributions -->
	<available property="contrib.available" resource="strategoxt-antlib.xml" />
	<typedef resource="strategoxt-antlib.xml" />

	<!-- Import the properties file, containing e.g. the version number -->
	<property file="build.properties" />

	<!-- Location of the syntax folder -->
	<property name="syntax-dir" value="syntax" />

	<!-- Location of libraries folder -->
	<property name="libraries-dir" value="stratego-libraries" />

	<!-- Destination of files -->
	<property name="lib" location="lib/" />
	<property name="bin" location="bin/" />
	<property name="test-gen" location="generated/" />

	<!-- For CI builds -->
	<!--<property name="java-front" location="syntax/java-front" />-->
	<property name="install-prefix" location="dist" />
	<property name="install-location" location="${install-prefix}/share/strategoxt" />
	<property name="jar.name" value="strategoxt.jar" />

	<!-- Import syntax builder -->
	<include file="${syntax-dir}/build.xml" as="syntax" />

	<!-- Import the libraries builder -->
	<include file="${libraries-dir}/build.xml" as="libraries" />

	<target name="test" depends="create-dirs">
		<for param="deffile">
			<path>
				<fileset dir="${libraries-dir}" includes="sglr/tests/*.def" excludes="sglr/tests/List.def" />
			</path>
			<sequential>
				<basename file="@{deffile}" property="@{deffile}.basename" suffix=".def" />
				<dirname file="@{deffile}" property="@{deffile}.dirname" />
				<property name="@{deffile}.rel.in" value="@{deffile}" relative="yes" />
				<property name="@{deffile}.rel.out" value="${test-gen}/${@{deffile}.basename}" relative="yes" />

				<sdf2rtg input="${@{deffile}.rel.in}" output="${@{deffile}.rel.out}.rtg" main="Main" />
				<rtg2sig input="${@{deffile}.rel.out}.rtg" output="${@{deffile}.rel.out}.str" main="Main" />
				<sdf2table input="@{deffile}" output="${test-gen}/${@{deffile}.basename}.tbl" main="Main" />
			</sequential>
		</for>

		<for param="strfile">
			<path>
				<fileset dir="${libraries-dir}" includes="*/tests/*.str" />
				<fileset dir="${syntax-dir}/java-front" includes="test/*.str" />
			</path>
			<sequential>
				<trycatch>
					<try>
						<strj-test input="@{strfile}" synaterm="${syntax-dir}/${syn.aterm}" synbox="${syntax-dir}/${syn.box}" generated="${test-gen}" compiler="${install-location}/${jar.name}" />
					</try>
					<catch>
						<echo message="FAILURE: Test @{strfile} failed" />
					</catch>
				</trycatch>
			</sequential>
		</for>
	</target>

	<target name="all" depends="
		ant-contrib-local,							
		create-dirs,
		syntax,
		generate-java,
		compile-java,
		jar,
		install" />

	<target name="create-dirs">
		<mkdir dir="${lib}" />
		<mkdir dir="${bin}" />
		<mkdir dir="${test-gen}" />
		<mkdir dir="${install-location}" />
	</target>

	<target name="install" depends="jar">
		<copy file="${jar.name}" tofile="${install-location}/${jar.name}" overwrite="true" verbose="true" />
		<mkdir dir="${install-prefix}/bin" />
		<copy todir="${install-prefix}/bin" verbose="true">
			<fileset dir="wrapper-scripts/unix/" includes="*" />
		</copy>
		<chmod dir="${install-prefix}/bin" includes="*" perm="a+rx" />
		<echo file="${install-prefix}/nix-support/hydra-build-products" append="true">nix-build out ${install-location}</echo>
		<echo file="${install-prefix}/nix-support/hydra-build-products" append="true">file jar ${install-location}/${jar.name}</echo>
	</target>

	<target name="clean">
		<delete dir="${lib}" />
		<delete dir="${bin}" />
		<delete dir="${test-gen}" />
		<delete dir="${install-prefix}" />
		<delete file="${jar.name}" />
		<!-- Clean the syntax -->
		<antcall target="syntax.clean">
			<param name="basedir" value="${syntax-dir}" />
		</antcall>
		<antcall target="libraries.clean">
			<param name="basedir" value="${syntax-dir}" />
		</antcall>
	</target>

	<target name="syntax">
		<!-- Build the syntax -->
		<antcall target="syntax.all">
			<param name="basedir" value="${syntax-dir}" />
		</antcall>
	</target>

	<target name="generate-java" depends="syntax">
		<!-- Compile libraries to Java -->
		<antcall target="libraries.part-1">
			<param name="basedir" value="${libraries-dir}" />
		</antcall>
		<antcall target="syntax.java-front-java">
			<param name="basedir" value="${syntax-dir}" />
		</antcall>
		<antcall target="libraries.part-2">
			<param name="basedir" value="${libraries-dir}" />
		</antcall>
	</target>

	<target name="compile-java" depends="generate-java">
		<javac srcdir="${lib}" destdir="${bin}" classpath="${libraries-dir}/java-backend/java/spoofax-libs.jar:${libraries-dir}/java-backend/java/runtime:${bin}" source="1.5" target="1.5" nowarn="on" debug="true" debuglevel="source" />
		<javac srcdir="${libraries-dir}/java-backend/java/runtime" destdir="${bin}" classpath="${libraries-dir}/java-backend/java/spoofax-libs.jar:${libraries-dir}/java-backend/java/runtime:${bin}" source="1.5" target="1.5" nowarn="on" debug="true" debuglevel="source" />
	</target>

	<target name="jar">
		<jar destfile="${jar.name}" manifest="${libraries-dir}/java-backend/java/META-INF/MANIFEST.MF" update="false">
			<fileset dir="ant-contrib" includes="**/*.xml" />
			<fileset dir="." includes="COPYING" />
			<fileset dir="${bin}" includes="**/*.class" />
			<fileset dir="${lib}" includes="**/*.rtree" />
			<fileset dir="${lib}" includes="**/*.af" />
			<fileset dir="${lib}" includes="**/*.tbl" />
			<zipfileset includes="**/*" src="${libraries-dir}/java-backend/java/spoofax-libs.jar" />
		</jar>
	</target>

	<target name="ant-contrib-local" unless="${contrib.available}">
		<echo>Import local definition of StrategoXT-antlib</echo>
		<typedef file="ant-contrib/strategoxt-antlib.xml" />
	</target>

</project>
{'fraction_non_alphanumeric': 0.23627138063671332, 'fraction_numerical': 0.0031099107946640477, 'mean_word_length': 4.409473218238158, 'pattern_counts': {'":': 0, '<': 273, '<?xml version=': 2, '>': 273, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 16}, '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': '2090236', 'n_tokens_mistral': 4570, 'n_tokens_neox': 4108, 'n_words': 705}