forked from easyrdf/easyrdf
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
183 lines (159 loc) · 6.41 KB
/
build.xml
File metadata and controls
183 lines (159 loc) · 6.41 KB
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
<?xml version="1.0"?>
<project name="EasyRdf" default="default">
<property name="version" value="0.7.0" />
<property name="shortname" value="easyrdf" />
<property name="shortdesc" value="PHP library for working with RDF as objects." />
<property name="homepage" value="http://www.aelius.com/njh/easyrdf/" />
<property name="reports.dir" value="${project.basedir}/reports" override="true" />
<property name="docs.dir" value="${project.basedir}/docs" override="true" />
<property name="dist.dir" value="${project.basedir}/dist" override="true" />
<property name="logger" value="phing.listener.DefaultLogger" override="true" />
<includepath classpath="${project.basedir}/lib" />
<fileset id="source" dir="${project.basedir}">
<include name="lib/EasyRdf.php" />
<include name="lib/EasyRdf/*.php" />
<include name="lib/EasyRdf/**/*.php" />
</fileset>
<fileset id="tests" dir="${project.basedir}">
<include name="test/EasyRdf/*Test.php" />
<include name="test/EasyRdf/**/*Test.php" />
</fileset>
<fileset id="test-support" dir="${project.basedir}">
<include name="test/cli_example_wrapper.php" />
<include name="test/TestHelper.php" />
<include name="test/EasyRdf/TestCase.php" />
<include name="test/EasyRdf/Http/MockClient.php" />
<include name="test/fixtures/*" />
</fileset>
<fileset id="examples" dir="${project.basedir}">
<include name="examples/*.php" />
</fileset>
<fileset id="examples-tests" dir="${project.basedir}">
<include name="test/examples/*Test.php" />
</fileset>
<fileset id="docs" dir="${project.basedir}">
<include name="docs/*" />
<include name="docs/*/*" />
<include name="README.md" />
<include name="LICENSE.md" />
<include name="CHANGELOG.md" />
</fileset>
<target name="test" depends="dir_setup" description="Run all unit tests.">
<phpunit haltonfailure="true" printsummary="true">
<batchtest>
<fileset refid="tests" />
</batchtest>
<formatter type="plain" usefile="false" />
<formatter type="xml" usefile="true" todir="${reports.dir}" outfile="test-results.xml" />
</phpunit>
<phpunitreport format="noframes" todir="${reports.dir}/html" infile="${reports.dir}/test-results.xml" />
</target>
<target name="test-examples" depends="dir_setup" description="Run all unit tests.">
<phpunit haltonfailure="true" printsummary="true">
<batchtest>
<fileset refid="examples-tests" />
</batchtest>
<formatter type="plain" usefile="false" />
</phpunit>
</target>
<!-- Can't get this to work on my laptop
<target name="coverage" description="Run unit tests and create code coverage report">
<mkdir dir="${reports.dir}" />
<coverage-setup database="${reports.dir}/coverage.db">
<fileset refid="source" />
</coverage-setup>
<phpunit codecoverage="true">
<batchtest>
<fileset refid="tests" />
</batchtest>
</phpunit>
<coverage-report outfile="${reports.dir}/coverage.xml">
<report todir="${reports.dir}" />
</coverage-report>
</target>
-->
<target name="coverage" depends="dir_setup">
<mkdir dir="${reports.dir}/coverage" />
<exec command="phpunit --coverage-html ${reports.dir}/coverage --log-junit ${reports.dir}/test-results.xml test" dir="${project.basedir}" passthru="true" />
</target>
<target name="docs" description="Create API documentation">
<echo msg="Creating index.html..." />
<exec command="php homepage.php > index.html" dir="${project.basedir}" passthru="true" />
<echo msg="Creating doap.rdf..." />
<exec command="php doap.php > doap.rdf" dir="${project.basedir}" passthru="true" />
<phpdoc title="EasyRdf ${version} API Documentation"
destdir="${docs.dir}"
sourcecode="no"
undocumentedelements="yes"
output="HTML:frames:default">
<fileset refid="source" />
<projdocfileset dir="${project.basedir}">
<include name="README.md" />
<include name="CHANGELOG.md" />
<include name="LICENSE.md" />
</projdocfileset>
</phpdoc>
</target>
<!-- Note sure I like the style of the DocBlox documentation at the moment
<target name="docs" description="Create API documentation">
<mkdir dir="${docs.dir}" />
<docblox title="EasyRdf ${version} API Documentation"
destdir="${docs.dir}">
<fileset refid="source" />
</docblox>
</target>
-->
<target name="cs">
<phpcodesniffer standard="Zend" showWarnings="false" haltonerror="true">
<fileset refid="source" />
<fileset refid="tests" />
</phpcodesniffer>
</target>
<target name="lint">
<phplint haltonfailure="true">
<fileset refid="source" />
<fileset refid="tests" />
<fileset refid="examples" />
</phplint>
</target>
<target name="dist" depends="docs">
<echo msg="Creating archive..." />
<mkdir dir="${dist.dir}/easyrdf-${version}" />
<copy todir="${dist.dir}/easyrdf-${version}" >
<fileset refid="source" />
<fileset refid="tests" />
<fileset refid="test-support" />
<fileset refid="examples" />
<fileset refid="examples-tests" />
<fileset refid="docs" />
<fileset dir="${project.basedir}">
<include name="build.xml" />
<include name="doap.rdf" />
</fileset>
</copy>
<delete file="easyrdf-${version}.tar.gz" />
<tar destfile="easyrdf-${version}.tar.gz"
basedir="${dist.dir}"
compression="gzip" />
</target>
<target name="dir_setup">
<mkdir dir="${reports.dir}" />
<mkdir dir="${reports.dir}/html" />
<mkdir dir="${reports.dir}/coverage" />
</target>
<target name="clean">
<delete dir="${reports.dir}" includeemptydirs="true" verbose="true" />
<delete dir="${docs.dir}" includeemptydirs="true" verbose="true" />
<delete dir="${dist.dir}" includeemptydirs="true" verbose="true" />
<delete file="doap.rdf" verbose="true" />
<delete file="index.html" verbose="true" />
</target>
<target name="fixme" description="Search for code that needs fixing">
<exec command="git grep -n -E 'FIXME|TODO' lib" dir="${project.basedir}" passthru="true" />
</target>
<target name="whitespace" description="Search for trailing whitespace">
<echo msg="Checking for trailing whitespace..." />
<exec command="git grep -n -E '[ ]+$'" dir="${project.basedir}" passthru="true" />
</target>
<target name="default" description="Default target" depends="clean,lint,test,cs,docs" />
</project>