-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.xml
66 lines (56 loc) · 2.59 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
<project name="Symfony-custom-coding-standard" default="test">
<property file="build.properties"/>
<available property="composer.exists" file="${composer.path}"/>
<available property="symlink.exists" file="${phpcs.symlink.path}"/>
<target name="test" depends="vendor,lint,phpunit,phpcs"/>
<target name="vendor" depends="composer" description="Load composer repositories">
<exec executable="/bin/bash" failonerror="true">
<arg value="-c" />
<arg value="php composer.phar install"/>
</exec>
</target>
<target name="composer" description="Download composer" unless="composer.exists">
<get src="${composer.url}" dest="${composer.path}"/>
</target>
<target name="lint" description="Perform syntax check">
<apply executable="php" failonerror="true">
<arg value="-l"/>
<fileset dir="${basedir}">
<include name="**/*.php"/>
<exclude name="vendor/**"/>
</fileset>
</apply>
</target>
<target name="phpunit" depends="symlink-cs" description="Run unit tests with PHPUnit">
<exec executable="${phpunit.bin}" failonerror="true" >
<arg value="--testsuite=SymfonyCustom"/>
</exec>
</target>
<target name="coverage" depends="symlink-cs" description="Run coverage with PHPUnit">
<exec executable="${phpunit.bin}" failonerror="true" >
<arg value="--verbose"/>
<arg value="--group=SymfonyCustom"/>
<arg value="${phpcs.dir}/tests/AllTests.php"/>
<arg value="--coverage-html=coverage"/>
</exec>
</target>
<target name="phpcs" depends="symlink-cs" description="Find coding standard violations using PHP Code Sniffer">
<exec executable="${phpcs.bin}" failonerror="true">
<arg value="--standard=SymfonyCustom"/>
<arg value="--extensions=php"/>
<arg value="--ignore=vendor/*"/>
<arg path="${basedir}"/>
</exec>
</target>
<target name="phpcbf" depends="symlink-cs" description="Find coding standard violations using PHP Code Sniffer">
<exec executable="${phpcbf.bin}" failonerror="true">
<arg value="--standard=SymfonyCustom"/>
<arg value="--extensions=php"/>
<arg value="--ignore=vendor/*"/>
<arg path="${basedir}"/>
</exec>
</target>
<target name="symlink-cs" description="Symlink this coding standard" unless="symlink.exists">
<symlink link="${phpcs.symlink.path}" resource="${basedir}/SymfonyCustom"/>
</target>
</project>