-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathbuild.xml
139 lines (125 loc) · 4.92 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
133
134
135
136
137
138
139
<?xml version="1.0" encoding="UTF-8"?>
<project name="moodle-enrol_autoenrol" default="build">
<property name="srcdir" value="enrol"/>
<property name="logdir" value="logs"/>
<property name="codedir" value="code-browser"/>
<property name="apidir" value="api"/>
<property name="vendordir" value="vendor/bin"/>
<target name="clean">
<delete dir="${logdir}"/>
<delete dir="${codedir}"/>
<delete dir="${apidir}"/>
</target>
<target name="prepare" depends="clean">
<mkdir dir="${logdir}"/>
<mkdir dir="${codedir}"/>
<mkdir dir="${apidir}"/>
</target>
<target name="phpunit" depends="prepare">
<exec executable="${vendordir}/phpunit" logoutput="/dev/stdout">
<arg value="-c"/>
<arg file="phpunit.xml"/>
</exec>
</target>
<target name="codesniffer" depends="prepare">
<phpcodesniffer
standard="vendor/moodlehq/moodle-local_codechecker/moodle/ruleset.xml"
showSniffs="true"
showWarnings="true">
<fileset dir="${srcdir}">
<include name="**/*.php"/>
<include name="*.php"/>
<exclude name="**/tests/**"/>
</fileset>
<formatter type="checkstyle" outfile="${logdir}/checkstyle.xml"/>
<formatter type="full" outfile="${logdir}/codesniffer.txt"/>
<formatter type="full" usefile="false"/>
</phpcodesniffer>
</target>
<target name="phploc" depends="prepare">
<exec executable="${vendordir}/phploc">
<arg value="--count-tests"/>
<arg value="--log-csv"/>
<arg file="${logdir}/phploc.csv"/>
<arg file="${srcdir}"/>
</exec>
</target>
<target name="phpdepend" depends="prepare">
<phpdepend>
<fileset dir="${srcdir}">
<include name="**/*.php"/>
<include name="*.php"/>
<exclude name="**/tests/**"/>
</fileset>
<logger type="jdepend-xml" outfile="${logdir}/jdepend.xml"/>
<logger type="jdepend-chart" outfile="${logdir}/dependencies.svg"/>
<logger type="overview-pyramid" outfile="${logdir}/overview-pyramid.svg"/>
</phpdepend>
</target>
<target name="messdetector" depends="prepare">
<phpmd rulesets="codesize,design,unusedcode">
<fileset dir="${srcdir}">
<include name="**/*.php"/>
<include name="*.php"/>
<exclude name="**/tests/**"/>
</fileset>
<formatter type="xml" outfile="${logdir}/pmd.xml"/>
</phpmd>
</target>
<target name="cpd" depends="prepare">
<phpcpd minLines="3" minTokens="40">
<fileset dir="${srcdir}">
<include name="**/*.php"/>
<include name="*.php"/>
</fileset>
<formatter type="pmd" outfile="${logdir}/pmd-cpd.xml"/>
</phpcpd>
</target>
<target name="analysis" depends="codesniffer,phploc,phpdepend,messdetector,cpd"/>
<target name="codebrowser" depends="analysis,phpunit">
<copy file="${logdir}/checkstyle.xml" tofile="${logdir}/Checkstyle.xml"/>
<exec executable="${vendordir}/phpcb" passthru="true">
<arg value="--log"/>
<arg path="${logdir}"/>
<arg value="--source"/>
<arg path="${srcdir}"/>
<arg value="--output"/>
<arg path="${codedir}"/>
</exec>
</target>
<target name="api" depends="prepare">
<exec executable="${vendordir}/phpdoc" passthru="true">
<arg value="--directory"/>
<arg path="${srcdir}"/>
<arg value="--target"/>
<arg path="${apidir}"/>
<arg value="--template"/>
<arg value="responsive"/>
<arg value="--parseprivate"/>
<arg value="--sourcecode"/>
<arg value="--no-interaction"/>
</exec>
<exec executable="${vendordir}/phpdoc" passthru="true">
<arg value="--directory"/>
<arg path="${srcdir}"/>
<arg value="--target"/>
<arg path="${apidir}"/>
<arg value="--template"/>
<arg value="checkstyle"/>
<arg value="--parseprivate"/>
<arg value="--sourcecode"/>
<arg value="--no-interaction"/>
</exec>
</target>
<target name="quality" depends="analysis,codebrowser"/>
<target name="build" depends="phpunit,quality,api"/>
<target name="deploy">
<propertyprompt propertyName="dest" defaultValue="/var/www/html/" promptText="Enter your web root for deployment"
useExistingValue="true"/>
<exec executable="cp" passthru="true" dir="${srcdir}">
<arg value="-LfR"/>
<arg value="*"/>
<arg path="${dest}/enrol/"/>
</exec>
</target>
</project>