-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.xml
85 lines (84 loc) · 3.14 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="${projectName}" default="main">
<!-- Properties -->
<property name="dir.reports" value="${project.basedir}/build/logs" />
<property name="dir.doc" value="${project.basedir}/doc" />
<!-- Clean target -->
<target name="clean">
<delete dir="${dir.reports}" />
<mkdir dir="${dir.reports}" />
<delete dir="${dir.doc}" />
<mkdir dir="${dir.doc}" />
<mkdir dir="${project.basedir}/logs/docblox/" />
</target>
<!-- Default target -->
<target name="main" depends="clean,test,pdepend,phpmd,phpcpd,phpcs,phploc,phpdoc">
<echo msg="All analysis done." />
</target>
<!-- PHP API Documentation -->
<target name="phpdoc" depends="clean">
<echo msg="PHP Documentor..." />
<exec command="docblox" dir="${project.basedir}" />
</target>
<!-- symfony test -->
<target name="test" depends="clean">
<echo msg="Running tests (sf1.3)" />
<exec command="php ${project.basedir}/test/bin/prove.php --symfony ../../../lib/sf13/lib --xml ${dir.reports}/build-13.xml" dir="${project.basedir}" />
<echo msg="Running tests (sf1.4)" />
<exec command="php ${project.basedir}/test/bin/prove.php --symfony ../../../lib/sf14/lib --xml ${dir.reports}/build-14.xml" dir="${project.basedir}" />
</target>
<!-- PHPLoc -->
<target name="phploc">
<taskdef name="phploc" classname="phing.tasks.ext.PHPLocTask" />
<phploc reportType="csv" reportName="phploc" reportDirectory="${dir.reports}" countTests="true">
<fileset dir="${project.basedir}">
<include name="**/*.php" />
</fileset>
</phploc>
</target>
<!-- PHP Mess Detector -->
<target name="phpmd">
<echo msg="PHP Mess Detector..." />
<phpmd rulesets="codesize,unusedcode">
<fileset dir="${project.basedir}">
<include name="**/*.php" />
</fileset>
<formatter type="xml" outfile="${dir.reports}/pmd.xml" />
</phpmd>
</target>
<!-- PHP copy/paste analysis -->
<target name="phpcpd">
<echo msg="PHP Copy/Paste..." />
<phpcpd>
<fileset dir="${project.basedir}">
<include name="**/*.php" />
</fileset>
<formatter type="pmd" outfile="${dir.reports}/pmd-cpd.xml" />
</phpcpd>
</target>
<!-- PHP dependency checker -->
<target name="pdepend">
<echo msg="PHP Depend..." />
<phpdepend>
<fileset dir="${project.basedir}">
<include name="**/*.php" />
</fileset>
<logger type="jdepend-xml" outfile="${dir.reports}/jdepend.xml" />
<logger type="jdepend-chart" outfile="${dir.reports}/dependencies.svg" />
<logger type="overview-pyramid" outfile="${dir.reports}/overview-pyramid.svg" />
</phpdepend>
</target>
<!-- PHP CodeSniffer -->
<target name="phpcs">
<echo msg="PHP CodeSniffer..." />
<phpcodesniffer standard="Symfony" showSniffs="true" showWarnings="true">
<fileset dir="${project.basedir}">
<include name="**/*.php" />
<exclude name="**/om/" />
<exclude name="**/base/" />
<exclude name="**/map/" />
</fileset>
<formatter type="checkstyle" outfile="${dir.reports}/checkstyle.xml" />
</phpcodesniffer>
</target>
</project>