cmlenz      2002/12/26 05:04:16

  Modified:    anttasks build.xml
               framework build.xml
  Added:       .        common.xml
  Log:
  - Make it possible to keep the JARs needed for Checkstyle code audit
    outside of $ANT_HOME/lib.
  - Put the relevant initialization in a buildfile fragment called common.xml, 
    which is included from anttasks/build.xml and framework/build.xml by
    entity expansion.
  - Added the build.properties at the root of the project to the build files of
    both anttasks and framework... this might need some further tweaking
    to be really clean
  
  Revision  Changes    Path
  1.1                  jakarta-cactus/common.xml
  
  Index: common.xml
  ===================================================================
  <!--
    =============================================================================
      Build file fragments used by multiple components
    =============================================================================
  -->
  
      <!--
         ========================================================================
           Initialize Checkstyle.
         ========================================================================
      -->
      <target name="init.checkstyle.check">
  
          <path id="checkstyle.classpath">
              <pathelement location="${antlr.jar}"/>
              <pathelement location="${checkstyle.jar}"/>
              <pathelement location="${commons-beanutils.jar}"/>
              <pathelement location="${commons-collections.jar}"/>
              <pathelement location="${commons-logging.jar}"/>
              <pathelement location="${jakarta-regexp.jar}"/>
              <!-- Includes system classpath for jars that are in ANT_HOME/lib 
                   such as aspectrt.jar, etc -->
              <pathelement path="${java.class.path}"/>
          </path>
  
          <condition property="checkstyle.available">
              <and>
                  <available
                      classname="antlr.Parser"
                      classpathref="checkstyle.classpath"/>
                  <available
                      classname="org.apache.commons.beanutils.BeanUtils"
                      classpathref="checkstyle.classpath"/>
                  <available
                      classname="org.apache.commons.collections.CollectionUtils"
                      classpathref="checkstyle.classpath"/>
                  <available
                      classname="org.apache.commons.logging.Log"
                      classpathref="checkstyle.classpath"/>
                  <available
                      classname="org.apache.regexp.RE"
                      classpathref="checkstyle.classpath"/>
              </and>
          </condition>
  
      </target>
  
      <target name="init.checkstyle"
          depends="init.checkstyle.check"
          if="checkstyle.available">
  
          <taskdef resource="checkstyletask.properties"
              classpathref="checkstyle.classpath"/>
  
      </target>
  
  
  
  1.31      +15 -12    jakarta-cactus/anttasks/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-cactus/anttasks/build.xml,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- build.xml 9 Dec 2002 22:37:42 -0000       1.30
  +++ build.xml 26 Dec 2002 13:04:16 -0000      1.31
  @@ -1,4 +1,7 @@
   <?xml version="1.0"?>
  +<!DOCTYPE project [
  +    <!ENTITY common SYSTEM "file:../common.xml">
  +]>
   
   <!--
     =============================================================================
  @@ -28,7 +31,8 @@
   
       <!-- Give user a chance to override without editing this file
            (and without typing -D each time it compiles it) -->
  -    <property file="anttasks/build.properties" />
  +    <property file="${basedir}/anttasks/build.properties" />
  +    <property file="${basedir}/build.properties" />
       <property file="${user.home}/build.properties" />
   
       <!-- Global project properties -->
  @@ -99,6 +103,13 @@
   
       <!--
          ========================================================================
  +         Include common targets and properties
  +       ========================================================================
  +    -->
  +    &common;
  +
  +    <!--
  +       ========================================================================
            Display configurable properties values
          ========================================================================
       -->
  @@ -250,18 +261,10 @@
            Perform a code audit using CheckStyle.
          ========================================================================
       -->
  -    <target name="checkstyle.check">
  -
  -        <available property="checkstyle.present"
  -            classname="com.puppycrawl.tools.checkstyle.CheckStyleTask"/>
  -
  -    </target>
  -    <target name="checkstyle" depends="checkstyle.check,init"
  -        if="checkstyle.present"
  +    <target name="checkstyle"
  +        depends="init, init.checkstyle"
  +        if="checkstyle.available"
           description="Perform a code audit using Checkstyle">
  -
  -        <taskdef name="checkstyle"
  -            classname="com.puppycrawl.tools.checkstyle.CheckStyleTask"/>
   
           <mkdir dir="${target.dir}"/>
   
  
  
  
  1.35      +15 -13    jakarta-cactus/framework/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-cactus/framework/build.xml,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- build.xml 25 Dec 2002 14:40:05 -0000      1.34
  +++ build.xml 26 Dec 2002 13:04:16 -0000      1.35
  @@ -1,4 +1,7 @@
   <?xml version="1.0"?>
  +<!DOCTYPE project [
  +    <!ENTITY common SYSTEM "file:../common.xml">
  +]>
   
   <!--
     =============================================================================
  @@ -36,7 +39,8 @@
   
       <!-- Give user a chance to override without editing this file
            (and without typing -D each time it compiles it) -->
  -    <property file="framework/build.properties" />
  +    <property file="${basedir}/framework/build.properties" />
  +    <property file="${basedir}/build.properties" />
       <property file="${user.home}/build.properties" />
   
       <!-- Global project properties -->
  @@ -67,6 +71,13 @@
   
       <!--
          ========================================================================
  +         Include common targets and properties
  +       ========================================================================
  +    -->
  +    &common;
  +
  +    <!--
  +       ========================================================================
            Set the properties related to the source tree.
            Note: These properties are defined in a target as some need the
                  j2ee.api property to be set
  @@ -623,19 +634,10 @@
            the checkstyle jar is in the Ant classpasth.
          ========================================================================
       -->
  -    <target name="checkstyle.check">
  -
  -        <available property="checkstyle.present"
  -            classname="com.puppycrawl.tools.checkstyle.CheckStyleTask"/>
  -
  -    </target>
  -
  -    <target name="checkstyle" depends="checkstyle.check,init"
  -        if="checkstyle.present"
  +    <target name="checkstyle"
  +        depends="init, init.checkstyle"
  +        if="checkstyle.available"
           description="Perform a code audit using Checkstyle">
  -
  -        <taskdef name="checkstyle"
  -            classname="com.puppycrawl.tools.checkstyle.CheckStyleTask"/>
   
           <mkdir dir="${target.dir}"/>
   
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to