-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.xml
132 lines (104 loc) · 4.1 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model xlink:href="/usr/share/php5/PEAR/data/phing/etc/phing-grammar.rng"
type="application/xml"
schematypens="http://relaxng.org/ns/structure/1.0" ?>
<project name="php-druid-ingest" default="build">
<target name="clean" description="Clean project from build artifacts">
<delete dir="build"/>
</target>
<target name="prepare" description="Prepare artifact folders">
<mkdir dir="build/logs"/>
<mkdir dir="build/logs/phpunit"/>
<mkdir dir="build/logs/phpmd"/>
<mkdir dir="build/logs/phploc"/>
<mkdir dir="build/reports"/>
<mkdir dir="build/reports/phpunit"/>
<mkdir dir="build/reports/phpmd"/>
</target>
<target name="phpunit" description="Run PHPUnit on the project">
<phpunit printsummary="true"
haltonfailure="true"
haltonerror="true">
<formatter type="plain"
todir="build/logs/phpunit"
outfile="phpunit-testsuites-logfile.txt"/>
<formatter type="xml"
todir="build/logs/phpunit"
outfile="phpunit-testsuites-logfile.xml"/>
<batchtest>
<fileset dir="./tests">
<include name="**/*Test*.php"/>
</fileset>
</batchtest>
</phpunit>
<phpunitreport infile="build/logs/phpunit/phpunit-testsuites-logfile.xml"
styledir="vendor/phing/phing/etc"
format="frames"
todir="build/reports/phpunit"/>
</target>
<target name="phpmd" description="Run PHPMessDetector on the project">
<phpmd>
<fileset dir="./src">
<include name="**/*.php" />
</fileset>
<formatter type="xml" outfile="build/logs/phpmd/phpmessdetector-report.xml"/>
<formatter type="text" outfile="build/logs/phpmd/phpmessdetector-report.txt"/>
<formatter type="html" outfile="build/reports/phpmd/index.html"/>
</phpmd>
</target>
<target name="phploc" description="Measures and logs the size of the project">
<!-- Source only (text) -->
<phploc reportType="txt"
reportName="phploc-src-report"
reportDirectory="build/logs/phploc">
<fileset dir="src">
<include name="**/*.php" />
</fileset>
<fileset dir=".">
<include name="*.php" />
</fileset>
</phploc>
<!-- Source only (xml) -->
<phploc reportType="xml"
reportName="phploc-src-report"
reportDirectory="build/logs/phploc">
<fileset dir="src">
<include name="**/*.php" />
</fileset>
<fileset dir=".">
<include name="*.php" />
</fileset>
</phploc>
<!-- Source and Tests (text) -->
<phploc reportType="txt"
reportName="phploc-src-and-test-report"
reportDirectory="build/logs/phploc">
<fileset dir="src">
<include name="**/*.php" />
</fileset>
<fileset dir="tests">
<include name="**/*.php" />
</fileset>
<fileset dir=".">
<include name="*.php" />
</fileset>
</phploc>
<!-- Source and Tests (xml) -->
<phploc reportType="xml"
reportName="phploc-src-and-test-report"
reportDirectory="build/logs/phploc">
<fileset dir="src">
<include name="**/*.php" />
</fileset>
<fileset dir="tests">
<include name="**/*.php" />
</fileset>
<fileset dir=".">
<include name="*.php" />
</fileset>
</phploc>
</target>
<target name="build" depends="clean,prepare,phpunit"/>
<target name="report" depends="clean,prepare,phpmd,phploc"/>
<target name="all" depends="build,report"/>
</project>