-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
149 lines (131 loc) · 4.68 KB
/
build.xml
File metadata and controls
149 lines (131 loc) · 4.68 KB
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
<?xml version="1.0" encoding="UTF-8" ?>
<project default="start" basedir="./">
<!-- ### Settings -->
<!-- Available tools -->
<property name="phpmd" value="./vendor/bin/phpmd" />
<property name="phpcpd" value="./vendor/bin/phpcpd" />
<property name="phpcsfixer" value="./vendor/bin/php-cs-fixer" />
<property name="phpcs" value="vendor/bin/phpcs" />
<property name="phpcbf" value="vendor/bin/phpcbf" />
<property name="phpspec" value="bin/phpspec" />
<!-- Project directories -->
<property name="module" value="./test/" />
<!-- ### Main Tasks -->
<!-- Build project -->
<target name="start"
description="Perform syntax check and mess detection of sourcecode files, find duplicate code"
depends="verify, analyze" />
<!-- Verify code consistency -->
<target name="verify"
description="Perform syntax check of sourcecode files"
depends="lint-php"
hidden="true" />
<!-- Analyze code -->
<target name="analyze"
description="Perform project mess detection, find duplicate code"
depends="phpmd, phpcs, phpcpd"
hidden="true" />
<!-- Code Style fixes -->
<target name="fix"
description="Find coding standard violations and print human readable output"
depends="phpcbf, phpcsfixer" />
<target name="dryrun"
description="Find coding standard violations and print human readable outup fix dryrun"
depends="phpcsfixer-dry-run" />
<!-- ### Subtasks -->
<!-- PHP linting -->
<target name="lint-php"
unless="lint.done"
hidden="true">
<phplint haltonfailure="true" deprecatedAsError="true">
<fileset dir="${module}">
<include name="**/*.php" />
<include name="*.php" />
</fileset>
</phplint>
<property name="lint.done" value="true" />
</target>
<!-- PHP Code Sniffer -->
<target name="phpcs"
unless="phpcs.done"
hidden="true">
<exec logoutput="true"
executable="${phpcs}"
passthru="true"
output="logs/phpcs.log">
<arg line="--standard=PSR12 ${module} -v" />
</exec>
<property name="phpcs.done" value="true" />
</target>
<!-- PHP Code Fixer -->
<target name="phpcbf"
unless="phpcbf.done"
hidden="true">
<exec logoutput="true"
executable="${phpcbf}"
passthru="true"
output="logs/phpcbf.log">
<arg line="--standard=PSR12 ${module} -v" />
</exec>
<property name="phpcbf.done" value="true" />
</target>
<!-- PHP Mess Detector -->
<target name="phpmd"
unless="phpmd.done"
hidden="true">
<exec executable="${phpmd}"
logoutput="true"
output="logs/phpmd.log"
passthru="true">
<arg line="${module} text ./phpmd.xml" />
</exec>
<property name="phpmd.done" value="true" />
</target>
<!-- PHP Coding Standards Fixer -->
<target name="phpcsfixer"
unless="phpcsfixer.done"
hidden="true">
<exec logoutput="true"
executable="${phpcsfixer}"
output="logs/fixed.log"
passthru="true">
<arg line="fix ${module} --using-cache=no -v" />
</exec>
<property name="phpcsfixer.done" value="true" />
</target>
<!-- PHP Coding Standards Fixer - Dry Run -->
<target name="phpcsfixer-dry-run"
unless="phpcsfixer.done"
hidden="true">
<exec logoutput="true"
executable="${phpcsfixer}"
output="logs/tofix.log"
passthru="true">
<arg line="fix ${module} --dry-run -vv" />
</exec>
<property name="phpcsfixer.done" value="true" />
</target>
<!-- PHP Copy/Paste Detector -->
<target name="phpcpd"
unless="phpcpd.done"
hidden="true">
<phpcpd>
<fileset dir="${module}">
<include name="**/*.php" />
<include name="*.php" />
</fileset>
<formatter type="pmd" outfile="logs/phpcpd.xml" />
</phpcpd>
<property name="phpcpd.done" value="true" />
</target>
<target name="phpspec">
<exec executable="bin/phpspec" passthru="true" checkreturn="true">
<arg line="run --format=pretty"/>
</exec>
</target>
<target name="phpspec">
<exec executable="${phpspec}" passthru="true" checkreturn="true">
<arg line="run --format=pretty"/>
</exec>
</target>
</project>