forked from mrprompt/silex-api-skel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
178 lines (156 loc) · 7.96 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
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model xlink:href="vendor/phing/phing/etc/phing-grammar.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0" ?>
<project name="Twitter-like" default="build">
<property name="project.bindir" value="${project.basedir}/vendor/bin" />
<property name="project.tmpdir" value="${project.basedir}/tmp" />
<property name="project.logdir" value="${project.tmpdir}/log" />
<target name="build" description="Build application" depends="phpcs, phploc, pdepend, phpmd, phpcpd, test, phpdox" />
<target name="database:create" description="Create database structure">
<exec executable="${project.bindir}/doctrine" passthru="true" checkreturn="true">
<arg value="orm:schema-tool:create" />
</exec>
</target>
<target name="database:update" description="Update database structure">
<exec executable="${project.bindir}/doctrine" passthru="true" checkreturn="true">
<arg value="orm:schema-tool:update" />
<arg value="--force" />
</exec>
</target>
<target name="database:migrate" description="Run migrations utility to update database">
<exec executable="${project.bindir}/doctrine" passthru="true" checkreturn="true">
<arg value="migrations:migrate" />
<arg value="--no-interaction" />
</exec>
</target>
<target name="database:clean-cache" description="Cleanup doctrine cache">
<exec executable="${project.bindir}/doctrine" passthru="true" checkreturn="true">
<arg value="orm:clear-cache:metadata" />
</exec>
<exec executable="${project.bindir}/doctrine" passthru="true" checkreturn="true">
<arg value="orm:clear-cache:query" />
</exec>
<exec executable="${project.bindir}/doctrine" passthru="true" checkreturn="true">
<arg value="orm:clear-cache:result" />
</exec>
<exec executable="${project.bindir}/doctrine" passthru="true" checkreturn="true">
<arg value="orm:generate:proxies" />
</exec>
</target>
<target name="database:drop" description="Drop the database">
<exec executable="${project.bindir}/doctrine" passthru="true" checkreturn="true">
<arg value="orm:schema-tool:drop" />
<arg value="--force" />
</exec>
</target>
<target name="fixtures" depends="database:drop, database:create" description="Load fixtures into database">
<exec executable="${project.bindir}/doctrine" passthru="true" checkreturn="true" description="Loading fixtures">
<arg value="fixtures:load" />
<arg value="${project.basedir}/fixtures/" />
<arg value="--append" />
</exec>
</target>
<target name="test" description="Run all tests">
<exec executable="${project.bindir}/phpunit" passthru="true" checkreturn="true">
<arg value="--log-junit" />
<arg value="${project.logdir}/junit-controller.xml" />
<arg value="--coverage-text=${project.logdir}/coverage.log" />
<arg value="--coverage-clover" />
<arg value="${project.logdir}/coverage.xml" />
</exec>
<exec executable="${project.bindir}/phpunit" passthru="true" checkreturn="true">
<arg value="--testsuite" />
<arg value="Entity" />
<arg value="--log-junit" />
<arg value="${project.logdir}/junit-entity.xml" />
<arg value="--coverage-text=${project.logdir}/coverage-entity.log" />
<arg value="--coverage-clover" />
<arg value="${project.logdir}/coverage-entity.xml" />
</exec>
<exec executable="${project.bindir}/phpunit" passthru="true" checkreturn="true">
<arg value="--testsuite" />
<arg value="Repository" />
<arg value="--log-junit" />
<arg value="${project.logdir}/junit-repository.xml" />
<arg value="--coverage-text=${project.logdir}/coverage-repository.log" />
<arg value="--coverage-clover" />
<arg value="${project.logdir}/coverage-repository.xml" />
</exec>
<exec executable="${project.bindir}/phpunit" passthru="true" checkreturn="true">
<arg value="--testsuite" />
<arg value="Service" />
<arg value="--log-junit" />
<arg value="${project.logdir}/junit-service.xml" />
<arg value="--coverage-text=${project.logdir}/coverage-service.log" />
<arg value="--coverage-clover" />
<arg value="${project.logdir}/coverage-service.xml" />
</exec>
</target>
<target name="lint" description="Perform syntax check of source code files">
<apply executable="php" failonerror="true" passthru="true" checkreturn="false">
<arg value="-l" />
<fileset dir="${project.basedir}/src/">
<include name="**/*.php" />
</fileset>
<fileset dir="${project.basedir}/migrations/">
<include name="**/*.php" />
</fileset>
<fileset dir="${project.basedir}/public/">
<include name="**/*.php" />
</fileset>
</apply>
</target>
<target name="phploc" description="Measure project size using PHPLOC and log result in CSV and XML format.">
<exec executable="${project.bindir}/phploc">
<arg value="--count-tests" />
<arg value="--log-csv" />
<arg path="${project.logdir}/phploc.csv" />
<arg value="--log-xml" />
<arg path="${project.logdir}/phploc.xml" />
<arg path="${project.basedir}/src" />
</exec>
</target>
<target name="pdepend" description="Calculate software metrics using PHP_Depend and log result in XML format.">
<exec executable="${project.bindir}/pdepend" passthru="true" checkreturn="false">
<arg value="--jdepend-xml=${project.logdir}/jdepend.xml" />
<arg value="--jdepend-chart=${project.logdir}/dependencies.svg" />
<arg value="--overview-pyramid=${project.logdir}/overview-pyramid.svg" />
<arg path="${project.basedir}/src" />
</exec>
</target>
<target name="phpmd" description="Perform project mess detection using PHPMD and log result in XML format.">
<exec executable="${project.bindir}/phpmd" passthru="true" checkreturn="false">
<arg path="${project.basedir}/src" />
<arg value="xml" />
<arg path="cleancode,codesize,unusedcode" />
<arg value="--reportfile" />
<arg path="${project.logdir}/pmd.xml" />
</exec>
</target>
<target name="phpcs" description="Find coding standard violations using PHP_CodeSniffer and log result in XML format.">
<exec executable="${project.bindir}/phpcs" passthru="true" checkreturn="false">
<arg value="-p" />
<arg value="--colors" />
<arg value="--report=checkstyle" />
<arg value="--report-file=${project.logdir}/checkstyle.xml" />
<arg value="--standard=PSR2" />
<arg value="--extensions=php" />
<arg value="--ignore=public" />
<arg value="--ignore=vendor" />
<arg path="${project.basedir}/src" />
</exec>
</target>
<target name="phpcpd" description="Find duplicate code using PHPCPD and log result in XML format.">
<exec executable="${project.bindir}/phpcpd" passthru="true" checkreturn="false">
<arg value="--progress" />
<arg value="--log-pmd" />
<arg path="${project.logdir}/phpcpd.xml" />
<arg path="${project.basedir}/src" />
</exec>
</target>
<target name="phpdox" description="Generate project documentation using phpDox">
<exec executable="${project.bindir}/phpdox" passthru="true" checkreturn="true">
<arg value="-f" />
<arg value="${project.basedir}/phpdox.xml" />
</exec>
</target>
</project>