File: build.xml

package info (click to toggle)
phing 3.1.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 9,560 kB
  • sloc: php: 59,817; xml: 9,767; sql: 78; makefile: 39; sh: 14
file content (64 lines) | stat: -rw-r--r-- 1,741 bytes parent folder | download | duplicates (2)
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
<?xml version="1.0"?>

<project name="Hello World Example" default="build" description="This is an example buildfile for Phing.">
	<target name="prepare">
		<mkdir dir="reports/coverage"/>
		<mkdir dir="reports/tests"/>
		<mkdir dir="docs"/>
	</target>
	
	<target name="reports">
		<coverage-setup database="reports/coverage.db">
			<fileset dir="src">
				<include name="*.php"/>
				<exclude name="*Test.php"/>
			</fileset>
		</coverage-setup>
		<phpunit codecoverage="true">
			<formatter type="xml" todir="reports"/>
			<formatter type="clover" todir="."/>
			<batchtest>
				<fileset dir="src">
					<include name="*Test.php"/>
				</fileset>
			</batchtest>
		</phpunit>
		<phpunitreport infile="reports/testsuites.xml" format="frames" todir="reports/tests"
			styledir="../../etc" usesorttable="true"/>
		<coverage-report outfile="reports/coverage.xml">
			<report toDir="reports/coverage" styleDir="../../etc" title="Demo Project"
				usesorttable="true"/>
		</coverage-report>
	</target>
	
	<target name="test">
		<phpunit haltonerror="true" haltonfailure="true">
			<formatter type="plain" usefile="false"/>
			<batchtest>
				<fileset dir="src">
					<include name="*Test.php"/>
				</fileset>
			</batchtest>
		</phpunit>
	</target>
	
	<target name="docs">
		<phpdoc2 title="Phing Example" destdir="docs">
			<fileset dir="src">
				<include name="*.php"/>
			</fileset>
		</phpdoc2>
	</target>
	
	<target name="build" depends="test,prepare,reports,docs">
		<zip destfile="helloworld.zip" basedir="src"/>
		<tar destfile="helloworld.tar" basedir="src"/>
	</target>

	<target name="clean">
		<delete dir="reports"/>
		<delete dir="docs"/>
		<delete file="helloworld.zip"/>
		<delete file="helloworld.tar"/>
	</target>
</project>