aboutsummaryrefslogtreecommitdiffstats
path: root/build/build.xml
blob: a44eca134d5d56f96e599f77f9fbe07da49c33c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?xml version="1.0" encoding="UTF-8"?>
<!--
 - SPDX-FileCopyrightText: 2014 ownCloud, Inc.
 - SPDX-License-Identifier: AGPL-3.0-or-later
-->
<project name="ownCloud" default="build">

 <!-- the target 'build' can be used by developers for command line builds -->
 <target name="build" depends="lint"/>

 <!-- php syntax analysis -->
 <target name="lint">
  <apply executable="php" failonerror="true">
   <arg value="-l" />

   <fileset dir="${basedir}">
    <include name="**/*.php" />
    <exclude name="**/3rdparty/**" />
    <exclude name="**/l10n/**" />
    <!-- modified / -->
   </fileset>

  </apply>

  <!-- this looks for @brief and @returns annotation in PHP files and fails if it found some -->
  <apply executable="egrep" failonerror="false" resultproperty="grepReturnCode">
    <arg value="-rsHn" />
    <arg value="@brief|@returns" />

    <fileset dir="${basedir}/build">
      <include name="**/*.php" />
      <exclude name="**/3rdparty/**" />
      <exclude name="**/l10n/**" />
    </fileset>
  </apply>

  <!-- fail if grep has found something -->
  <fail message="Please remove @returns and @brief annotations for PHPDoc (listed above)">
    <condition>
      <equals arg1="0" arg2="${grepReturnCode}"/>
    </condition>
  </fail>

 </target>
</project>