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

<project name="ai-admin-graphql" default="test">

	<target name="test" description="Executes unit tests" depends="clean">
		<echo msg="Executing unit tests" />
		<exec executable="${bindir}phpunit" dir="tests" checkreturn="true" logoutput="true" passthru="true">
			<arg line="-d memory_limit=-1 --include-path ${coredir} --configuration=phpunit.xml" />
		</exec>
	</target>

	<target name="coverage" description="Generates code coverage report" depends="clean">
		<echo msg="Generating code coverage report" />
		<exec executable="${bindir}phpunit" dir="tests" checkreturn="true" logoutput="true" passthru="true">
			<arg line="-d memory_limit=-1 --include-path ${coredir} --configuration=phpunit-coverage.xml" />
		</exec>
	</target>

	<target name="check" description="Executes code sniffer">
		<echo msg="Executing code sniffer" />
		<exec executable="${bindir}phpcs" checkreturn="true" logoutput="true" passthru="true">
			<arg line="-n --standard=${codestddir}/Aimeos src tests/*/" />
		</exec>
	</target>

	<target name="clean" description="Cleans up temporary files">
		<delete file="tests/coverage.xml" quiet="true" failonerror="false" />
		<delete quiet="true" failonerror="false" >
			<fileset dir="tests">
				<include name="*.log" />
			</fileset>
		</delete>
	</target>

	<target name="i18n" description="Creates translation message files">
		<echo msg="Nothing to do" />
	</target>

	<target name="i18n-update" description="Updates translation message files">
		<echo msg="Nothing to do" />
	</target>

	<target name="build" description="Builds package for deployment">
		<echo msg="Nothing to do" />
	</target>

	<target name="all" depends="coverage,check" description="Builds all parts of the package">
	</target>

</project>