<commit_before><?xml version="1.0" encoding="UTF-8"?>

<!-- Build file for extensions. -->
<project basedir="." default="all" name="extensions">
    <import file="../config/config.xml"/>


    <!-- Initialization for the extensions builder -->
    <target name="init">
		<property name="extensions.root" value="${xal.home}/extensions" />
		<property name="build.intermediates.extensions" value="${build.intermediates.extensions}" />
		<property name="extension.compiler" value="${build.intermediates.extensions}/compiler.xml" />
		<property name="extension.compile.root" value="${build.intermediates.extensions}/compile" />
    </target>


    <!-- Generate the build file. -->
    <target name="all" depends="init, compile, jar" />


	<!-- Compile the extensions -->
	<target name="compile" depends="generate-compiler">
		<mkdir dir="${extension.compile.root}" />

		<!-- Compile every extension -->
		<subant target="compile" antfile="compiler.xml">
			<fileset dir="${build.intermediates.extensions}" includes="compiler.xml"/>
		</subant>

		<!-- Merge the pure extensions' resources into the compile directory -->
		<copy todir="${extension.compile.root}" quiet="true" failonerror="false" includeEmptyDirs="false">
			<regexpmapper handledirsep="true" from="^[^/]+/resources/(.*)$$" to="\1" />
			<fileset dir="${extensions.root}" includes="*/resources/**/*" />
		</copy>

		<!-- Merge the services extensions' resources into the compile directory -->
		<copy todir="${extension.compile.root}" quiet="true" failonerror="false" includeEmptyDirs="false">
			<regexpmapper handledirsep="true" from="^[^/]+/extension/resources/(.*)$$" to="\1" />
			<fileset dir="${services.root}" includes="*/extension/resources/**/*" />
		</copy>
	</target>


	<!-- Archive the extensions -->
    <target  name="jar" depends="init, compile">
        <mkdir dir="${extension.compile.root}" />
        <mkdir dir="${build.intermediates.shared}" />
        <jar compress="true" jarfile="${build.intermediates.shared}/xal-extensions.jar" index="true" basedir="${extension.compile.root}" includes="xal/**/*">
			<zipgroupfileset dir="${build.intermediates.extensions}">
				<patternset>
					<include name="lib.jar" />
				</patternset>
			</zipgroupfileset>
		</jar>
    </target>


	<!-- Clean the extensions -->
	<target name="clean" depends="generate-compiler">
        <delete dir="${build.intermediates.extensions}" quiet="true" />
	</target>


	<!-- Generate the build file for compiling extensions. -->
	<target name="generate-compiler" depends="init">
		<touch file="${extension.compiler}" mkdirs="true" />

		<echo file="${extension.compiler}">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;project basedir="." default="compile" name="xal.extension-compiler"&gt;
	&lt;target name="compile"&gt;
		&lt;mkdir dir="${extension.compile.root}" /&gt;
		&lt;javac debug="true" source="${build.compile.java.source}" target="${build.compile.java.target}" includeAntRuntime="no" deprecation="true" destdir="${extension.compile.root}" includes="**" sourcepath=""&gt;

			&lt;classpath&gt;
				&lt;pathelement location="${build.intermediates.shared}/xal-core.jar" /&gt;
			&lt;/classpath&gt;
		</echo>

		<!-- loop over every extension directory and add the source code -->
		<subant genericantfile="${ant.file.extensions}" target="append-extension">
			<dirset dir="${extensions.root}" includes="*" />
			<dirset dir="${services.root}" includes="*/extension" />
		</subant>

		<echo file="${extension.compiler}" append="true">
		&lt;/javac&gt;
	&lt;/target&gt;
&lt;/project&gt;&#10;</echo>
	</target>


    <!-- Append the extension to the common extensions build file. -->
    <target name="append-extension" depends="init">
		<echo file="${extension.compiler}" append="true">&lt;src path="${basedir}/src" /&gt;
		</echo>
		<echo message="Appending extension: ${basedir}" />
    </target>

	
	<!-- provide guidance on the various targets -->
    <target name="help">
		<echo message="Build the XAL Extensions" />
		<echo message="Usage: ant [ant options] target1 [target2 | target3 | ... ]" />
		<echo message="" />
		<echo message="  where target(s) can be:" />
		<echo message="    help ....................... Print this message." />
    </target>

</project><commit_msg>-n  Add support for libraries in extensions.<commit_after><?xml version="1.0" encoding="UTF-8"?>

