build.xml 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. - SPDX-FileCopyrightText: 2014 ownCloud, Inc.
  4. - SPDX-License-Identifier: AGPL-3.0-or-later
  5. -->
  6. <project name="ownCloud" default="build">
  7. <!-- the target 'build' can be used by developers for command line builds -->
  8. <target name="build" depends="lint"/>
  9. <!-- php syntax analysis -->
  10. <target name="lint">
  11. <apply executable="php" failonerror="true">
  12. <arg value="-l" />
  13. <fileset dir="${basedir}">
  14. <include name="**/*.php" />
  15. <exclude name="**/3rdparty/**" />
  16. <exclude name="**/l10n/**" />
  17. <!-- modified / -->
  18. </fileset>
  19. </apply>
  20. <!-- this looks for @brief and @returns annotation in PHP files and fails if it found some -->
  21. <apply executable="egrep" failonerror="false" resultproperty="grepReturnCode">
  22. <arg value="-rsHn" />
  23. <arg value="@brief|@returns" />
  24. <fileset dir="${basedir}/build">
  25. <include name="**/*.php" />
  26. <exclude name="**/3rdparty/**" />
  27. <exclude name="**/l10n/**" />
  28. </fileset>
  29. </apply>
  30. <!-- fail if grep has found something -->
  31. <fail message="Please remove @returns and @brief annotations for PHPDoc (listed above)">
  32. <condition>
  33. <equals arg1="0" arg2="${grepReturnCode}"/>
  34. </condition>
  35. </fail>
  36. </target>
  37. </project>