-
Notifications
You must be signed in to change notification settings - Fork 85
/
build.xml
114 lines (96 loc) · 4.08 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="Leos" default="build">
<property name="workspace" value="/app"/>
<property name="sourcedir" value="${workspace}/src"/>
<property name="consoledir" value="${workspace}/bin"/>
<property name="vardir" value="${workspace}/var"/>
<property name="vendordir" value="${workspace}/vendor"/>
<property name="bindir" value="${vendordir}/bin"/>
<target name="clean" description="Cleanup build artifacts">
<delete dir="${workspace}/report"/>
</target>
<target name="waitfor" description="wait for mysql socket">
<waitfor>
<socket server="mysql" port="3306"/>
</waitfor>
</target>
<target name="prepare" depends="clean" description="Prepare for build">
<mkdir dir="${workspace}/report"/>
</target>
<target name="createdatabase" description="Load fixtures">
<exec executable="php" failonerror="false">
<arg value="${consoledir}/console"/>
<arg value="doctrine:database:drop"/>
<arg value="--force"/>
<arg value="--no-interaction"/>
</exec>
<exec executable="php" failonerror="true">
<arg value="${consoledir}/console"/>
<arg value="doctrine:database:create"/>
<arg value="--no-interaction"/>
</exec>
<exec executable="php" failonerror="true">
<arg value="${consoledir}/console"/>
<arg value="doctrine:schema:create"/>
<arg value="--no-interaction"/>
</exec>
</target>
<target name="createdatabase-test" description="Load fixtures">
<exec executable="php" failonerror="false">
<arg value="${consoledir}/console"/>
<arg value="doctrine:database:drop"/>
<arg value="--force"/>
<arg value="--no-interaction"/>
<arg value="--env=test"/>
</exec>
<exec executable="php" failonerror="true">
<arg value="${consoledir}/console"/>
<arg value="doctrine:database:create"/>
<arg value="--no-interaction"/>
<arg value="--env=test"/>
</exec>
<exec executable="php" failonerror="true">
<arg value="${consoledir}/console"/>
<arg value="doctrine:schema:create"/>
<arg value="--no-interaction"/>
<arg value="--env=test"/>
</exec>
</target>
<target name="apidoc" description="Dump an HTML file with the API documentation">
<exec executable="php" output="${workspace}/doc/api_doc.html">
<arg value="${consoledir}/console" />
<arg value="api:doc:dump" />
<arg value="--format=html" />
</exec>
</target>
<target name="cachewarm" description="Wipe test and dev caches">
<delete dir="${project.basedir}/var/cache/dev"/>
<delete dir="${project.basedir}/var/cache/test"/>
<exec executable="php">
<arg value="${consoledir}/console"/>
<arg value="cache:w"/>
</exec>
<exec executable="php">
<arg value="${consoledir}/console"/>
<arg value="cache:w"/>
<arg value="--env=test"/>
</exec>
</target>
<target name="phpunit" description="Run PHPUnit tests">
<exec executable="${bindir}/phpunit" failonerror="true">
<arg value="-c"/>
<arg path="${workspace}/phpunit.xml.dist"/>
</exec>
</target>
<target name="behat" description="Run Behat tests">
<exec executable="${bindir}/behat" failonerror="true">
<arg value="-c"/>
<arg path="${workspace}/behat.yml"/>
<arg value="-f"/>
<arg value="progress"/>
</exec>
</target>
<target name="build" depends="waitfor, prepare, createdatabase, createdatabase-test" description="Prepare project dependencies"/>
<target name="unit-and-functional" depends="cachewarm, phpunit" description="Run project unit and functional tests"/>
<target name="acceptation" depends="cachewarm, behat" description="Run project acceptation tests"/>
</project>