-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
75 lines (62 loc) · 2.57 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
<?xml version="1.0" encoding="UTF-8"?>
<!--
phpdepend-processor
Makes PHPDepend code metrics readable
@author Frank Neff <[email protected]>
@since 2013-03-15
@license MIT (see license.md)
@source https://github.com/ymc-devel/phpdepend-processor
-->
<!--
Probably override your ${basedir}:
@see http://ant.apache.org/manual/using.html
-->
<project name="MyProject" default="dist" basedir=".">
<!-- make your configurations here -->
<property
name="ymc.jdepend-processor.srcdir"
location="${basedir}/path/to/the/sources/to/analyze"
/>
<property
name="ymc.jdepend-processor.basedir"
location="${basedir}/path/to/this/repo"
/>
<property
name="ymc.jdepend-processor.builddir"
location="${basedir}/build"
/>
<target name="pdepend">
<!--
Change, if you are using composer instead of PEAR:
<echo>Invoking pdepend from composer: ${basedir}/vendor/bin/pdepend</echo>
<exec executable="${basedir}/vendor/bin/pdepend">
-->
<echo>Invoking pdepend from pear</echo>
<exec executable="pdepend">
<arg value="--jdepend-xml=${ymc.jdepend-processor.builddir}/logs/jdepend.xml"/>
<arg value="--jdepend-chart=${ymc.jdepend-processor.builddir}/phpdepend/jdepend.svg"/>
<arg value="--overview-pyramid=${ymc.jdepend-processor.builddir}/phpdepend/overview-pyramid.svg"/>
<arg path="${ymc.jdepend-processor.srcdir}"/>
</exec>
<!-- Generate HTML report -->
<echo>Generating HTML report to: ${ymc.jdepend-processor.builddir}/phpdepend/report.html</echo>
<xslt
in="${ymc.jdepend-processor.builddir}/logs/jdepend.xml"
out="${ymc.jdepend-processor.builddir}/phpdepend/report.html"
style="${ymc.jdepend-processor.basedir}/src/xsl/jdepend-report.xsl"
/>
<!-- Detect if cycles -->
<echo>Detecting cycles...</echo>
<xslt
in="${ymc.jdepend-processor.builddir}/logs/jdepend.xml"
out="${ymc.jdepend-processor.builddir}/phpdepend/cycle-check.txt"
style="${basedir}/${ymc.jdepend-processor.basedir}/src/xsl/jdepend-cycles-check.xsl"
/>
<!-- Fail build if cycles -->
<fail message="There are cycles in the packages, see ${ymc.jdepend-processor.builddir}/phpdepend/report.html">
<condition>
<length file="${basedir}/build/phpdepend/cycle-check.txt" when="gt" length="0"/>
</condition>
</fail>
</target>
</project>