<!-- Build file for extensions. -->
<project basedir="." default="all" name="extensions">
    <import file="../config/config.xml"/>


    <!-- Initialization for the extensions builder -->
    <target name="init">
		<property name="extensions.root" value="${xal.home}/extensions" />
		<property name="build.intermediates.extensions" value="${build.intermediates.extensions}" />
		<property name="extension.compiler" value="${build.intermediates.extensions}/compiler.xml" />
		<property name="extension.compile.root" value="${build.intermediates.extensions}/compile" />

		<!-- fileset for pure extensions' libraries -->
		<fileset id="fileset.extensions.lib" dir="${extensions.root}">
			<include name="*/lib/*.jar" />
		</fileset>

		<!-- sets the property if there are any pure extensions libraries to process -->
		<pathconvert refid="fileset.extensions.lib" property="extensions.have.libs" setonempty="false" />

		<!-- fileset for services extensions' libraries -->
		<fileset id="fileset.services.extensions.lib" dir="${services.root}">
			<include name="*/extension/lib/*.jar" />
		</fileset>

		<!-- sets the property if there are any services extensions libraries to process -->
		<pathconvert refid="fileset.services.extensions.lib" property="extensions.have.libs" setonempty="false" />
    </target>


    <!-- Generate the build file. -->
    <target name="all" depends="init, compile, jar" />


	<!-- Compile the extensions -->
	<target name="compile" depends="generate-compiler, jar-lib">
		<mkdir dir="${extension.compile.root}" />

		<!-- Compile every extension -->
		<subant target="compile" antfile="compiler.xml">
			<fileset dir="${build.intermediates.extensions}" includes="compiler.xml"/>
		</subant>

		<!-- Merge the pure extensions' resources into the compile directory -->
		<copy todir="${extension.compile.root}" quiet="true" failonerror="false" includeEmptyDirs="false">
			<regexpmapper handledirsep="true" from="^[^/]+/resources/(.*)$$" to="\1" />
			<fileset dir="${extensions.root}" includes="*/resources/**/*" />
		</copy>

		<!-- Merge the services extensions' resources into the compile directory -->
		<copy todir="${extension.compile.root}" quiet="true" failonerror="false" includeEmptyDirs="false">
			<regexpmapper handledirsep="true" from="^[^/]+/extension/resources/(.*)$$" to="\1" />
			<fileset dir="${services.root}" includes="*/extension/resources/**/*" />
		</copy>
	</target>


	<!-- Archive the extensions -->
    <target  name="jar" depends="init, compile">
        <mkdir dir="${extension.compile.root}" />
        <mkdir dir="${build.intermediates.shared}" />
        <jar compress="true" jarfile="${build.intermediates.shared}/xal-extensions.jar" index="true" basedir="${extension.compile.root}" includes="xal/**/*">
			<zipgroupfileset dir="${build.intermediates.extensions}">
				<patternset>
					<include name="lib.jar" />
				</patternset>
			</zipgroupfileset>
		</jar>
    </target>


	<!-- Join the third party jars into a common external jar file -->
    <target name="jar-lib" depends="init" if="extensions.have.libs">
        <mkdir dir="${build.intermediates.extensions}" />
        <jar compress="true" jarfile="${build.intermediates.extensions}/lib.jar" duplicate="preserve">
			<!-- include jars from each extension -->
			<zipgroupfileset dir="${extensions.root}">
				<include name="*/lib/*.jar" />
			</zipgroupfileset>

			<!-- include jars from each service extension -->
			<zipgroupfileset dir="${services.root}">
				<include name="*/extension/lib/*.jar" />
			</zipgroupfileset>
        </jar>
    </target>


	<!-- Clean the extensions -->
	<target name="clean" depends="generate-compiler">
        <delete dir="${build.intermediates.extensions}" quiet="true" />
	</target>


	<!-- Generate the build file for compiling extensions. -->
	<target name="generate-compiler" depends="init">
		<touch file="${extension.compiler}" mkdirs="true" />

		<echo file="${extension.compiler}">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;project basedir="." default="compile" name="xal.extension-compiler"&gt;
	&lt;target name="compile"&gt;
		&lt;mkdir dir="${extension.compile.root}" /&gt;
		&lt;javac debug="true" source="${build.compile.java.source}" target="${build.compile.java.target}" includeAntRuntime="no" deprecation="true" destdir="${extension.compile.root}" includes="**" sourcepath=""&gt;

			&lt;classpath&gt;
				&lt;pathelement location="${build.intermediates.shared}/xal-core.jar" /&gt;
				&lt;pathelement location="${build.intermediates.extensions}/lib.jar" /&gt;
			&lt;/classpath&gt;
		</echo>

		<!-- loop over every extension directory and add the source code -->
		<subant genericantfile="${ant.file.extensions}" target="append-extension">
			<dirset dir="${extensions.root}" includes="*" />
			<dirset dir="${services.root}" includes="*/extension" />
		</subant>
		<echo file="${extension.compiler}" append="true">
		&lt;/javac&gt;
	&lt;/target&gt;
&lt;/project&gt;&#10;</echo>
	</target>


    <!-- Append the extension to the common extensions build file. -->
    <target name="append-extension" depends="init">
		<echo file="${extension.compiler}" append="true">&lt;src path="${basedir}/src" /&gt;
		</echo>
		<echo message="Appending extension: ${basedir}" />
    </target>

	
	<!-- provide guidance on the various targets -->
    <target name="help">
		<echo message="Build the XAL Extensions" />
		<echo message="Usage: ant [ant options] target1 [target2 | target3 | ... ]" />
		<echo message="" />
		<echo message="  where target(s) can be:" />
		<echo message="    help ....................... Print this message." />
    </target>

</project>
{'fraction_non_alphanumeric': 0.20514102820564112, 'fraction_numerical': 0.002600520104020804, 'mean_word_length': 4.180829015544042, 'pattern_counts': {'":': 0, '<': 179, '<?xml version=': 4, '>': 179, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 12}, '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': '3265166', 'n_tokens_mistral': 3177, 'n_tokens_neox': 2914, 'n_words': 645}