-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.xml
166 lines (129 loc) · 5.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
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
<?xml version="1.0" encoding="UTF-8" ?>
<project name="WebEnq" basedir="." default="help">
<!-- create a file build.properties with key/value pairs to
override the property defaults below.
-->
<if><available file="build.properties"/>
<then><property file="build.properties"/></then>
</if>
<!-- set defaults (if not set yet) -->
<property name="doc_output_path" value="public/developer"/>
<property name="dev_output_path" value="public/developer"/>
<property name="tmp_path" value="logs"/>
<property name="local_http" value="http://localhost"/>
<property name="local_file_root" value="."/>
<property name="eclipse_exec" value="eclipse"/>
<target name="help" description="List available targets">
<exec command='bash -c "phing -l"' passthru="true"/>
<echo message="run 'phing -?' for command-line options"/>
</target>
<target name="testsuite"
description="Run the complete testsuite">
<!-- set codecoverage property if not set yet -->
<property name="codecoverage" value="false" />
<mkdir dir="${tmp_path}"/>
<phpunit bootstrap="tests/bootstrap.php" printsummary="true"
codecoverage="${codecoverage}">
<formatter todir="${tmp_path}" type="xml"/>
<batchtest>
<fileset refid="tests" />
</batchtest>
</phpunit>
<mkdir dir="${local_file_root}/${dev_output_path}/testsuite" />
<phpunitreport todir="${local_file_root}/${dev_output_path}/testsuite"
infile="${tmp_path}/testsuites.xml"
format="frames"
usesorttable="true" />
<echo message="Test results available in ${local_http}/${dev_output_path}/testsuite/"/>
</target>
<target name="testcoverage"
description="Run the complete testsuite with code coverage recording">
<mkdir dir="${tmp_path}"/>
<coverage-setup database="${tmp_path}/coverage.db">
<fileset refid="application" />
<fileset refid="libraries" />
</coverage-setup>
<phingcall target="testsuite">
<property name="codecoverage" value="true" />
</phingcall>
<!-- <phingcall target="reportcoverage"/> doesn't seem to work... -->
<exec command='bash -c "phing _reportcoverage"' passthru="true"/>
</target>
<target name="_reportcoverage">
<property name="coverage.database" value="${tmp_path}/coverage.db"/>
<mkdir dir="${local_file_root}/${dev_output_path}/testcoverage" />
<adhoc><![CDATA[
/* somehow needed to find classes in libraries etc */
require_once 'tests/bootstrap.php';
]]></adhoc>
<coverage-report outfile="${tmp_path}/coverage.xml">
<report todir="${local_file_root}/${dev_output_path}/testcoverage"
usesorttable="true" />
</coverage-report>
<echo message="Test results available in ${local_http}/${dev_output_path}/testcoverage/"/>
</target>
<target name="doc-all" description="Generate everything for doc.webenq.org"
depends="doc-zim, doc-phpdoc, doc-mockup"/>
<target name="doc-phpdoc"
description="Generate PHP documentation">
<mkdir dir="${local_file_root}/${doc_output_path}/phpdoc"/>
<phpdoc2 title="WebEnq4 PHP Documentation"
destdir="${local_file_root}/${doc_output_path}/phpdoc">
<fileset refid="application"/>
<fileset refid="libraries"/>
</phpdoc2>
<echo message="PHPDocumentation available in ${local_http}/${doc_output_path}/phpdoc/"/>
</target>
<target name="doc-mockup"
description="Generate wireframes mockup (requires WireframeSketcher)">
<if>
<not><isset property="eclipse_workspace"/></not>
<then>
<echo message="You need to have WireframeSketcher (stand-alone or as Eclipse plugin)"/>
<echo message="Set two properties in build.properties"/>
<echo message="* eclipse_exec - path to the executable if 'eclipse' is not in your PATH"/>
<echo message="* eclipse_workspace - path to your workspace directory"/>
</then>
<else>
<mkdir dir="${local_file_root}/${doc_output_path}/wireframes"/>
<exec command="${eclipse_exec}
-application com.wireframesketcher.ui.screenExport
-data ${eclipse_workspace}
-source documentation/wireframes/stories/index.story
-dest ${local_file_root}/${doc_output_path}/wireframes
-format HTML"/>
<echo message="Wireframes available in ${local_http}/${doc_output_path}/wireframes/"/>
</else>
</if>
</target>
<target name="doc-zim"
description="Export Zim documentation to HTML">
<if>
<not><available file="${local_file_root}/${doc_output_path}/zim" type="dir"/></not>
<then>
<echo message="No zim directory found in ${local_file_root}/${doc_output_path}"/>
</then>
<else>
<delete dir="${local_file_root}/${doc_output_path}/Home" quiet="yes"/>
<delete dir="${local_file_root}/${doc_output_path}/Tools" quiet="yes"/>
<exec command="zim --index ${local_file_root}/${doc_output_path}/zim/notebook"/>
<exec command="zim --export --format=html
--output=${local_file_root}/${doc_output_path}
--template=${local_file_root}/${doc_output_path}/zim/template/webenq.html
${local_file_root}/${doc_output_path}/zim/notebook"/>
<echo message="Zim HTML available in ${local_http}/${doc_output_path}/"/>
</else>
</if>
</target>
<fileset dir="application" id="application">
<include name="**/*.php"/>
</fileset>
<fileset dir="libraries" id="libraries">
<include name="WebEnq4/**/*.php"/>
</fileset>
<fileset dir="tests" id="tests">
<include name="application/**/*Test.php"/>
<exclude name="application/controllers/*"/>
<include name="libraries/**/*Test.php"/>
</fileset>
</project>