-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
107 lines (92 loc) · 3.88 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="Apache log4php" basedir="." description="A versatile logging framework for PHP" default="help">
<property name="version" value="3.0.0-dev" />
<!-- Task for rendering manual pages via Twig -->
<taskdef name="twig" classname="lib.phing.task.TwigTask" />
<target name="help" description="Display build options">
<echo msg="No target given. Use 'phing -l' to see available targets." />
</target>
<target name="clean" description="Clean build artifacts">
<delete dir="build" includeemptydirs="true" quiet="true" />
</target>
<target name="prepare">
<mkdir dir="build" />
<mkdir dir="build/packages" />
<mkdir dir="build/temp" />
<mkdir dir="build/reports" />
</target>
<target name="build" depends="clean,prepare,test" />
<target name="apigen" description="Generate API documentation using ApiGen" depends="prepare">
<apigen config="apigen.neon" executable="vendor\\bin\\apigen.php.bat" />
</target>
<target name="test" depends="prepare" description="Run unit tests and generate code coverage.">
<mkdir dir="build/reports/coverage" />
<!-- Prepare the coverage database -->
<coverage-setup database="build/temp/coverage.db">
<fileset dir="src">
<include name="**/*.php"/>
</fileset>
</coverage-setup>
<!-- Run unit tests, collect coverage data -->
<phpunit codecoverage="true" haltonerror="true" haltonfailure="true" printSummary="true">
<formatter type="plain" usefile="false" />
<batchtest>
<fileset dir="tests">
<include name="**/*Test*.php"/>
</fileset>
</batchtest>
</phpunit>
<!-- Generate coverage report -->
<coverage-report outfile="build/temp/coverage.xml">
<report todir="build/reports/coverage" />
</coverage-report>
</target>
<target name="phpcs" description="Check coding standards using PHP_Codesniffer">
<phpcodesniffer standard="PSR2" skipversioncheck="true">
<fileset dir="src/">
<include name="**/*.php"/>
</fileset>
<fileset dir="tests/">
<include name="**/*.php"/>
</fileset>
</phpcodesniffer>
</target>
<target name="package" depends="test,docs">
<mkdir dir="build/packages" />
<echo msg="Creating zip archive..." />
<zip destfile="build/packages/apache-log4php-${version}.zip">
<fileset dir=".">
<include name="examples/**" />
<include name="lib/**" />
<include name="manual/**" />
<include name="src/**" />
<include name="tests/**" />
<include name="apigen.neon" />
<include name="build.xml" />
<include name="composer.json" />
<include name="phpunit.xml" />
<include name="README.textile" />
<include name="setenv.bat" />
</fileset>
</zip>
<!--
<tar destfile="build/packages/apache-log4php-${version}.tar.gz" compression="gzip">
<fileset dir=".">
<include name="src" />
</fileset>
</tar>
-->
</target>
<target name="docs">
<copy todir="build/docs">
<fileset dir="manual/resources">
<include name="**" />
</fileset>
</copy>
<twig templates="manual/templates" target="build/docs">
<fileset dir="manual/pages">
<include name="**/*.twig"/>
</fileset>
</twig>
</target>
</project>