werken      2002/06/27 09:04:51

  Modified:    src/java/org/apache/maven/app Maven.java
               src/templates/build/plugins/test plugin.jelly
  Log:
  Spit and polish.
  
  Revision  Changes    Path
  1.26      +34 -0     jakarta-turbine-maven/src/java/org/apache/maven/app/Maven.java
  
  Index: Maven.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/app/Maven.java,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- Maven.java        27 Jun 2002 02:55:13 -0000      1.25
  +++ Maven.java        27 Jun 2002 16:04:51 -0000      1.26
  @@ -109,6 +109,7 @@
   import java.util.Enumeration;
   import java.util.Iterator;
   import java.util.StringTokenizer;
  +import java.util.Date;
   
   /** 
    * Command-line entry-point to maven.
  @@ -1223,6 +1224,8 @@
       public void doMain(String[] args)
       {
           boolean done = false;
  +
  +        Date fullStart = new Date();
           
           try
           {
  @@ -1258,6 +1261,8 @@
               return;
           }
   
  +        Date buildStart = new Date();
  +
           Project mavenProject = getProjectDescriptor().getProject();
   
           System.out.println("");
  @@ -1272,6 +1277,8 @@
                              + mavenProject.getCurrentVersion());
           System.out.println("");
   
  +        boolean failed = false;
  +
           try
           {
               runtimeInitialization();
  @@ -1288,12 +1295,14 @@
           }
           catch (UnknownGoalException e)
           {
  +            failed = true;
               System.err.println("BUILD FAILED");
               System.err.println("Goal \"" + e.getGoalName()
                                  + "\" does not exist in this project.");
           }
           catch (UnattainableGoalException e)
           {
  +            failed = true;
               System.err.println("BUILD FAILED");
   
               String msg = null;
  @@ -1314,6 +1323,7 @@
           }
           catch (JellyException e)
           {
  +            failed = true;
               Throwable rootCause = e.getCause();
   
               if ( rootCause != null )
  @@ -1328,12 +1338,35 @@
           }
           catch (Exception e)
           {
  +            failed = true;
               e.printStackTrace();
           }
   
  +        if ( ! failed )
  +        {
  +            System.out.println( "BUILD SUCCESSFUL" );
  +        }
  +
  +        Date fullStop = new Date();
  +
  +        long diff = fullStop.getTime() - fullStart.getTime();
  +
  +        System.out.println( "Total time: " + formatTime( diff ) );
  +
  +
           System.out.println("");
       }
   
  +    static String formatTime(long ms)
  +    {
  +        long secs = ms / 1000;
  +        long min  = secs / 60;
  +
  +        secs = secs % 60;
  +
  +        return secs + " seconds";
  +    }
  +
   
       // ------------------------------------------------------------
       //     Class methods
  @@ -1349,4 +1382,5 @@
           
           maven.doMain(args);
       }
  +
   }
  
  
  
  1.8       +0 -1      
jakarta-turbine-maven/src/templates/build/plugins/test/plugin.jelly
  
  Index: plugin.jelly
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-maven/src/templates/build/plugins/test/plugin.jelly,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- plugin.jelly      26 Jun 2002 19:51:52 -0000      1.7
  +++ plugin.jelly      27 Jun 2002 16:04:51 -0000      1.8
  @@ -62,7 +62,6 @@
         </batchtest>
       </junit>
   
  -    <echo message="fail: ${maven.test.failure}"/>
       <j:if test="${maven.test.failure}">
         <fail message="There were test failures."/>
       </j:if>
  
  
  

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

Reply via email to