-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathbuild.xml
121 lines (106 loc) · 4.51 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="projecttemplate" default="help">
<property name="builddir" value="${project.basedir}/build"/>
<!-- Shows the help message -->
<target name="help">
<echo message="General Targets"/>
<echo message="==============="/>
<echo message="phing test Run unit tests."/>
<echo message="phing test-log Run unit tests with logging enabled."/>
<echo message="phing phpcs Run phpcs."/>
<echo message="phing phpcs-log Run phpcs with logging enabled."/>
<echo message="phing phpmd Run phpmd."/>
<echo message="phing phpmd-log Run phpmd with logging enabled."/>
<echo message="phing phpcpd-log Run phpcpd with logging enabled."/>
<echo message="phing pdepend-log Run pdepend with logging enabled."/>
<echo message="phing phpcb-log Run phpcb with logging enabled."/>
<echo message=""/>
<echo message="Misc Targets"/>
<echo message="============"/>
<echo message="phing ci Alias task for continuous integration servers"/>
</target>
<!-- Clean up -->
<target name="clean">
<delete dir="${builddir}"/>
<!-- Create build directories -->
<mkdir dir="${builddir}/coverage"/>
<mkdir dir="${builddir}/logs"/>
<mkdir dir="${builddir}/release"/>
<mkdir dir="${builddir}/code-browser"/>
</target>
<!-- Run unit tests -->
<target name="test">
<exec command="phpunit --bootstrap=modules/unittest/bootstrap.php modules/unittest/tests.php" passthru="true"/>
</target>
<!-- Run unit tests and generate junit.xml and clover.xml -->
<target name="test-log">
<exec command="phpunit --bootstrap=modules/unittest/bootstrap.php --coverage-html=${builddir}/coverage --log-junit=${builddir}/logs/junit.xml --coverage-clover=${builddir}/logs/clover.xml modules/unittest/tests.php" passthru="true"/>
</target>
<!-- Run PHP Code Sniffer -->
<target name="phpcs">
<phpcodesniffer standard="Kohana" showSniffs="true" showWarnings="true">
<fileset dir="${project.basedir}">
<include name="**/*.php" />
<exclude name="**/vendor/**" />
</fileset>
<formatter type="default" usefile="false"/>
</phpcodesniffer>
</target>
<!-- Run PHP Code Sniffer and generate checkstyle.xml -->
<target name="phpcs-log">
<phpcodesniffer standard="Kohana" showSniffs="true" showWarnings="true">
<fileset dir="${project.basedir}">
<include name="**/*.php" />
<exclude name="**/vendor/**" />
</fileset>
<formatter type="default" usefile="false"/>
<formatter type="checkstyle" outfile="${builddir}/logs/checkstyle.xml"/>
</phpcodesniffer>
</target>
<!-- Run PHP Mess Detector -->
<target name="phpmd">
<exec command="phpmd ${project.basedir} text codesize,unusedcode --exclude=**/vendor/**" passthru="true"/>
</target>
<!-- Run PHP Mess Detector and generate pmd.xml -->
<target name="phpmd-log">
<exec command="phpmd ${project.basedir} xml codesize,unusedcode --exclude=**/vendor/** --reportfile ${builddir}/logs/pmd.xml" passthru="true"/>
</target>
<!-- Run PHP Copy/Paste Detector and generate pmd.xml -->
<target name="phpcpd-log">
<phpcpd>
<fileset dir="${project.basedir}">
<include name="**/*.php" />
<exclude name="**/vendor/**" />
</fileset>
<formatter type="pmd" outfile="${builddir}/logs/pmd-cpd.xml"/>
</phpcpd>
</target>
<!-- Run PHP Depend and generate jdepend.xml -->
<target name="pdepend-log">
<phpdepend>
<fileset dir="${project.basedir}">
<include name="**/*.php" />
<exclude name="**/vendor/**" />
</fileset>
<logger type="jdepend-xml" outfile="${builddir}/logs/jdepend.xml"/>
<!--<analyzer type="coderank-mode" value="method"/>-->
</phpdepend>
</target>
<!-- Run PHP CodeBrowser and generate output -->
<target name="phpcb-log">
<exec command="phpcb --log ${builddir}/logs --source ${project.basedir} --output ${builddir}/code-browser" passthru="true"/>
</target>
<!-- Hudson CI target -->
<target name="ci" depends="clean">
<phingcall target="test-log"/>
<phingcall target="pdepend-log"/>
<!-- <phingcall target="phpmd-log"/> -->
<phingcall target="phpcpd-log"/>
<phingcall target="phpcs-log"/>
<phingcall target="phpcb-log"/>
</target>
<!-- Webistrano Deploy of QA Stage -->
<target name="deploy-qa">
<exec command="ruby /usr/local/webistrano/script/deploy --description='Automatically deployed from successful build' ${phing.project.name} qa" passthru="true"/>
</target>
</project>