This repository has been archived by the owner on Nov 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.xml
64 lines (53 loc) · 2.04 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="Sastrawi\SentenceDetector" default="build">
<property name="php" value="php"/>
<target name="build"
depends="prepare,lint,phpcs,php-cs-fixer,phpunit,behat"/>
<target name="prepare">
<mkdir dir="${basedir}/build"/>
</target>
<target name="lint">
<apply executable="${php}" failonerror="true">
<arg value="-l" />
<fileset dir="${basedir}/src">
<include name="**/*.php" />
<modified />
</fileset>
<fileset dir="${basedir}/tests">
<include name="**/*.php" />
<modified />
</fileset>
</apply>
</target>
<target name="phpunit" description="Run unit tests with PHPUnit">
<exec executable="phpunit" failonerror="true">
<arg value="--coverage-clover=${basedir}/build/coverage.clover" />
</exec>
</target>
<target name="behat" description="Run behat tests">
<exec executable="vendor/bin/behat" failonerror="true">
</exec>
</target>
<target name="phpcs" description="Run coding style analysis PHP Code Sniffer">
<exec executable="${basedir}/vendor/bin/phpcs" failonerror="true">
<arg value="--standard=PSR2" />
<arg value="--extensions=php" />
<arg path="${basedir}/src" />
<arg path="${basedir}/tests" />
</exec>
</target>
<target name="php-cs-fixer" description="Run fabpot/PHP-CS-Fixer">
<exec executable="${basedir}/php-cs-fixer.phar" failonerror="true">
<arg value="fix" />
<arg value="--dry-run" />
<arg value="--level=psr2" />
<arg path="${basedir}/src" />
</exec>
<exec executable="${basedir}/php-cs-fixer.phar" failonerror="true">
<arg value="fix" />
<arg value="--dry-run" />
<arg value="--level=psr2" />
<arg path="${basedir}/tests" />
</exec>
</target>
</project>