build.xml 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <project name="solarium" default="build" basedir=".">
  2. <target name="clean">
  3. <!-- Clean up -->
  4. <delete dir="build"/>
  5. <!-- Create build directories -->
  6. <mkdir dir="${basedir}/build/api"/>
  7. <mkdir dir="${basedir}/build/code-browser"/>
  8. <mkdir dir="${basedir}/build/coverage"/>
  9. <mkdir dir="${basedir}/build/logs"/>
  10. <mkdir dir="${basedir}/build/pdepend"/>
  11. </target>
  12. <!-- Run unit tests and generate junit.xml and clover.xml
  13. (This is done in the phpunit.xml.dist,
  14. you could also write the switches here)
  15. -->
  16. <target name="phpunit">
  17. <exec executable="${basedir}/vendor/bin/phpunit" />
  18. </target>
  19. <!-- Run pdepend, phpmd, phpcpd, and phpcs in parallel -->
  20. <target name="parallelTasks">
  21. <parallel>
  22. <antcall target="pdepend"/>
  23. <antcall target="phpmd"/>
  24. <antcall target="phpcpd"/>
  25. <antcall target="phpcs"/>
  26. <antcall target="docblox"/>
  27. </parallel>
  28. </target>
  29. <!-- Generate jdepend.xml and software metrics charts -->
  30. <target name="pdepend">
  31. <exec executable="pdepend">
  32. <arg line="--overview-pyramid=${basedir}/build/pdepend/overview-pyramid.svg" />
  33. <arg line="--jdepend-chart=${basedir}/build/pdepend/dependencies.svg" />
  34. <arg line="--jdepend-xml=${basedir}/build/logs/jdepend.xml" />
  35. <arg line="library" />
  36. </exec>
  37. </target>
  38. <!-- Generate pmd.xml -->
  39. <target name="phpmd">
  40. <exec executable="phpmd">
  41. <arg line="library xml codesize,unusedcode --reportfile ${basedir}/build/logs/pmd.xml" />
  42. </exec>
  43. </target>
  44. <!-- Generate pmd-cpd.xml -->
  45. <target name="phpcpd">
  46. <exec executable="phpcpd">
  47. <arg line="--log-pmd ${basedir}/build/logs/pmd-cpd.xml library" />
  48. </exec>
  49. </target>
  50. <!-- Generate checkstyle.xml -->
  51. <target name="phpcs">
  52. <exec executable="${basedir}/vendor/bin/phpcs">
  53. <arg value="--report=checkstyle" />
  54. <arg value="--report-file=${basedir}/build/logs/checkstyle.xml" />
  55. <arg value="--standard=PSR2" />
  56. <arg value="--extensions=php" />
  57. <arg path="library" />
  58. </exec>
  59. </target>
  60. <!-- Generate API documentation -->
  61. <target name="docblox">
  62. <exec executable="docblox">
  63. <arg line="run -d library -t build/api"/>
  64. </exec>
  65. </target>
  66. <target name="phpcb">
  67. <exec executable="phpcb">
  68. <arg line="--log ${basedir}/build/logs --source ${basedir}/library --output ${basedir}/build/code-browser" />
  69. </exec>
  70. </target>
  71. <target name="build" depends="clean,phpunit,parallelTasks,phpcb"/>
  72. </project>