-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathbuild.xml
More file actions
97 lines (90 loc) · 4.29 KB
/
build.xml
File metadata and controls
97 lines (90 loc) · 4.29 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<?xml version="1.0" encoding="UTF-8"?>
<!--
Phing build config file.
@link http://www.phing.info/
-->
<project name="blogapp" default="build">
<!-- Properties -->
<property name="basedir" value="${phing.dir}" />
<property name="appdir" value="${basedir}/app" />
<property name="logdir" value="${appdir}/tmp/logs" />
<property name="vendorbindir" value="${appdir}/Vendor/bin" />
<!-- Build(1) -->
<target name="build" depends="prepare,caketest,behat,phpcs,phpmd,phpcpd,phpdoc"/>
<!-- Prepare(2) -->
<target name="prepare" description="Prepare for build">
<exec dir="${appdir}" executable="${appdir}/Console/cake" output="${logdir}/migration.log" checkreturn="true">
<arg line="migrations.migration" />
<arg line="run" />
<arg line="all" />
</exec>
</target>
<!-- CakePHP unit test with PHPUnit(3) -->
<target name="caketest" description="Run CakePHP unit tests with PHPUnit">
<exec dir="${appdir}" executable="${appdir}/Console/cake" output="${logdir}/caketest.log" checkreturn="true">
<arg line="test" />
<arg line="--log-junit=${appdir}/reports/unittest.xml" />
<arg line="--coverage-html=${appdir}/reports" />
<arg line="--coverage-clover=${appdir}/reports/coverage.xml" />
<arg line="app" />
<arg line="AllTests" />
</exec>
</target>
<!-- CakePHP acceptance test with Behat -->
<target name="behat" description="Run CakePHP acceptance test with Behat">
<exec command="find ${appdir}/tmp -type d -print | xargs chmod 777" escape="false" />
<exec dir="${appdir}" executable="${appdir}/Console/cake" output="${logdir}/behat.log" checkreturn="true">
<arg line="Bdd.story" />
<arg line="--format=junit" />
<arg line="--out=${appdir}/reports" />
</exec>
</target>
<!-- PHPCodeSniffer -->
<target name="phpcs" description="Find coding standard violations using PHP_CodeSniffer.">
<exec dir="${basedir}" executable="${vendorbindir}/phpcs" output="${logdir}/phpcs.log">
<arg line="--config-set" />
<arg line="installed_paths" />
<arg line="${appdir}/Vendor/cakephp/cakephp-codesniffer" />
</exec>
<exec dir="${basedir}" executable="${vendorbindir}/phpcs" output="${logdir}/phpcs.log">
<arg line="--ignore=Test,Vendor,Plugin" />
<arg line="--report=checkstyle" />
<arg line="--report-checkstyle=${appdir}/reports/checkstyle.xml" />
<arg line="--standard=CakePHP" />
<arg line="--extensions=php" />
<arg line="${appdir}" />
</exec>
</target>
<!-- PHPMD -->
<target name="phpmd" description="Perform project mess detection using PHPMD">
<exec dir="${basedir}" executable="${vendorbindir}/phpmd" output="${logdir}/phpmd.log">
<arg line="${appdir}" />
<arg line="xml" />
<arg line="codesize,unusedcode,design,naming" />
<arg line="--exclude ${appdir}/Test,${appdir}/Vendor,${appdir}/Plugin,${appdir}/Config/Migration,${appdir}/Config/Schema" />
<arg line="--reportfile ${appdir}/reports/phpmd.xml" />
</exec>
</target>
<!-- PHPCPD -->
<target name="phpcpd" description="Perform project mess detection using PHPMD">
<exec dir="${basedir}" executable="${vendorbindir}/phpcpd" output="${logdir}/phpcpd.log">
<arg line="--exclude Vendor" />
<arg line="--exclude Plugin" />
<arg line="--exclude webroot" />
<arg line="--log-pmd ${appdir}/reports/phpcpd.xml" />
<arg line="--names *.php,*.cpt" />
<arg line="${appdir}" />
</exec>
</target>
<!-- phpdoc -->
<target name="phpdoc" description="Generate Application Documentation using phpDocumentor">
<exec dir="${basedir}" executable="phpdoc" output="${logdir}/phpdoc.log" checkreturn="true">
<arg line="run" />
<arg line="-t ${appdir}/reports/doc" />
<arg line="-d ${appdir}/" />
<arg line="-e php" />
<arg line="-i ${appdir}/Vendor/,${appdir}/Plugin/,${appdir}/Test/,${appdir}/Config/" />
<arg line="-p" />
</exec>
</target>
</project>