build.xml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project name="Chamilo LMS" default="build">
  3. <target name="build"
  4. depends="prepare,phpunit,pdepend,phpdoc"/>
  5. <target name="clean" description="Cleanup build artifacts">
  6. <!--delete dir="${basedir}/../tests/api"/>
  7. <delete dir="${basedir}/../tests/code-browser"/>
  8. <delete dir="${basedir}/../tests/coverage"/>
  9. <delete dir="${basedir}/../tests/logs"/>
  10. <delete dir="${basedir}/../tests/pdepend"/-->
  11. </target>
  12. <target name="prepare" depends="clean" description="Prepare for build">
  13. <mkdir dir="${basedir}/../tests/api"/>
  14. <mkdir dir="${basedir}/../tests/code-browser"/>
  15. <mkdir dir="${basedir}/../tests/coverage"/>
  16. <mkdir dir="${basedir}/../tests/logs"/>
  17. <mkdir dir="${basedir}/../tests/pdepend"/>
  18. <mkdir dir="${basedir}/../tests/phpdox"/>
  19. </target>
  20. <target name="lint" description="Perform syntax check of sourcecode files">
  21. <apply executable="php" failonerror="true">
  22. <arg value="-l" />
  23. <fileset dir="${basedir}/../main">
  24. <include name="**/*.php"/>
  25. </fileset>
  26. <fileset dir="${basedir}">
  27. <include name="**/*.php"/>
  28. </fileset>
  29. </apply>
  30. </target>
  31. <target name="pdepend" description="Calculate software metrics using PHP_Depend">
  32. <exec executable="pdepend">
  33. <arg value="--jdepend-xml=${basedir}/tests/logs/jdepend.xml" />
  34. <arg value="--jdepend-chart=${basedir}/tests/pdepend/dependencies.svg" />
  35. <arg value="--overview-pyramid=${basedir}/tests/pdepend/overview-pyramid.svg" />
  36. <arg path="${basedir}" />
  37. </exec>
  38. </target>
  39. <target name="phpmd"
  40. description="Perform project mess detection using PHPMD and print human readable output. Intended for usage on the command line before committing.">
  41. <exec executable="phpmd">
  42. <arg path="${basedir}" />
  43. <arg value="text" />
  44. <arg value="${basedir}/tests/phpmd.xml" />
  45. </exec>
  46. </target>
  47. <target name="phpmd-ci" description="Perform project mess detection using PHPMD creating a log file for the continuous integration server">
  48. <exec executable="phpmd">
  49. <arg path="${basedir}" />
  50. <arg value="xml" />
  51. <arg value="${basedir}/tests/phpmd.xml" />
  52. <arg value="--reportfile" />
  53. <arg value="${basedir}/tests/logs/pmd.xml" />
  54. </exec>
  55. </target>
  56. <target name="phpcs"
  57. description="Find coding standard violations using PHP_CodeSniffer and print human readable output. Intended for usage on the command line before committing.">
  58. <exec executable="phpcs">
  59. <arg value="--standard=${basedir}/tests/phpcs.xml" />
  60. <arg path="${basedir}" />
  61. </exec>
  62. </target>
  63. <target name="phpcs-ci" description="Find coding standard violations using PHP_CodeSniffer creating a log file for the continuous integration server">
  64. <exec executable="phpcs" output="/dev/null">
  65. <arg value="--report=checkstyle" />
  66. <arg value="--report-file=${basedir}/tests/logs/checkstyle.xml" />
  67. <arg value="--standard=${basedir}/tests/phpcs.xml" />
  68. <arg path="${basedir}" />
  69. </exec>
  70. </target>
  71. <!--target name="simpletest" description="Run simpletests">
  72. <simpletest>
  73. <formatter type="plain"/>
  74. <fileset dir="${basedir}/tests">
  75. <include name="test_suite.php"/>
  76. </fileset>
  77. </simpletest>
  78. </target-->
  79. <target name="phpunit" description="Run unit tests with PHPUnit">
  80. <!-- depends="lint"-->
  81. <!--exec executable="phpunit" failonerror="true"-->
  82. <exec executable="phpunit">
  83. <arg line="-c ${basedir}/phpunit/phpunit.xml" />
  84. </exec>
  85. </target>
  86. <target name="phpdoc" description="Generate API documentation">
  87. <exec executable="phpdoc">
  88. <arg line="-d ${basedir} -t ${basedir}/logs/docs -ti ChamiloLMS -i ${basedir}/../archive/*,${basedir}/../home/*,${basedir}/../main/inc/entity/*,${basedir}/../main/inc/lib/symfony/*,${basedir}/../main/inc/lib/phpdocx/*,${basedir}/../main/inc/lib/phpqrcode/*,${basedir}/../main/inc/lib/mpdf/*,${basedir}/../main/inc/lib/internationalization_database/transliteration/*,${basedir}/../main/inc/lib/phpmailer/*,${basedir}/../main/inc/lib/htmlpurifier/*,${basedir}/../main/inc/lib/fckeditor/*,${basedir}/../main/inc/lib/formvalidator/*,${basedir}/../main/upload/users/*,${basedir}/../main/lang/*,${basedir}/../courses/*,.htaccess -c ${basedir}/phpDocumentor.ini" />
  89. </exec>
  90. </target>
  91. <target name="phpcb" description="Aggregate tool output with PHP_CodeBrowser">
  92. <exec executable="phpcb">
  93. <arg value="--log" />
  94. <arg path="${basedir}/tests/logs" />
  95. <arg value="--source" />
  96. <arg path="${basedir}" />
  97. <arg value="--output" />
  98. <arg path="${basedir}/tests/code-browser" />
  99. </exec>
  100. </target>
  101. </project>