ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roberto Juarez" <rjua...@omnilogic.es>
Subject Classpath problem with Checkstyle?
Date Thu, 28 Oct 2004 09:11:44 GMT
Hi folks,

I am using Checkstyle 3.3 under Ant 1.6.2.

I have in	structed Checkstyle to allow the @throws tag for undeclared exceptions in the checkstyle.xml
configuration file

   ...
   
   <!-- javadoc -->
    <module name="JavadocType">
      <property name="versionFormat" value="\S"/>
    </module>
    <module name="JavadocMethod">
      <property name="scope" value="package"/>
      <property name="allowUndeclaredRTE" value="true"/>
      <property name="allowThrowsTagsForSubclasses" value="true"/>
    </module>
    <module name="JavadocVariable">
      <property name="scope" value="package"/>
    </module>
    <module name="JavadocStyle"/>

   ...

but Checkstyle is unable to find class information for some runtime exceptions. Checkstyle
has no problem in finding class information for runtime exceptions that belong to packages
like java.lang. But, when it comes to user defined packages, Checkstyle is unable to find
the classes. Here are the relevant snippets of code in my build.xml

  <!-- environment -->
  <property environment="env."/>
  <property name="develop.dir" value="${env.DEVELOP_HOME}"/>

  <!-- directory mappings -->
  <property name="library.dir"  value="${develop.dir}/library"/>
  <property name="build.dir"    location="build"/>
  <property name="conf.dir"     location="conf"/>
  <property name="classes.dir"  location="${build.dir}/classes"/>

  <!-- jars -->
  <property name="checkstyle.jar"          value="${library.dir}/checkstyle-3.3.jar"/>
  <property name="antlr.jar"               value="${library.dir}/antlr-2.7.2.jar"/>
  <property name="jakarta-regexp-1.3.jar"  value="${library.dir}/jakarta-regexp-1.3.jar"/>
  <property name="commons-beanutils.jar"   value="${library.dir}/commons-beanutils-1.6.jar"/>
  <property name="commons-collections.jar" value="${library.dir}/commons-collections-2.1.jar"/>
  <property name="commons-logging.jar"     value="${library.dir}/commons-logging-1.0.4.jar"/>

  <!-- paths -->
  <path id="checkstyle.classpath">
    <pathelement location="${classes.dir}"/>
    <pathelement location="${checkstyle.jar}"/>
    <pathelement location="${antlr.jar}"/>
    <pathelement location="${jakarta-regexp-1.3.jar}"/>
    <pathelement location="${commons-beanutils.jar}"/>
    <pathelement location="${commons-collections.jar}"/>
    <pathelement location="${commons-logging.jar}"/>
  </path>

  <!-- taskdefs -->
  <taskdef name="checkstyle" classname="com.puppycrawl.tools.checkstyle.CheckStyleTask">
    <classpath refid="checkstyle.classpath"/> 
  </taskdef> 

  <!-- targets -->
  <target name="setup"
          description="Sets up the build system.">
    <mkdir dir="${build.dir}"/>
    <mkdir dir="${classes.dir}"/>
    <mkdir dir="${checkstyle.dir}"/>
    <mkdir dir="${checkstyle.data.dir}"/>
    <mkdir dir="${checkstyle.report.dir}"/>
  </target>

  <target name="checkstyle"
          depends="setup"
          description="Checks source code conventions.">

    <checkstyle config="${conf.dir}/checkstyle.xml" failOnViolation="${checkstyle.haltOnFailure}">
      <formatter type="plain"/>
      <formatter type="xml" tofile="${checkstyle.data.dir}/checkstyle_results.xml"/>
      <fileset dir="${src.dir}" includes="**/*.java"/>
    </checkstyle>
    
    <xslt basedir="${checkstyle.data.dir}"
          destdir="${checkstyle.report.dir}"
          includes="*.xml"
          style="${conf.dir}/checkstyle-noframes-sorted.xsl"/>
  </target>

Any help will be really appreciated as Javadoc is a very important concern for us.




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message