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/ejb BorlandDeploymentTool.java BorlandGenerateClient.java DDCreator.java Ejbc.java EjbJar.java GenericDeploymentTool.java
Date Sun, 13 Jan 2002 00:04:03 GMT
donaldp     02/01/12 16:04:03

  Modified:    proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb
                        BorlandDeploymentTool.java
                        BorlandGenerateClient.java DDCreator.java Ejbc.java
                        EjbJar.java GenericDeploymentTool.java
  Log:
  Don't use ExecTask directly but instead go via Commandline + Execute2
  
  Move all the generic scanners into types package
  
  Revision  Changes    Path
  1.15      +37 -34    jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/BorlandDeploymentTool.java
  
  Index: BorlandDeploymentTool.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/BorlandDeploymentTool.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- BorlandDeploymentTool.java	6 Jan 2002 02:20:53 -0000	1.14
  +++ BorlandDeploymentTool.java	13 Jan 2002 00:04:03 -0000	1.15
  @@ -17,9 +17,8 @@
   import java.util.Hashtable;
   import java.util.Iterator;
   import org.apache.myrmidon.api.TaskException;
  -import org.apache.tools.ant.Project;
   import org.apache.tools.ant.taskdefs.Java;
  -import org.apache.tools.ant.taskdefs.exec.Execute;
  +import org.apache.tools.ant.taskdefs.exec.Execute2;
   import org.apache.tools.ant.taskdefs.exec.ExecuteStreamHandler;
   import org.apache.tools.ant.types.Argument;
   import org.apache.tools.ant.types.Commandline;
  @@ -361,43 +360,18 @@
        */
       private void buildBorlandStubs( Iterator ithomes, Hashtable files )
       {
  -        Execute execTask = null;
  +        final Execute2 exe = new Execute2();
  +        exe.setWorkingDirectory( getTask().getBaseDirectory() );
   
  -        execTask = new Execute( this );
  -        Project project = getTask().getProject();
  -        execTask.setWorkingDirectory( project.getBaseDir() );
  +        final Commandline cmd = buildCommandline( ithomes );
  +        exe.setCommandline( cmd.getCommandline() );
   
  -        Commandline commandline = new Commandline();
  -        commandline.setExecutable( JAVA2IIOP );
  -        //debug ?
  -        if( java2iiopdebug )
  -        {
  -            commandline.createArgument().setValue( "-VBJdebug" );
  -        }// end of if ()
  -        //set the classpath
  -        commandline.createArgument().setValue( "-VBJclasspath" );
  -        commandline.createArgument().setPath( getCombinedClasspath() );
  -        //list file
  -        commandline.createArgument().setValue( "-list_files" );
  -        //no TIE classes
  -        commandline.createArgument().setValue( "-no_tie" );
  -        //root dir
  -        commandline.createArgument().setValue( "-root_dir" );
  -        commandline.createArgument().setValue( getConfig().srcDir.getAbsolutePath() );
  -        //compiling order
  -        commandline.createArgument().setValue( "-compile" );
  -        //add the home class
  -        while( ithomes.hasNext() )
  -        {
  -            commandline.createArgument().setValue( ithomes.next().toString() );
  -        }// end of while ()
  +        getLogger().debug( "Calling java2iiop" );
  +        getLogger().debug( cmd.toString() );
   
           try
           {
  -            getLogger().debug( "Calling java2iiop" );
  -            getLogger().debug( commandline.toString() );
  -            execTask.setCommandline( commandline.getCommandline() );
  -            int result = execTask.execute();
  +            final int result = exe.execute();
               if( result != 0 )
               {
                   String msg = "Failed executing java2iiop (ret code is " + result + ")";
  @@ -409,6 +383,35 @@
               getLogger().error( "java2iiop exception :" + e.getMessage() );
               throw new TaskException( "Error", e );
           }
  +    }
  +
  +    private Commandline buildCommandline( final Iterator ithomes )
  +    {
  +        final Commandline cmd = new Commandline();
  +        cmd.setExecutable( JAVA2IIOP );
  +        //debug ?
  +        if( java2iiopdebug )
  +        {
  +            cmd.createArgument().setValue( "-VBJdebug" );
  +        }// end of if ()
  +        //set the classpath
  +        cmd.createArgument().setValue( "-VBJclasspath" );
  +        cmd.createArgument().setPath( getCombinedClasspath() );
  +        //list file
  +        cmd.createArgument().setValue( "-list_files" );
  +        //no TIE classes
  +        cmd.createArgument().setValue( "-no_tie" );
  +        //root dir
  +        cmd.createArgument().setValue( "-root_dir" );
  +        cmd.createArgument().setValue( getConfig().srcDir.getAbsolutePath() );
  +        //compiling order
  +        cmd.createArgument().setValue( "-compile" );
  +        //add the home class
  +        while( ithomes.hasNext() )
  +        {
  +            cmd.createArgument().setValue( ithomes.next().toString() );
  +        }
  +        return cmd;
       }
   
       /**
  
  
  
  1.13      +31 -24    jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/BorlandGenerateClient.java
  
  Index: BorlandGenerateClient.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/BorlandGenerateClient.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- BorlandGenerateClient.java	12 Jan 2002 05:01:23 -0000	1.12
  +++ BorlandGenerateClient.java	13 Jan 2002 00:04:03 -0000	1.13
  @@ -10,8 +10,8 @@
   import java.io.File;
   import org.apache.myrmidon.api.TaskException;
   import org.apache.tools.ant.Task;
  -import org.apache.tools.ant.taskdefs.Java;
  -import org.apache.tools.ant.taskdefs.exec.ExecTask;
  +import org.apache.tools.ant.taskdefs.exec.Execute2;
  +import org.apache.tools.ant.types.Commandline;
   import org.apache.tools.ant.types.Path;
   
   /**
  @@ -150,31 +150,17 @@
       {
           try
           {
  -            getLogger().info( "mode : fork" );
  -
  -            org.apache.tools.ant.taskdefs.exec.ExecTask execTask = null;
  -            execTask = (ExecTask)getProject().createTask( "exec" );
   
  -            execTask.setDir( new File( "." ) );
  -            execTask.setExecutable( "iastool" );
  -            execTask.createArg().setValue( "generateclient" );
  -            if( debug )
  -            {
  -                execTask.createArg().setValue( "-trace" );
  -            }// end of if ()
  -
  -            //
  -            execTask.createArg().setValue( "-short" );
  -            execTask.createArg().setValue( "-jarfile" );
  -            // ejb jar file
  -            execTask.createArg().setValue( ejbjarfile.getAbsolutePath() );
  -            //client jar file
  -            execTask.createArg().setValue( "-single" );
  -            execTask.createArg().setValue( "-clientjarfile" );
  -            execTask.createArg().setValue( clientjarfile.getAbsolutePath() );
  +            final Commandline cmd = buildCommand();
   
  +            getLogger().info( "mode : fork" );
               getLogger().debug( "Calling java2iiop" );
  -            execTask.execute();
  +
  +            final Execute2 exe = new Execute2();
  +            setupLogger( exe );
  +            exe.setWorkingDirectory( new File( "." ) );
  +            exe.setCommandline( cmd.getCommandline() );
  +            exe.execute();
           }
           catch( Exception e )
           {
  @@ -183,6 +169,27 @@
               throw new TaskException( msg, e );
           }
   
  +    }
  +
  +    private Commandline buildCommand()
  +    {
  +        final Commandline cmd = new Commandline();
  +        cmd.setExecutable( "iastool" );
  +        cmd.createArgument().setValue( "generateclient" );
  +        if( debug )
  +        {
  +            cmd.createArgument().setValue( "-trace" );
  +        }
  +
  +        cmd.createArgument().setValue( "-short" );
  +        cmd.createArgument().setValue( "-jarfile" );
  +        // ejb jar file
  +        cmd.createArgument().setValue( ejbjarfile.getAbsolutePath() );
  +        //client jar file
  +        cmd.createArgument().setValue( "-single" );
  +        cmd.createArgument().setValue( "-clientjarfile" );
  +        cmd.createArgument().setValue( clientjarfile.getAbsolutePath() );
  +        return cmd;
       }
   
       /**
  
  
  
  1.9       +1 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/DDCreator.java
  
  Index: DDCreator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/DDCreator.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- DDCreator.java	30 Dec 2001 01:04:35 -0000	1.8
  +++ DDCreator.java	13 Jan 2002 00:04:03 -0000	1.9
  @@ -9,7 +9,7 @@
   
   import java.io.File;
   import org.apache.myrmidon.api.TaskException;
  -import org.apache.tools.ant.DirectoryScanner;
  +import org.apache.tools.ant.types.DirectoryScanner;
   import org.apache.tools.ant.taskdefs.Java;
   import org.apache.tools.ant.taskdefs.MatchingTask;
   import org.apache.tools.ant.types.Argument;
  
  
  
  1.10      +1 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/Ejbc.java
  
  Index: Ejbc.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/Ejbc.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- Ejbc.java	30 Dec 2001 01:04:35 -0000	1.9
  +++ Ejbc.java	13 Jan 2002 00:04:03 -0000	1.10
  @@ -9,7 +9,7 @@
   
   import java.io.File;
   import org.apache.myrmidon.api.TaskException;
  -import org.apache.tools.ant.DirectoryScanner;
  +import org.apache.tools.ant.types.DirectoryScanner;
   import org.apache.tools.ant.taskdefs.Java;
   import org.apache.tools.ant.taskdefs.MatchingTask;
   import org.apache.tools.ant.types.Argument;
  
  
  
  1.7       +1 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/EjbJar.java
  
  Index: EjbJar.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/EjbJar.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- EjbJar.java	30 Dec 2001 00:21:52 -0000	1.6
  +++ EjbJar.java	13 Jan 2002 00:04:03 -0000	1.7
  @@ -15,7 +15,7 @@
   import javax.xml.parsers.SAXParser;
   import javax.xml.parsers.SAXParserFactory;
   import org.apache.myrmidon.api.TaskException;
  -import org.apache.tools.ant.DirectoryScanner;
  +import org.apache.tools.ant.types.DirectoryScanner;
   import org.apache.tools.ant.taskdefs.MatchingTask;
   import org.apache.tools.ant.types.EnumeratedAttribute;
   import org.apache.tools.ant.types.FileSet;
  
  
  
  1.13      +1 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/GenericDeploymentTool.java
  
  Index: GenericDeploymentTool.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/GenericDeploymentTool.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- GenericDeploymentTool.java	1 Jan 2002 09:13:46 -0000	1.12
  +++ GenericDeploymentTool.java	13 Jan 2002 00:04:03 -0000	1.13
  @@ -28,7 +28,7 @@
   import org.apache.bcel.*;
   import org.apache.bcel.classfile.*;
   import org.apache.myrmidon.api.TaskException;
  -import org.apache.tools.ant.DirectoryScanner;
  +import org.apache.tools.ant.types.DirectoryScanner;
   import org.apache.tools.ant.Project;
   import org.apache.tools.ant.Task;
   import org.apache.tools.ant.types.FileSet;
  
  
  

--
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