-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.xml
109 lines (98 loc) · 3.65 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
<?xml version="1.0" ?>
<project name="lamu" default="help">
<property environment="env"/>
<property environment="env"/>
<property name="basedir" value="${project.basedir}"/>
<property name="builddir" value="${basedir}/build"/>
<!-- Shows the help message -->
<target name="help">
<echo message="Targets"/>
<echo message="==============="/>
<echo message="phing test Run unit tests."/>
<echo message="phing test-log Run unit tests with logging enabled."/>
<echo message="phing ci Alias task for continuous integration servers"/>
<echo message="phing dist Build a release .zip"/>
</target>
<!-- Clean up -->
<target name="clean">
<delete dir="${builddir}"/>
<!-- Create build directories -->
<mkdir dir="${builddir}/coverage"/>
<mkdir dir="${builddir}/logs"/>
<mkdir dir="${builddir}/release"/>
<mkdir dir="${builddir}/code-browser"/>
</target>
<!-- Run unit tests -->
<target name="test">
<exec command="./bin/phpunit -c application/tests/phpunit.xml" checkreturn="true" passthru="true"/>
<exec command="./bin/behat --config=application/tests/behat.yml" checkreturn="true" passthru="true"/>
</target>
<!-- Run unit tests and generate junit.xml and clover.xml -->
<target name="test-log">
<exec command="./bin/phpunit -c application/tests/phpunit.xml --coverage-html='${builddir}/coverage' --log-junit='${builddir}/logs/junit-phpunit.xml' --coverage-clover='${builddir}/logs/clover.xml'" checkreturn="true" passthru="true"/>
<exec command="./bin/behat --config=application/tests/behat.yml --format=junit --out='${builddir}/logs/behat'" checkreturn="true" passthru="true"/>
</target>
<!-- Build a release .zip -->
<target name="dist">
<!-- Pick an appropriate dist filename -->
<if>
<isset property="dist.filename" />
<else>
<if>
<and>
<!-- basically - are we running inside hudson? -->
<isset property="env.BUILD_NUMBER" />
<isset property="env.JOB_NAME" />
</and>
<then>
<property name="dist.filename" value="${env.JOB_NAME}-${env.BUILD_NUMBER}" />
</then>
<else>
<property name="dist.filename" value="Lamu" />
</else>
</if>
</else>
</if>
<fileset dir="${basedir}" id="build-files">
<include name="**/**"/>
<!-- Deployment Files -->
<exclude name="application/cache/**" />
<exclude name="application/logs/**" />
<exclude name="application/config/environments/development/**" />
<exclude name="application/media/uploads/**" />
<exclude name=".htaccess" />
<!-- Build Files -->
<exclude name="*.zip" />
<exclude name="build/**" />
<!-- Dev Files -->
<exclude name="build.xml" />
<exclude name="application/tests/phpunit.xml" />
<exclude name="application/tests/behat.yml" />
<exclude name=".travis.yml" />
<exclude name=".vagrant/**" />
<exclude name="composer.*" />
<exclude name="bin/**" />
<exclude name="vendor/**" />
<!-- IDE Files -->
<exclude name="modules/UshahidiUI/.sass-cache/**" />
<exclude name="modules/UshahidiUI/node_modules/**" />
<exclude name=".floo*" />
<exclude name=".project" />
<exclude name=".settings/**" />
<exclude name=".sublime-project/**" />
<!-- SCM Files -->
<exclude name="**/.git/**" />
<exclude name="**/.git*" />
</fileset>
<zip destfile="${builddir}/${dist.filename}.zip" prefix="${dist.filename}/">
<fileset refid="build-files" />
</zip>
<tar destfile="${builddir}/${dist.filename}.tar.gz" prefix="${dist.filename}/" compression="gzip">
<fileset refid="build-files" />
</tar>
</target>
<!-- Hudson CI target -->
<target name="ci" depends="clean">
<phingcall target="test-log"/>
</target>
</project>