vmassol     2004/03/22 12:26:56

  Modified:    integration/ant build.xml
               integration/ant/src/java/org/apache/cactus/integration/ant/container
                        AbstractJavaContainer.java
  Log:
  After several hours of debugging... finally found why the clover reports were 
missing the Ant integration source code... I have not yet fully tested the code but it 
works with Resin. Hope it works with other containers too.
  
  Revision  Changes    Path
  1.54      +2 -2      jakarta-cactus/integration/ant/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-cactus/integration/ant/build.xml,v
  retrieving revision 1.53
  retrieving revision 1.54
  diff -u -r1.53 -r1.54
  --- build.xml 22 Feb 2004 13:22:45 -0000      1.53
  +++ build.xml 22 Mar 2004 20:26:56 -0000      1.54
  @@ -369,7 +369,7 @@
           <include name="LICENSE.cactus"/>
           <include name="NOTICE.cactus"/>
         </metainf>
  -      <fileset dir="${target.classes.java.dir}"/>
  +      <fileset dir="${target.classes.clover.dir}"/>
       </jar>
   
     </target>
  
  
  
  1.10      +25 -1     
jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/container/AbstractJavaContainer.java
  
  Index: AbstractJavaContainer.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/container/AbstractJavaContainer.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- AbstractJavaContainer.java        29 Feb 2004 10:05:26 -0000      1.9
  +++ AbstractJavaContainer.java        22 Mar 2004 20:26:56 -0000      1.10
  @@ -22,6 +22,7 @@
   import java.io.File;
   import java.io.FileNotFoundException;
   
  +import org.apache.cactus.integration.ant.util.ResourceUtils;
   import org.apache.tools.ant.taskdefs.Java;
   import org.apache.tools.ant.types.Path;
   import org.apache.tools.ant.types.Environment.Variable;
  @@ -98,6 +99,11 @@
           java.setOutput(this.output);
           java.setAppend(this.append);
   
  +        // Add Clover jar to the server classpath if Clover is in the classpath
  +        // that started the <cactus> task. This is required when running in 
  +        // Clovered mode.
  +        addCloverJar(java);
  +       
           // Add Cactus properties for the server side
           for (int i = 0; i < getSystemProperties().length; i++)
           {
  @@ -109,6 +115,24 @@
           return java;
       }
   
  +    /**
  +     * Add Clover jar to the server classpath if Clover is in the classpath
  +     * that started the <cactus> task. This is required when running in
  +     * Clovered mode.
  +     * 
  +     * @param theJavaCommand the java command that will start the container
  +     */
  +    private void addCloverJar(Java theJavaCommand)
  +    {
  +        Path classpath = theJavaCommand.createClasspath();
  +        File file = ResourceUtils.getResourceLocation(
  +            "/com/cortexeb/tools/clover/tasks/CloverTask.class");
  +        if (file != null)
  +        {
  +            classpath.createPathElement().setLocation(file);
  +        }
  +    }
  +    
       /**
        * Convenience method to create an Ant environment variable that points to
        * a file.
  
  
  

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

Reply via email to