~tcuthbert/wordpress/openstack-objectstorage

« back to all changes in this revision

Viewing changes to vendor/phpunit/php-timer/build.xml

  • Committer: Jacek Nykis
  • Date: 2015-02-11 15:35:31 UTC
  • Revision ID: jacek.nykis@canonical.com-20150211153531-hmy6zi0ov2qfkl0b
Initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="UTF-8"?>
 
2
 
 
3
<project name="PHP_Timer" default="build">
 
4
 <property name="php" value="php"/>
 
5
 <property name="phpunit" value="phpunit"/>
 
6
 
 
7
 <target name="build"
 
8
   depends="prepare,lint,phploc,pdepend,phpmd-ci,phpcs-ci,phpcpd,phpunit,phpcb"/>
 
9
 
 
10
 <target name="build-parallel"
 
11
   depends="prepare,lint,tools-parallel,phpunit,phpcb"/>
 
12
 
 
13
 <target name="tools-parallel"
 
14
         description="Run tools in parallel">
 
15
  <parallel threadCount="2">
 
16
   <sequential>
 
17
    <antcall target="pdepend"/>
 
18
    <antcall target="phpmd-ci"/>
 
19
   </sequential>
 
20
   <antcall target="phpcpd"/>
 
21
   <antcall target="phpcs-ci"/>
 
22
   <antcall target="phploc"/>
 
23
  </parallel>
 
24
 </target>
 
25
 
 
26
 <target name="clean" description="Cleanup build artifacts">
 
27
  <delete dir="${basedir}/build/api"/>
 
28
  <delete dir="${basedir}/build/code-browser"/>
 
29
  <delete dir="${basedir}/build/coverage"/>
 
30
  <delete dir="${basedir}/build/logs"/>
 
31
  <delete dir="${basedir}/build/pdepend"/>
 
32
 </target>
 
33
 
 
34
 <target name="prepare" depends="clean,phpab"
 
35
         description="Prepare for build">
 
36
  <mkdir dir="${basedir}/build/api"/>
 
37
  <mkdir dir="${basedir}/build/code-browser"/>
 
38
  <mkdir dir="${basedir}/build/coverage"/>
 
39
  <mkdir dir="${basedir}/build/logs"/>
 
40
  <mkdir dir="${basedir}/build/pdepend"/>
 
41
 </target>
 
42
 
 
43
 <target name="phpab" description="Generate autoloader scripts">
 
44
  <exec executable="phpab">
 
45
   <arg value="--output" />
 
46
   <arg path="PHP/Timer/Autoload.php" />
 
47
   <arg value="--template" />
 
48
   <arg path="PHP/Timer/Autoload.php.in" />
 
49
   <arg value="--indent" />
 
50
   <arg value="            " />
 
51
   <arg path="PHP" />
 
52
  </exec>
 
53
 </target>
 
54
 
 
55
 <target name="lint">
 
56
  <apply executable="${php}" failonerror="true">
 
57
   <arg value="-l" />
 
58
 
 
59
   <fileset dir="${basedir}/PHP">
 
60
    <include name="**/*.php" />
 
61
    <modified />
 
62
   </fileset>
 
63
 
 
64
   <fileset dir="${basedir}/Tests">
 
65
    <include name="**/*.php" />
 
66
    <modified />
 
67
   </fileset>
 
68
  </apply>
 
69
 </target>
 
70
 
 
71
 <target name="phploc" description="Measure project size using PHPLOC">
 
72
  <exec executable="phploc">
 
73
   <arg value="--log-csv" />
 
74
   <arg value="${basedir}/build/logs/phploc.csv" />
 
75
   <arg path="${basedir}/PHP" />
 
76
  </exec>
 
77
 </target>
 
78
 
 
79
 <target name="pdepend"
 
80
         description="Calculate software metrics using PHP_Depend">
 
81
  <exec executable="pdepend">
 
82
   <arg value="--jdepend-xml=${basedir}/build/logs/jdepend.xml" />
 
83
   <arg value="--jdepend-chart=${basedir}/build/pdepend/dependencies.svg" />
 
84
   <arg value="--overview-pyramid=${basedir}/build/pdepend/overview-pyramid.svg" />
 
85
   <arg path="${basedir}/PHP" />
 
86
  </exec>
 
87
 </target>
 
88
 
 
89
 <target name="phpmd"
 
90
         description="Perform project mess detection using PHPMD">
 
91
  <exec executable="phpmd">
 
92
   <arg path="${basedir}/PHP" />
 
93
   <arg value="text" />
 
94
   <arg value="${basedir}/build/phpmd.xml" />
 
95
  </exec>
 
96
 </target>
 
97
 
 
98
 <target name="phpmd-ci"
 
99
         description="Perform project mess detection using PHPMD">
 
100
  <exec executable="phpmd">
 
101
   <arg path="${basedir}/PHP" />
 
102
   <arg value="xml" />
 
103
   <arg value="${basedir}/build/phpmd.xml" />
 
104
   <arg value="--reportfile" />
 
105
   <arg value="${basedir}/build/logs/pmd.xml" />
 
106
  </exec>
 
107
 </target>
 
108
 
 
109
 <target name="phpcs"
 
110
         description="Find coding standard violations using PHP_CodeSniffer">
 
111
  <exec executable="phpcs">
 
112
   <arg value="--standard=${basedir}/build/PHPCS" />
 
113
   <arg value="--extensions=php" />
 
114
   <arg value="--ignore=Autoload.php" />
 
115
   <arg path="${basedir}/PHP" />
 
116
  </exec>
 
117
 </target>
 
118
 
 
119
 <target name="phpcs-ci"
 
120
         description="Find coding standard violations using PHP_CodeSniffer">
 
121
  <exec executable="phpcs" output="/dev/null">
 
122
   <arg value="--report=checkstyle" />
 
123
   <arg value="--report-file=${basedir}/build/logs/checkstyle.xml" />
 
124
   <arg value="--standard=${basedir}/build/PHPCS" />
 
125
   <arg value="--extensions=php" />
 
126
   <arg value="--ignore=Autoload.php" />
 
127
   <arg path="${basedir}/PHP" />
 
128
  </exec>
 
129
 </target>
 
130
 
 
131
 <target name="phpcpd" description="Find duplicate code using PHPCPD">
 
132
  <exec executable="phpcpd">
 
133
   <arg value="--log-pmd" />
 
134
   <arg value="${basedir}/build/logs/pmd-cpd.xml" />
 
135
   <arg path="${basedir}/PHP" />
 
136
  </exec>
 
137
 </target>
 
138
 
 
139
 <target name="phpunit" description="Run unit tests with PHPUnit">
 
140
  <condition property="phpunit_cmd" value="${php} ${phpunit}" else="${phpunit}">
 
141
   <not>
 
142
    <equals arg1="${phpunit}" arg2="phpunit" />
 
143
   </not>
 
144
  </condition>
 
145
 
 
146
  <exec executable="${phpunit_cmd}" failonerror="true"/>
 
147
 </target>
 
148
 
 
149
 <target name="phpcb"
 
150
         description="Aggregate tool output with PHP_CodeBrowser">
 
151
  <exec executable="phpcb">
 
152
   <arg value="--log" />
 
153
   <arg path="${basedir}/build/logs" />
 
154
   <arg value="--source" />
 
155
   <arg path="${basedir}/PHP" />
 
156
   <arg value="--output" />
 
157
   <arg path="${basedir}/build/code-browser" />
 
158
  </exec>
 
159
 </target>
 
160
</project>