-
Notifications
You must be signed in to change notification settings - Fork 1
/
metrics.xml
140 lines (116 loc) · 5.07 KB
/
metrics.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
<?xml version="1.0" encoding="UTF-8"?>
<project name="metrics" default="build" basedir="." xmlns:ivy="antlib:org.apache.ivy.ant">
<property file="build.properties" />
<import file="build-ivy.xml" />
<taskdef resource="org/apache/ivy/ant/antlib.xml"
uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/>
<ivy:settings file="ivysettings.xml" />
<ivy:cachepath pathid="classpath.test" conf="test" resolveId="test" file="ivy.xml" />
<ivy:cachepath pathid="classpath.qa" conf="qa" resolveId="qa" file="ivy.xml" />
<path id="compile.classpath">
<fileset dir="lib" includes="*.jar" />
</path>
<path id="src.path">
<pathelement location="${project.src}" />
</path>
<path id="run.classpath">
<path refid="compile.classpath" />
<path location="${project.build}" />
<path location="${project.config}" />
<path location="${project.resources}" />
</path>
<path id="test.classpath">
<path refid="run.classpath" />
<path refid="classpath.test" />
</path>
<target name="init">
<mkdir dir="${project.config}" />
<mkdir dir="${project.resources}" />
<mkdir dir="${project.src}" />
<mkdir dir="${project.test}" />
<mkdir dir="lib" />
</target>
<target name="compile-test" depends="compile">
<javac encoding="iso-8859-1" destdir="${project.build}" classpathref="test.classpath" includes="**/*.java" debug="true">
<src path="${project.test}" />
</javac>
</target>
<target name="prepare">
<mkdir dir="${project.build}" />
</target>
<target name="build" depends="init,compile,test" description="Build the project incrementally.">
</target>
<target name="clean">
<delete dir="${project.build}" />
</target>
<target name="compile" depends="prepare" description="Compile the sources (checked in and generated)">
<copy todir="${project.build}">
<fileset dir="${project.src}">
<include name="**/*.properties" />
</fileset>
<fileset dir="${project.config}">
<include name="*.properties" />
<include name="*.xml" />
</fileset>
</copy>
<javac encoding="iso-8859-1" destdir="${project.build}" classpathref="compile.classpath" includes="**/*.java" debug="true">
<src path="${project.src}" />
</javac>
</target>
<target name="test" depends="compile-test">
<property name="junit.dest" value="${project.build.report}/junit" />
<mkdir dir="${junit.dest}" />
<junit fork="yes" forkmode="once" printsummary="yes" haltonfailure="yes">
<jvmarg value="-Dcurrent.env=test"/>
<classpath>
<path refid="test.classpath" />
</classpath>
<formatter type="plain" usefile="false" />
<formatter type="xml" />
<batchtest todir="${junit.dest}">
<fileset dir="${project.test}">
<include name="**/*Test.java" />
</fileset>
</batchtest>
</junit>
<junitreport todir="${junit.dest}">
<fileset dir="${junit.dest}" includes="TEST-*.xml" />
<report format="frames" todir="${junit.dest}" />
</junitreport>
</target>
<!-- QA -->
<target name="qa" depends="build,cpd,findbugs,pmd" />
<taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" classpathref="classpath.qa" />
<taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask" classpathref="classpath.qa" />
<taskdef name="cpd" classname="net.sourceforge.pmd.cpd.CPDTask" classpathref="classpath.qa" />
<target name="findbugs" depends="build">
<property name="findbugs.dest" value="${project.build.report}/findbugs" />
<mkdir dir="${findbugs.dest}" />
<findbugs output="xml:withMessages" outputFile="${findbugs.dest}/${ant.project.name}-fb.xml">
<auxClasspath refid="compile.classpath" />
<sourcePath path="${project.src}" />
<class location="${project.build}" />
</findbugs>
</target>
<target name="pmd" depends="build">
<property name="pmd.dest" value="${project.build.report}/pmd" />
<mkdir dir="${pmd.dest}" />
<pmd shortFilenames="true">
<ruleset>rulesets/favorites.xml</ruleset>
<ruleset>basic</ruleset>
<formatter type="xml" toFile="${pmd.dest}/${ant.project.name}-pmd.xml" linkPrefix="http://pmd.sourceforge.net/xref/" />
<fileset dir="${project.src}">
<include name="**/*.java" />
</fileset>
</pmd>
</target>
<target name="cpd" depends="build">
<property name="cpd.dest" value="${project.build.report}/cpd" />
<mkdir dir="${cpd.dest}" />
<cpd minimumTokenCount="70" format="xml" outputFile="${cpd.dest}/cpd.xml">
<fileset dir="${project.src}">
<include name="**/*.java" />
</fileset>
</cpd>
</target>
</project>