Skip to content
Newer
Older
100644 137 lines (113 sloc) 5.12 KB
892086b @cebe first commit
authored
1 <?xml version="1.0" encoding="UTF-8"?>
2 <project name="bms-whitelabel-tests" default="build" basedir=".">
3
4 <target name="build" depends="clean,lint,parallelTasks,phpunit"/>
5 <target name="build-nounit" depends="clean,lint,parallelTasks"/>
6 <target name="build-unit" depends="clean,lint,parallelTasks,phpunit-unit"/>
7
8 <target name="clean" depends="lncfg">
9 <!-- Clean up -->
10 <delete dir="build"/>
11
12 <!-- Create build directories -->
13 <mkdir dir="${basedir}/build/api"/>
14 <mkdir dir="${basedir}/build/yiiapi"/>
15 <mkdir dir="${basedir}/build/yiiapion"/>
16 <mkdir dir="${basedir}/build/code-browser"/>
17 <mkdir dir="${basedir}/build/coverage"/>
18 <mkdir dir="${basedir}/build/graph" />
19 <mkdir dir="${basedir}/build/logs"/>
20 <mkdir dir="${basedir}/build/pdepend"/>
21
22 <mkdir dir="${basedir}/application/runtime" />
23 <mkdir dir="${basedir}/application/tests/report" />
24
25 </target>
26
27 <target name="lncfg">
28 <exec executable="ln"><arg line="-sf -T /opt/yii yii" /></exec>
29 </target>
30
31 <!-- Run pdepend, phpmd, phpcpd, and phpcs in parallel -->
32 <target name="parallelTasks">
33 <parallel>
34 <antcall target="pdepend"/>
35 <antcall target="phpmd"/>
36 <antcall target="phpcpd"/>
37 <antcall target="phpcs"/>
38 <!--antcall target="phpdoc"/-->
39 </parallel>
40 </target>
41
42 <!-- Generate jdepend.xml and software metrics charts -->
43 <target name="pdepend">
44 <exec executable="pdepend">
45 <arg line="--jdepend-xml=${basedir}/build/logs/jdepend.xml
46 --jdepend-chart=${basedir}/build/pdepend/dependencies.svg
47 --overview-pyramid=${basedir}/build/pdepend/overview-pyramid.svg
48 --ignore=extensions,vendors,sites,migrations,messages,guidelines
49 app" />
50 </exec>
51 </target>
52
53 <!-- Generate pmd.xml -->
54 <target name="phpmd">
55 <exec executable="phpmd">
56 <arg line=". xml codesize,unusedcode
57 --reportfile ${basedir}/build/logs/pmd.xml
58 --exclude yii,extensions,vendors,sites,migrations,messages,guidelines" />
59 </exec>
60 </target>
61
62 <!-- Generate pmd-cpd.xml -->
63 <target name="phpcpd">
64 <exec executable="phpcpd">
65 <arg line="--log-pmd ${basedir}/build/logs/pmd-cpd.xml ." />
66 </exec>
67 </target>
68
69 <!-- Generate checkstyle.xml -->
70 <target name="phpcs">
71 <exec executable="phpcs">
72 <arg line="-v --report=checkstyle
73 --report-file=${basedir}/build/logs/checkstyle.xml
74 --standard=${basedir}/app/tests/guidelines
75 --ignore=extensions,vendors,sites,migrations,messages,guidelines,yiic.php
76 --extensions=php
77 app" />
78 </exec>
79 </target>
80 <!-- phpcs -v - -report=checkstyle - -report-file=build/logs/checkstyle.xml - -standard=application/resources/Guidelines.xml - -ignore=extensions,vendors,sites - -extensions=php application customer-->
81 <!-- Generate API documentation -->
82 <target name="phpdoc">
83 <exec executable="phpdoc">
84 <arg line="-ct type -ue on -t ${basedir}/build/api -tb application/vendors/phpuc/data/phpdoc -o HTML:Phpuc:phpuc -i extensions/,vendors/,sites/,migrations/,messages/,CSaveRelationsBehavior.php,TimeZoneCommand.php,yiic.php,Sniffs/ -d application"/>
85 </exec>
86 </target>
87
88 <target name="yiidoc">
89 <exec executable="${basedir}/application/yiic">
90 <arg line="api build/yiiapi"/>
91 </exec>
92 </target>
93
94 <target name="yiidocon">
95 <exec executable="${basedir}/application/yiic">
96 <arg line="api build/yiiapion online"/>
97 </exec>
98 </target>
99
100 <target name="lint" depends="clean">
101 <apply executable="php" dir="${basedir}" failonerror="on" logerror="on">
102 <arg line="-l"/>
103 <fileset dir="${basedir}">
104 <include name="**/*.php"/>
105 <exclude name="yii/**"/>
106 <exclude name="vendors/**"/>
107 </fileset>
108 </apply>
109 </target>
110
8ef3544 @cebe added sloccount to build.xml
authored
111 <target name="sloccount">
112 <exec executable="/opt/sloccount-2.26/sloccount" output="${basedir}/build/logs/sloccount.sc">
113 <env key="PATH" path="${env.PATH}:/sbin:/bin:/usr/sbin:/usr/bin:/opt/sloccount-2.26" />
114 <arg line="--duplicates --wide --details app/commands/testRunner"/>
115 </exec>
116 </target>
117
892086b @cebe first commit
authored
118 <target name="phpunit" depends="phpunit-unit,phpunit-functional" />
119
120 <target name="phpunit-unit" depends="lint">
121 <exec executable="phpunit" dir="${basedir}/application/tests" failonerror="on">
122 <arg line=" --log-junit ${basedir}/build/logs/junit.xml --coverage-clover ${basedir}/build/logs/clover.xml --coverage-html ${basedir}/build/coverage unit"/>
123 </exec>
124 </target>
125
126 <target name="phpunit-functional" depends="lint">
127 <exec executable="phpunit" dir="${basedir}/application/tests" failonerror="on">
128 <arg line=" --log-junit ${basedir}/build/logs/junit.xml --coverage-clover ${basedir}/build/logs/clover.xml --coverage-html ${basedir}/build/coverage functional"/>
129 </exec>
130 </target>
131
132 </project>
133
134
135
136
Something went wrong with that request. Please try again.