-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathbuild.xml
68 lines (62 loc) · 2.32 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
<?xml version="1.0" encoding="UTF-8"?>
<project default="all">
<property file="./build.properties" />
<tstamp/>
<property name="build" value="${DSTAMP}${TSTAMP}" />
<target name="unittest">
<echo msg="Running PHPUnit tests..." />
<if>
<os family="windows" />
<then>
<property name="phpunit" value="vendor\bin\phpunit" />
</then>
<else>
<property name="phpunit" value="./vendor/bin/phpunit" />
</else>
</if>
<exec command="${phpunit} -c phpunit.xml" checkreturn="true" logoutput="true" />
<echo msg="...done" />
</target>
<target name="apidoc">
<echo msg="Generating API documentation..." />
<mkdir dir="./doc/" />
<mkdir dir="./doc/tmp" />
<mkdir dir="./build" />
<mkdir dir="./build/doc" />
<mkdir dir="./build/doc/src" />
<copy file="./composer.json" todir="./build/doc" />
<copy todir="./build/doc/src">
<fileset dir="src" />
</copy>
<exec
command="composer install --no-dev --no-autoloader --ignore-platform-reqs --working-dir build/doc"
checkreturn="true" />
<if>
<os family="windows" />
<then>
<property name="apigen" value="vendor\bin\apigen" />
</then>
<else>
<property name="apigen" value="./vendor/bin/apigen" />
</else>
</if>
<exec
command="${apigen} generate --title '${title}' --main=${namespace} --tree --php --source build/doc --destination doc/tmp --exclude=*tests* --exclude=*testdata* --template-theme bootstrap --deprecated"
checkreturn="true" logoutput="true" />
<delete file="./doc/*.html" quiet="true" />
<delete file="./doc/*.js" quiet="true" />
<delete dir="./doc/resources" includeemptydirs="true" />
<copy todir="./doc/">
<fileset dir="./doc/tmp/" />
</copy>
<delete dir="./doc/tmp" quiet="true" />
<echo msg="...done" />
</target>
<target name="tests">
<phingcall target="unittest" />
</target>
<target name="all">
<phingcall target="unittest" />
<phingcall target="apidoc" />
</target>
</project>