<commit_before><?xml version="1.0"?>
<!-- ================================================================= -->
<!-- caGrid Master build file                                          -->
<!-- ================================================================= -->
<project name="caGrid-Incubation-Master" basedir="." default="all" xmlns:ivy="antlib:org.apache.ivy.ant">
	<dirname property="caGrid-Incubation-Master.basedir" file="${ant.file.caGrid-Incubation-Master}" />

	<!-- Give user the chance to override properties -->
	<property environment="env" />
	<property file="build.properties" />
	<!-- Load in project listings -->
	<property file="${caGrid-Incubation-Master.basedir}/project.properties" />

	<import file="antfiles/ivy/ivy-def-1.3.xml" />

	<!-- Layout info -->
	<property name="projects.dir" location="${caGrid-Incubation-Master.basedir}/projects" />
	<property name="test.dir" location="${caGrid-Incubation-Master.basedir}/test" />
	<property name="build.dir" location="${caGrid-Incubation-Master.basedir}/build" />
	<property name="antfiles.dir" location="${caGrid-Incubation-Master.basedir}/antfiles" />

	<property name="antfiles.lib.dir" location="${antfiles.dir}/lib" />
	<property name="test.lib.dir" location="${test.dir}/lib" />

	<condition property="isJDK1.5" value="true">
		<or>
			<equals arg1="${ant.java.version}" arg2="1.5" />
			<equals arg1="${ant.java.version}" arg2="1.6" />
		</or>
	</condition>
	<!-- Require Java 1.5 for now -->
	<fail message="JDK 1.5 is currently required to build this project!" unless="isJDK1.5" />

	<!-- IMPORT THE UTILITIES TARGETS -->
	<import file="${antfiles.dir}/target-grid.xml" />


	<!-- =============================================================== -->
	<!-- Bootstrap the build by setting up the structure                 -->
	<!-- =============================================================== -->
	<target name="prepare" depends="define-ant-tasks,build-projects-list">
		<tstamp />
	</target>


	<target name="define-ant-tasks" depends="init-ivy" unless="defined.anttasks">
		<taskdef resource="net/sf/antcontrib/antlib.xml" loaderref="artifact">
			<classpath>
				<fileset dir="${ant.library.dir}">
					<include name="ant.jar" />
				</fileset>
				<fileset dir="${antfiles.lib.dir}">
					<include name="ant-contrib*.jar" />
				</fileset>
			</classpath>
		</taskdef>
		<property name="defined.anttasks" value="true" />
	</target>

	<target name="build-projects-list">
		<ivy:buildlist reference="ivy.projects.list" ivyfilepath="ivy.xml" skipbuildwithoutivy="true">
			<fileset dir="${projects.dir}">
				<include name="*/dependencies-build.xml" />
			</fileset>
		</ivy:buildlist>
	</target>

	<target name="input-project-name">
		<input addproperty="single.project.name" message="Please enter the project name:" />
	</target>
	<target name="check-project-name">
		<fail unless="single.project.name" message="The expected property, 'single.project.name' was not defined!" />
		<condition property="single.project.name.invalid">
				<equals arg1="${single.project.name}" arg2="" trim="true" />
					<not>
						<available file="${projects.dir}/${single.project.name}" type="dir" />
					</not>
		</condition>
		<fail if="single.project.name.invalid" message="The expected property, 'single.project.name' was not defined as a valid project name!  The value was: [${single.project.name}]" />
	</target>


	<target name="build-project" depends="prepare,input-project-name,check-project-name">
		<echo message="Building ${single.project.name}, and all its dependencies (as necessary)." />

		<ivy:buildlist reference="single.ivy.project.list" root="${single.project.name}" skipbuildwithoutivy="true" ivyfilepath="ivy.xml">
			<fileset dir="${projects.dir}">
				<include name="*/dependencies-build.xml" />
			</fileset>
		</ivy:buildlist>

		<echo message="Computed build order is: ${ivy.sorted.modules}" />


		<subant target="publish" buildpathref="single.ivy.project.list">
			<property name="target.grid" value="${target.grid}" />
		</subant>

	</target>

	<target name="build-depending-on-project" depends="prepare,input-project-name,check-project-name">
		<echo message="Building all projects depending on ${single.project.name}.  Note, the depending projects' dependencies are not built, this should just be used to propagate changes to the given project for integration." />

		<ivy:buildlist reference="depending.on.single.ivy.project.list" leaf="${single.project.name}" skipbuildwithoutivy="true" ivyfilepath="ivy.xml">
			<fileset dir="${projects.dir}">
				<include name="*/dependencies-build.xml" />
			</fileset>
		</ivy:buildlist>


		<echo message="Computed build order is: ${ivy.sorted.modules}" />


		<subant target="publish" buildpathref="depending.on.single.ivy.project.list">
			<property name="target.grid" value="${target.grid}" />
		</subant>

	</target>

	<target name="set-project-versions" depends="prepare">
		<fail unless="project.version" message="You must provide a a value for the property [project.version]!" />
		<echo message="Setting all project versions to version ${project.version}" />

		<ivy:buildlist reference="ivy.project.properties.list" skipbuildwithoutivy="true" ivyfilepath="ivy.xml">
			<fileset dir="${projects.dir}">
				<include name="*/project.properties" />
			</fileset>
		</ivy:buildlist>

		<for parallel="true" param="project.properties.file" trim="true">
			<path refid="ivy.project.properties.list" />
			<sequential>
				<propertyfile file="@{project.properties.file}">
					<entry key="project.version" value="${project.version}" />
				</propertyfile>
			</sequential>
		</for>
	</target>


	<target name="all" depends="prepare,clean" description="compile, jar and publish all projects in the right order">
		<for parallel="false" param="project.buildfile" trim="true">
			<path refid="ivy.projects.list" />
			<sequential>
				<dirname file="@{project.buildfile}" property="@{project.buildfile}.dir" />
				<ant inheritAll="false" inheritrefs="false" dir="${@{project.buildfile}.dir}" antfile="@{project.buildfile}" target="publish">
					<property name="target.grid" value="${target.grid}" />
				</ant>
			</sequential>
		</for>
	</target>


	<target name="clean" depends="prepare" description="Delete repository, ivy cache, and clean all projects's generated and resolved artificats.">
		<delete dir="${integration.repository.dir}" />
		<ivy:cleancache />

		<for parallel="true" param="project.buildfile" trim="true" threadcount="10">
			<path refid="ivy.projects.list" />
			<sequential>
				<dirname file="@{project.buildfile}" property="@{project.buildfile}.dir" />
				<ant inheritAll="false" dir="${@{project.buildfile}.dir}" antfile="@{project.buildfile}" target="clean-dependencies" />
			</sequential>
		</for>
	</target>


