<commit_before><?xml version="1.0" encoding="UTF-8"?>
<project name="Elastica" default="build" basedir=".">

	<property name="source" value="${basedir}/lib"/>

	<target name="parallelTasks">
		<parallel threadCount="2">
			<sequential>
				<antcall target="pdepend"/>
				<antcall target="phpmd-ci"/>
			</sequential>
			<antcall target="phpcpd"/>
			<antcall target="phpcs-ci"/>
			<antcall target="phpdoc"/>
			<antcall target="phpcb"/>
		</parallel>
	</target>

	<target name="clean" description="Cleanup build artifacts">
		<delete dir="${basedir}/build/api"/>
		<delete dir="${basedir}/build/code-browser"/>
		<delete dir="${basedir}/build/coverage"/>
		<delete dir="${basedir}/build/logs"/>
		<delete dir="${basedir}/build/pdepend"/>
		<delete file="${basedir}/cache.properties"/>
	</target>

	<target name="prepare" depends="clean" description="Prepare for build">
		<mkdir dir="${basedir}/build/api"/>
		<mkdir dir="${basedir}/build/code-browser"/>
		<mkdir dir="${basedir}/build/coverage"/>
		<mkdir dir="${basedir}/build/logs"/>
		<mkdir dir="${basedir}/build/pdepend"/>
	</target>

	<target name="lint">
		<apply executable="php" failonerror="true">
			<arg value="-lf"/>

			<fileset dir="${source}">
				<include name="**/*.php"/>
				<modified/>
			</fileset>

			<fileset dir="${basedir}/test">
				<include name="**/*.php"/>
				<modified/>
			</fileset>
		</apply>
	</target>

	<target name="phpunit" depends="prepare">
		<exec executable="phpunit" dir="${basedir}/test" failonerror="off" />
	</target>

	<!-- Generate jdepend.xml and software metrics charts -->
	<target name="pdepend">
		<exec executable="pdepend">
			<arg value="--jdepend-xml=${basedir}/build/logs/jdepend.xml" /><commit_msg>Update build file to use run script to download elasticsearch<commit_after><?xml version="1.0" encoding="UTF-8"?>
<project name="Elastica" default="build" basedir=".">

	<property name="source" value="${basedir}/lib"/>

	<target name="parallelTasks">
		<parallel threadCount="2">
			<sequential>
				<antcall target="pdepend"/>
				<antcall target="phpmd-ci"/>
			</sequential>
			<antcall target="phpcpd"/>
			<antcall target="phpcs-ci"/>
			<antcall target="phpdoc"/>
			<antcall target="phpcb"/>
		</parallel>
	</target>

	<target name="clean" description="Cleanup build artifacts">
		<delete dir="${basedir}/build/api"/>
		<delete dir="${basedir}/build/code-browser"/>
		<delete dir="${basedir}/build/coverage"/>
		<delete dir="${basedir}/build/logs"/>
		<delete dir="${basedir}/build/pdepend"/>
		<delete file="${basedir}/cache.properties"/>
	</target>

	<target name="prepare" depends="clean" description="Prepare for build">
		<mkdir dir="${basedir}/build/api"/>
		<mkdir dir="${basedir}/build/code-browser"/>
		<mkdir dir="${basedir}/build/coverage"/>
		<mkdir dir="${basedir}/build/logs"/>
		<mkdir dir="${basedir}/build/pdepend"/>
	</target>
	
	<target name="install" description="installs and starts elasticsearch">
		<exec executable="bash">
			<env key="ES_VER" value="0.20.5"/>
			<env key="ES_MAPPER_ATTACHMENTS_VER" value="1.6.0"/>
			<env key="ES_TRANSPORT_THRIFT_VER" value="1.4.0"/>
			<arg value="test/bin/run_elasticsearch.sh"/>
		</exec>
	</target>

	<target name="lint">
		<apply executable="php" failonerror="true">
			<arg value="-lf"/>

			<fileset dir="${source}">
				<include name="**/*.php"/>
				<modified/>
			</fileset>

			<fileset dir="${basedir}/test">
				<include name="**/*.php"/>
				<modified/>
			</fileset>
		</apply>
	</target>

	<target name="phpunit" depends="prepare">
		<exec executable="phpunit" dir="${basedir}/test" failonerror="off" />
	</target>

	<!-- Generate jdepend.xml and software metrics charts -->
	<target name="pdepend">
		<exec executable="pdepend">
			<arg value="--jdepend-xml=${basedir}/build/logs/jdepend.xml" />
{'fraction_non_alphanumeric': 0.21961508041128394, 'fraction_numerical': 0.004745583970471922, 'mean_word_length': 4.546783625730995, 'pattern_counts': {'":': 0, '<': 111, '<?xml version=': 2, '>': 111, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 8}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '278769', 'n_tokens_mistral': 1419, 'n_tokens_neox': 1248, 'n_words': 242}