-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheckstyle.xml
More file actions
103 lines (85 loc) · 3.7 KB
/
Copy pathcheckstyle.xml
File metadata and controls
103 lines (85 loc) · 3.7 KB
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
<?xml version="1.0" encoding="UTF-8"?>
<project name="jlibiada-misc" default="run">
<property name="build" value="build"/>
<property name="build.main" value="${build}/main"/>
<property name="build.test" value="${build}/test"/>
<property name="build.instr" value="${build}/instr"/>
<property name="src" value="src"/>
<property name="src.main" value="${src}/main"/>
<property name="src.test" value="${src}/test"/>
<property name="lib" value="lib"/>
<property name="checkstyle.policy" location="checkstyle-policy.xml"/>
<property name="reports" location="reports/checkstyle"/>
<property name="checkstyle.report.xml" location="${reports}/checkstyle.xml" />
<property name="coverage.report.xml" location="${reports}/coverage.xml" />
<property name="cobertura.dir" value="/usr/share/java/cobertura"/>
<target name="checkstyle-init">
<path id="checkstyle.lib" >
<pathelement location="/usr/share/ant/lib/checkstyle-5.5-all.jar" />
</path>
<taskdef resource="checkstyletask.properties" classpathref="checkstyle.lib"/>
<mkdir dir="${reports}" />
</target>
<target name="checkstyle-run" depends="checkstyle-init">
<checkstyle failOnViolation="false"
failureProperty="checkstyle.failed"
config="${checkstyle.policy}">
<formatter type="plain"/>
<formatter type="xml" toFile="${checkstyle.report.xml}"/>
<fileset dir="${src.main}" includes="**/*.java"/>
</checkstyle>
</target>
<path id="cobertura.classpath">
<fileset dir="${cobertura.dir}">
<!--<include name="cobertura.jar" />-->
<include name="**/*.jar" />
</fileset>
</path>
<target name="cover-init">
<taskdef classpathref="cobertura.classpath" resource="tasks.properties"/>
</target>
<target name="cover-instrumentation" depends="cover-init">
<delete file="cobertura.ser"/>
<delete dir="${build.instr}" />
<cobertura-instrument todir="${build.instr}">
<fileset dir="${build}">
<include name="**/*.class"/>
<exclude name="**/test*.class"/>
</fileset>
</cobertura-instrument>
</target>
<path id="test.compile.classpath">
<fileset dir="lib">
<include name="*.jar"/>
</fileset>
<pathelement location="${build.main}"/>
</path>
<path id="test.classpath">
<path refid="test.compile.classpath"/>
<pathelement location="${build.test}"/>
</path>
<target name="cover-run" depends="cover-instrumentation">
<mkdir dir="${reports}/coverage/tests" />
<junit showoutput="true" printsummary="true" fork="yes">
<jvmarg value="-XX:-UseSplitVerifier"/>
<sysproperty key="net.sourceforge.cobertura.datafile" file="${basedir}/cobertura.ser"/>
<classpath location="${build.instr}" />
<classpath refid="test.classpath" />
<classpath refid="cobertura.classpath" />
<formatter type="xml"/>
<batchtest todir="${reports}/coverage/tests" unless="testcase">
<fileset dir="${src}">
<include name="**/test*.java" />
</fileset>
</batchtest>
</junit>
</target>
<target name="cover-report" depends="cover-run">
<cobertura-report datafile="cobertura.ser" format="xml" srcdir="${src}" destdir="${reports}"/>
<cobertura-report datafile="cobertura.ser" format="html" srcdir="${src}" destdir="${reports}/coverage"/>
</target>
<target name="run">
<antcall target="checkstyle-run" />
<antcall target="cover-report"/>
</target>
</project>