</project><commit_msg>added 'testBuild' task to automate the temporary EXIST Db installation and running 'all' task<commit_after><?xml version="1.0"?>
<!-- ================================================================= -->
<!-- caGrid Master build file                                          -->
<!-- ================================================================= -->
<project name="caGrid-Incubation-Master" basedir="." default="all" xmlns:ivy="antlib:org.apache.ivy.ant">
	<dirname property="caGrid-Incubation-Master.basedir" file="${ant.file.caGrid-Incubation-Master}" />

	<!-- Give user the chance to override properties -->
	<property environment="env" />
	<property file="build.properties" />
	<!-- Load in project listings -->
	<property file="${caGrid-Incubation-Master.basedir}/project.properties" />

	<import file="antfiles/ivy/ivy-def-1.3.xml" />

	<!-- Layout info -->
	<property name="projects.dir" location="${caGrid-Incubation-Master.basedir}/projects" />
	<property name="test.dir" location="${caGrid-Incubation-Master.basedir}/test" />
	<property name="build.dir" location="${caGrid-Incubation-Master.basedir}/build" />
	<property name="antfiles.dir" location="${caGrid-Incubation-Master.basedir}/antfiles" />

	<property name="antfiles.lib.dir" location="${antfiles.dir}/lib" />
	<property name="test.lib.dir" location="${test.dir}/lib" />

	<condition property="isJDK1.5" value="true">
		<or>
			<equals arg1="${ant.java.version}" arg2="1.5" />
			<equals arg1="${ant.java.version}" arg2="1.6" />
		</or>
	</condition>
	<!-- Require Java 1.5 for now -->
	<fail message="JDK 1.5 is currently required to build this project!" unless="isJDK1.5" />

	<!-- IMPORT THE UTILITIES TARGETS -->
	<import file="${antfiles.dir}/target-grid.xml" />


	<!-- =============================================================== -->
	<!-- Bootstrap the build by setting up the structure                 -->
	<!-- =============================================================== -->
	<target name="prepare" depends="define-ant-tasks,build-projects-list">
		<tstamp />
	</target>


	<target name="define-ant-tasks" depends="init-ivy" unless="defined.anttasks">
		<taskdef resource="net/sf/antcontrib/antlib.xml" loaderref="artifact">
			<classpath>
				<fileset dir="${ant.library.dir}">
					<include name="ant.jar" />
				</fileset>
				<fileset dir="${antfiles.lib.dir}">
					<include name="ant-contrib*.jar" />
				</fileset>
			</classpath>
		</taskdef>
		<property name="defined.anttasks" value="true" />
	</target>

	<target name="build-projects-list">
		<ivy:buildlist reference="ivy.projects.list" ivyfilepath="ivy.xml" skipbuildwithoutivy="true">
			<fileset dir="${projects.dir}">
				<include name="*/dependencies-build.xml" />
			</fileset>
		</ivy:buildlist>
	</target>

	<target name="input-project-name">
		<input addproperty="single.project.name" message="Please enter the project name:" />
	</target>
	<target name="check-project-name">
		<fail unless="single.project.name" message="The expected property, 'single.project.name' was not defined!" />
		<condition property="single.project.name.invalid">
				<equals arg1="${single.project.name}" arg2="" trim="true" />
					<not>
						<available file="${projects.dir}/${single.project.name}" type="dir" />
					</not>
		</condition>
		<fail if="single.project.name.invalid" message="The expected property, 'single.project.name' was not defined as a valid project name!  The value was: [${single.project.name}]" />
	</target>


	<target name="build-project" depends="prepare,input-project-name,check-project-name">
		<echo message="Building ${single.project.name}, and all its dependencies (as necessary)." />

		<ivy:buildlist reference="single.ivy.project.list" root="${single.project.name}" skipbuildwithoutivy="true" ivyfilepath="ivy.xml">
			<fileset dir="${projects.dir}">
				<include name="*/dependencies-build.xml" />
			</fileset>
		</ivy:buildlist>

		<echo message="Computed build order is: ${ivy.sorted.modules}" />


		<subant target="publish" buildpathref="single.ivy.project.list">
			<property name="target.grid" value="${target.grid}" />
		</subant>

	</target>

	<target name="build-depending-on-project" depends="prepare,input-project-name,check-project-name">
		<echo message="Building all projects depending on ${single.project.name}.  Note, the depending projects' dependencies are not built, this should just be used to propagate changes to the given project for integration." />

		<ivy:buildlist reference="depending.on.single.ivy.project.list" leaf="${single.project.name}" skipbuildwithoutivy="true" ivyfilepath="ivy.xml">
			<fileset dir="${projects.dir}">
				<include name="*/dependencies-build.xml" />
			</fileset>
		</ivy:buildlist>


		<echo message="Computed build order is: ${ivy.sorted.modules}" />


		<subant target="publish" buildpathref="depending.on.single.ivy.project.list">
			<property name="target.grid" value="${target.grid}" />
		</subant>

	</target>

	<target name="set-project-versions" depends="prepare">
		<fail unless="project.version" message="You must provide a a value for the property [project.version]!" />
		<echo message="Setting all project versions to version ${project.version}" />

		<ivy:buildlist reference="ivy.project.properties.list" skipbuildwithoutivy="true" ivyfilepath="ivy.xml">
			<fileset dir="${projects.dir}">
				<include name="*/project.properties" />
			</fileset>
		</ivy:buildlist>

		<for parallel="true" param="project.properties.file" trim="true">
			<path refid="ivy.project.properties.list" />
			<sequential>
				<propertyfile file="@{project.properties.file}">
					<entry key="project.version" value="${project.version}" />
				</propertyfile>
			</sequential>
		</for>
	</target>


	<target name="all" depends="prepare,clean" description="compile, jar and publish all projects in the right order">
		<for parallel="false" param="project.buildfile" trim="true">
			<path refid="ivy.projects.list" />
			<sequential>
				<dirname file="@{project.buildfile}" property="@{project.buildfile}.dir" />
				<ant inheritAll="false" inheritrefs="false" dir="${@{project.buildfile}.dir}" antfile="@{project.buildfile}" target="publish">
					<property name="target.grid" value="${target.grid}" />
				</ant>
			</sequential>
		</for>
	</target>


	<target name="clean" depends="prepare" description="Delete repository, ivy cache, and clean all projects's generated and resolved artificats.">
		<delete dir="${integration.repository.dir}" />
		<ivy:cleancache />

		<for parallel="true" param="project.buildfile" trim="true" threadcount="10">
			<path refid="ivy.projects.list" />
			<sequential>
				<dirname file="@{project.buildfile}" property="@{project.buildfile}.dir" />
				<ant inheritAll="false" dir="${@{project.buildfile}.dir}" antfile="@{project.buildfile}" target="clean-dependencies" />
			</sequential>
		</for>
	</target>

	<target name="installExist">
	    <mkdir dir="temp"/>
		<property name="verify.dir" location="./temp" />
		<java
			jar="./resource/eXist-setup-1.2.6-rev9165.jar"
	        fork="true"
	        failonerror="true">
			<arg line="-p ${verify.dir}" />
	    </java>
	</target>
	
	<target name="testBuild" depends="installExist, all" description="Tests the Build in temporary EXIST_HOME" />

</project>
{'fraction_non_alphanumeric': 0.21769722814498935, 'fraction_numerical': 0.0039090262970859985, 'mean_word_length': 4.570467141726049, 'pattern_counts': {'":': 0, '<': 275, '<?xml version=': 2, '>': 275, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 24}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '927573', 'n_tokens_mistral': 4742, 'n_tokens_neox': 4241, 'n_words': 850}