-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
132 lines (119 loc) · 4.81 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" ?>
<project name="Services" default="main" basedir=".">
<property file="${project.basedir}/build.properties" />
<!-- Default values voor properties -->
<property name="crab.user" value="USER" />
<property name="crab.password" value="PWD" />
<property name="crab.run_integration_tests" value="0" />
<property name="crab.proxy_host" value="" />
<property name="crab.proxy_port" value="" />
<property name="capakey.user" value="USER" />
<property name="capakey.password" value="PWD" />
<property name="capakey.run_integration_tests" value="0" />
<property name="capakey.proxy_host" value="" />
<property name="capakey.proxy_port" value="" />
<target name="main" description="Overzicht van de mogelijke taken">
<echo msg="U kunt volgende taken uitvoeren:" />
<echo msg=" docs: Maak de API-documentatie aan." />
</target>
<target name="createBuildDir">
<available file="build" property="build.build_dir_exists" />
<if>
<not>
<isset property="build.build_dir_exists" />
</not>
<then>
<echo>Build dir wordt aangemaakt.</echo>
<mkdir dir="build" />
</then>
</if>
<available file="build/reports" type="dir" property="build.reports_dir_exists" />
<if>
<not>
<isset property="build.reports_dir_exists" />
</not>
<then>
<echo>build/reports dir wordt aangemaakt.</echo>
<mkdir dir="build/reports" />
</then>
</if>
<available file="build/docs" type="dir" property="build.docs_dir_exists" />
<if>
<not>
<isset property="build.docs_dir_exists" />
</not>
<then>
<echo>build/docs dir wordt aangemaakt.</echo>
<mkdir dir="build/docs" />
</then>
</if>
</target>
<target name="genBootstrap">
<copy file="test/dev/phpunit.dist.xml" tofile="test/phpunit.xml" overwrite="true">
<filterchain>
<replacetokens begintoken="%%" endtoken="%%">
<token key="CRAB_RUN_INTEGRATION_TESTS" value="${crab.run_integration_tests}" />
<token key="CRAB_PROXY_HOST" value="${crab.proxy_host}" />
<token key="CRAB_PROXY_PORT" value="${crab.proxy_port}" />
<token key="CAPAKEY_USER" value="${capakey.user}" />
<token key="CAPAKEY_PASSWORD" value="${capakey.password}" />
<token key="CAPAKEY_RUN_INTEGRATION_TESTS" value="${capakey.run_integration_tests}" />
<token key="CAPAKEY_PROXY_HOST" value="${capakey.proxy_host}" />
<token key="CAPAKEY_PROXY_PORT" value="${capakey.proxy_port}" />
<token key="TMS_RUN_INTEGRATION_TESTS" value="${tms.run_integration_tests}" />
<token key="TMS_PROXY_HOST" value="${tms.proxy_host}" />
<token key="TMS_PROXY_PORT" value="${tms.proxy_port}" />
</replacetokens>
</filterchain>
</copy>
</target>
<target name="runTests" description="Laat de Unit Tests lopen." depends="createBuildDir,genBootstrap">
<exec command="phpunit --configuration test/phpunit.xml"
passthru="true" returnProperty="testsExit" />
<if>
<equals arg1="${testsExit}" arg2="0" />
<then>
<echo>Unit tests werden met success uitgevoerd.</echo>
</then>
<else>
<echo>Niet alle unit tests werden succesvol uitgevoerd!</echo>
</else>
</if>
</target>
<target name="genTestReports" description="Maak rapporten over de UnitTests aan." depends="createBuildDir,genBootstrap">
<delete dir="build/reports" />
<mkdir dir="build/reports" />
<mkdir dir="build/reports/tests" />
<mkdir dir="build/reports/coverage" />
<exec command="phpunit --configuration test/phpunit.xml
--coverage-html build/reports/coverage
--coverage-clover build/clover-coverage.xml"
passthru="true" returnProperty="testsExit" />
<if>
<equals arg1="${testsExit}" arg2="0" />
<then>
<echo>Unit tests werden met success uitgevoerd.</echo>
</then>
<else>
<echo>Niet alle unit tests werden succesvol uitgevoerd!</echo>
</else>
</if>
</target>
<target name="genCodeSnifferReports" description="Maak rapporten over de staat van de code aan." depends="createBuildDir">
<delete dir="build/reports/sniffs" />
<mkdir dir="build/reports/sniffs" />
<exec command="phpcs --standard=${project.basedir}/dev/phpcs/VIOE ${project.basedir}/lib
--report-summary --report-full=${project.basedir}/build/reports/sniffs/sniffs.txt
--report-checkstyle=${project.basedir}/build/reports/sniffs/checkstyle.xml" />
</target>
<target name="genDocs" description="Genereer de documentatie." depends="createBuildDir">
<mkdir dir="build/docs/api" />
<echo msg="De API-documentatie voor de Services wordt aangemaakt. Dit kan even duren." />
<exec command="docblox run -d ${project.basedir}/lib/ -t ${project.basedir}/build/docs" />
</target>
<target name="runBuild" description="Maak een volledig build met unit tests en documentatie." depends="createBuildDir">
<phingcall target="genTestReports" />
<phingcall target="genCodeSnifferReports" />
<phingcall target="genDocs" />
</target>
</project>