aboutsummaryrefslogtreecommitdiff
path: root/config/ant-phase-verify.xml
blob: b9a2331a48e7b73ea81224cc63de10e3bb05e91f (plain)
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
<?xml version="1.0" encoding="UTF-8"?>

<project name="phase-package" default="execute">

  <condition property="checkstyle.ant.skip">
    <isset property="checkstyle.ant.skip" />
  </condition>

  <target name="execute" unless="checkstyle.ant.skip">
    <taskdef name="checkstyle"
             classname="com.puppycrawl.tools.checkstyle.ant.CheckstyleAntTask"
             classpath="${mvn.runtime_classpath}"
             />

    <property name="checkstyle.pattern.todo" value="NOTHingWillMatCH_-"/>
    <property name="check.config" location="config/checkstyle_checks.xml"/>

    <tstamp>
      <format property="STARTED" pattern="dd/MM/yyyy hh:mm:ss aa" />
    </tstamp>
    <echo>Checkstyle started (checkstyle_checks.xml): ${STARTED}</echo>

    <checkstyle config="${check.config}"
                failOnViolation="false"
                failureProperty="checkstyle.failure.property"
                executeIgnoredModules="true"
                >
      <fileset dir="src"
               includes="**/*"
               excludes="it/resources/**/*,test/resources/**/*,test/resources-noncompilable/**/*"/>
      <formatter type="plain"/>
      <formatter type="xml" toFile="${mvn.project.build.directory}/cs_errors.xml"/>
      <classpath path="${mvn.runtime_classpath}"/>
      <property key="checkstyle.cache.file" file="${mvn.project.build.directory}/cachefile"/>
      <property key="checkstyle.header.file" file="config/java.header"/>
      <property key="checkstyle.regexp.header.file" file="config/java_regexp.header"/>
      <property key="checkstyle.importcontrol.file" file="config/import-control.xml"/>
      <property key="checkstyle.importcontroltest.file" file="config/import-control-test.xml"/>
      <property key="checkstyle.suppressions.file"
                file="config/suppressions.xml"/>
    </checkstyle>

    <tstamp>
      <format property="FINISHED" pattern="dd/MM/yyyy hh:mm:ss aa"/>
    </tstamp>
    <echo>Checkstyle finished (checkstyle_checks.xml) : ${FINISHED}</echo>

    <tstamp>
      <format property="STARTED" pattern="dd/MM/yyyy hh:mm:ss aa"/>
    </tstamp>
    <echo>Checkstyle started (checkstyle_non_main_files_checks.xml): ${STARTED}</echo>

    <checkstyle config="config/checkstyle_non_main_files_checks.xml"
                failOnViolation="true"
                failureProperty="checkstyle.failure.property"
                executeIgnoredModules="true"
                >
      <path>
        <fileset dir="${basedir}" includes="**/*">
          <exclude name=".git/**/*"/>
          <exclude name="src/main/**/*"/>
          <exclude name="src/test/java/**/*"/>
          <exclude name="src/site/resources/images/**/*"/>

          <!-- Eclipse project files -->
          <exclude name=".settings/**/*"/>
          <exclude name=".externalToolBuilders/**/*"/>
          <exclude name=".classpath"/>
          <exclude name=".project"/>

          <!-- m2e-code-quality Eclipse IDE plugin temporary configuration files for Eclipse CS Checkstyle / PMD / FindBugs Plug-Ins -->
          <exclude name=".checkstyle/**/*"/>
          <exclude name=".pmd/**/*"/>
          <exclude name=".pmdruleset.xml"/>
          <exclude name=".fbExcludeFilterFile/**/*"/>

          <!-- NetBeans project files -->
          <exclude name="**/nbactions.xml"/>
          <exclude name="**/nb-configuration.xml"/>

          <!-- Maven build folder -->
          <exclude name="target/**/*" />
          <exclude name="bin/**/*" />

          <!-- IDEA project files -->
          <exclude name="*.iml"/>
          <exclude name="*.ipr"/>
          <exclude name="*.iws"/>
          <exclude name=".idea/**/*"/>

          <!-- Temp files -->
          <exclude name="*~" />

          <!-- Java Virtual machine crash logs -->
          <exclude name="hs_err_pid*"/>
          <exclude name="replay_pid*"/>

          <!-- Apple MAC OSX hidden file -->
          <exclude name=".DS_Store" />

          <!-- NonDex files -->
          <exclude name=".nondex/**/*" />
        </fileset>
      </path>
      <formatter type="plain"/>
      <formatter type="xml" toFile="${mvn.project.build.directory}/cs_non_main_files_errors.xml"/>
      <classpath path="${mvn.runtime_classpath}"/>
    </checkstyle>

    <tstamp>
      <format property="FINISHED" pattern="dd/MM/yyyy hh:mm:ss aa"/>
    </tstamp>
    <echo>Checkstyle finished (checkstyle_non_main_files_checks.xml): ${FINISHED}</echo>

    <fail if="checkstyle.failure.property"
          message="Checkstyle failed: ${checkstyle.failure.property}"
          />
  </target>
</project>