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

<project name="smsapi/php-client" default="test">
    <target name="test">
        <property name="suite" value="all"/>
        <exec command="./vendor/bin/phpunit --testsuite=${suite}" passthru="true" />
    </target>
    <target name="phpcbf-src">
        <exec command="./vendor/bin/phpcbf --standard=./phpcs.xml src" passthru="true" />
    </target>
    <target name="phpcbf-tests">
        <exec command="./vendor/bin/phpcbf --standard=./phpcs.xml tests" passthru="true" />
    </target>
    <target name="phpcs-src">
        <exec command="./vendor/bin/phpcs --standard=./phpcs.xml src" passthru="true" />
    </target>
    <target name="phpcs-tests">
        <exec command="./vendor/bin/phpcs --standard=./phpcs.xml tests" passthru="true" />
    </target>
    <target name="phpcbf">
        <phingcall target="phpcbf-src" />
        <phingcall target="phpcbf-tests" />
    </target>
    <target name="phpcs">
        <phingcall target="phpcs-src" />
        <phingcall target="phpcs-tests" />
    </target>
    <target name="build">
        <phingcall target="phpcbf" />
        <phingcall target="phpcs" />
    </target>
    <target name="composer">
        <available property="is_composer_installed" file="composer" filepath="${env.PATH}" value="true" />
        <if>
            <equals arg1="${is_composer_installed}" arg2="0" />
            <then>
                <exec command="wget -nc http://getcomposer.org/composer.phar" passthru="true" />
            </then>
        </if>
    </target>
    <target name="composer-update" depends="composer">
        <exec command="composer update" passthru="true" />
    </target>
</project>
