jvanzyl     2004/01/24 16:27:01

  Modified:    maven-mboot/src/bash maven.functions
               maven-mboot/src/main Bootstrapper.java
  Log:
  o account for there being no tests
  
  Revision  Changes    Path
  1.12      +4 -1      maven-components/maven-mboot/src/bash/maven.functions
  
  Index: maven.functions
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-mboot/src/bash/maven.functions,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- maven.functions   20 Jan 2004 08:53:38 -0000      1.11
  +++ maven.functions   25 Jan 2004 00:27:01 -0000      1.12
  @@ -46,7 +46,10 @@
       CP=$1
     fi
     
  -  "${JAVACMD}" -classpath "$CP" TestRunnerBooter "$2" "$3" $4 $5 $6
  +  if [ -f $5 ]
  +  then
  +    "${JAVACMD}" -classpath "$CP" TestRunnerBooter "$2" "$3" $4 $5 $6
  +  fi
   }
   
   compile()
  
  
  
  1.11      +52 -47    maven-components/maven-mboot/src/main/Bootstrapper.java
  
  Index: Bootstrapper.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-mboot/src/main/Bootstrapper.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- Bootstrapper.java 20 Jan 2004 08:53:38 -0000      1.10
  +++ Bootstrapper.java 25 Jan 2004 00:27:01 -0000      1.11
  @@ -9,7 +9,6 @@
   import java.io.File;
   import java.io.FileInputStream;
   import java.io.FileWriter;
  -import java.io.InputStream;
   import java.io.Serializable;
   import java.io.Writer;
   import java.util.ArrayList;
  @@ -19,10 +18,11 @@
   public class Bootstrapper
   {
       private ArtifactDownloader downloader;
  +
       private BootstrapPomParser bootstrapPomParser;
   
       private List dependencies;
  -    
  +
       private UnitTests unitTests;
   
       private List resources;
  @@ -39,7 +39,7 @@
           throws Exception
       {
           String basedir = args[0];
  -        
  +
           downloader = new ArtifactDownloader();
   
           bootstrapPomParser = new BootstrapPomParser();
  @@ -75,62 +75,67 @@
           writeFile( "bootstrap.classpath", classPath.toString() );
   
           writeFile( "bootstrap.libs", libs.toString() );
  -        
  +
  +        int size;
  +
           unitTests = bootstrapPomParser.getUnitTests();
  -        
  -        StringBuffer tests = new StringBuffer();
  -        
  -        tests.append(unitTests.getDirectory());
  -        
  -        tests.append("@");
  -        
  -        int size = unitTests.getIncludes().size();
   
  -        // If there are no includes specified then we want it all.
  -        if ( size == 0 )
  +        if ( unitTests != null )
           {
  -            tests.append( "'*'" );
  -        }
  +            StringBuffer tests = new StringBuffer();
   
  -        for ( int j = 0; j < size; j++ )
  -        {
  -            String include = (String) unitTests.getIncludes().get( j );
  +            tests.append( unitTests.getDirectory() );
   
  -            tests.append( include );
  +            tests.append( "@" );
   
  -            if ( j != size - 1 )
  +            size = unitTests.getIncludes().size();
  +
  +            // If there are no includes specified then we want it all.
  +            if ( size == 0 )
               {
  -                tests.append( "," );
  +                tests.append( "'*'" );
               }
  -        }
   
  -        tests.append( "\n" );
  -        
  -        writeFile( "bootstrap.tests.includes", tests.toString() );
  +            for ( int j = 0; j < size; j++ )
  +            {
  +                String include = (String) unitTests.getIncludes().get( j );
   
  -        tests = new StringBuffer();
  -        
  -        tests.append(unitTests.getDirectory());
  -        
  -        tests.append("@");
  -        
  -        size = unitTests.getExcludes().size();
  +                tests.append( include );
   
  -        for ( int j = 0; j < size; j++ )
  -        {
  -            String exclude = (String) unitTests.getExcludes().get( j );
  +                if ( j != size - 1 )
  +                {
  +                    tests.append( "," );
  +                }
  +            }
   
  -            tests.append( exclude );
  +            tests.append( "\n" );
   
  -            if ( j != size - 1 )
  +            writeFile( "bootstrap.tests.includes", tests.toString() );
  +
  +            tests = new StringBuffer();
  +
  +            tests.append( unitTests.getDirectory() );
  +
  +            tests.append( "@" );
  +
  +            size = unitTests.getExcludes().size();
  +
  +            for ( int j = 0; j < size; j++ )
               {
  -                tests.append( "," );
  +                String exclude = (String) unitTests.getExcludes().get( j );
  +
  +                tests.append( exclude );
  +
  +                if ( j != size - 1 )
  +                {
  +                    tests.append( "," );
  +                }
               }
  -        }
   
  -        tests.append( "\n" );
  -        
  -        writeFile( "bootstrap.tests.excludes", tests.toString() );
  +            tests.append( "\n" );
  +
  +            writeFile( "bootstrap.tests.excludes", tests.toString() );
  +        }
   
           resources = bootstrapPomParser.getResources();
   
  @@ -207,7 +212,7 @@
           extends DefaultHandler
       {
           private List dependencies = new ArrayList();
  -        
  +
           private UnitTests unitTests;
   
           private List resources = new ArrayList();
  @@ -232,7 +237,7 @@
           {
               return dependencies;
           }
  -        
  +
           public UnitTests getUnitTests()
           {
               return unitTests;
  @@ -320,7 +325,7 @@
               }
               else if ( rawName.equals( "unitTestSourceDirectory" ) )
               {
  -                unitTests.setDirectory(getBodyText());
  +                unitTests.setDirectory( getBodyText() );
               }
               else if ( rawName.equals( "unitTest" ) )
               {
  @@ -575,7 +580,7 @@
               return false;
           }
       }
  -    
  +
       public static class UnitTests
           implements Serializable
       {
  
  
  

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

Reply via email to