No Description

build.xml 2.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project name="version" default="build">
  3. <property name="php" value="php"/>
  4. <property name="phpunit" value="phpunit"/>
  5. <target name="build" depends="prepare,lint,phpcs,phpunit"/>
  6. <target name="clean" description="Cleanup build artifacts">
  7. </target>
  8. <target name="prepare" depends="clean,phpab" description="Prepare for build">
  9. </target>
  10. <target name="phpab" description="Generate autoloader script">
  11. <exec executable="phpab">
  12. <arg value="--output" />
  13. <arg path="src/autoload.php" />
  14. <arg path="src" />
  15. </exec>
  16. </target>
  17. <target name="lint">
  18. <apply executable="${php}" failonerror="true">
  19. <arg value="-l" />
  20. <fileset dir="${basedir}/src">
  21. <include name="**/*.php" />
  22. <modified />
  23. </fileset>
  24. <fileset dir="${basedir}/tests">
  25. <include name="**/*.php" />
  26. <modified />
  27. </fileset>
  28. </apply>
  29. </target>
  30. <target name="phpcs" description="Find coding standard violations using PHP_CodeSniffer">
  31. <exec executable="phpcs">
  32. <arg value="--standard=PSR2" />
  33. <arg value="--extensions=php" />
  34. <arg value="--ignore=autoload.php" />
  35. <arg path="${basedir}/src" />
  36. </exec>
  37. </target>
  38. <target name="phpunit" description="Run unit tests with PHPUnit">
  39. <condition property="phpunit_cmd" value="${php} ${phpunit}" else="${phpunit}">
  40. <not>
  41. <equals arg1="${phpunit}" arg2="phpunit" />
  42. </not>
  43. </condition>
  44. <exec executable="${phpunit_cmd}" failonerror="true">
  45. <arg value="--configuration" />
  46. <arg path="${basedir}/build/phpunit.xml" />
  47. </exec>
  48. </target>
  49. <target name="pear">
  50. <mkdir dir="${basedir}/build/SebastianBergmann/Version"/>
  51. <copy todir="${basedir}/build/SebastianBergmann/Version">
  52. <fileset dir="${basedir}/src"/>
  53. </copy>
  54. <copy file="ChangeLog.md" todir="${basedir}/build"/>
  55. <copy file="LICENSE" todir="${basedir}/build"/>
  56. <copy file="README.md" todir="${basedir}/build"/>
  57. <exec executable="pear" dir="${basedir}/build">
  58. <arg value="package" />
  59. </exec>
  60. <delete dir="${basedir}/build/SebastianBergmann"/>
  61. <delete file="${basedir}/build/ChangeLog.md"/>
  62. <delete file="${basedir}/build/LICENSE"/>
  63. <delete file="${basedir}/build/README.md"/>
  64. </target>
  65. </project>