1+ <?xml version =" 1.0" encoding =" utf-8" ?>
2+ <project name =" Wavevision Point" default =" init" >
3+
4+
5+ <property name =" src" value =" php/WavevisionCodingStandard" />
6+ <property name =" tests" value =" php/tests" />
7+ <property name =" phpBin" value =" php" />
8+ <property name =" codeSnifferExclude" value =" */data/*" />
9+ <property name =" codeSnifferRuleset" value =" codesniffer-ruleset.xml" />
10+ <property name =" bin" value =" vendor/bin" />
11+
12+ <target name =" check" description =" Run lints and tests. Run before every pull request"
13+ depends =" rm-cache, lint, cs, phpstan, test" />
14+ <target name =" cs" description =" Check code style and fix it if possible" depends =" phpcbf, phpcs" />
15+ <target name =" init" description =" Initialize project" depends =" composer" />
16+
17+ <target name =" rm-cache" description =" Clear cache" >
18+ <exec executable =" rm -rf temp/cache" />
19+ </target >
20+
21+ <target name =" composer" description =" Download php dependencies" >
22+ <exec
23+ executable =" composer"
24+ logoutput =" true"
25+ passthru =" true"
26+ checkreturn =" true"
27+ >
28+ <arg value =" install" />
29+ </exec >
30+ </target >
31+
32+ <target name =" lint" description =" Check php syntax" >
33+ <exec
34+ executable =" ${ bin } /parallel-lint"
35+ logoutput =" true"
36+ passthru =" true"
37+ checkreturn =" true"
38+ >
39+ <arg value =" -e" />
40+ <arg value =" ${ phpBin } " />
41+ <arg value =" ${ src } " />
42+ <arg value =" ${ tests } " />
43+ </exec >
44+ </target >
45+
46+ <target name =" phpcbf" description =" Fix fixable code style issues" >
47+ <exec
48+ executable =" ${ bin } /phpcbf"
49+ logoutput =" true"
50+ passthru =" true"
51+ checkreturn =" false"
52+ >
53+ <arg value =" -spn" />
54+ <arg value =" --standard=${ codeSnifferRuleset } " />
55+ <arg value =" --extensions=${ phpBin } " />
56+ <arg value =" --ignore=${ codeSnifferExclude } " />
57+ <arg value =" ${ src } " />
58+ <arg value =" ${ tests } " />
59+ </exec >
60+ </target >
61+
62+ <target name =" phpcs" description =" Check code style and don't fix it" >
63+ <exec
64+ executable =" ${ bin } /phpcs"
65+ logoutput =" true"
66+ passthru =" true"
67+ checkreturn =" true"
68+ >
69+ <arg value =" -sp" />
70+ <arg value =" --standard=${ codeSnifferRuleset } " />
71+ <arg value =" --extensions=${ phpBin } " />
72+ <arg value =" --ignore=${ codeSnifferExclude } " />
73+ <arg value =" ${ src } " />
74+ <arg value =" ${ tests } " />
75+ </exec >
76+ </target >
77+
78+ <target name =" phpstan" description =" Run static analysis" >
79+ <exec
80+ executable =" ${ bin } /phpstan"
81+ logoutput =" true"
82+ passthru =" true"
83+ checkreturn =" true"
84+ >
85+ <arg value =" analyze" />
86+ <arg value =" ${ src } " />
87+ <arg value =" --level" />
88+ <arg value =" max" />
89+ </exec >
90+ </target >
91+
92+ <target name =" test" description =" Run tests" >
93+ <exec
94+ executable =" ${ bin } /phpunit"
95+ logoutput =" true"
96+ passthru =" true"
97+ checkreturn =" true"
98+ >
99+ </exec >
100+ </target >
101+
102+ <target name =" test-no-coverage" description =" Run tests without coverage" >
103+ <exec
104+ executable =" ${ bin } /phpunit"
105+ logoutput =" true"
106+ passthru =" true"
107+ checkreturn =" true"
108+ >
109+ <arg value =" --no-coverage" />
110+ </exec >
111+ </target >
112+
113+
114+ </project >
0 commit comments