~eventum-developers/eventum/trunk

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"?>
<project name="eventum" default="all" basedir=".">
	<property name="name" value="${phing.project.name}" />
	<property name="version" value="2.3.1" />
	<property name="dir.src" value="." />
	<property name="dir.test" value="${dir.src}/tests" />

	<!-- show jslint warnings -->
	<property name="jslint.warnings" value="true" />

	<!-- all targets -->
	<target name="all" depends="phplint,test"
		description="Exectute all targets.">
	</target>

	<!-- filesets -->
	<fileset id="phpsource" dir="${dir.src}">
		<include name="**/*.php" />

		<!-- Exclude data dirs -->
		<exclude name=".bzr/**" />
		<exclude name="config/**" />
		<exclude name="docs/**" />
		<exclude name="templates_c/**" />
	</fileset>

	<fileset id="jssource" dir="${dir.src}/htdocs/js">
		<include name="**/*.js" />
	</fileset>

	<!-- phplint -->
	<target name="phplint" description="Run PHP Lint.">
		<echo msg="Checking syntax with PHP lint" />
		<phplint haltonfailure="true">
			<fileset refid="phpsource" />
		</phplint>
	</target>

	<!-- jslint -->
	<target name="jslint" description="Run JSLint.">
		<echo msg="Checking syntax with JSlint" />
		<jsllint haltonfailure="true" showwarnings="${jslint.warnings}">
			<fileset refid="jssource" />
		</jsllint>
	</target>

	<!-- PHP CodeSniffer -->
	<target name="phpcs" description="Generate PHPCS Report.">
		<echo msg="Running PHP Code Sniffer Task" />
		<phpcodesniffer standard="${dir.src}/phpcs.xml" showsniffs="true" showwarnings="true" haltonerror="yes">
			<fileset refid="phpsource" />
			<formatter type="default" usefile="false"/>
		</phpcodesniffer>
	</target>

	<!-- test -->
	<target name="test" description="Run unit tests.">
		<echo msg="Run PHPUnit tests" />
		<phpunit haltonerror="true" haltonfailure="true" printsummary="true">
			<formatter usefile="false" type="plain" />
			<batchtest>
				<fileset dir="${dir.test}">
					<include name="**/*Test.php" />
				</fileset>
			</batchtest>
		</phpunit>
	</target>
</project>