You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by do...@apache.org on 2001/12/16 01:35:05 UTC

cvs commit: jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/perforce P4Add.java P4Base.java P4Change.java P4Counter.java P4Delete.java P4Edit.java P4Handler.java P4HandlerAdapter.java P4Have.java P4Label.java P4OutputHandler.java P4Reopen.java P4Revert.java P4Submit.java P4Sync.java SimpleP4OutputHandler.java

donaldp     01/12/15 16:35:05

  Modified:    proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/perforce
                        P4Add.java P4Base.java P4Change.java P4Counter.java
                        P4Delete.java P4Edit.java P4Handler.java
                        P4HandlerAdapter.java P4Have.java P4Label.java
                        P4OutputHandler.java P4Reopen.java P4Revert.java
                        P4Submit.java P4Sync.java
                        SimpleP4OutputHandler.java
  Log:
  BuildException -> TaskException
  
  Removed uneeded imports.
  
  Processed code through style formatter.
  
  Revision  Changes    Path
  1.2       +9 -8      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Add.java
  
  Index: P4Add.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Add.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- P4Add.java	2001/12/15 12:06:29	1.1
  +++ P4Add.java	2001/12/16 00:35:04	1.2
  @@ -6,9 +6,10 @@
    * the LICENSE file.
    */
   package org.apache.tools.ant.taskdefs.optional.perforce;
  +
   import java.io.File;
   import java.util.Vector;
  -import org.apache.tools.ant.BuildException;
  +import org.apache.myrmidon.api.TaskException;
   import org.apache.tools.ant.DirectoryScanner;
   import org.apache.tools.ant.Project;
   import org.apache.tools.ant.types.FileSet;
  @@ -86,19 +87,19 @@
       private int m_changelist;
   
       public void setChangelist( int changelist )
  -        throws BuildException
  +        throws TaskException
       {
           if( changelist <= 0 )
  -            throw new BuildException( "P4Add: Changelist# should be a positive number" );
  +            throw new TaskException( "P4Add: Changelist# should be a positive number" );
   
           this.m_changelist = changelist;
       }
   
       public void setCommandlength( int len )
  -        throws BuildException
  +        throws TaskException
       {
           if( len <= 0 )
  -            throw new BuildException( "P4Add: Commandlength should be a positive number" );
  +            throw new TaskException( "P4Add: Commandlength should be a positive number" );
           this.m_cmdLength = len;
       }
   
  @@ -108,7 +109,7 @@
       }
   
       public void execute()
  -        throws BuildException
  +        throws TaskException
       {
   
           if( P4View != null )
  @@ -122,7 +123,7 @@
   
           for( int i = 0; i < filesets.size(); i++ )
           {
  -            FileSet fs = ( FileSet )filesets.elementAt( i );
  +            FileSet fs = (FileSet)filesets.elementAt( i );
               DirectoryScanner ds = fs.getDirectoryScanner( project );
               //File fromDir = fs.getDir(project);
   
  @@ -131,7 +132,7 @@
               {
                   for( int j = 0; j < srcFiles.length; j++ )
                   {
  -                    File f = new File( ds.getBasedir(), srcFiles[j] );
  +                    File f = new File( ds.getBasedir(), srcFiles[ j ] );
                       filelist.append( " " ).append( '"' ).append( f.getAbsolutePath() ).append( '"' );
                       if( filelist.length() > m_cmdLength )
                       {
  
  
  
  1.3       +10 -10    jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Base.java
  
  Index: P4Base.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Base.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- P4Base.java	2001/12/15 14:55:59	1.2
  +++ P4Base.java	2001/12/16 00:35:04	1.3
  @@ -6,14 +6,14 @@
    * the LICENSE file.
    */
   package org.apache.tools.ant.taskdefs.optional.perforce;
  +
   import java.io.IOException;
  +import org.apache.myrmidon.api.TaskException;
   import org.apache.oro.text.perl.Perl5Util;
  -import org.apache.tools.ant.BuildException;
   import org.apache.tools.ant.Project;
   import org.apache.tools.ant.taskdefs.Execute;
   import org.apache.tools.ant.types.Commandline;
   
  -
   /**
    * Base class for Perforce (P4) ANT tasks. See individual task for example
    * usage.
  @@ -110,7 +110,7 @@
       }
   
       protected void execP4Command( String command )
  -        throws BuildException
  +        throws TaskException
       {
           execP4Command( command, null );
       }
  @@ -120,10 +120,10 @@
        *
        * @param command The command to run
        * @param handler A P4Handler to process any input and output
  -     * @exception BuildException Description of Exception
  +     * @exception TaskException Description of Exception
        */
       protected void execP4Command( String command, P4Handler handler )
  -        throws BuildException
  +        throws TaskException
       {
           try
           {
  @@ -150,7 +150,7 @@
               String cmdl = "";
               for( int i = 0; i < cmdline.length; i++ )
               {
  -                cmdl += cmdline[i] + " ";
  +                cmdl += cmdline[ i ] + " ";
               }
   
               log( "Execing " + cmdl, Project.MSG_VERBOSE );
  @@ -170,7 +170,7 @@
               }
               catch( IOException e )
               {
  -                throw new BuildException( "Error", e );
  +                throw new TaskException( "Error", e );
               }
               finally
               {
  @@ -179,14 +179,14 @@
                       handler.stop();
                   }
                   catch( Exception e )
  -                {}
  +                {
  +                }
               }
   
  -
           }
           catch( Exception e )
           {
  -            throw new BuildException( "Problem exec'ing P4 command: " + e.getMessage() );
  +            throw new TaskException( "Problem exec'ing P4 command: " + e.getMessage() );
           }
       }
   }
  
  
  
  1.2       +37 -37    jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Change.java
  
  Index: P4Change.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Change.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- P4Change.java	2001/12/15 12:06:29	1.1
  +++ P4Change.java	2001/12/16 00:35:04	1.2
  @@ -6,7 +6,8 @@
    * the LICENSE file.
    */
   package org.apache.tools.ant.taskdefs.optional.perforce;
  -import org.apache.tools.ant.BuildException;
  +
  +import org.apache.myrmidon.api.TaskException;
   import org.apache.tools.ant.Project;
   
   /**
  @@ -32,51 +33,50 @@
           this.description = desc;
       }
   
  -
       public String getEmptyChangeList()
  -        throws BuildException
  +        throws TaskException
       {
           final StringBuffer stringbuf = new StringBuffer();
   
           execP4Command( "change -o",
  -            new P4HandlerAdapter()
  -            {
  -                public void process( String line )
  -                {
  -                    if( !util.match( "/^#/", line ) )
  -                    {
  -                        if( util.match( "/error/", line ) )
  -                        {
  -
  -                            log( "Client Error", Project.MSG_VERBOSE );
  -                            throw new BuildException( "Perforce Error, check client settings and/or server" );
  -                        }
  -                        else if( util.match( "/<enter description here>/", line ) )
  -                        {
  -
  -                            // we need to escape the description in case there are /
  -                            description = backslash( description );
  -                            line = util.substitute( "s/<enter description here>/" + description + "/", line );
  -
  -                        }
  -                        else if( util.match( "/\\/\\//", line ) )
  -                        {
  -                            //Match "//" for begining of depot filespec
  -                            return;
  -                        }
  -
  -                        stringbuf.append( line );
  -                        stringbuf.append( "\n" );
  -
  -                    }
  -                }
  -            } );
  +                       new P4HandlerAdapter()
  +                       {
  +                           public void process( String line )
  +                           {
  +                               if( !util.match( "/^#/", line ) )
  +                               {
  +                                   if( util.match( "/error/", line ) )
  +                                   {
  +
  +                                       log( "Client Error", Project.MSG_VERBOSE );
  +                                       throw new TaskException( "Perforce Error, check client settings and/or server" );
  +                                   }
  +                                   else if( util.match( "/<enter description here>/", line ) )
  +                                   {
  +
  +                                       // we need to escape the description in case there are /
  +                                       description = backslash( description );
  +                                       line = util.substitute( "s/<enter description here>/" + description + "/", line );
  +
  +                                   }
  +                                   else if( util.match( "/\\/\\//", line ) )
  +                                   {
  +                                       //Match "//" for begining of depot filespec
  +                                       return;
  +                                   }
  +
  +                                   stringbuf.append( line );
  +                                   stringbuf.append( "\n" );
  +
  +                               }
  +                           }
  +                       } );
   
           return stringbuf.toString();
       }
   
       public void execute()
  -        throws BuildException
  +        throws TaskException
       {
   
           if( emptyChangeList == null )
  @@ -101,7 +101,7 @@
                       }
                       else if( util.match( "/error/", line ) )
                       {
  -                        throw new BuildException( "Perforce Error, check client settings and/or server" );
  +                        throw new TaskException( "Perforce Error, check client settings and/or server" );
                       }
   
                   }
  
  
  
  1.2       +6 -5      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Counter.java
  
  Index: P4Counter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Counter.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- P4Counter.java	2001/12/15 12:06:29	1.1
  +++ P4Counter.java	2001/12/16 00:35:05	1.2
  @@ -6,7 +6,8 @@
    * the LICENSE file.
    */
   package org.apache.tools.ant.taskdefs.optional.perforce;
  -import org.apache.tools.ant.BuildException;
  +
  +import org.apache.myrmidon.api.TaskException;
   import org.apache.tools.ant.Project;
   
   /**
  @@ -46,17 +47,17 @@
       }
   
       public void execute()
  -        throws BuildException
  +        throws TaskException
       {
   
           if( ( counter == null ) || counter.length() == 0 )
           {
  -            throw new BuildException( "No counter specified to retrieve" );
  +            throw new TaskException( "No counter specified to retrieve" );
           }
   
           if( shouldSetValue && shouldSetProperty )
           {
  -            throw new BuildException( "Cannot both set the value of the property and retrieve the value of the property." );
  +            throw new TaskException( "Cannot both set the value of the property and retrieve the value of the property." );
           }
   
           String command = "counter " + P4CmdOpts + " " + counter;
  @@ -90,7 +91,7 @@
                           }
                           catch( NumberFormatException nfe )
                           {
  -                            throw new BuildException( "Perforce error. Could not retrieve counter value." );
  +                            throw new TaskException( "Perforce error. Could not retrieve counter value." );
                           }
                       }
                   };
  
  
  
  1.2       +4 -3      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Delete.java
  
  Index: P4Delete.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Delete.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- P4Delete.java	2001/12/15 12:06:29	1.1
  +++ P4Delete.java	2001/12/16 00:35:05	1.2
  @@ -6,8 +6,9 @@
    * the LICENSE file.
    */
   package org.apache.tools.ant.taskdefs.optional.perforce;
  -import org.apache.tools.ant.BuildException;
   
  +import org.apache.myrmidon.api.TaskException;
  +
   /**
    * P4Delete - checkout file(s) for delete. Example Usage:<br>
    * &lt;p4delete change="${p4.change}" view="//depot/project/foo.txt" /&gt;<br>
  @@ -30,12 +31,12 @@
       }
   
       public void execute()
  -        throws BuildException
  +        throws TaskException
       {
           if( change != null )
               P4CmdOpts = "-c " + change;
           if( P4View == null )
  -            throw new BuildException( "No view specified to delete" );
  +            throw new TaskException( "No view specified to delete" );
           execP4Command( "-s delete " + P4CmdOpts + " " + P4View, new SimpleP4OutputHandler( this ) );
       }
   }
  
  
  
  1.2       +4 -3      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Edit.java
  
  Index: P4Edit.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Edit.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- P4Edit.java	2001/12/15 12:06:29	1.1
  +++ P4Edit.java	2001/12/16 00:35:05	1.2
  @@ -6,8 +6,9 @@
    * the LICENSE file.
    */
   package org.apache.tools.ant.taskdefs.optional.perforce;
  -import org.apache.tools.ant.BuildException;
   
  +import org.apache.myrmidon.api.TaskException;
  +
   /**
    * P4Edit - checkout file(s) for edit. Example Usage:<br>
    * &lt;p4edit change="${p4.change}" view="//depot/project/foo.txt" /&gt;
  @@ -27,12 +28,12 @@
       }
   
       public void execute()
  -        throws BuildException
  +        throws TaskException
       {
           if( change != null )
               P4CmdOpts = "-c " + change;
           if( P4View == null )
  -            throw new BuildException( "No view specified to edit" );
  +            throw new TaskException( "No view specified to edit" );
           execP4Command( "-s edit " + P4CmdOpts + " " + P4View, new SimpleP4OutputHandler( this ) );
       }
   }
  
  
  
  1.2       +4 -3      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Handler.java
  
  Index: P4Handler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Handler.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- P4Handler.java	2001/12/15 12:06:29	1.1
  +++ P4Handler.java	2001/12/16 00:35:05	1.2
  @@ -6,7 +6,8 @@
    * the LICENSE file.
    */
   package org.apache.tools.ant.taskdefs.optional.perforce;
  -import org.apache.tools.ant.BuildException;
  +
  +import org.apache.myrmidon.api.TaskException;
   import org.apache.tools.ant.taskdefs.ExecuteStreamHandler;
   
   /**
  @@ -19,8 +20,8 @@
   {
   
       public void process( String line )
  -        throws BuildException;
  +        throws TaskException;
   
       public void setOutput( String line )
  -        throws BuildException;
  +        throws TaskException;
   }
  
  
  
  1.3       +8 -6      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4HandlerAdapter.java
  
  Index: P4HandlerAdapter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4HandlerAdapter.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- P4HandlerAdapter.java	2001/12/15 14:55:59	1.2
  +++ P4HandlerAdapter.java	2001/12/16 00:35:05	1.3
  @@ -6,13 +6,14 @@
    * the LICENSE file.
    */
   package org.apache.tools.ant.taskdefs.optional.perforce;
  +
   import java.io.BufferedReader;
   import java.io.IOException;
   import java.io.InputStream;
   import java.io.InputStreamReader;
   import java.io.OutputStream;
   import java.io.SequenceInputStream;
  -import org.apache.tools.ant.BuildException;
  +import org.apache.myrmidon.api.TaskException;
   
   public abstract class P4HandlerAdapter implements P4Handler
   {
  @@ -49,9 +50,8 @@
   
       public abstract void process( String line );
   
  -
       public void start()
  -        throws BuildException
  +        throws TaskException
       {
   
           try
  @@ -68,7 +68,7 @@
   
               BufferedReader input = new BufferedReader(
                   new InputStreamReader(
  -                new SequenceInputStream( is, es ) ) );
  +                    new SequenceInputStream( is, es ) ) );
   
               String line;
               while( ( line = input.readLine() ) != null )
  @@ -81,9 +81,11 @@
           }
           catch( Exception e )
           {
  -            throw new BuildException( "Error", e );
  +            throw new TaskException( "Error", e );
           }
       }
   
  -    public void stop() { }
  +    public void stop()
  +    {
  +    }
   }
  
  
  
  1.2       +2 -2      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Have.java
  
  Index: P4Have.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Have.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- P4Have.java	2001/12/15 12:06:29	1.1
  +++ P4Have.java	2001/12/16 00:35:05	1.2
  @@ -6,8 +6,8 @@
    * the LICENSE file.
    */
   package org.apache.tools.ant.taskdefs.optional.perforce;
  -import org.apache.tools.ant.BuildException;
   
  +import org.apache.myrmidon.api.TaskException;
   
   /**
    * P4Have - lists files currently on client. P4Have simply dumps the current
  @@ -19,7 +19,7 @@
   {
   
       public void execute()
  -        throws BuildException
  +        throws TaskException
       {
           execP4Command( "have " + P4CmdOpts + " " + P4View, new SimpleP4OutputHandler( this ) );
       }
  
  
  
  1.2       +10 -11    jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Label.java
  
  Index: P4Label.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Label.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- P4Label.java	2001/12/15 12:06:29	1.1
  +++ P4Label.java	2001/12/16 00:35:05	1.2
  @@ -6,12 +6,12 @@
    * the LICENSE file.
    */
   package org.apache.tools.ant.taskdefs.optional.perforce;
  +
   import java.text.SimpleDateFormat;
   import java.util.Date;
  -import org.apache.tools.ant.BuildException;
  +import org.apache.myrmidon.api.TaskException;
   import org.apache.tools.ant.Project;
   
  -
   /**
    * P4Label - create a Perforce Label. P4Label inserts a label into perforce
    * reflecting the current client contents. Label name defaults to AntLabel if
  @@ -44,7 +44,7 @@
       }
   
       public void execute()
  -        throws BuildException
  +        throws TaskException
       {
           log( "P4Label exec:", Project.MSG_INFO );
   
  @@ -94,13 +94,13 @@
           execP4Command( "label -i", handler );
   
           execP4Command( "labelsync -l " + name,
  -            new P4HandlerAdapter()
  -            {
  -                public void process( String line )
  -                {
  -                    log( line, Project.MSG_VERBOSE );
  -                }
  -            } );
  +                       new P4HandlerAdapter()
  +                       {
  +                           public void process( String line )
  +                           {
  +                               log( line, Project.MSG_VERBOSE );
  +                           }
  +                       } );
   
           log( "Created Label " + name + " (" + desc + ")", Project.MSG_INFO );
   
  @@ -131,7 +131,6 @@
                           labelSpec.append( line + "\n" );
                       }
                   };
  -
   
               execP4Command( "label -o " + name, handler );
               log( labelSpec.toString(), Project.MSG_DEBUG );
  
  
  
  1.2       +3 -2      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4OutputHandler.java
  
  Index: P4OutputHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4OutputHandler.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- P4OutputHandler.java	2001/12/15 12:06:29	1.1
  +++ P4OutputHandler.java	2001/12/16 00:35:05	1.2
  @@ -6,8 +6,9 @@
    * the LICENSE file.
    */
   package org.apache.tools.ant.taskdefs.optional.perforce;
  -import org.apache.tools.ant.BuildException;
   
  +import org.apache.myrmidon.api.TaskException;
  +
   /**
    * Interface for p4 job output stream handler. Classes implementing this
    * interface can be called back by P4Base.execP4Command();
  @@ -18,5 +19,5 @@
   {
   
       public void process( String line )
  -        throws BuildException;
  +        throws TaskException;
   }
  
  
  
  1.2       +7 -5      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Reopen.java
  
  Index: P4Reopen.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Reopen.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- P4Reopen.java	2001/12/15 12:06:29	1.1
  +++ P4Reopen.java	2001/12/16 00:35:05	1.2
  @@ -6,33 +6,35 @@
    * the LICENSE file.
    */
   package org.apache.tools.ant.taskdefs.optional.perforce;
  -import org.apache.tools.ant.BuildException;
   
  +import org.apache.myrmidon.api.TaskException;
  +
   /*
    * P4Reopen - move files to a new changelist
    *
    * @author <A HREF="mailto:leslie.hughes@rubus.com">Les Hughes</A>
    */
  +
   public class P4Reopen extends P4Base
   {
   
       private String toChange = "";
   
       public void setToChange( String toChange )
  -        throws BuildException
  +        throws TaskException
       {
           if( toChange == null && !toChange.equals( "" ) )
  -            throw new BuildException( "P4Reopen: tochange cannot be null or empty" );
  +            throw new TaskException( "P4Reopen: tochange cannot be null or empty" );
   
           this.toChange = toChange;
       }
   
       public void execute()
  -        throws BuildException
  +        throws TaskException
       {
           if( P4View == null )
               if( P4View == null )
  -                throw new BuildException( "No view specified to reopen" );
  +                throw new TaskException( "No view specified to reopen" );
           execP4Command( "-s reopen -c " + toChange + " " + P4View, new SimpleP4OutputHandler( this ) );
       }
   }
  
  
  
  1.2       +6 -4      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Revert.java
  
  Index: P4Revert.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Revert.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- P4Revert.java	2001/12/15 12:06:29	1.1
  +++ P4Revert.java	2001/12/16 00:35:05	1.2
  @@ -6,13 +6,15 @@
    * the LICENSE file.
    */
   package org.apache.tools.ant.taskdefs.optional.perforce;
  -import org.apache.tools.ant.BuildException;
   
  +import org.apache.myrmidon.api.TaskException;
  +
   /*
    * P4Revert - revert open files or files in a changelist
    *
    * @author <A HREF="mailto:leslie.hughes@rubus.com">Les Hughes</A>
    */
  +
   public class P4Revert extends P4Base
   {
   
  @@ -20,10 +22,10 @@
       private boolean onlyUnchanged = false;
   
       public void setChange( String revertChange )
  -        throws BuildException
  +        throws TaskException
       {
           if( revertChange == null && !revertChange.equals( "" ) )
  -            throw new BuildException( "P4Revert: change cannot be null or empty" );
  +            throw new TaskException( "P4Revert: change cannot be null or empty" );
   
           this.revertChange = revertChange;
   
  @@ -35,7 +37,7 @@
       }
   
       public void execute()
  -        throws BuildException
  +        throws TaskException
       {
   
           /*
  
  
  
  1.2       +12 -11    jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Submit.java
  
  Index: P4Submit.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Submit.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- P4Submit.java	2001/12/15 12:06:29	1.1
  +++ P4Submit.java	2001/12/16 00:35:05	1.2
  @@ -6,7 +6,8 @@
    * the LICENSE file.
    */
   package org.apache.tools.ant.taskdefs.optional.perforce;
  -import org.apache.tools.ant.BuildException;
  +
  +import org.apache.myrmidon.api.TaskException;
   import org.apache.tools.ant.Project;
   
   /**
  @@ -30,26 +31,26 @@
       }
   
       public void execute()
  -        throws BuildException
  +        throws TaskException
       {
           if( change != null )
           {
               execP4Command( "submit -c " + change,
  -                new P4HandlerAdapter()
  -                {
  -                    public void process( String line )
  -                    {
  -                        log( line, Project.MSG_VERBOSE );
  -                    }
  -                }
  -                 );
  +                           new P4HandlerAdapter()
  +                           {
  +                               public void process( String line )
  +                               {
  +                                   log( line, Project.MSG_VERBOSE );
  +                               }
  +                           }
  +            );
   
           }
           else
           {
               //here we'd parse the output from change -o into submit -i
               //in order to support default change.
  -            throw new BuildException( "No change specified (no support for default change yet...." );
  +            throw new TaskException( "No change specified (no support for default change yet...." );
           }
       }
   
  
  
  
  1.2       +7 -7      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Sync.java
  
  Index: P4Sync.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Sync.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- P4Sync.java	2001/12/15 12:06:29	1.1
  +++ P4Sync.java	2001/12/16 00:35:05	1.2
  @@ -6,7 +6,8 @@
    * the LICENSE file.
    */
   package org.apache.tools.ant.taskdefs.optional.perforce;
  -import org.apache.tools.ant.BuildException;
  +
  +import org.apache.myrmidon.api.TaskException;
   import org.apache.tools.ant.Project;
   
   /**
  @@ -88,27 +89,26 @@
   
       String label;
   
  -
       public void setForce( String force )
  -        throws BuildException
  +        throws TaskException
       {
           if( force == null && !label.equals( "" ) )
  -            throw new BuildException( "P4Sync: If you want to force, set force to non-null string!" );
  +            throw new TaskException( "P4Sync: If you want to force, set force to non-null string!" );
           P4CmdOpts = "-f";
       }
   
       public void setLabel( String label )
  -        throws BuildException
  +        throws TaskException
       {
           if( label == null && !label.equals( "" ) )
  -            throw new BuildException( "P4Sync: Labels cannot be Null or Empty" );
  +            throw new TaskException( "P4Sync: Labels cannot be Null or Empty" );
   
           this.label = label;
   
       }
   
       public void execute()
  -        throws BuildException
  +        throws TaskException
       {
   
           if( P4View != null )
  
  
  
  1.2       +4 -3      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/perforce/SimpleP4OutputHandler.java
  
  Index: SimpleP4OutputHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/perforce/SimpleP4OutputHandler.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SimpleP4OutputHandler.java	2001/12/15 12:06:29	1.1
  +++ SimpleP4OutputHandler.java	2001/12/16 00:35:05	1.2
  @@ -6,7 +6,8 @@
    * the LICENSE file.
    */
   package org.apache.tools.ant.taskdefs.optional.perforce;
  -import org.apache.tools.ant.BuildException;
  +
  +import org.apache.myrmidon.api.TaskException;
   import org.apache.tools.ant.Project;
   
   public class SimpleP4OutputHandler extends P4HandlerAdapter
  @@ -20,7 +21,7 @@
       }
   
       public void process( String line )
  -        throws BuildException
  +        throws TaskException
       {
           if( parent.util.match( "/^exit/", line ) )
               return;
  @@ -37,7 +38,7 @@
   
           if( parent.util.match( "/error:/", line ) && !parent.util.match( "/up-to-date/", line ) )
           {
  -            throw new BuildException( line );
  +            throw new TaskException( line );
           }
   
           parent.log( parent.util.substitute( "s/^.*: //", line ), Project.MSG_INFO );
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>