avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcconn...@apache.org
Subject cvs commit: jakarta-avalon-apps/enterprise/pss checkstyle.xml
Date Sat, 18 May 2002 14:58:24 GMT
mcconnell    02/05/18 07:58:24

  Added:       enterprise/pss checkstyle.xml
  Log:
  temporary local checkstyle task that includes patterns for IDL method signatures.
  
  Revision  Changes    Path
  1.1                  jakarta-avalon-apps/enterprise/pss/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 <mcconnell@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">
  
          <echo message="Local PSS checkstyle execution"/>
          <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="200"
              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_]*$)"
              methodPattern="[a-z][a-zA-Z0-9_]*$"
              localvarPattern="[a-z][a-zA-Z0-9_]*$"
              ignoreImportLen="true"
              allowTabs="false"
              javadocScope="protected"
              ignoreWhitespace="true"
              cacheFile="checkstyle.cache"
              failOnViolation="${checkstyle.failOnViolation}"
              ignoreCastWhitespace="true">
              <fileset dir="${java.dir}">
                  <include name="org/apache/pss/wrapper/**/*.java"/>
                  <exclude name="org/omg/**"/>
              </fileset>
              <formatter type="plain"/>
              <formatter type="xml" toFile="${build.dir}/checkstyle-results.xml"/>
          </checkstyle>
      </target>
  
  </project>
  
  

--
To unsubscribe, e-mail:   <mailto:avalon-cvs-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-cvs-help@jakarta.apache.org>


Mime
View raw message