ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/dotnet CSharp.java Ilasm.java NetCommand.java
Date Sun, 16 Dec 2001 00:37:10 GMT
donaldp     01/12/15 16:37:10

  Modified:    proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/dotnet
                        CSharp.java Ilasm.java NetCommand.java
  Log:
  BuildException -> TaskException
  
  Removed uneeded imports.
  
  Processed code through style formatter.
  
  Revision  Changes    Path
  1.3       +11 -13    jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/CSharp.java
  
  Index: CSharp.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/CSharp.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- CSharp.java	2001/12/15 14:55:58	1.2
  +++ CSharp.java	2001/12/16 00:37:10	1.3
  @@ -6,15 +6,14 @@
    * the LICENSE file.
    */
   package org.apache.tools.ant.taskdefs.optional.dotnet;
  -import java.io.File;// ====================================================================
  -// imports
  -// ====================================================================
  -import org.apache.tools.ant.BuildException;
  +
  +import java.io.File;
  +import org.apache.myrmidon.api.TaskException;
   import org.apache.tools.ant.DirectoryScanner;
   import org.apache.tools.ant.types.Path;
   
  -
   // ====================================================================
  +
   /**
    * This task compiles CSharp source into executables or modules. The task will
    * only work on win2K until other platforms support csc.exe or an equivalent.
  @@ -95,7 +94,7 @@
    */
   
   public class CSharp
  -     extends org.apache.tools.ant.taskdefs.MatchingTask
  +    extends org.apache.tools.ant.taskdefs.MatchingTask
   {
   
       /**
  @@ -449,11 +448,11 @@
        * define the target
        *
        * @param targetType The new TargetType value
  -     * @exception BuildException if target is not one of
  +     * @exception TaskException if target is not one of
        *      exe|library|module|winexe
        */
       public void setTargetType( String targetType )
  -        throws BuildException
  +        throws TaskException
       {
           targetType = targetType.toLowerCase();
           if( targetType.equals( "exe" ) || targetType.equals( "library" ) ||
  @@ -462,7 +461,7 @@
               _targetType = targetType;
           }
           else
  -            throw new BuildException( "targetType " + targetType + " is not a valid type"
);
  +            throw new TaskException( "targetType " + targetType + " is not a valid type"
);
       }
   
       /**
  @@ -643,10 +642,10 @@
       /**
        * do the work by building the command line and then calling it
        *
  -     * @exception BuildException Description of Exception
  +     * @exception TaskException Description of Exception
        */
       public void execute()
  -        throws BuildException
  +        throws TaskException
       {
           if( _srcDir == null )
               _srcDir = resolveFile( "." );
  @@ -686,7 +685,7 @@
           //add to the command
           for( int i = 0; i < dependencies.length; i++ )
           {
  -            String targetFile = dependencies[i];
  +            String targetFile = dependencies[ i ];
               targetFile = baseDir + File.separator + targetFile;
               command.addArgument( targetFile );
           }
  @@ -722,7 +721,6 @@
       {
           return "/debug" + ( _debug ? "+" : "-" );
       }
  -
   
       /**
        * get default reference list
  
  
  
  1.3       +13 -19    jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/Ilasm.java
  
  Index: Ilasm.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/Ilasm.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Ilasm.java	2001/12/15 14:55:58	1.2
  +++ Ilasm.java	2001/12/16 00:37:10	1.3
  @@ -5,15 +5,13 @@
    * version 1.1, a copy of which has been included with this distribution in
    * the LICENSE file.
    */
  -package org.apache.tools.ant.taskdefs.optional.dotnet;// ====================================================================
  -// imports
  -// ====================================================================
  +package org.apache.tools.ant.taskdefs.optional.dotnet;
  +
   import java.io.File;
  -import org.apache.tools.ant.BuildException;
  +import org.apache.myrmidon.api.TaskException;
   import org.apache.tools.ant.DirectoryScanner;
   import org.apache.tools.ant.Project;
   
  -
   /**
    * Task to assemble .net 'Intermediate Language' files. The task will only work
    * on win2K until other platforms support csc.exe or an equivalent. ilasm.exe
  @@ -39,7 +37,7 @@
    */
   
   public class Ilasm
  -     extends org.apache.tools.ant.taskdefs.MatchingTask
  +    extends org.apache.tools.ant.taskdefs.MatchingTask
   {
   
       /**
  @@ -181,7 +179,6 @@
           _outputFile = params;
       }
   
  -
       /**
        * Sets the Owner attribute
        *
  @@ -217,12 +214,12 @@
        * define the target
        *
        * @param targetType one of exe|library|
  -     * @exception BuildException if target is not one of
  +     * @exception TaskException if target is not one of
        *      exe|library|module|winexe
        */
   
       public void setTargetType( String targetType )
  -        throws BuildException
  +        throws TaskException
       {
           targetType = targetType.toLowerCase();
           if( targetType.equals( "exe" ) || targetType.equals( "library" ) )
  @@ -230,7 +227,7 @@
               _targetType = targetType;
           }
           else
  -            throw new BuildException( "targetType " + targetType + " is not a valid type"
);
  +            throw new TaskException( "targetType " + targetType + " is not a valid type"
);
       }
   
       /**
  @@ -299,15 +296,14 @@
           _extraOptions = null;
       }
   
  -
       /**
        * This is the execution entry point. Build a list of files and call ilasm
        * on each of them.
        *
  -     * @throws BuildException if the assembly failed and FailOnError is true
  +     * @throws TaskException if the assembly failed and FailOnError is true
        */
       public void execute()
  -        throws BuildException
  +        throws TaskException
       {
           if( _srcDir == null )
               _srcDir = resolveFile( "." );
  @@ -320,22 +316,21 @@
           //add to the command
           for( int i = 0; i < dependencies.length; i++ )
           {
  -            String targetFile = dependencies[i];
  +            String targetFile = dependencies[ i ];
               targetFile = baseDir + File.separator + targetFile;
               executeOneFile( targetFile );
           }
   
       }// end execute
   
  -
       /**
        * do the work for one file by building the command line then calling it
        *
        * @param targetFile name of the the file to assemble
  -     * @throws BuildException if the assembly failed and FailOnError is true
  +     * @throws TaskException if the assembly failed and FailOnError is true
        */
       public void executeOneFile( String targetFile )
  -        throws BuildException
  +        throws TaskException
       {
           NetCommand command = new NetCommand( this, exe_title, exe_name );
           command.setFailOnError( getFailFailOnError() );
  @@ -444,8 +439,7 @@
               return null;
           if( _targetType.equals( "exe" ) )
               return "/exe";
  -        else
  -            if( _targetType.equals( "library" ) )
  +        else if( _targetType.equals( "library" ) )
               return "/dll";
           else
               return null;
  
  
  
  1.3       +7 -8      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/NetCommand.java
  
  Index: NetCommand.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/NetCommand.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- NetCommand.java	2001/12/15 14:55:58	1.2
  +++ NetCommand.java	2001/12/16 00:37:10	1.3
  @@ -6,9 +6,10 @@
    * the LICENSE file.
    */
   package org.apache.tools.ant.taskdefs.optional.dotnet;// imports
  +
   import java.io.File;
   import java.io.IOException;
  -import org.apache.tools.ant.BuildException;
  +import org.apache.myrmidon.api.TaskException;
   import org.apache.tools.ant.Project;
   import org.apache.tools.ant.Task;
   import org.apache.tools.ant.taskdefs.Execute;
  @@ -16,7 +17,6 @@
   import org.apache.tools.ant.taskdefs.LogStreamHandler;
   import org.apache.tools.ant.types.Commandline;
   
  -
   /**
    * This is a helper class to spawn net commands out. In its initial form it
    * contains no .net specifics, just contains all the command line/exe
  @@ -133,12 +133,12 @@
       /**
        * Run the command using the given Execute instance.
        *
  -     * @exception BuildException Description of Exception
  +     * @exception TaskException Description of Exception
        * @throws an exception of something goes wrong and the failOnError flag is
        *      true
        */
       public void runCommand()
  -        throws BuildException
  +        throws TaskException
       {
           int err = -1;// assume the worst
           try
  @@ -158,7 +158,7 @@
               {
                   if( _failOnError )
                   {
  -                    throw new BuildException( _title + " returned: " + err );
  +                    throw new TaskException( _title + " returned: " + err );
                   }
                   else
                   {
  @@ -168,11 +168,10 @@
           }
           catch( IOException e )
           {
  -            throw new BuildException( _title + " failed: " + e, e );
  +            throw new TaskException( _title + " failed: " + e, e );
           }
       }
   
  -
       /**
        * error text log
        *
  @@ -201,7 +200,7 @@
           // default directory to the project's base directory
           File dir = _owner.getProject().getBaseDir();
           ExecuteStreamHandler handler = new LogStreamHandler( _owner,
  -            Project.MSG_INFO, Project.MSG_WARN );
  +                                                             Project.MSG_INFO, Project.MSG_WARN
);
           _exe = new Execute( handler, null );
           _exe.setAntRun( _owner.getProject() );
           _exe.setWorkingDirectory( dir );
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message