]> git.immae.eu Git - github/wallabag/wallabag.git/blame_incremental - build.xml
Merge pull request #3076 from wallabag/hotfix/2979
[github/wallabag/wallabag.git] / build.xml
... / ...
CommitLineData
1<?xml version="1.0" encoding="UTF-8"?>
2<project name="wallabag" default="build">
3 <target name="build" depends="clean,prepare,phpunit"/>
4 <target name="prepare-mysql" depends="clean,prepare_mysql"/>
5 <target name="prepare-sqlite" depends="clean,prepare_sqlite"/>
6 <target name="prepare-pgsql" depends="clean,prepare_pgsql"/>
7
8 <target name="clean" description="Cleanup build artifacts">
9 <delete dir="${basedir}/var/cache"/>
10 </target>
11
12 <target name="prepare" description="Prepare for build">
13 <exec executable="php">
14 <arg value="${basedir}/bin/console"/>
15 <arg value="doctrine:database:drop"/>
16 <arg value="--force"/>
17 <arg value="--env=test"/>
18 </exec>
19 <exec executable="php">
20 <arg value="${basedir}/bin/console"/>
21 <arg value="doctrine:database:create"/>
22 <arg value="--env=test"/>
23 </exec>
24 <exec executable="php">
25 <arg value="${basedir}/bin/console"/>
26 <arg value="doctrine:schema:create"/>
27 <arg value="--env=test"/>
28 </exec>
29 <exec executable="php">
30 <arg value="${basedir}/bin/console"/>
31 <arg value="doctrine:fixtures:load"/>
32 <arg value="--no-interaction"/>
33 <arg value="--env=test"/>
34 </exec>
35 </target>
36
37 <target name="prepare_mysql" description="Run test for MySQL">
38 <delete dir="${basedir}/app/config/parameters.yml"/>
39 <exec executable="cp">
40 <arg value="${basedir}/app/config/tests/parameters_test.mysql.yml"/>
41 <arg value="${basedir}/app/config/parameters_test.yml"/>
42 </exec>
43 <exec executable="php">
44 <arg value="${basedir}/bin/console"/>
45 <arg value="cache:clear"/>
46 <arg value="--env=test"/>
47 </exec>
48 <exec executable="php">
49 <arg value="${basedir}/bin/console"/>
50 <arg value="doctrine:database:drop"/>
51 <arg value="--force"/>
52 <arg value="--env=test"/>
53 </exec>
54 <exec executable="php">
55 <arg value="${basedir}/bin/console"/>
56 <arg value="doctrine:database:create"/>
57 <arg value="--env=test"/>
58 </exec>
59 <exec executable="php">
60 <arg value="${basedir}/bin/console"/>
61 <arg value="doctrine:database:import"/>
62 <arg value="data/sql/mysql_base.sql"/>
63 <arg value="--env=test"/>
64 </exec>
65 <exec executable="php">
66 <arg value="${basedir}/bin/console"/>
67 <arg value="doctrine:migrations:migrate"/>
68 <arg value="--no-interaction"/>
69 <arg value="--env=test"/>
70 </exec>
71 <exec executable="php">
72 <arg value="${basedir}/bin/console"/>
73 <arg value="doctrine:fixtures:load"/>
74 <arg value="--no-interaction"/>
75 <arg value="--env=test"/>
76 </exec>
77 </target>
78
79 <target name="prepare_sqlite" description="Run test for SQLite">
80 <delete dir="${basedir}/app/config/parameters.yml"/>
81 <exec executable="cp">
82 <arg value="${basedir}/app/config/tests/parameters_test.sqlite.yml"/>
83 <arg value="${basedir}/app/config/parameters_test.yml"/>
84 </exec>
85 <exec executable="php">
86 <arg value="${basedir}/bin/console"/>
87 <arg value="cache:clear"/>
88 <arg value="--env=test"/>
89 </exec>
90 <exec executable="php">
91 <arg value="${basedir}/bin/console"/>
92 <arg value="doctrine:database:drop"/>
93 <arg value="--force"/>
94 <arg value="--env=test"/>
95 </exec>
96 <exec executable="php">
97 <arg value="${basedir}/bin/console"/>
98 <arg value="doctrine:database:create"/>
99 <arg value="--env=test"/>
100 </exec>
101 <exec executable="php">
102 <arg value="${basedir}/bin/console"/>
103 <arg value="doctrine:schema:create"/>
104 <arg value="--env=test"/>
105 </exec>
106 <exec executable="php">
107 <arg value="${basedir}/bin/console"/>
108 <arg value="doctrine:migrations:migrate"/>
109 <arg value="--no-interaction"/>
110 <arg value="--env=test"/>
111 </exec>
112 <exec executable="php">
113 <arg value="${basedir}/bin/console"/>
114 <arg value="doctrine:fixtures:load"/>
115 <arg value="--no-interaction"/>
116 <arg value="--env=test"/>
117 </exec>
118 </target>
119
120 <target name="prepare_pgsql" description="Run test for PostgreSQL">
121 <delete dir="${basedir}/app/config/parameters.yml"/>
122 <exec executable="cp">
123 <arg value="${basedir}/app/config/tests/parameters_test.pgsql.yml"/>
124 <arg value="${basedir}/app/config/parameters_test.yml"/>
125 </exec>
126 <exec executable="php">
127 <arg value="${basedir}/bin/console"/>
128 <arg value="cache:clear"/>
129 <arg value="--env=test"/>
130 </exec>
131 <exec executable="php">
132 <arg value="${basedir}/bin/console"/>
133 <arg value="doctrine:database:drop"/>
134 <arg value="--force"/>
135 <arg value="--env=test"/>
136 </exec>
137 <exec executable="php">
138 <arg value="${basedir}/bin/console"/>
139 <arg value="doctrine:database:create"/>
140 <arg value="--env=test"/>
141 </exec>
142 <exec executable="psql">
143 <arg value="-h"/>
144 <arg value="localhost"/>
145 <arg value="-d"/>
146 <arg value="wallabag_test"/>
147 <arg value="-U"/>
148 <arg value="travis"/>
149 <arg value="-f"/>
150 <arg value="data/sql/pgsql_base.sql"/>
151 </exec>
152 <exec executable="php">
153 <arg value="${basedir}/bin/console"/>
154 <arg value="doctrine:migrations:migrate"/>
155 <arg value="--no-interaction"/>
156 <arg value="--env=test"/>
157 </exec>
158 <exec executable="php">
159 <arg value="${basedir}/bin/console"/>
160 <arg value="doctrine:fixtures:load"/>
161 <arg value="--no-interaction"/>
162 <arg value="--env=test"/>
163 </exec>
164 </target>
165
166 <target name="phpunit" description="Run unit tests with PHPUnit + HTML Coverage">
167 <exec executable="phpunit" failonerror="true">
168 <arg value="--coverage-html"/>
169 <arg value="build/coverage"/>
170 </exec>
171 </target>
172</project>