1<?xml version="1.0" encoding="UTF-8"?>
2<project name="global-state">
3 <target name="clean" description="Cleanup build artifacts">
4  <delete dir="${basedir}/vendor"/>
5  <delete file="${basedir}/composer.lock"/>
6 </target>
7
8 <target name="composer" depends="clean" description="Install dependencies with Composer">
9  <tstamp>
10   <format property="thirty.days.ago" pattern="MM/dd/yyyy hh:mm aa" offset="-30" unit="day"/>
11  </tstamp>
12  <delete>
13   <fileset dir="${basedir}">
14    <include name="composer.phar" />
15    <date datetime="${thirty.days.ago}" when="before"/>
16   </fileset>
17  </delete>
18
19  <get src="https://getcomposer.org/composer.phar" dest="${basedir}/composer.phar" skipexisting="true"/>
20
21  <exec executable="php">
22   <arg value="composer.phar"/>
23   <arg value="install"/>
24  </exec>
25 </target>
26
27 <target name="phpunit" description="Run unit tests with PHPUnit">
28  <exec executable="${basedir}/vendor/bin/phpunit" failonerror="true">
29   <arg value="--configuration"/>
30   <arg path="${basedir}/build/phpunit.xml"/>
31  </exec>
32 </target>
33</project>
34