forked from bco-trey/edonate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
129 lines (99 loc) · 3.74 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
<?xml version="1.0"?>
<project name="eCollecte" default="build" basedir="." description="eCollecte.">
<property file="./build.properties" />
<!-- Prepare build folders -->
<target name="prepare">
<mkdir dir="docs"/>
<mkdir dir="reports"/>
<mkdir dir=".coverage_db"/>
<mkdir dir="cov"/>
<echo msg="Making docs, report and build directories"/>
</target>
<!-- run all symfony related commands to update local installation -->
<target name="build" depends="prepare" description="Build application from codebase">
<!-- composer install -->
<composer command="install" composer="${composer.bin.path}">
<arg value="--optimize-autoloader" />
</composer>
<echo msg="composer install."/>
<!-- database update -->
<SymfonyConsole command="doctrine:schema:update">
<arg name="force"/>
</SymfonyConsole>
<echo msg="app/console doctrine:schema:update --force"/>
<!-- dump assets -->
<SymfonyConsole command="assetic:dump">
<arg name="env" value="${symfony.env}" />
</SymfonyConsole>
<echo msg="app/console assetic:dump"/>
<!-- npm -->
<exec command="npm install" dir="." />
<!-- produce bower resources -->
<exec command="bower install" dir="." />
<echo msg="bower installation task"/>
<!-- produce gulp resources -->
<exec command="gulp" dir="." />
<echo msg="glup compilation task"/>
<!-- clear cache -->
<SymfonyConsole command="cache:clear">
<arg name="env" value="${symfony.env}" />
</SymfonyConsole>
<echo msg="app/console cache:clear"/>
</target>
<!-- generate documentation -->
<target name="doc" depends="prepare" description="Generate documentation">
<phpdoc2 title="eCollecte" destdir="docs">
<fileset dir="src">
<include name="**/*.php"/>
</fileset>
</phpdoc2>
<echo msg="Generating PhpDoc."/>
</target>
<target name="test" depends="phpspec, behat" description="Run all tests">
</target>
<!-- Run unit tests -->
<target name="phpspec" depends="prepare">
<exec command="./bin/phpspec run --format=pretty" output="reports/phpspec.log"/>
<echo msg="run phpspec"/>
</target>
<!-- Run unit tests -->
<target name="behat" depends="prepare">
<SymfonyConsole command="cache:clear">
<arg name="env" value="test" />
</SymfonyConsole>
<exec command="./bin/behat --format=pretty" output="reports/behat.log"/>
<echo msg="run phpspec"/>
</target>
<!-- Run integration test (WARNING: require db reset) -->
<target name="coverage-test" depends="prepare">
<fileset dir="src" id="php">
<include name="*.php"/>
<include name="**/*.php"/>
<exclude name="*Test.php"/>
<exclude name="**/*Test.php"/>
</fileset>
<coverage-setup database=".coverage_db/coverage.db">
<fileset refid="php"/>
</coverage-setup>
<phpunit codecoverage="true" configuration="app/phpunit.xml">
<formatter todir="reports" type="xml" outfile="integration.xml"/>
</phpunit>
</target>
<target name="fixtures" description="Load Fixture. !!Will drop schema">
<SymfonyConsole command="doctrine:schema:drop">
<arg name="env" value="${symfony.env}" />
<arg name="force"/>
</SymfonyConsole>
<SymfonyConsole command="doctrine:schema:create">
<arg name="env" value="${symfony.env}" />
</SymfonyConsole>
<SymfonyConsole command="doctrine:fixture:load">
<arg name="env" value="${symfony.env}" />
<arg name="no-interaction"/>
</SymfonyConsole>
</target>
<target name="clean">
<delete dir="reports"/>
<delete dir="docs"/>
</target>
</project>