You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by mc...@apache.org on 2002/05/14 06:40:59 UTC

cvs commit: jakarta-avalon-apps/common/util checkstyle.xml

mcconnell    02/05/13 21:40:59

  Added:       common/lib avalon-framework.jar logkit.jar
                        phoenix-client.jar xerces.jar
               common/tools checkstyle-all.jar
               common/util checkstyle.xml
  Log:
  addition of common libraries, tools and utilities
  
  Revision  Changes    Path
  1.1                  jakarta-avalon-apps/common/lib/avalon-framework.jar
  
  	<<Binary file>>
  
  
  1.1                  jakarta-avalon-apps/common/lib/logkit.jar
  
  	<<Binary file>>
  
  
  1.1                  jakarta-avalon-apps/common/lib/phoenix-client.jar
  
  	<<Binary file>>
  
  
  1.1                  jakarta-avalon-apps/common/lib/xerces.jar
  
  	<<Binary file>>
  
  
  1.1                  jakarta-avalon-apps/common/tools/checkstyle-all.jar
  
  	<<Binary file>>
  
  
  1.1                  jakarta-avalon-apps/common/util/checkstyle.xml
  
  Index: checkstyle.xml
  ===================================================================
  <?xml version="1.0"?>
  
  <!--
  =================================================================================
  
  Description
  
      This project contains the checkstyle task.  It is intended that
      the task will be invoked by a project using the following approach:
  
        <property name="enterprise.path" value=".."/>
        <property name="common.path" value="${enterprise.path}/../common"/>
        <target name="checkstyle">
          <ant antfile="${common.path}/util/checkstyle.xml">
            <property name="checkstyle.failOnViolation" value="true"/>
            <property name="build.dir" value="your-build-directory"/>
            <property name="java.dir" value="your-source-directory/java"/>
          </ant>
        </target>
  
      The three properties can be supplied under the ant call, two of which are
      mandatory. The ${checkstyle.failOnViolation} property is a value of 'true'
      or 'false' and will cause the build to fail if true.  The ${build.dir} referrs
      top a directory into which a report will be generated.  The ${java.dir} is your
      java source directory containing the sources files to be validated.
  
  Authors:
  
      Stephen McConnell <mc...@apache.org>
  
  Legal:
  
    Copyright (c) 2002 The Apache Software Foundation. All Rights Reserved.
  
  =================================================================================
  -->
  
  <project name="checkstyle" default="checkstyle" basedir="..">
  
  
    <!-- local build environment -->
  
  
      <!-- common diorectories -->
      <property name="apps.dir" value="../.."/>
      <property name="common.dir" value="${apps.dir}/common"/>
      <property name="common.lib.dir" value="${common.dir}/lib"/>
      <property name="common.tools.dir" value="${common.dir}/tools"/>
  
      <!-- common jar files -->
      <property name="logkit.jar" value="${common.lib.dir}/logkit.jar"/>
      <property name="avalon-framework.jar" value="${common.lib.dir}/avalon-framework.jar"/>
      <property name="phoenix-client.jar" value="${common.lib.dir}/phoenix-client.jar"/>
      <property name="checkstyle.jar" value="${common.tools.dir}/checkstyle-all.jar"/>
  
      <!-- declaration of validation defaults -->
      <property name="checkstyle.failOnViolation" value="false"/>
  
      <!-- Classpath for tools -->
      <path id="tools.class.path">
          <pathelement location="${logkit.jar}"/>
          <pathelement location="${avalon-framework.jar}"/>
          <pathelement location="${checkstyle.jar}"/>
          <pathelement path="${java.class.path}"/>
      </path>
  
      <!-- checkstyle directories that are needed in the target project -->
      <target name="target.context">
        <available file="${java.dir}" type="dir" property="src.path.present"/>
        <available file="${build.dir}" type="dir" property="build.path.present"/>
      </target>
  
      <!-- check java source directory -->
      <target name="java.error" depends="target.context" unless="src.path.present">
        <property name="runtime.error value=true"/>
        <echo message="The java.dir property '${java.dir}' does not refer to a directory."/>
      </target>
  
      <!-- check build directory -->
      <target name="build.error" depends="java.error" unless="build.path.present">
        <property name="runtime.error value=true"/>
        <echo message="The build.dir property '${build.dir}' does not refer to a directory."/>
      </target>
  
      <!-- checkstyle target -->
      <target name="checkstyle" description="Checkstyle" depends="build.error" unless="runtime.error">
  
          <taskdef name="checkstyle"
              classname="com.puppycrawl.tools.checkstyle.CheckStyleTask">
              <classpath refid="tools.class.path"/>
          </taskdef>
          <checkstyle
              lcurlyType="nl"
              lcurlyMethod="nl"
              lcurlyOther="nl"
              rcurly="ignore"
              allowProtected="false"
              allowPackage="false"
              allowNoAuthor="false"
              maxLineLen="100"
              maxMethodLen="100"
              maxConstructorLen="100"
              memberPattern="^m_[a-z][a-zA-Z0-9]*$"
              staticPattern="^c_[a-z][a-zA-Z0-9]*$"
              constPattern="(^c_[a-z][a-zA-Z0-9]*$)|([A-Z_]*$)"
              ignoreImportLen="true"
              allowTabs="false"
              javadocScope="protected"
              ignoreWhitespace="true"
              cacheFile="checkstyle.cache"
              failOnViolation="${checkstyle.failOnViolation}"
              ignoreCastWhitespace="true">
              <fileset dir="${java.dir}">
                  <include name="**/*.java"/>
              </fileset>
              <formatter type="plain"/>
              <formatter type="xml" toFile="${build.dir}/checkstyle-results.xml"/>
          </checkstyle>
      </target>
  
  </project>
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>