-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
119 lines (102 loc) · 4.09 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="My Project" default="build">
<property name="cmd.doxygen" value="/usr/bin/doxygen" />
<property name="db" value="database_name" />
<property name="db_user" value="database_user" />
<property name="db_password" value="database_password" />
<property name="db_server" value="localhost" />
<property name="db_port" value="3306" />
<target name="build" depends="db-config" />
<target name="test" depends="docs,phpunit,phpcpd,phpmd,phpcs,skelgen" />
<target name="configure" depends="db-config" />
<target name="models" depends="db-config">
<exec executable="php" dir="${basedir}/build/generation" failonerror="off">
<arg line=" 'models.php'" />
</exec>
</target>
<target name="models-clean" depends="db-config">
<exec executable="php" dir="${basedir}/build/generation" failonerror="off">
<arg line=" 'models-clean.php'" />
</exec>
</target>
<target name="api" depends="db-config">
<mkdir dir="${basedir}/framework/application/controller/api" />
<exec executable="php" dir="${basedir}/build/generation" failonerror="off">
<arg line=" 'api.php'" />
</exec>
</target>
<target name="docs" depends="init">
<exec executable="${cmd.doxygen}" dir="${basedir}" failonerror="off">
<arg
line=" build/doxyfile.cfg" />
</exec>
</target>
<!-- Housekeeping -->
<target name="clean">
<delete dir="${basedir}/build/logs" />
<delete dir="${basedir}/tests/framework" />
</target>
<target name="init" depends="clean">
<mkdir dir="${basedir}/build/logs" />
<mkdir dir="${basedir}/build/logs/docs" />
<mkdir dir="${basedir}/build/logs/docs/doxygen" />
<mkdir dir="${basedir}/build/logs/docs/clover" />
<chmod dir="${basedir}/build/logs" perm="0777" />
<chmod dir="${basedir}/build/logs/docs/doxygen" perm="0777" />
</target>
<!-- Configuration -->
<target name="db-config">
<exec executable="bash" dir="${basedir}/build" failonerror="off">
<arg
line=" 'dbconfig.sh' ${db} ${db_user} ${db_password} ${db_server} ${db_port}" />
</exec>
</target>
<target name="db-schema" depends="db-config">
<exec executable="php" dir="${basedir}/build" failonerror="off">
<arg line=" 'schema_load.php'" />
</exec>
</target>
<!-- Test Data -->
<target name="db-testdata" depends="db-schema">
<exec executable="php" dir="${basedir}/build" failonerror="off">
<arg line=" 'testdata_load.php'" />
</exec>
</target>
<!-- Testers -->
<target name="skelgen">
<exec executable="bash" dir="${basedir}" failonerror="off">
<arg line=" '${basedir}/build/build.sh'" />
</exec>
</target>
<target name="phpmd" depends="init">
<exec executable="phpmd" dir="${basedir}/framework" failonerror="off">
<arg
line=" '${basedir}/framework' xml codesize,unusedcode --reportfile '${basedir}/build/logs/pmd.xml'" />
</exec>
</target>
<target name="phpcs" depends="init">
<exec executable="phpcs" dir="${basedir}/framework"
output="${basedir}/build/logs/checkstyle.xml" failonerror="off">
<arg
line=" --standard='${basedir}/build/PHPCS' --report=checkstyle --tab-width=4 --extensions=php '${basedir}/framework'" />
</exec>
</target>
<target name="phpcpd" depends="init">
<exec executable="phpcpd" dir="${basedir}/framework" failonerror="off">
<arg
line=" --log-pmd '${basedir}/build/logs/phpcpd.xml' '${basedir}/framework'" />
</exec>
</target>
<target name="phpunit" depends="init,db-testdata,skelgen">
<exec executable="phpunit" dir="${basedir}" failonerror="off">
<arg
line=" --bootstrap '${basedir}/build/phpunit/phpunit.php' --log-junit '${basedir}/build/logs/phpunit.xml' --coverage-clover '${basedir}/build/logs/clover.xml' --coverage-html '${basedir}/build/logs/coverage' '${basedir}/tests/'" />
</exec>
</target>
<target name="phpunit-manual">
<exec executable="phpunit" dir="${basedir}" failonerror="off">
<arg
line=" --bootstrap '${basedir}/build/phpunit/phpunit.php' --log-junit '${basedir}/build/logs/phpunit.xml' --coverage-clover '${basedir}/build/logs/clover.xml' --coverage-html '${basedir}/build/logs/coverage' '${basedir}/tests/${test}'" />
</exec>
</target>
</project>