This repository has been archived by the owner on Oct 15, 2024. It is now read-only.
forked from inetprocess/sugarcli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
126 lines (111 loc) · 4.9 KB
/
build.xml
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<?xml version="1.0"?>
<project name="build" default="mainloop">
<property name="directories" value="src" />
<property name="excludeDirs" value="Inet/Tests/**" />
<property name="mainPhingDir" value="reports/phing-reports" />
<property name="pkgPHPVersions" value="5.3 -> 5.4" />
<property name="pkgSugarCRMVersions" value="6.5 -> 7.6" />
<property name="pkgCopyright" value="2005-2016 iNet Process" />
<property name="pkgName" value="inetprocess/sugarcli" />
<property name="pkgLicense" value="Apache License 2.0" />
<property name="pkgLink" value="https://github.com/inetprocess/sugarcli" />
<target name="mainloop">
<!-- Deleting old reports and creating an empty folder -->
<delete dir="${mainPhingDir}" failonerror="false" />
<mkdir dir="${mainPhingDir}" />
<!-- Folder by Folder, launch the PHP Checks -->
<foreach list="${directories}" param="directory" target="phpcheck" />
</target>
<!-- PHP Code checking -->
<target name="phpcheck">
<reflexive>
<fileset dir="${directory}" excludes="${excludeDirs}">
<include name="**/*.php"/>
</fileset>
<filterchain>
<replaceregexp>
<regexp pattern=" \* PHP Version (.*)" replace=" * PHP Version ${pkgPHPVersions}"/>
<regexp pattern=" \* SugarCRM Versions (.*)" replace=" * SugarCRM Versions ${pkgSugarCRMVersions}"/>
<regexp pattern=" \* @copyright (.*)" replace=" * @copyright ${pkgCopyright}"/>
<regexp pattern=" \* @package (.*)" replace=" * @package ${pkgName}"/>
<regexp pattern=" \* @license (.*)" replace=" * @license ${pkgLicense}"/>
<regexp pattern=" \* @link (.*)" replace=" * @link ${pkgLink}"/>
</replaceregexp>
</filterchain>
</reflexive>
<!-- Define the directory where we'll put our reports -->
<php function="str_replace" returnProperty="reportsSubDir">
<param value="/"/>
<param value="--"/>
<param value="${directory}"/>
</php>
<property name="reportsDir" value="${mainPhingDir}/${reportsSubDir}" />
<!-- Deleting old reports and creating an empty folder -->
<delete dir="${reportsDir}" failonerror="false" />
<mkdir dir="${reportsDir}" />
<!-- Executing phpCodeSniffer -->
<phpcodesniffer
standard="PSR2"
showSniffs="true"
showWarnings="true"
haltonerror="false"
docGenerator="HTML"
docFile="${mainPhingDir}/phpcs-coding-standards.html"
tabWidth="4">
<fileset dir="${directory}" excludes="${excludeDirs}">
<include name="**/*.php"/>
</fileset>
<formatter type="csv" usefile="true" outfile="${reportsDir}/phpcs.csv"/>
<formatter type="full" usefile="true" outfile="${reportsDir}/phpcs-full.txt"/>
</phpcodesniffer>
<!-- Executing phpCopyPasteDetector -->
<phpcpd>
<fileset dir="${directory}" excludes="${excludeDirs}">
<include name="**/*.php"/>
</fileset>
<formatter type="pmd" outfile="${reportsDir}/phpcpd.xml"/>
</phpcpd>
<!-- Executing phploc -->
<phploc
countTests="true"
reportType="txt"
reportDirectory="${reportsDir}"
reportName="phploc">
<fileset dir="${directory}" excludes="${excludeDirs}">
<include name="**/*.php"/>
</fileset>
</phploc>
<!-- Executing phpMessDetector -->
<phpmd>
<fileset dir="${directory}" excludes="${excludeDirs}">
<include name="**/*.php"/>
</fileset>
<formatter type="html" outfile="${reportsDir}/pmd.html"/>
</phpmd>
<!-- Executing phpdepend -->
<phpdepend>
<fileset dir="${directory}" excludes="${excludeDirs}">
<include name="**/*.php"/>
</fileset>
<logger type="jdepend-xml" outfile="${reportsDir}/phpdepend-jdepend.xml"/>
<analyzer type="coderank-mode" value="method"/>
</phpdepend>
<!-- Executing phpdoc2 -->
<delete dir="${reportsDir}/apidocs" failonerror="false" />
<mkdir dir="${reportsDir}/apidocs" />
<phpdoc2 title="API Documentation"
destdir="${reportsDir}/apidocs"
template="responsive-twig">
<fileset dir="${directory}" excludes="${excludeDirs}">
<include name="**/*.php" />
</fileset>
</phpdoc2>
<!-- Executing phpLint -->
<phplint
tofile="${reportsDir}/phplint.txt">
<fileset dir="${directory}" excludes="${excludeDirs}">
<include name="**/*.php"/>
</fileset>
</phplint>
</target>
</project>