-
Notifications
You must be signed in to change notification settings - Fork 52
/
Copy pathbuild-checkstyle.xml
50 lines (38 loc) · 2.14 KB
/
build-checkstyle.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
<?xml version="1.0" encoding="UTF-8" ?>
<!--
This file is part of SoSy-Lab Java-Project Template,
a collection of common files and build definitions for Java projects:
https://gitlab.com/sosy-lab/software/java-project-template
SPDX-FileCopyrightText: 2018-2020 Dirk Beyer <https://www.sosy-lab.org>
SPDX-License-Identifier: Apache-2.0
-->
<!-- vim: set tabstop=8 shiftwidth=4 expandtab filetype=ant : -->
<project name="checkstyle" basedir="."
xmlns:cs="antlib:com.puppycrawl.tools.checkstyle.ant">
<!-- Targets for running Checkstyle. -->
<!-- DO NOT EDIT LOCALLY!
Keep this file synchronized with
https://gitlab.com/sosy-lab/software/java-project-template
-->
<property name="checkstyle.output" value="xml"/>
<target name="run-checkstyle" depends="resolve-dependencies">
<path id="checkstyle.lib.path">
<fileset dir="${ivy.lib.dir}/checkstyle" includes="*.jar"/>
</path>
<property name="config_loc" value="build"/>
<taskdef resource="com/puppycrawl/tools/checkstyle/ant/checkstyle-ant-task.properties" uri="antlib:com.puppycrawl.tools.checkstyle.ant" classpathref="checkstyle.lib.path"/>
<cs:checkstyle config="build/checkstyle.xml">
<fileset dir="${source.dir}" includes="**/*.java" excludes="**/test/*.java **/*Test.java **/*Test0.java **/*TestBase.java **/*TestSuite.java"/>
<formatter type="${checkstyle.output}" toFile="Checkstyle.xml"/>
</cs:checkstyle>
<cs:checkstyle config="build/checkstyle.test.xml">
<fileset dir="${source.dir}" includes="**/test/*.java **/*Test.java **/*Test0.java **/*TestBase.java **/*TestSuite.java"/>
<formatter type="${checkstyle.output}" toFile="Checkstyle.Test.xml"/>
</cs:checkstyle>
</target>
<target name="checkstyle-report">
<xslt in="Checkstyle.xml" out="Checkstyle.html" style="build/checkstyle.xsl"/>
<xslt in="Checkstyle.Test.xml" out="Checkstyle.Test.html" style="build/checkstyle.xsl"/>
</target>
<target name="checkstyle" depends="run-checkstyle, checkstyle-report" description="Run CheckStyle on source code" />
</project>