-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
63 lines (53 loc) · 2.12 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
<?xml version="1.0" encoding="UTF-8"?>
<project default="build">
<property name="workspace" value="${basedir}" />
<property name="sourcedir" value="${basedir}/src" />
<property name="builddir" value="${workspace}/app/build" />
<target name="build" depends="prepare"/>
<target name="clean" description="Cleanup build artifacts">
<delete dir="${builddir}"/>
<delete dir="${workspace}/vendor"/>
<delete file="${workspace}/composer.phar"/>
</target>
<target name="prepare" depends="clean" description="Prepare for build">
<mkdir dir="${builddir}/logs"/>
<exec executable="wget">
<arg value="http://getcomposer.org/composer.phar" />
</exec>
<exec executable="php">
<arg value="composer.phar"/>
<arg value="update"/>
<arg value="--dev"/>
</exec>
</target>
<target name="lint" description="Perform syntax check of sourcecode files">
<apply executable="php" failonerror="true">
<arg value="-l" />
<fileset dir="${sourcedir}">
<include name="**/*.php" />
<modified />
</fileset>
<fileset dir="${basedir}/src/">
<include name="**/*Test.php" />
<modified />
</fileset>
</apply>
</target>
<target name="phpcs-ci" description="Find coding standard violations using PHP_CodeSniffer creating a log file for the continuous integration server">
<exec executable="phpcs">
<arg value="-p" />
<arg value="--report=checkstyle" />
<arg value="--report-file=${builddir}/logs/checkstyle.xml" />
<arg value="--standard=PSR2" />
<arg value="--extensions=php" />
<arg path="${sourcedir}" />
</exec>
</target>
<target name="phpunit" description="Run unit tests with PHPUnit">
<exec executable="phpunit" failonerror="true">
<arg value="--debug" />
<arg value="-c" />
<arg value="${basedir}/app/phpunit.xml.dist" />
</exec>
</target>
</project>