forked from tine20/syncroton
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
118 lines (94 loc) · 4.74 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
<?xml version="1.0" encoding="UTF-8"?>
<!-- ================================================== -->
<!-- Build Definition for Syncroton -->
<!-- -->
<!-- http://www.syncroton.org -->
<!-- ================================================== -->
<project name="syncroton" description="Syncroton build file" default="phpunit">
<property name="builddir" value="${project.basedir}/build" override="true" />
<fileset dir="lib/Syncroton" id="sourceFiles">
<include name="**/*.php" />
</fileset>
<fileset dir="tests/Syncroton" id="testFiles">
<include name="**/*Tests.php" />
<exclude name="**/AllTests.php" />
<exclude name="ServerTests.php" />
</fileset>
<!-- ============================================ -->
<!-- Target: autodiscover -->
<!-- ============================================ -->
<target name="autodiscover">
<echo msg="(Re)Creating autodiscover.php..." />
<!-- @todo implement -->
</target>
<!-- ============================================ -->
<!-- Target: clean -->
<!-- ============================================ -->
<target name="clean">
<echo msg="Cleaning up ${builddir}..." />
<delete dir="${builddir}" quiet="true" />
</target>
<!-- ============================================ -->
<!-- Target: phpdoc -->
<!-- ============================================ -->
<target name="phpdoc">
<echo msg="Building Syncroton API Documentation..." />
<includepath classpath="${project.basedir}/vendor/phpdocumentor" />
<mkdir dir="${builddir}/apidocs" />
<phpdoc2 title="Syncroton API Documentation" destdir="${builddir}/apidocs" template="responsive-twig">
<fileset refid="sourceFiles" />
</phpdoc2>
</target>
<!-- ============================================ -->
<!-- Target: phpunit -->
<!-- ============================================ -->
<target name="phpunit">
<echo msg="Starting Tests..." />
<delete dir="${builddir}/reports" quiet="true" />
<mkdir dir="${builddir}/reports/tests" />
<phpunit configuration="tests/phpunit.xml" haltonfailure="true" haltonerror="true" printsummary="true">
<formatter type="plain" usefile="false" />
<formatter type="xml" todir="${builddir}/reports" />
<batchtest>
<fileset refid="testFiles" />
</batchtest>
</phpunit>
<phpunitreport infile="${builddir}/reports/testsuites.xml" format="frames" todir="${builddir}/reports/tests" />
</target>
<!-- ============================================ -->
<!-- Target: report -->
<!-- ============================================ -->
<target name="report">
<echo msg="Starting Tests..." />
<delete dir="${builddir}/reports" quiet="true" />
<mkdir dir="${builddir}/reports/tests" />
<mkdir dir="${builddir}/reports/coverage" />
<coverage-setup database="${builddir}/reports/coverage.db">
<fileset refid="sourceFiles" />
</coverage-setup>
<phpunit codecoverage="true" configuration="tests/phpunit.xml" haltonfailure="true" haltonerror="true" printsummary="true">
<formatter type="xml" todir="${builddir}/reports" />
<batchtest>
<fileset refid="testFiles" />
</batchtest>
</phpunit>
<phpunitreport infile="${builddir}/reports/testsuites.xml" format="frames" todir="${builddir}/reports/tests" />
<coverage-report outfile="${builddir}/reports/coverage.xml">
<report todir="${builddir}/reports/coverage" title="Syncroton" />
</coverage-report>
</target>
<!-- ============================================ -->
<!-- Target: compose -->
<!-- ============================================ -->
<target name="compose">
<echo msg="Fetching dependencies" />
<exec command="composer install" passthru="true" />
</target>
<!-- ============================================ -->
<!-- Target: compose-dev -->
<!-- ============================================ -->
<target name="compose-dev">
<echo msg="Fetching dependencies for development" />
<exec command="composer --dev install" passthru="true" />
</target>
</project>