<commit_before><project name="kohana" default="help" basedir=".">
	<property environment="env"/>

	<property name="basedir" value="${project.basedir}"/>
	<property name="builddir" value="${basedir}/build"/>

	<property name="repo" value="<EMAIL>:kohana/kohana.git"/>
	<property name="branch" value="3.1/develop"/>
	<property name="tag" value="${env.TAG}"/>

	<property name="submodules" value="system,modules/auth,modules/cache,modules/codebench,modules/database,modules/image,modules/oauth,modules/orm,modules/pagination,modules/unittest,modules/userguide"/>
	<property name="release-excludes" value="**/.git,**/.git*,build.xml,phpunit.xml,DEVELOPERS.md,phpunitcc,code_coverage.xml,release-tag,TESTING.md,**/tests"/>

	<!-- Shows the help message -->
	<target name="help">
		<echo message="General Targets"/>
		<echo message="==============="/>
		<echo message="phing test              Run unit tests."/>
		<echo message="phing test-log          Run unit tests with logging enabled."/>
		<echo message="phing phpcs             Run phpcs."/>
		<echo message="phing phpcs-log         Run phpcs with logging enabled."/>
		<echo message="phing phpmd             Run phpmd."/>
		<echo message="phing phpmd-log         Run phpmd with logging enabled."/>
		<echo message="phing phpcpd-log        Run phpcpd with logging enabled."/>
		<echo message="phing pdepend-log       Run pdepend with logging enabled."/>
		<echo message="phing phpcb-log         Run phpcb with logging enabled."/>
		<echo message=""/>
		<echo message="Kohana Developer Targets"/>
		<echo message="========================"/>
		<echo message="phing dev-setup         Setup for development on Kohana itself."/>
		<echo message="phing git-status        Show the git status of each submodule."/>
		<echo message="phing git-checkout      Checkout a branch accross all submodules."/>
		<echo message="phing git-pull          Perform a pull for each submodule."/>
		<echo message="phing git-push          Perform a push for each submodule."/>
		<echo message=""/>
		<echo message="Misc Targets"/>
		<echo message="============"/>
		<echo message="phing ci                Alias task for continuous integration servers"/>
	</target>

	<!-- Clean up -->
	<target name="clean">
		<delete dir="${builddir}"/>
		<!-- Create build directories -->
		<mkdir dir="${builddir}/coverage"/>
		<mkdir dir="${builddir}/logs"/>
		<mkdir dir="${builddir}/release"/>
		<mkdir dir="${builddir}/code-browser"/>
	</target>

	<target name="dev-setup">
		<property name="git-checkout-branch" value="${branch}"/> <!-- Prevents git-checkout asking for a branch name -->
		<exec command="git submodule update --init --recursive" dir="${basedir}" />
		<phingcall target="_dev-setup-remotes" />
		<phingcall target="git-pull" />
		<phingcall target="git-checkout" />
	</target>

	<target name="git-pull">
		<phingcall target="_git-pull">
			<property name="dir" value="." />
		</phingcall>
		<foreach list="${submodules}" param="dir" target="_git-pull"/>
	</target>

	<target name="_git-pull">
		<exec command="git pull dev" dir="${dir}"/>
	</target>

	<target name="git-checkout">
		<if>
			<not>
				<isset property="git-checkout-branch"/>
			</not>
			<then>
				<propertyprompt propertyName="git-checkout-branch" defaultValue="${branch}" promptText="Branch name:" />
			</then>
		</if>

		<phingcall target="_git-checkout">
			<property name="dir" value="." />
		</phingcall>

		<foreach list="${submodules}" param="dir" target="_git-checkout"/>
	</target>

	<target name="_git-checkout">
		<exec returnProperty="git-checkout-branch-exists" command="git show-ref --quiet --verify -- 'refs/remotes/dev/${git-checkout-branch}'" dir="${dir}"  passthru="true"/>
		<if>
			<equals arg1="${git-checkout-branch-exists}" arg2="0"/>
			<then>
				<exec command="git checkout --track -b ${git-checkout-branch} dev/${git-checkout-branch}" dir="${dir}" passthru="true"/>
			</then>
			<else>
				<exec command="git checkout -b ${git-checkout-branch}" dir="${dir}" passthru="true"/>
			</else>
		</if>
	</target>

	<target name="git-push">
		<foreach list="${submodules}" param="dir" target="_git-push"/>
		<phingcall target="_git-push">
			<property name="dir" value="." />
		</phingcall>
	</target>

	<target name="_git-push">
		<exec command="git push dev" dir="${dir}" passthru="true"/>
	</target>

	<target name="git-status">
		<foreach list="${submodules}" param="dir" target="_git-status"/>
		<phingcall target="_git-status">
			<property name="dir" value="." />
		</phingcall>
	</target>

	<target name="_git-status">
		<exec command="git status" dir="${dir}" passthru="true"/>
	</target>

	<target name="_dev-setup-remotes">
		<!-- TODO: Clean up... -->
		<phingcall target="_dev-setup-remote">
			<property name="repository" value="<EMAIL>:kohana/kohana.git" />
			<property name="dir"        value="${basedir}" />
		</phingcall>
		<phingcall target="_dev-setup-remote">
			<property name="repository" value="<EMAIL>:kohana/core.git" />
			<property name="dir"        value="${basedir}/system" />
		</phingcall>
		<phingcall target="_dev-setup-remote">
			<property name="repository" value="<EMAIL>:kohana/auth.git" />
			<property name="dir"        value="${basedir}/modules/auth" />
		</phingcall>
		<phingcall target="_dev-setup-remote">
			<property name="repository" value="<EMAIL>:kohana/cache.git" />
			<property name="dir"        value="${basedir}/modules/cache" />
		</phingcall>
		<phingcall target="_dev-setup-remote">
			<property name="repository" value="<EMAIL>:kohana/codebench.git" />
			<property name="dir"        value="${basedir}/modules/codebench" />
		</phingcall>
		<phingcall target="_dev-setup-remote">
			<property name="repository" value="<EMAIL>:kohana/database.git" />
			<property name="dir"        value="${basedir}/modules/database" />
		</phingcall>
		<phingcall target="_dev-setup-remote">
			<property name="repository" value="<EMAIL>:kohana/image.git" />
			<property name="dir"        value="${basedir}/modules/image" />
		</phingcall>
		<phingcall target="_dev-setup-remote">
			<property name="repository" value="<EMAIL>:kohana/oauth.git" />
			<property name="dir"        value="${basedir}/modules/oauth" />
		</phingcall>
		<phingcall target="_dev-setup-remote">
			<property name="repository" value="<EMAIL>:kohana/orm.git" />
			<property name="dir"        value="${basedir}/modules/orm" />
		</phingcall>
		<phingcall target="_dev-setup-remote">
			<property name="repository" value="<EMAIL>:kohana/pagination.git" />
			<property name="dir"        value="${basedir}/modules/pagination" />
		</phingcall>
		<phingcall target="_dev-setup-remote">
			<property name="repository" value="<EMAIL>:kohana/unittest.git" />
			<property name="dir"        value="${basedir}/modules/unittest" />
		</phingcall>
		<phingcall target="_dev-setup-remote">
			<property name="repository" value="<EMAIL>:kohana/userguide.git" />
			<property name="dir"        value="${basedir}/modules/userguide" />
		</phingcall>
	</target>

	<target name="_dev-setup-remote">
		<exec command="git remote rm dev" dir="${dir}"/>
		<exec command="git remote add dev ${repository}" dir="${dir}"/>
	</target>

	<!-- Run unit tests -->
	<target name="test">
		<exec command="phpunit --bootstrap=modules/unittest/bootstrap.php modules/unittest/tests.php" checkreturn="true" passthru="true"/>
	</target>

	<!-- Run unit tests and generate junit.xml and clover.xml -->
	<target name="test-log">
		<exec command="phpunit --bootstrap=modules/unittest/bootstrap.php --coverage-html=${builddir}/coverage --log-junit=${builddir}/logs/junit.xml --coverage-clover=${builddir}/logs/clover.xml modules/unittest/tests.php" checkreturn="true" passthru="true"/>
	</target>

	<!-- Run PHP Code Sniffer -->
	<target name="phpcs">
		<exec command="phpcs --standard=Kohana --ignore=*.js,*.css,**/vendor/**,**/tests/**,**/unittest/** ${basedir}" passthru="true"/>
	</target>

	<!-- Run PHP Code Sniffer and generate checkstyle.xml -->
	<target name="phpcs-log">
		<exec command="phpcs --standard=Kohana --ignore=*.js,*.css,**/vendor/**,**/tests/**,**/unittest/** --report=checkstyle --report-file=${builddir}/logs/checkstyle.xml ${basedir}"  passthru="false"/>
	</target>

	<!-- Run PHP Mess Detector -->
	<target name="phpmd">
		<exec command="phpmd ${basedir} text codesize,unusedcode --exclude=**/vendor/**"  passthru="true"/>
	</target>

	<!-- Run PHP Mess Detector and generate pmd.xml -->
	<target name="phpmd-log">
		<exec command="phpmd ${basedir} xml codesize,unusedcode --exclude=**/vendor/** --reportfile ${builddir}/logs/pmd.xml"  passthru="true"/>
	</target>

	<!-- Run PHP Copy/Paste Detector and generate pmd.xml -->
	<target name="phpcpd-log">
		<exec command="phpcpd --log-pmd ${builddir}/logs/pmd-cpd.xml ${basedir}"  passthru="true"/>
	</target>

	<!-- Run PHP Depend and generate jdepend.xml -->
	<target name="pdepend-log">
		<exec command="pdepend --jdepend-xml=${builddir}/logs/jdepend.xml ${basedir}"  passthru="true"/>
	</target>

	<!-- Run PHP CodeBrowser and generate output -->
	<target name="phpcb-log">
		<exec command="phpcb --log ${builddir}/logs --source ${basedir} --output ${builddir}/code-browser"  passthru="true"/>
	</target>

	<!-- Hudson CI target -->
	<target name="ci" depends="clean">
		<phingcall target="test-log"/>
		<phingcall target="pdepend-log"/>
		<phingcall target="phpmd-log"/>
		<phingcall target="phpcpd-log"/>
		<phingcall target="phpcs-log"/>
		<phingcall target="phpcb-log"/>
	</target>
