-
Notifications
You must be signed in to change notification settings - Fork 34
/
build.xml
51 lines (42 loc) · 1.98 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="stfalcon.com" basedir="." default="build">
<property name="builddir" value="./build" />
<property name="sourcedir" value="./src" />
<property name="logsdir" value="${builddir}/logs" />
<property name="cachedir" value="./app/cache" />
<target name="init">
<mkdir dir="${builddir}" />
<mkdir dir="${logsdir}" />
<mkdir dir="${cachedir}" />
<exec command="php composer.phar self-update" escape="false" />
<exec command="php composer.phar update" escape="false" />
<exec command="git submodule init" escape="false" />
<exec command="git submodule update" escape="false" />
<exec command="php app/console cache:clear" escape="false" />
</target>
<target name="clean">
<echo msg="Clean..." />
<delete dir="${builddir}" />
</target>
<target name="build" depends="clean,init,phpcpd,phpunit,phpcs" />
<!-- PHP copy/paste analysis -->
<target name="phpcpd">
<phpcpd minLines="2" minTokens="10">
<fileset dir="${sourcedir}" id="filestocpd">
<include name="**/*.php"/>
</fileset>
<formatter type="pmd" outfile="${logsdir}/pmd.xml"/>
</phpcpd>
</target>
<target name="phpcs">
<touch file="${logsdir}/checkstyle.xml"/>
<exec command="phpcs --standard=symfony2 --ignore=*/Tests/*,*/Admin/* --report=checkstyle ${sourcedir} --report-file=${logsdir}/checkstyle.xml" escape="false" />
</target>
<!-- PHPUnit tests -->
<target name="phpunit">
<mkdir dir="${logsdir}/reports" />
<mkdir dir="${logsdir}/reports/coverage" />
<exec command="php app/console doctrine:migrations:migrate --no-interaction -env=test" escape="false" />
<exec command="phpunit -c ./app/ --log-junit ${logsdir}/reports/testsuites.xml --coverage-clover ${logsdir}/reports/coverage/clover.xml -c ./app/ " escape="false" />
</target>
</project>