forked from a-musing-moose/morph
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
109 lines (92 loc) · 4.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
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" encoding="UTF-8"?>
<project name="Mongo Object" default="api-docs">
<fileset dir="unit-tests" id="unit-tests">
<include name="**/Test*.php" />
</fileset>
<fileset dir="integration-tests" id="integration-tests">
<include name="**/Test*.php" />
<exclude name="mongoUnit/*" />
<exclude name="IntegrationsTests.php" />
</fileset>
<fileset dir="src/morph" id="classes">
<include name="**/*.php" />
</fileset>
<target name="api-docs" description="Creates Morph documentation">
<echo msg="Starting Creation of API Documentation" />
<delete dir="doc/api" quiet="true" includeemptydirs="true" verbose="false" failonerror="false" />
<mkdir dir="doc" />
<phpdoc title="Morph Documentation" destdir="doc/api" sourcecode="yes"
output="HTML:frames:DOM/default" quiet="true" defaultpackagename="Morph">
<fileset refid="classes" />
<fileset dir="src/tutorials">
<include name="**/*.pkg" />
<include name="**/*.cls" />
</fileset>
</phpdoc>
<echo msg="API Documentation Complete" />
</target>
<target name="unit-report" description="Runs Morph unit tests">
<echo msg="Starting Unit Test Suite" />
<phpunit haltonfailure="false" haltonerror="false" printsummary="true">
<formatter type="xml" outfile="test-report.xml" />
<batchtest>
<fileset refid="unit-tests" />
</batchtest>
</phpunit>
<delete dir="doc/test_report" quiet="true" includeemptydirs="true" verbose="false" failonerror="false" />
<mkdir dir="doc/test_report" />
<phpunitreport infile="test-report.xml" format="frames"
todir="doc/test_report" />
<delete file="test-report.xml" />
<echo msg="Unit Test Suite Complete" />
</target>
<target name="coverage-report" description="generates unit test coverage report">
<exec command="phpunit --coverage-html doc/coverage/ unit-tests/UnitTests.php" checkreturn="false" />
</target>
<target name="integration-report" description="Runs Morph integration tests">
<echo msg="Starting Integration Test Suite" />
<phpunit haltonfailure="false" haltonerror="false" printsummary="true">
<formatter type="xml" outfile="integration-tests.xml" />
<formatter type="plain" usefile="false" />
<batchtest>
<fileset refid="integration-tests" />
</batchtest>
</phpunit>
<delete dir="doc/integration_report" quiet="true" includeemptydirs="true" verbose="false" failonerror="false" />
<mkdir dir="doc/integration_report" />
<phpunitreport infile="integration-tests.xml" format="frames" todir="doc/integration_report" />
<delete file="integration-tests.xml"/>
<echo msg="Integration Test Suite Complete" />
</target>
<target name="package" description="builds Morph.phar">
<echo message="Building Morph.phar" />
<tstamp>
<format property="date.created" pattern="%Y-%m-%d %H:%I:%S" />
<format property="date.year" pattern="%Y" />
<format property="date.build" pattern="%s" />
</tstamp>
<echo message="Creating comment free classes export" />
<mkdir dir="./export" />
<copy todir="./export">
<fileset refid="classes" />
<filterchain>
<stripphpcomments />
</filterchain>
</copy>
<delete file="Morph.phar" quiet="true" />
<pharpackage basedir="./export" destfile="Morph.phar" compression="gzip" stub="./src/bootstrap.php" alias="Morph">
<fileset dir="./export">
<include name="**/*.php" />
</fileset>
<metadata>
<element name="Title" value="Morph" />
<element name="Author" value="Jonathan Moss <[email protected]>" />
<element name="Description" value="The Morph package provides a high level framework for working with MongoDB" />
<element name="Copyright" value="Jonathan Moss (c) 2008-${date.year}" />
<element name="Build" value="${date.build}" />
<element name="Created Date" value="${date.created}" />
</metadata>
</pharpackage>
<delete dir="./export" quiet="true" includeemptydirs="true" />
</target>
</project>