-
Notifications
You must be signed in to change notification settings - Fork 102
/
build.xml
53 lines (45 loc) · 1.95 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
<project name="Symfony-coding-standard" default="test">
<property file="build.properties" />
<property environment="env"/>
<available property="composer.exists" file="${composer.path}" />
<condition property="composer.exists">
<istrue value="${env.TRAVIS}" />
</condition>
<target name="test" depends="vendor,lint,phpunit,phpcs" />
<target name="prepare" depends="clean" description="Prepare for build">
<mkdir dir="${basedir}/build/coverage" />
<mkdir dir="${basedir}/build/logs" />
</target>
<target name="clean" description="Cleanup build artifacts">
<delete dir="${basedir}/build" />
</target>
<target name="vendor" description="Load composer repositories" depends="composer" unless="${env.TRAVIS}">
<exec executable="${composer.path}" failonerror="true">
<arg value="install" />
</exec>
</target>
<target name="composer" description="Download composer" unless="composer.exists">
<get src="${composer.url}" dest="${composer.path}" />
<chmod file="${composer.path}" perm="u+x"/>
</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" description="Run unit tests with PHPUnit">
<exec executable="./vendor/bin/phpunit" failonerror="true" />
</target>
<target name="phpcs" description="Find coding standard violations using PHP Code Sniffer">
<exec executable="./vendor/bin/phpcs" failonerror="true">
<arg value="--standard=${phpcs.standard}" />
<arg value="--extensions=php" />
<arg value="--ignore=vendor/*" />
<arg path="${basedir}" />
</exec>
</target>
</project>