build.xml 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project name="manifest" default="setup">
  3. <target name="setup" depends="clean,install-tools,install-dependencies"/>
  4. <target name="clean" unless="clean.done" description="Cleanup build artifacts">
  5. <delete dir="${basedir}/tools"/>
  6. <delete dir="${basedir}/vendor"/>
  7. <delete file="${basedir}/src/autoload.php"/>
  8. <property name="clean.done" value="true"/>
  9. </target>
  10. <target name="prepare" unless="prepare.done" depends="clean" description="Prepare for build">
  11. <property name="prepare.done" value="true"/>
  12. </target>
  13. <target name="install-dependencies" unless="dependencies-installed" depends="-dependencies-installed" description="Install dependencies with Composer">
  14. <exec executable="composer" taskname="composer">
  15. <env key="COMPOSER_DISABLE_XDEBUG_WARN" value="1"/>
  16. <arg value="update"/>
  17. <arg value="--no-interaction"/>
  18. <arg value="--no-progress"/>
  19. <arg value="--no-ansi"/>
  20. <arg value="--no-suggest"/>
  21. <arg value="--optimize-autoloader"/>
  22. <arg value="--prefer-stable"/>
  23. </exec>
  24. </target>
  25. <target name="install-tools" unless="tools-installed" depends="-tools-installed" description="Install tools with Phive">
  26. <exec executable="phive" taskname="phive">
  27. <arg value="install"/>
  28. <arg value="--trust-gpg-keys" />
  29. <arg value="4AA394086372C20A,2A8299CE842DD38C" />
  30. </exec>
  31. </target>
  32. <target name="test" depends="install-tools,install-dependencies" description="Run tests">
  33. <exec executable="${basedir}/tools/phpunit" taskname="phpunit"/>
  34. </target>
  35. <target name="-dependencies-installed">
  36. <available file="${basedir}/composer.lock" property="dependencies-installed"/>
  37. </target>
  38. <target name="-tools-installed">
  39. <available file="${basedir}/tools" property="tools-installed" type="dir"/>
  40. </target>
  41. </project>