-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.xml
49 lines (38 loc) · 1.64 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="cadre" default="build">
<target name="build" depends="prepare,lint,phpcs,phpunit" />
<target name="test" depends="phpunit" />
<target name="coverage" depends="phpunit-coverage" />
<target name="clean" description="Cleanup build artifacts">
<delete dir="build/coverage"/>
</target>
<target name="prepare" depends="clean" description="Prepare for build">
<mkdir dir="build/coverage"/>
</target>
<target name="lint" description="Perform syntax check of sourcecode files">
<apply executable="php" checkreturn="true">
<arg value="-l" />
<fileset dir="src">
<include name="**/*.php" />
</fileset>
<fileset dir="tests">
<include name="**/*.php" />
</fileset>
</apply>
</target>
<target name="phpcs" description="Find coding standard violations using PHP_CodeSniffer">
<exec executable="vendor/bin/phpcs" passthru="true" checkreturn="true">
<arg value="--standard=phpcs.xml" />
<arg path="src" />
<arg path="tests" />
</exec>
</target>
<target name="phpunit" description="Run all tests with PHPUnit">
<exec executable="vendor/bin/phpunit" passthru="true" checkreturn="true" />
</target>
<target name="phpunit-coverage" depends="prepare" description="Run all tests and generate html coverage report">
<exec executable="vendor/bin/phpunit" passthru="true" checkreturn="true">
<arg value="--coverage-html=build/coverage" />
</exec>
</target>
</project>