<?xml version="1.0" encoding="UTF-8"?>
<project name="WebToPay" default="build" basedir="..">
    <target name="test">
        <exec command="phpunit" passthru="true" returnProperty="phpunitResult" />
        <if>
            <equals arg1="${phpunitResult}" arg2="0" />
            <then>
                <echo message="Tests passed successfully" />
            </then>
            <else>
                <fail message="Stopping build, tests do not pass" />
            </else>
        </if>
    </target>
    <target name="build" depends="test">
        <echo msg="Combining all php files into one" />
        <echo file="WebToPay.php" append="false">&lt;?php
/*
 * This file is autogenerated, DO NOT EDIT
 */</echo>
        <append destFile="WebToPay.php">
            <filterchain>
                <replaceregexp>
                    <regexp pattern="^\&lt;\?php" replace="" />
                </replaceregexp>
            </filterchain>
            <filelist dir="src" files="WebToPay.php,WebToPayException.php" />
        </append>
        <append destFile="WebToPay.php">
            <filterchain>
                <replaceregexp>
                    <regexp pattern="^\&lt;\?php" replace="" />
                </replaceregexp>
            </filterchain>
            <fileset dir="src/WebToPay">
                <include name="**/*.php"/>
            </fileset>
        </append>
    </target>
</project>