</project><commit_msg>Adding initial dist target to build.xml. Needs some cleanup.<commit_after><project name="kohana" default="help" basedir=".">
<!--	<property environment="env"/>-->

	<property name="basedir" value="${project.basedir}"/>
	<property name="builddir" value="${basedir}/build"/>

	<property name="repo" value="<EMAIL>:kohana/kohana.git"/>
	<property name="branch" value="3.1/develop"/>
	<property name="tag" value="${env.TAG}"/>

	<property name="submodules" value="system,modules/auth,modules/cache,modules/codebench,modules/database,modules/image,modules/oauth,modules/orm,modules/pagination,modules/unittest,modules/userguide"/>

	<!-- Shows the help message -->
	<target name="help">
		<echo message="General Targets"/>
		<echo message="==============="/>
		<echo message="phing test              Run unit tests."/>
		<echo message="phing test-log          Run unit tests with logging enabled."/>
		<echo message="phing phpcs             Run phpcs."/>
		<echo message="phing phpcs-log         Run phpcs with logging enabled."/>
		<echo message="phing phpmd             Run phpmd."/>
		<echo message="phing phpmd-log         Run phpmd with logging enabled."/>
		<echo message="phing phpcpd-log        Run phpcpd with logging enabled."/>
		<echo message="phing pdepend-log       Run pdepend with logging enabled."/>
		<echo message="phing phpcb-log         Run phpcb with logging enabled."/>
		<echo message=""/>
		<echo message="Kohana Developer Targets"/>
		<echo message="========================"/>
		<echo message="phing dev-setup         Setup for development on Kohana itself."/>
		<echo message="phing git-status        Show the git status of each submodule."/>
		<echo message="phing git-checkout      Checkout a branch accross all submodules."/>
		<echo message="phing git-pull          Perform a pull for each submodule."/>
		<echo message="phing git-push          Perform a push for each submodule."/>
		<echo message=""/>
		<echo message="Misc Targets"/>
		<echo message="============"/>
		<echo message="phing ci                Alias task for continuous integration servers"/>
	</target>

	<!-- Clean up -->
	<target name="clean">
		<delete dir="${builddir}"/>
		<!-- Create build directories -->
		<mkdir dir="${builddir}/coverage"/>
		<mkdir dir="${builddir}/logs"/>
		<mkdir dir="${builddir}/release"/>
		<mkdir dir="${builddir}/code-browser"/>
	</target>

	<target name="dev-setup">
		<property name="git-checkout-branch" value="${branch}"/> <!-- Prevents git-checkout asking for a branch name -->
		<exec command="git submodule update --init --recursive" dir="${basedir}" />
		<phingcall target="_dev-setup-remotes" />
		<phingcall target="git-pull" />
		<phingcall target="git-checkout" />
	</target>

	<target name="git-pull">
		<phingcall target="_git-pull">
			<property name="dir" value="." />
		</phingcall>
		<foreach list="${submodules}" param="dir" target="_git-pull"/>
	</target>

	<target name="_git-pull">
		<exec command="git pull dev" dir="${dir}"/>
	</target>

	<target name="git-checkout">
		<if>
			<not>
				<isset property="git-checkout-branch"/>
			</not>
			<then>
				<propertyprompt propertyName="git-checkout-branch" defaultValue="${branch}" promptText="Branch name:" />
			</then>
		</if>

		<phingcall target="_git-checkout">
			<property name="dir" value="." />
		</phingcall>

		<foreach list="${submodules}" param="dir" target="_git-checkout"/>
	</target>

	<target name="_git-checkout">
		<exec returnProperty="git-checkout-branch-exists" command="git show-ref --quiet --verify -- 'refs/remotes/dev/${git-checkout-branch}'" dir="${dir}"  passthru="true"/>
		<if>
			<equals arg1="${git-checkout-branch-exists}" arg2="0"/>
			<then>
				<exec command="git checkout --track -b ${git-checkout-branch} dev/${git-checkout-branch}" dir="${dir}" passthru="true"/>
			</then>
			<else>
				<exec command="git checkout -b ${git-checkout-branch}" dir="${dir}" passthru="true"/>
			</else>
		</if>
	</target>

	<target name="git-push">
		<foreach list="${submodules}" param="dir" target="_git-push"/>
		<phingcall target="_git-push">
			<property name="dir" value="." />
		</phingcall>
	</target>

	<target name="_git-push">
		<exec command="git push dev" dir="${dir}" passthru="true"/>
	</target>

	<target name="git-status">
		<foreach list="${submodules}" param="dir" target="_git-status"/>
		<phingcall target="_git-status">
			<property name="dir" value="." />
		</phingcall>
	</target>

	<target name="_git-status">
		<exec command="git status" dir="${dir}" passthru="true"/>
	</target>

	<target name="_dev-setup-remotes">
		<!-- TODO: Clean up... -->
		<phingcall target="_dev-setup-remote">
			<property name="repository" value="<EMAIL>:kohana/kohana.git" />
			<property name="dir"        value="${basedir}" />
		</phingcall>
		<phingcall target="_dev-setup-remote">
			<property name="repository" value="<EMAIL>:kohana/core.git" />
			<property name="dir"        value="${basedir}/system" />
		</phingcall>
		<phingcall target="_dev-setup-remote">
			<property name="repository" value="<EMAIL>:kohana/auth.git" />
			<property name="dir"        value="${basedir}/modules/auth" />
		</phingcall>
		<phingcall target="_dev-setup-remote">
			<property name="repository" value="<EMAIL>:kohana/cache.git" />
			<property name="dir"        value="${basedir}/modules/cache" />
		</phingcall>
		<phingcall target="_dev-setup-remote">
			<property name="repository" value="<EMAIL>:kohana/codebench.git" />
			<property name="dir"        value="${basedir}/modules/codebench" />
		</phingcall>
		<phingcall target="_dev-setup-remote">
			<property name="repository" value="<EMAIL>:kohana/database.git" />
			<property name="dir"        value="${basedir}/modules/database" />
		</phingcall>
		<phingcall target="_dev-setup-remote">
			<property name="repository" value="<EMAIL>:kohana/image.git" />
			<property name="dir"        value="${basedir}/modules/image" />
		</phingcall>
		<phingcall target="_dev-setup-remote">
			<property name="repository" value="<EMAIL>:kohana/oauth.git" />
			<property name="dir"        value="${basedir}/modules/oauth" />
		</phingcall>
		<phingcall target="_dev-setup-remote">
			<property name="repository" value="<EMAIL>:kohana/orm.git" />
			<property name="dir"        value="${basedir}/modules/orm" />
		</phingcall>
		<phingcall target="_dev-setup-remote">
			<property name="repository" value="<EMAIL>:kohana/pagination.git" />
			<property name="dir"        value="${basedir}/modules/pagination" />
		</phingcall>
		<phingcall target="_dev-setup-remote">
			<property name="repository" value="<EMAIL>:kohana/unittest.git" />
			<property name="dir"        value="${basedir}/modules/unittest" />
		</phingcall>
		<phingcall target="_dev-setup-remote">
			<property name="repository" value="<EMAIL>:kohana/userguide.git" />
			<property name="dir"        value="${basedir}/modules/userguide" />
		</phingcall>
	</target>

	<target name="_dev-setup-remote">
		<exec command="git remote rm dev" dir="${dir}"/>
		<exec command="git remote add dev ${repository}" dir="${dir}"/>
	</target>

	<!-- Run unit tests -->
	<target name="test">
		<exec command="phpunit --bootstrap=modules/unittest/bootstrap.php modules/unittest/tests.php" checkreturn="true" passthru="true"/>
	</target>

	<!-- Run unit tests and generate junit.xml and clover.xml -->
	<target name="test-log">
		<exec command="phpunit --bootstrap=modules/unittest/bootstrap.php --coverage-html=${builddir}/coverage --log-junit=${builddir}/logs/junit.xml --coverage-clover=${builddir}/logs/clover.xml modules/unittest/tests.php" checkreturn="true" passthru="true"/>
	</target>

	<!-- Run PHP Code Sniffer -->
	<target name="phpcs">
		<exec command="phpcs --standard=Kohana --ignore=*.js,*.css,**/vendor/**,**/tests/**,**/unittest/** ${basedir}" passthru="true"/>
	</target>

	<!-- Run PHP Code Sniffer and generate checkstyle.xml -->
	<target name="phpcs-log">
		<exec command="phpcs --standard=Kohana --ignore=*.js,*.css,**/vendor/**,**/tests/**,**/unittest/** --report=checkstyle --report-file=${builddir}/logs/checkstyle.xml ${basedir}"  passthru="false"/>
	</target>

	<!-- Run PHP Mess Detector -->
	<target name="phpmd">
		<exec command="phpmd ${basedir} text codesize,unusedcode --exclude=**/vendor/**"  passthru="true"/>
	</target>

	<!-- Run PHP Mess Detector and generate pmd.xml -->
	<target name="phpmd-log">
		<exec command="phpmd ${basedir} xml codesize,unusedcode --exclude=**/vendor/** --reportfile ${builddir}/logs/pmd.xml"  passthru="true"/>
	</target>

	<!-- Run PHP Copy/Paste Detector and generate pmd.xml -->
	<target name="phpcpd-log">
		<exec command="phpcpd --log-pmd ${builddir}/logs/pmd-cpd.xml ${basedir}"  passthru="true"/>
	</target>

	<!-- Run PHP Depend and generate jdepend.xml -->
	<target name="pdepend-log">
		<exec command="pdepend --jdepend-xml=${builddir}/logs/jdepend.xml ${basedir}"  passthru="true"/>
	</target>

	<!-- Run PHP CodeBrowser and generate output -->
	<target name="phpcb-log">
		<exec command="phpcb --log ${builddir}/logs --source ${basedir} --output ${builddir}/code-browser"  passthru="true"/>
	</target>

	<!-- Build a release .zip -->
	<target name="dist">
		<-- There has to be a better way to allow this to be overridden, and allow for detecting Hudson vars -->
		<if>
			<isset property="dist.filename" />
			<else>
				<if>
					<isset property="env.BUILD_NUMBER" />
					<then>
						<if>
							<isset property="env.JOB_NAME" />
							<then>
								<property name="dist.filename" value="${builddir}/${env.JOB_NAME}-${env.BUILD_NUMBER}" />
							</then>
							<else>
								<property name="dist.filename" value="${builddir}/kohana" />
							</else>
						</if>
					</then>
					<else>
						<property name="dist.filename" value="${builddir}/kohana" />
					</else>
				</if>
			</else>
		</if>

		<zip destfile="${dist.filename}.zip" prefix="${dist.filename}/">
			<fileset dir="${basedir}">
				<include name="**/**"/>
				<!-- Build Files -->
				<exclude name="*.zip" />
				<exclude name="build/**" />
				<!-- Dev Files -->
				<exclude name="build.xml" />
				<exclude name="phpunit.xml" />
				<exclude name="**/tests/**" />
				<!-- SCM Files -->
				<exclude name="**/.git/**" />
				<exclude name="**/.git*" />
			</fileset>
		</zip>
	</target>

	<!-- Hudson CI target -->
	<target name="ci" depends="clean">
		<phingcall target="test-log"/>
		<phingcall target="pdepend-log"/>
		<phingcall target="phpmd-log"/>
		<phingcall target="phpcpd-log"/>
		<phingcall target="phpcs-log"/>
		<phingcall target="phpcb-log"/>
	</target>
</project>
{'fraction_non_alphanumeric': 0.20657815931323617, 'fraction_numerical': 0.0004991016170892394, 'mean_word_length': 3.8990220048899755, 'pattern_counts': {'":': 0, '<': 482, '<?xml version=': 0, '>': 482, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 34}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '159914', 'n_tokens_mistral': 7127, 'n_tokens_neox': 6545, 'n_words': 1368}