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/jsp WLJspc.java
Date Sun, 16 Dec 2001 05:01:13 GMT
donaldp     01/12/15 21:01:13

  Modified:    proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs
                        GenerateKey.java Rmic.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional
                        Cab.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jsp
                        WLJspc.java
  Log:
  Fixed some compile errors due to tasks relying on deprecated behaviour in Ant1.
  
  Revision  Changes    Path
  1.5       +28 -40    jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/GenerateKey.java
  
  Index: GenerateKey.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/GenerateKey.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- GenerateKey.java	2001/12/16 04:12:39	1.4
  +++ GenerateKey.java	2001/12/16 05:01:12	1.5
  @@ -160,96 +160,84 @@
               throw new TaskException( "dname must be set" );
           }
   
  -        final StringBuffer sb = new StringBuffer();
  +        log( "Generating Key for " + alias );
  +        final ExecTask cmd = (ExecTask)project.createTask( "exec" );
  +        cmd.setExecutable( "keytool" );
   
  -        sb.append( "keytool -genkey " );
  +        cmd.createArg().setValue( "-genkey " );
   
           if( verbose )
           {
  -            sb.append( "-v " );
  +            cmd.createArg().setValue( "-v " );
           }
   
  -        sb.append( "-alias \"" );
  -        sb.append( alias );
  -        sb.append( "\" " );
  +        cmd.createArg().setValue( "-alias" );
  +        cmd.createArg().setValue( alias );
   
           if( null != dname )
           {
  -            sb.append( "-dname \"" );
  -            sb.append( dname );
  -            sb.append( "\" " );
  +            cmd.createArg().setValue( "-dname" );
  +            cmd.createArg().setValue( dname );
           }
   
           if( null != expandedDname )
           {
  -            sb.append( "-dname \"" );
  -            sb.append( expandedDname );
  -            sb.append( "\" " );
  +            cmd.createArg().setValue( "-dname" );
  +            cmd.createArg().setValue( expandedDname.toString() );
           }
   
           if( null != keystore )
           {
  -            sb.append( "-keystore \"" );
  -            sb.append( keystore );
  -            sb.append( "\" " );
  +            cmd.createArg().setValue( "-keystore" );
  +            cmd.createArg().setValue( keystore );
           }
   
           if( null != storepass )
           {
  -            sb.append( "-storepass \"" );
  -            sb.append( storepass );
  -            sb.append( "\" " );
  +            cmd.createArg().setValue( "-storepass" );
  +            cmd.createArg().setValue( storepass );
           }
   
           if( null != storetype )
           {
  -            sb.append( "-storetype \"" );
  -            sb.append( storetype );
  -            sb.append( "\" " );
  +            cmd.createArg().setValue( "-storetype" );
  +            cmd.createArg().setValue( storetype );
           }
   
  -        sb.append( "-keypass \"" );
  +        cmd.createArg().setValue( "-keypass" );
           if( null != keypass )
           {
  -            sb.append( keypass );
  +            cmd.createArg().setValue( keypass );
           }
           else
           {
  -            sb.append( storepass );
  +            cmd.createArg().setValue( storepass );
           }
  -        sb.append( "\" " );
   
           if( null != sigalg )
           {
  -            sb.append( "-sigalg \"" );
  -            sb.append( sigalg );
  -            sb.append( "\" " );
  +            cmd.createArg().setValue( "-sigalg" );
  +            cmd.createArg().setValue( sigalg );
           }
   
           if( null != keyalg )
           {
  -            sb.append( "-keyalg \"" );
  -            sb.append( keyalg );
  -            sb.append( "\" " );
  +            cmd.createArg().setValue( "-keyalg" );
  +            cmd.createArg().setValue( keyalg );
           }
   
           if( 0 < keysize )
           {
  -            sb.append( "-keysize \"" );
  -            sb.append( keysize );
  -            sb.append( "\" " );
  +            cmd.createArg().setValue( "-keysize" );
  +            cmd.createArg().setValue( "" + keysize );
           }
   
           if( 0 < validity )
           {
  -            sb.append( "-validity \"" );
  -            sb.append( validity );
  -            sb.append( "\" " );
  +            cmd.createArg().setValue( "-validity" );
  +            cmd.createArg().setValue( "" + validity );
           }
   
  -        log( "Generating Key for " + alias );
  -        final ExecTask cmd = (ExecTask)project.createTask( "exec" );
  -        cmd.setCommand( new Commandline( sb.toString() ) );
           cmd.setFailonerror( true );
           cmd.execute();
       }
  
  
  
  1.9       +10 -1     jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Rmic.java
  
  Index: Rmic.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Rmic.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Rmic.java	2001/12/16 04:34:14	1.8
  +++ Rmic.java	2001/12/16 05:01:12	1.9
  @@ -17,6 +17,7 @@
   import org.apache.tools.ant.Project;
   import org.apache.tools.ant.taskdefs.rmic.RmicAdapter;
   import org.apache.tools.ant.taskdefs.rmic.RmicAdapterFactory;
  +import org.apache.tools.ant.types.FilterSetCollection;
   import org.apache.tools.ant.types.Path;
   import org.apache.tools.ant.types.Reference;
   import org.apache.tools.ant.util.FileNameMapper;
  @@ -680,7 +681,15 @@
               File newFile = new File( sourceBaseFile, sourceFileName );
               try
               {
  -                FileUtils.newFileUtils().copyFile( oldFile, newFile, filtering );
  +                if( filtering )
  +                {
  +                    final FilterSetCollection filters = new FilterSetCollection( project.getGlobalFilterSet()
);
  +                    FileUtils.newFileUtils().copyFile( oldFile, newFile, filters );
  +                }
  +                else
  +                {
  +                    FileUtils.newFileUtils().copyFile( oldFile, newFile );
  +                }
                   oldFile.delete();
               }
               catch( IOException ioe )
  
  
  
  1.5       +11 -14    jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/Cab.java
  
  Index: Cab.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/Cab.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Cab.java	2001/12/16 04:34:14	1.4
  +++ Cab.java	2001/12/16 05:01:12	1.5
  @@ -165,7 +165,7 @@
                       exec.setOutput( outFile );
                   }
   
  -                exec.setCommand( createCommand( listFile ) );
  +                setupCommand( listFile, exec );
                   exec.execute();
   
                   if( outFile != null )
  @@ -280,30 +280,27 @@
        * @param listFile Description of Parameter
        * @return Description of the Returned Value
        */
  -    protected Commandline createCommand( File listFile )
  +    protected void setupCommand( File listFile, ExecTask exec )
           throws TaskException
       {
  -        Commandline command = new Commandline();
  -        command.setExecutable( "cabarc" );
  -        command.createArgument().setValue( "-r" );
  -        command.createArgument().setValue( "-p" );
  +        exec.setExecutable( "cabarc" );
  +        exec.createArg().setValue( "-r" );
  +        exec.createArg().setValue( "-p" );
   
           if( !doCompress )
           {
  -            command.createArgument().setValue( "-m" );
  -            command.createArgument().setValue( "none" );
  +            exec.createArg().setValue( "-m" );
  +            exec.createArg().setValue( "none" );
           }
   
           if( cmdOptions != null )
           {
  -            command.createArgument().setLine( cmdOptions );
  +            exec.createArg().setLine( cmdOptions );
           }
   
  -        command.createArgument().setValue( "n" );
  -        command.createArgument().setFile( cabFile );
  -        command.createArgument().setValue( "@" + listFile.getAbsolutePath() );
  -
  -        return command;
  +        exec.createArg().setValue( "n" );
  +        exec.createArg().setFile( cabFile );
  +        exec.createArg().setValue( "@" + listFile.getAbsolutePath() );
       }
   
       /**
  
  
  
  1.6       +1 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jsp/WLJspc.java
  
  Index: WLJspc.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jsp/WLJspc.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- WLJspc.java	2001/12/16 04:12:40	1.5
  +++ WLJspc.java	2001/12/16 05:01:13	1.6
  @@ -229,7 +229,7 @@
               System.out.println( "arg = " + arg );
   
               helperTask.clearArgs();
  -            helperTask.setArgs( arg );
  +            helperTask.createArg().setValue( arg );
               helperTask.setClasspath( compileClasspath );
               if( helperTask.executeJava() != 0 )
               {
  
  
  

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