forked from ApiGen/ApiGen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
146 lines (129 loc) · 5.31 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
140
141
142
143
144
145
146
<?xml version="1.0" encoding="UTF-8"?>
<project name="ApiGen" default="build" basedir=".">
<property name="sourcedir" value="${basedir}/ApiGen" />
<property name="builddir" value="${basedir}/build" />
<property name="releasedir" value="${basedir}/release" />
<property name="version" value="3.0dev" />
<condition property="executableExtension" value=".bat" else="">
<os family="windows" />
</condition>
<target name="build" depends="prepare,phplint,pdepend,phpmd,phpcpd,phploc,phpcs,apigen,phpcb" />
<target name="clean" description="Clean build artifacts">
<delete dir="${builddir}/api" />
<delete dir="${builddir}/code-browser" />
<delete dir="${builddir}/coverage" />
<delete dir="${builddir}/logs" />
<delete dir="${builddir}/pdepend" />
</target>
<target name="prepare" description="Prepare build" depends="clean">
<mkdir dir="${builddir}/api" />
<mkdir dir="${builddir}/code-browser" />
<mkdir dir="${builddir}/coverage" />
<mkdir dir="${builddir}/logs" />
<mkdir dir="${builddir}/pdepend" />
</target>
<target name="phplint">
<apply executable="php" failonerror="true">
<arg value="-l" />
<fileset dir="${sourcedir}" />
<fileset file="${basedir}/apigen.php" />
</apply>
</target>
<target name="pdepend" description="Calculate software metrics using PHP_Depend">
<exec executable="pdepend${executableExtension}">
<arg value="--jdepend-xml=${builddir}/logs/jdepend.xml" />
<arg value="--jdepend-chart=${builddir}/pdepend/dependencies.svg" />
<arg value="--overview-pyramid=${builddir}/pdepend/overview-pyramid.svg" />
<arg value="${sourcedir},${basedir}/apigen.php" />
</exec>
</target>
<target name="phpmd" description="Find duplicate code using PHPCPD">
<exec executable="phpmd${executableExtension}">
<arg value="${sourcedir},${basedir}/apigen.php" />
<arg value="xml" />
<arg path="${builddir}/phpmd.xml" />
<arg value="--reportfile" />
<arg path="${builddir}/logs/pmd.xml" />
</exec>
</target>
<target name="phpcpd" description="Perform project mess detection using PHPMD">
<exec executable="phpcpd${executableExtension}">
<arg value="--log-pmd" />
<arg path="${builddir}/logs/pmd-cpd.xml" />
<arg path="${sourcedir}" />
<arg path="${basedir}/apigen.php" />
</exec>
</target>
<target name="phploc" description="Measure project size using PHPLOC">
<exec executable="phploc${executableExtension}">
<arg value="--log-csv" />
<arg path="${builddir}/logs/phploc.csv" />
<arg path="${sourcedir}" />
<arg path="${basedir}/apigen.php" />
</exec>
</target>
<target name="phpcs" description="Find coding standard violations using PHP_CodeSniffer">
<exec executable="phpcs${executableExtension}">
<arg value="--standard=${builddir}/phpcs.xml" />
<arg value="--tab-width=4" />
<arg value="--encoding=utf-8" />
<arg value="--report=checkstyle" />
<arg value="--report-file=${builddir}/logs/checkstyle.xml" />
<arg value="--ignore=jquery" />
<arg path="${sourcedir}" />
<arg path="${basedir}/apigen.php" />
<arg path="${basedir}/templates" />
</exec>
</target>
<target name="apigen" description="Generate API documentation using ApiGen">
<exec executable="apigen${executableExtension}">
<arg value="--source" />
<arg path="${sourcedir}" />
<arg value="--source" />
<arg path="${basedir}/apigen.php" />
<arg value="--destination" />
<arg path="${builddir}/api" />
<arg value="--report" />
<arg path="${builddir}/logs/documentation.xml" />
<arg value="--deprecated" />
<arg value="--todo" />
<arg value="--progressbar=no" />
</exec>
</target>
<target name="phpcb" description="Aggregate tool output using PHP_CodeBrowser">
<exec executable="phpcb${executableExtension}">
<arg value="--log" />
<arg path="${builddir}/logs" />
<arg value="--source" />
<arg path="${sourcedir}" />
<arg value="--source" />
<arg path="${basedir}/apigen.php" />
<arg value="--source" />
<arg path="${basedir}/templates" />
<arg value="--exclude" />
<arg value="*jquery*" />
<arg value="--output" />
<arg path="${builddir}/code-browser" />
</exec>
</target>
<target name="release" description="Release packages">
<delete dir="${releasedir}" />
<mkdir dir="${releasedir}" />
<exec executable="pear${executableExtension}">
<arg value="package" />
</exec>
<move file="${ant.project.name}-${version}.tgz" todir="${releasedir}" />
<zip destfile="${releasedir}/${ant.project.name}-${version}-standalone.zip">
<zipfileset dir="ApiGen" prefix="apigen/ApiGen" />
<zipfileset dir="vendor/FSHL" includes="FSHL/**/*, LICENSE" prefix="apigen/vendor/FSHL" />
<zipfileset dir="vendor/Nette" includes="Nette/**/*, license.txt" prefix="apigen/vendor/Nette" />
<zipfileset dir="vendor/Texy" includes="texy/**/*, license.txt" prefix="apigen/vendor/Texy" />
<zipfileset dir="vendor/TokenReflection" includes="TokenReflection/**/*, LICENSE" prefix="apigen/vendor/TokenReflection" />
<zipfileset dir="templates" prefix="apigen/templates" />
<zipfileset dir="." includes="apigen.bat, apigen.neon.example, apigen.php, CHANGELOG.md, LICENSE.md, README.md" prefix="apigen" />
</zip>
<tar destfile="${releasedir}/${ant.project.name}-${version}-standalone.tar.gz" compression="gzip">
<zipfileset src="${releasedir}/${ant.project.name}-${version}-standalone.zip"/>
</tar>
</target>
</project>