-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
218 lines (202 loc) · 10.8 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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated by PHP Project Wizard (PPW) 1.0.4 on Mon Jun 6 10:54:25 CDT 2011 -->
<project name="HUGnetLib" default="build" basedir=".">
<property name="source" value="src/"/>
<property name="testSource" value="test"/>
<include file="${basedir}/build/package.xml"/>
<include file="${basedir}/build/debs.xml"/>
<target name="clean" description="Clean up">
<delete dir="${basedir}/build/api" failonerror="false"/>
<delete dir="${basedir}/build/code-browser" failonerror="false"/>
<delete dir="${basedir}/build/coverage" failonerror="false"/>
<delete dir="${basedir}/build/logs" failonerror="false"/>
<delete dir="${basedir}/build/pdepend" failonerror="false"/>
<delete dir="${basedir}/Documentation" failonerror="false"/>
<delete dir="${basedir}/rel/*" failonerror="false"/>
<delete failonerror="false" verbose="true">
<fileset dir=".">
<include name="**/php.core"/>
<include name="**/*~"/>
</fileset>
</delete>
</target>
<target name="setup" description="Create artifact directories">
<mkdir dir="${basedir}/build/api"/>
<mkdir dir="${basedir}/build/code-browser"/>
<mkdir dir="${basedir}/build/coverage"/>
<mkdir dir="${basedir}/build/logs"/>
<mkdir dir="${basedir}/build/pdepend"/>
</target>
<target name="jsdoc" depends="build" description="Run unit tests using jasmine and generates junit.xml and clover.xml">
<delete dir="${basedir}/build/jsdoc" failonerror="false"/>
<exec executable="${basedir}/bin/jsdoc" failonerror="false">
<arg line="-d=${basedir}/build/jsdoc ${basedir}/src/webapi/javascript/" />
</exec>
</target>
<target name="jasmine" depends="build" description="Run unit tests using jasmine and generates junit.xml and clover.xml">
<delete dir="${basedir}/build/jasmine" failonerror="false"/>
<mkdir dir="${basedir}/build/jasmine"/>
<exec executable="${basedir}/bin/phantomjs" failonerror="false" dir="${basedir}/test/jasmine">
<arg line="run-jasmine.js SpecRunner.html" />
</exec>
</target>
<target name="jshint" depends="build" description="code check">
<mkdir dir="${basedir}/build/javascript"/>
<delete file="${basedir}/build/javascript/jshint.xml" failonerror="false"/>
<exec executable="${basedir}/bin/jshint" failonerror="false" dir="${basedir}/src/webapi/html"
output="${basedir}/build/javascript/jshint.xml">
<arg line="--jslint-reporter --config ${basedir}/test/jshint.json hugnet.js" />
</exec>
</target>
<target name="phpunit" description="Run unit tests using PHPUnit and generates junit.xml and clover.xml">
<exec executable="${basedir}/bin/phpunit" failonerror="false"/>
</target>
<target name="parallelTasks" description="Run the pdepend, phpmd, phpcpd, phpcs, phpdoc and phploc tasks in parallel using a maximum of 2 threads.">
<parallel threadCount="2">
<sequential>
<antcall target="pdepend"/>
<antcall target="phpmd"/>
</sequential>
<antcall target="phpcpd"/>
<antcall target="phpcs"/>
<antcall target="phpdoc"/>
<antcall target="phploc"/>
</parallel>
</target>
<target name="pdepend" description="Generate jdepend.xml and software metrics charts using PHP_Depend">
<exec executable="${basedir}/bin/pdepend">
<arg line="--jdepend-xml=${basedir}/build/logs/jdepend.xml
--jdepend-chart=${basedir}/build/pdepend/dependencies.svg
--overview-pyramid=${basedir}/build/pdepend/overview-pyramid.svg
--configuration=${basedir}/build/pdepend.xml
--ignore=${basedir}/src/php/contrib
${source}/php" />
</exec>
</target>
<target name="phpmd" description="Generate pmd.xml using PHPMD">
<exec executable="${basedir}/bin/phpmd">
<arg line="${source}
xml
${basedir}/build/ruleset.xml
--exclude contrib
--reportfile ${basedir}/build/logs/pmd.xml" />
</exec>
</target>
<target name="phpcpd" description="Generate pmd-cpd.xml using PHPCPD">
<exec executable="${basedir}/bin/phpcpd">
<arg line="--log-pmd ${basedir}/build/logs/pmd-cpd.xml
${source}" />
</exec>
</target>
<target name="phploc" description="Generate phploc.csv">
<exec executable="${basedir}/bin/phploc">
<arg line="--log-csv ${basedir}/build/logs/phploc.csv
--exclude contrib
${source}" />
</exec>
</target>
<target name="phpcs" description="Generate checkstyle.xml using PHP_CodeSniffer">
<exec executable="${basedir}/bin/phpcs" output="/dev/null">
<arg line="--report=checkstyle
--report-file=${basedir}/build/logs/checkstyle.xml
--ignore=contrib/,scripts2/,test/jasmine/,src/webapi/
--standard=PEAR
${source} ${testSource}" />
</exec>
</target>
<target name="style" description="Generate readable output using PHP_CodeSniffer">
<exec executable="${basedir}/bin/phpcs">
<arg line=" --ignore=contrib/,scripts2/,test/jasmine/,src/webapi/
--standard=PEAR
${source} ${testSource}" />
</exec>
</target>
<target name="phpdoc" description="Generate API documentation using DocBlox">
<exec executable="${basedir}/bin/phpdox">
<arg line="" />
</exec>
</target>
<target name="phpcb" description="Aggregate tool output with PHP_CodeBrowser">
<exec executable="${basedir}/bin/phpcb">
<arg line="--log ${basedir}/build/logs
--source ${source}
--output ${basedir}/build/code-browser" />
</exec>
</target>
<target name="cleanafter" description="Clean up artifacts">
<delete file="${basedir}/php.core"/>
</target>
<target name="buildJavaScript" description="Build the javascript">
<delete>
<fileset dir="${basedir}/src" defaultexcludes="no">
<include name="**/*~" />
</fileset>
</delete>
<delete file="${basedir}/src/webapi/html/hugnet.js"/>
<delete file="${basedir}/src/webapi/html/hugnet.min.js"/>
<delete file="${basedir}/src/webapi/html/contrib.js"/>
<delete file="${basedir}/src/webapi/html/contrib.min.js"/>
<echo>Building src/webapi/html/contrib.js</echo>
<concat destfile="${basedir}/src/webapi/html/contrib.js">
<fileset file="${basedir}/src/webapi/contrib/jquery-2.1.1.js"/>
<fileset file="${basedir}/src/webapi/contrib/jquery.cookie.js"/>
<fileset file="${basedir}/src/webapi/contrib/jquery.metadata.js"/>
<fileset file="${basedir}/src/webapi/contrib/jquery.tablesorter.js"/>
<fileset file="${basedir}/src/webapi/contrib/jquery.serialize-object.js"/>
<fileset file="${basedir}/src/webapi/contrib/jquery-ui-1.10.0.custom.min.js"/>
<fileset file="${basedir}/src/webapi/contrib/jquery-ui-timepicker-addon.js"/>
<fileset file="${basedir}/src/webapi/contrib/json2.js"/>
<fileset file="${basedir}/src/webapi/contrib/underscore.js"/>
<fileset file="${basedir}/src/webapi/contrib/backbone.js"/>
<fileset file="${basedir}/src/webapi/contrib/flot/jquery.flot.js"/>
<fileset file="${basedir}/src/webapi/contrib/flot/jquery.flot.navigate.js"/>
<fileset file="${basedir}/src/webapi/contrib/flot/jquery.flot.resize.js"/>
<fileset file="${basedir}/src/webapi/contrib/flot/jquery.flot.selection.js"/>
<fileset file="${basedir}/src/webapi/contrib/flot/jquery.flot.time.js"/>
<fileset file="${basedir}/src/webapi/contrib/jquery.flot.axislabels.js"/>
<fileset file="${basedir}/src/webapi/contrib/jquery.jqplot.js"/>
<fileset file="${basedir}/src/webapi/contrib/jqplot.canvasAxisLabelRenderer.js"/>
<fileset file="${basedir}/src/webapi/contrib/jqplot.dateAxisRenderer.js"/>
<fileset file="${basedir}/src/webapi/contrib/svg.1.0.0-rc6.js"/>
<fileset file="${basedir}/src/webapi/contrib/svg.draggable.js"/>
<fileset file="${basedir}/src/webapi/contrib/tinycolor.js"/>
<!--
<fileset file="${basedir}/src/webapi/contrib/svg.filter.js"/>
<fileset file="${basedir}/src/webapi/javascript/contrib/jquery.flot.selection.js"/>
<fileset file="${basedir}/src/webapi/javascript/contrib/jquery.flot.navigation.js"/>
-->
</concat>
<echo>Building src/webapi/html/hugnet.js</echo>
<concat destfile="${basedir}/src/webapi/html/hugnet.js">
<fileset file="${basedir}/src/webapi/javascript/extra/header.js"/>
<fileset file="${basedir}/src/webapi/javascript/extra/viewhelpers.js"/>
<fileset dir="${basedir}/src/webapi/javascript/models" includes="*.js"/>
<fileset dir="${basedir}/src/webapi/javascript/views" includes="*.js"/>
<!--<fileset dir="${basedir}/src/webapi/javascript/controllers" includes="*.js"/>-->
<fileset dir="${basedir}/src/webapi/javascript" includes="*.js"/>
<fileset file="${basedir}/src/webapi/javascript/extra/footer.js"/>
</concat>
<echo>Building src/webapi/html/hugnet.min.js</echo>
<exec executable="uglifyjs">
<arg line="-o ${basedir}/src/webapi/html/hugnet.min.js
${basedir}/src/webapi/html/hugnet.js" />
</exec>
<echo>Building src/webapi/html/contrib.min.js</echo>
<exec executable="uglifyjs">
<arg line="-o ${basedir}/src/webapi/html/contrib.min.js
${basedir}/src/webapi/html/contrib.js" />
</exec>
</target>
<target name="build" depends="buildJavaScript"/>
<target name="jstest" depends="jasmine"/>
<target name="phptest" depends="pdepend,phpmd,phpcpd,phpcs,phpdoc,phploc,phpunit,phpcb,cleanafter"/>
<target name="test" depends="clean,setup,build,jstest,phptest"/>
<target name="deb" depends="build,deb.build"/>
<target name="post" depends="deb.post"/>
<target name="testpost" depends="clean,build,deb.testpost"/>
<target name="rcpost" depends="clean,build,deb.rcpost"/>
<target name="package" depends="clean,build,package.build,deb.build"/>
<target name="distclean" depends="clean,deb.clean,package.clean">
<delete dir="${basedir}/build/rel"/>
</target>
</project>