You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by st...@apache.org on 2005/02/19 00:28:00 UTC

cvs commit: ant/src/main/org/apache/tools/ant/taskdefs/optional/net FTP.java

stevel      2005/02/18 15:28:00

  Modified:    src/main/org/apache/tools/ant/taskdefs/optional/extension/resolvers
                        AntResolver.java URLResolver.java
               src/main/org/apache/tools/ant/taskdefs GenerateKey.java
                        SubAnt.java Ant.java CallTarget.java SignJar.java
                        LoadProperties.java
               src/main/org/apache/tools/ant/taskdefs/optional/j2ee
                        WebLogicHotDeploymentTool.java
                        GenericHotDeploymentTool.java
               src/main/org/apache/tools/ant/taskdefs/optional/clearcase
                        ClearCase.java
               src/main/org/apache/tools/ant/taskdefs/optional
                        IContract.java Cab.java RenameExtensions.java
               src/main/org/apache/tools/ant/taskdefs/optional/ejb
                        WLRun.java BorlandGenerateClient.java
                        DDCreator.java WLStop.java
                        WeblogicDeploymentTool.java
                        BorlandDeploymentTool.java JonasDeploymentTool.java
                        Ejbc.java WebsphereDeploymentTool.java
               src/main/org/apache/tools/ant/taskdefs/optional/jsp
                        WLJspc.java
               src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers
                        JasperC.java
               src/main/org/apache/tools/ant/taskdefs/optional/net FTP.java
  Log:
  This commit eliminates all (but one) use of Project.createTask("some name") from the codebase. It also sets up all created tasks using the new Task.bindToOwner call. 
  
  I'm tempted to retrofit Task.bindToOwner back to the 1.6.x codebase, for the benefit of third party tasks; same for the extra constructors for exec and java. Thoughts?
  
  Revision  Changes    Path
  1.12      +4 -3      ant/src/main/org/apache/tools/ant/taskdefs/optional/extension/resolvers/AntResolver.java
  
  Index: AntResolver.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/extension/resolvers/AntResolver.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- AntResolver.java	10 Dec 2004 10:58:19 -0000	1.11
  +++ AntResolver.java	18 Feb 2005 23:27:58 -0000	1.12
  @@ -1,5 +1,5 @@
   /*
  - * Copyright  2002-2004 The Apache Software Foundation
  + * Copyright  2002-2005 The Apache Software Foundation
    *
    *  Licensed under the Apache License, Version 2.0 (the "License");
    *  you may not use this file except in compliance with the License.
  @@ -69,7 +69,8 @@
                            final Project project) throws BuildException {
           validate();
   
  -        final Ant ant = (Ant) project.createTask("ant");
  +        final Ant ant = new Ant();
  +        ant.setProject(project);
           ant.setInheritAll(false);
           ant.setAntfile(antfile.getName());
   
  
  
  
  1.12      +4 -3      ant/src/main/org/apache/tools/ant/taskdefs/optional/extension/resolvers/URLResolver.java
  
  Index: URLResolver.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/extension/resolvers/URLResolver.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- URLResolver.java	10 Dec 2004 10:58:19 -0000	1.11
  +++ URLResolver.java	18 Feb 2005 23:27:59 -0000	1.12
  @@ -1,5 +1,5 @@
   /*
  - * Copyright  2002,2004 The Apache Software Foundation
  + * Copyright  2002,2004-2005 The Apache Software Foundation
    *
    *  Licensed under the Apache License, Version 2.0 (the "License");
    *  you may not use this file except in compliance with the License.
  @@ -71,7 +71,8 @@
   
           final File file = getDest();
   
  -        final Get get = (Get) project.createTask("get");
  +        final Get get = new Get();
  +        get.setProject(project);
           get.setDest(file);
           get.setSrc(url);
           get.execute();
  
  
  
  1.29      +2 -2      ant/src/main/org/apache/tools/ant/taskdefs/GenerateKey.java
  
  Index: GenerateKey.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/GenerateKey.java,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- GenerateKey.java	4 Jun 2004 07:44:54 -0000	1.28
  +++ GenerateKey.java	18 Feb 2005 23:27:59 -0000	1.29
  @@ -1,5 +1,5 @@
   /*
  - * Copyright  2000,2002,2004 The Apache Software Foundation
  + * Copyright  2000,2002,2004-2005 The Apache Software Foundation
    *
    *  Licensed under the Apache License, Version 2.0 (the "License");
    *  you may not use this file except in compliance with the License.
  @@ -354,7 +354,7 @@
           }
   
           log("Generating Key for " + alias);
  -        final ExecTask cmd = (ExecTask) getProject().createTask("exec");
  +        final ExecTask cmd = new ExecTask(this);
           cmd.setExecutable(JavaEnvUtils.getJdkExecutable("keytool"));
           Commandline.Argument arg = cmd.createArg();
           arg.setLine(sb.toString());
  
  
  
  1.22      +2 -4      ant/src/main/org/apache/tools/ant/taskdefs/SubAnt.java
  
  Index: SubAnt.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/SubAnt.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- SubAnt.java	1 Dec 2004 13:54:25 -0000	1.21
  +++ SubAnt.java	18 Feb 2005 23:27:59 -0000	1.22
  @@ -1,5 +1,5 @@
   /*
  - * Copyright  2003-2004 The Apache Software Foundation
  + * Copyright  2003-2005 The Apache Software Foundation
    *
    *  Licensed under the Apache License, Version 2.0 (the "License");
    *  you may not use this file except in compliance with the License.
  @@ -478,9 +478,7 @@
        *         references necessary to run the sub-build.
        */
       private Ant createAntTask(File directory) {
  -        Ant antTask = (Ant) getProject().createTask("ant");
  -        antTask.setOwningTarget(getOwningTarget());
  -        antTask.setTaskName(getTaskName());
  +        Ant antTask = new Ant(this);
           antTask.init();
           if (subTarget != null && subTarget.length() > 0) {
               antTask.setTarget(subTarget);
  
  
  
  1.117     +17 -0     ant/src/main/org/apache/tools/ant/taskdefs/Ant.java
  
  Index: Ant.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Ant.java,v
  retrieving revision 1.116
  retrieving revision 1.117
  diff -u -r1.116 -r1.117
  --- Ant.java	14 Jan 2005 17:23:37 -0000	1.116
  +++ Ant.java	18 Feb 2005 23:27:59 -0000	1.117
  @@ -109,6 +109,23 @@
       private boolean targetAttributeSet = false;
   
       /**
  +     * simple constructor
  +     */
  +    public Ant() {
  +    }
  +
  +    /**
  +     * create a task bound to its creator
  +     * @param owner owning task
  +     */
  +    public Ant(Task owner) {
  +        bindToOwner(owner);
  +    }
  +
  +
  +
  +
  +    /**
        * If true, pass all properties to the new Ant project.
        * Defaults to true.
        * @param value if true pass all properties to the new Ant project.
  
  
  
  1.43      +2 -5      ant/src/main/org/apache/tools/ant/taskdefs/CallTarget.java
  
  Index: CallTarget.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/CallTarget.java,v
  retrieving revision 1.42
  retrieving revision 1.43
  diff -u -r1.42 -r1.43
  --- CallTarget.java	14 Dec 2004 21:18:08 -0000	1.42
  +++ CallTarget.java	18 Feb 2005 23:27:59 -0000	1.43
  @@ -1,5 +1,5 @@
   /*
  - * Copyright  2000-2004 The Apache Software Foundation
  + * Copyright  2000-2005 The Apache Software Foundation
    *
    *  Licensed under the Apache License, Version 2.0 (the "License");
    *  you may not use this file except in compliance with the License.
  @@ -80,10 +80,7 @@
        * configuring it by calling its own init method.
        */
       public void init() {
  -        callee = (Ant) getProject().createTask("ant");
  -        callee.setOwningTarget(getOwningTarget());
  -        callee.setTaskName(getTaskName());
  -        callee.setLocation(getLocation());
  +        callee = new Ant(this);
           callee.init();
       }
   
  
  
  
  1.46      +1 -2      ant/src/main/org/apache/tools/ant/taskdefs/SignJar.java
  
  Index: SignJar.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/SignJar.java,v
  retrieving revision 1.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- SignJar.java	10 Feb 2005 22:48:46 -0000	1.45
  +++ SignJar.java	18 Feb 2005 23:27:59 -0000	1.46
  @@ -269,8 +269,7 @@
           }
   
           long lastModified = jarSource.lastModified();
  -        final ExecTask cmd = new ExecTask();
  -        cmd.setProject(getProject());
  +        final ExecTask cmd = new ExecTask(this);
           cmd.setExecutable(JavaEnvUtils.getJdkExecutable("jarsigner"));
   
           if (maxMemory != null) {
  
  
  
  1.28      +3 -4      ant/src/main/org/apache/tools/ant/taskdefs/LoadProperties.java
  
  Index: LoadProperties.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/LoadProperties.java,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- LoadProperties.java	6 Dec 2004 09:58:29 -0000	1.27
  +++ LoadProperties.java	18 Feb 2005 23:27:59 -0000	1.28
  @@ -1,5 +1,5 @@
   /*
  - * Copyright  2002-2004 The Apache Software Foundation
  + * Copyright  2002-2005 The Apache Software Foundation
    *
    *  Licensed under the Apache License, Version 2.0 (the "License");
    *  you may not use this file except in compliance with the License.
  @@ -216,9 +216,8 @@
                   final Properties props = new Properties();
                   props.load(tis);
   
  -                Property propertyTask =
  -                    (Property) getProject().createTask("property");
  -                propertyTask.setTaskName(getTaskName());
  +                Property propertyTask = new Property();
  +                propertyTask.bindToOwner(this);
                   propertyTask.addProperties(props);
               }
   
  
  
  
  1.15      +2 -2      ant/src/main/org/apache/tools/ant/taskdefs/optional/j2ee/WebLogicHotDeploymentTool.java
  
  Index: WebLogicHotDeploymentTool.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/j2ee/WebLogicHotDeploymentTool.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- WebLogicHotDeploymentTool.java	22 Nov 2004 09:23:33 -0000	1.14
  +++ WebLogicHotDeploymentTool.java	18 Feb 2005 23:27:59 -0000	1.15
  @@ -1,5 +1,5 @@
   /*
  - * Copyright  2002,2004 The Apache Software Foundation
  + * Copyright  2002,2004-2005 The Apache Software Foundation
    *
    *  Licensed under the Apache License, Version 2.0 (the "License");
    *  you may not use this file except in compliance with the License.
  @@ -58,7 +58,7 @@
        *  @exception org.apache.tools.ant.BuildException if the attributes are invalid or incomplete.
        */
       public void deploy() {
  -        Java java = (Java) getTask().getProject().createTask("java");
  +        Java java = new Java(getTask());
           java.setFork(true);
           java.setFailonerror(true);
           java.setClasspath(getClasspath());
  
  
  
  1.16      +2 -2      ant/src/main/org/apache/tools/ant/taskdefs/optional/j2ee/GenericHotDeploymentTool.java
  
  Index: GenericHotDeploymentTool.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/j2ee/GenericHotDeploymentTool.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- GenericHotDeploymentTool.java	9 Mar 2004 16:48:29 -0000	1.15
  +++ GenericHotDeploymentTool.java	18 Feb 2005 23:27:59 -0000	1.16
  @@ -1,5 +1,5 @@
   /*
  - * Copyright  2002,2004 The Apache Software Foundation
  + * Copyright  2002,2004-2005 The Apache Software Foundation
    *
    *  Licensed under the Apache License, Version 2.0 (the "License");
    *  you may not use this file except in compliance with the License.
  @@ -80,7 +80,7 @@
        */
       public void setTask(ServerDeploy task) {
           super.setTask(task);
  -        java = (Java) task.getProject().createTask("java");
  +        java = new Java(task);
       }
   
       /**
  
  
  
  1.21      +3 -5      ant/src/main/org/apache/tools/ant/taskdefs/optional/clearcase/ClearCase.java
  
  Index: ClearCase.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/clearcase/ClearCase.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- ClearCase.java	15 Nov 2004 14:52:27 -0000	1.20
  +++ ClearCase.java	18 Feb 2005 23:27:59 -0000	1.21
  @@ -1,5 +1,5 @@
   /*
  - * Copyright  2000-2004 The Apache Software Foundation
  + * Copyright  2000-2005 The Apache Software Foundation
    *
    *  Licensed under the Apache License, Version 2.0 (the "License");
    *  you may not use this file except in compliance with the License.
  @@ -144,17 +144,15 @@
        */
       protected String runS(Commandline cmdline) {
           String   outV  = "opts.cc.runS.output" + pcnt++;
  -        Project  aProj = getProject();
  -        ExecTask exe   = (ExecTask) aProj.createTask("exec");
  +        ExecTask exe   = new ExecTask(this);
           Commandline.Argument arg = exe.createArg();
   
           exe.setExecutable(cmdline.getExecutable());
           arg.setLine(Commandline.toString(cmdline.getArguments()));
           exe.setOutputproperty(outV);
           exe.execute();
  -        // System.out.println( "runS: " + outV + " : " + aProj.getProperty( outV ));
   
  -        return aProj.getProperty(outV);
  +        return getProject().getProperty(outV);
       }
       /**
        * If true, command will throw an exception on failure.
  
  
  
  1.25      +4 -5      ant/src/main/org/apache/tools/ant/taskdefs/optional/IContract.java
  
  Index: IContract.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/IContract.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- IContract.java	9 Mar 2004 16:48:14 -0000	1.24
  +++ IContract.java	18 Feb 2005 23:27:59 -0000	1.25
  @@ -1,5 +1,5 @@
   /*
  - * Copyright  2001-2004 The Apache Software Foundation
  + * Copyright  2001-2005 The Apache Software Foundation
    *
    *  Licensed under the Apache License, Version 2.0 (the "License");
    *  you may not use this file except in compliance with the License.
  @@ -522,7 +522,8 @@
               // Prepare the directories for iContract. iContract will make
               // them if they don't exist, but for some reason I don't know,
               // it will complain about the REP files afterwards
  -            Mkdir mkdir = (Mkdir) getProject().createTask("mkdir");
  +            Mkdir mkdir = new Mkdir();
  +            mkdir.bindToOwner(this);
   
               mkdir.setDir(instrumentDir);
               mkdir.execute();
  @@ -590,9 +591,7 @@
                   buildDir.getAbsolutePath()));
   
               // Create a forked java process
  -            Java iContract = (Java) getProject().createTask("java");
  -
  -            iContract.setTaskName(getTaskName());
  +            Java iContract = new Java(this);
               iContract.setFork(true);
               iContract.setClassname("com.reliablesystems.iContract.Tool");
               iContract.setClasspath(iContractClasspath);
  
  
  
  1.36      +1 -5      ant/src/main/org/apache/tools/ant/taskdefs/optional/Cab.java
  
  Index: Cab.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/Cab.java,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- Cab.java	6 Jan 2005 12:05:09 -0000	1.35
  +++ Cab.java	18 Feb 2005 23:27:59 -0000	1.36
  @@ -122,11 +122,7 @@
        * it appears in the logs to be the same task as this one.
        */
       protected ExecTask createExec() throws BuildException {
  -        ExecTask exec = (ExecTask) getProject().createTask("exec");
  -        exec.setOwningTarget(this.getOwningTarget());
  -        exec.setTaskName(this.getTaskName());
  -        exec.setDescription(this.getDescription());
  -
  +        ExecTask exec = new ExecTask(this);
           return exec;
       }
   
  
  
  
  1.28      +3 -2      ant/src/main/org/apache/tools/ant/taskdefs/optional/RenameExtensions.java
  
  Index: RenameExtensions.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/RenameExtensions.java,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- RenameExtensions.java	9 Mar 2004 16:48:15 -0000	1.27
  +++ RenameExtensions.java	18 Feb 2005 23:27:59 -0000	1.28
  @@ -1,5 +1,5 @@
   /*
  - * Copyright  2000,2002,2004 The Apache Software Foundation
  + * Copyright  2000,2002,2004-2005 The Apache Software Foundation
    *
    *  Licensed under the Apache License, Version 2.0 (the "License");
    *  you may not use this file except in compliance with the License.
  @@ -121,7 +121,8 @@
           log("using the same patterns on <fileset> as you\'ve used here",
               Project.MSG_INFO);
   
  -        Move move = (Move) getProject().createTask("move");
  +        Move move = new Move();
  +        move.bindToOwner(this);
           move.setOwningTarget(getOwningTarget());
           move.setTaskName(getTaskName());
           move.setLocation(getLocation());
  
  
  
  1.30      +3 -4      ant/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WLRun.java
  
  Index: WLRun.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WLRun.java,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- WLRun.java	9 Mar 2004 16:48:21 -0000	1.29
  +++ WLRun.java	18 Feb 2005 23:27:59 -0000	1.30
  @@ -1,5 +1,5 @@
   /*
  - * Copyright  2000-2002,2004 The Apache Software Foundation
  + * Copyright  2000-2002,2004-2005 The Apache Software Foundation
    *
    *  Licensed under the Apache License, Version 2.0 (the "License");
    *  you may not use this file except in compliance with the License.
  @@ -192,7 +192,7 @@
                                       + "to start the server");
           }
   
  -        Java weblogicServer = (Java) getProject().createTask("java");
  +        Java weblogicServer = new Java(this);
           weblogicServer.setTaskName(getTaskName());
           weblogicServer.setFork(true);
           weblogicServer.setDir(weblogicSystemHome);
  @@ -247,8 +247,7 @@
               }
           }
   
  -        Java weblogicServer = (Java) getProject().createTask("java");
  -        weblogicServer.setTaskName(getTaskName());
  +        Java weblogicServer = new Java(this);
           weblogicServer.setFork(true);
           weblogicServer.setClassname(weblogicMainClass);
   
  
  
  
  1.21      +5 -7      ant/src/main/org/apache/tools/ant/taskdefs/optional/ejb/BorlandGenerateClient.java
  
  Index: BorlandGenerateClient.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/ejb/BorlandGenerateClient.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- BorlandGenerateClient.java	9 Mar 2004 16:48:19 -0000	1.20
  +++ BorlandGenerateClient.java	18 Feb 2005 23:27:59 -0000	1.21
  @@ -1,5 +1,5 @@
   /*
  - * Copyright  2001-2004 The Apache Software Foundation
  + * Copyright  2001-2005 The Apache Software Foundation
    *
    *  Licensed under the Apache License, Version 2.0 (the "License");
    *  you may not use this file except in compliance with the License.
  @@ -170,8 +170,8 @@
   
               log("mode : java");
   
  -            org.apache.tools.ant.taskdefs.Java execTask = null;
  -            execTask = (Java) getProject().createTask("java");
  +            Java execTask = null;
  +            execTask = new Java(this);
   
               execTask.setDir(new File("."));
               execTask.setClassname("com.inprise.server.commandline.EJBUtilities");
  @@ -221,8 +221,7 @@
   
               log("mode : fork " + BorlandDeploymentTool.BAS, Project.MSG_DEBUG);
   
  -            org.apache.tools.ant.taskdefs.ExecTask execTask = null;
  -            execTask = (ExecTask) getProject().createTask("exec");
  +            ExecTask execTask = new ExecTask(this);
   
               execTask.setDir(new File("."));
               execTask.setExecutable("iastool");
  @@ -254,8 +253,7 @@
       protected  void executeForkV5() throws BuildException {
           try {
               log("mode : fork " + BorlandDeploymentTool.BES, Project.MSG_DEBUG);
  -            org.apache.tools.ant.taskdefs.ExecTask execTask = null;
  -            execTask = (ExecTask) getProject().createTask("exec");
  +            ExecTask execTask = new ExecTask(this);
   
               execTask.setDir(new File("."));
   
  
  
  
  1.29      +4 -4      ant/src/main/org/apache/tools/ant/taskdefs/optional/ejb/DDCreator.java
  
  Index: DDCreator.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/ejb/DDCreator.java,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- DDCreator.java	9 Mar 2004 16:48:19 -0000	1.28
  +++ DDCreator.java	18 Feb 2005 23:27:59 -0000	1.29
  @@ -1,5 +1,5 @@
   /*
  - * Copyright  2000-2004 The Apache Software Foundation
  + * Copyright  2000-2005 The Apache Software Foundation
    *
    *  Licensed under the Apache License, Version 2.0 (the "License");
    *  you may not use this file except in compliance with the License.
  @@ -19,6 +19,7 @@
   import java.io.File;
   import org.apache.tools.ant.BuildException;
   import org.apache.tools.ant.DirectoryScanner;
  +import org.apache.tools.ant.Project;
   import org.apache.tools.ant.taskdefs.Java;
   import org.apache.tools.ant.taskdefs.MatchingTask;
   import org.apache.tools.ant.types.Commandline;
  @@ -86,9 +87,8 @@
           }
   
           String systemClassPath = System.getProperty("java.class.path");
  -        String execClassPath = getProject().translatePath(systemClassPath + ":" + classpath);
  -        Java ddCreatorTask = (Java) getProject().createTask("java");
  -        ddCreatorTask.setTaskName(getTaskName());
  +        String execClassPath = Project.translatePath(systemClassPath + ":" + classpath);
  +        Java ddCreatorTask = new Java(this);
           ddCreatorTask.setFork(true);
           ddCreatorTask.setClassname("org.apache.tools.ant.taskdefs.optional.ejb.DDCreatorHelper");
           Commandline.Argument arguments = ddCreatorTask.createArg();
  
  
  
  1.21      +2 -2      ant/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WLStop.java
  
  Index: WLStop.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WLStop.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- WLStop.java	9 Mar 2004 16:48:21 -0000	1.20
  +++ WLStop.java	18 Feb 2005 23:27:59 -0000	1.21
  @@ -1,5 +1,5 @@
   /*
  - * Copyright  2000-2002,2004 The Apache Software Foundation
  + * Copyright  2000-2002,2004-2005 The Apache Software Foundation
    *
    *  Licensed under the Apache License, Version 2.0 (the "License");
    *  you may not use this file except in compliance with the License.
  @@ -78,7 +78,7 @@
               throw new BuildException("The url of the weblogic server must be provided.");
           }
   
  -        Java weblogicAdmin = (Java) getProject().createTask("java");
  +        Java weblogicAdmin = new Java(this);
           weblogicAdmin.setFork(true);
           weblogicAdmin.setClassname("weblogic.Admin");
           String args;
  
  
  
  1.57      +1 -1      ant/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WeblogicDeploymentTool.java
  
  Index: WeblogicDeploymentTool.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WeblogicDeploymentTool.java,v
  retrieving revision 1.56
  retrieving revision 1.57
  diff -u -r1.56 -r1.57
  --- WeblogicDeploymentTool.java	6 Jan 2005 12:05:09 -0000	1.56
  +++ WeblogicDeploymentTool.java	18 Feb 2005 23:27:59 -0000	1.57
  @@ -511,7 +511,7 @@
           String ejbcClassName = ejbcClass;
   
           try {
  -            javaTask = (Java) getTask().getProject().createTask("java");
  +            javaTask = new Java(getTask());
               javaTask.setTaskName("ejbc");
   
               javaTask.createJvmarg().setLine(additionalJvmArgs);
  
  
  
  1.33      +4 -4      ant/src/main/org/apache/tools/ant/taskdefs/optional/ejb/BorlandDeploymentTool.java
  
  Index: BorlandDeploymentTool.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/ejb/BorlandDeploymentTool.java,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- BorlandDeploymentTool.java	9 Mar 2004 16:48:19 -0000	1.32
  +++ BorlandDeploymentTool.java	18 Feb 2005 23:27:59 -0000	1.33
  @@ -1,5 +1,5 @@
   /*
  - * Copyright  2001-2004 The Apache Software Foundation
  + * Copyright  2001-2005 The Apache Software Foundation
    *
    *  Licensed under the Apache License, Version 2.0 (the "License");
    *  you may not use this file except in compliance with the License.
  @@ -281,8 +281,8 @@
       private void verifyBorlandJarV5(File sourceJar) {
           log("verify BES " + sourceJar, Project.MSG_INFO);
           try {
  -            org.apache.tools.ant.taskdefs.ExecTask execTask = null;
  -            execTask = (ExecTask) getTask().getProject().createTask("exec");
  +            ExecTask execTask = null;
  +            execTask = new ExecTask(getTask());
               execTask.setDir(new File("."));
               execTask.setExecutable("iastool");
               //classpath
  @@ -319,7 +319,7 @@
               String args = verifyArgs;
               args += " " + sourceJar.getPath();
   
  -            javaTask = (Java) getTask().getProject().createTask("java");
  +            javaTask = new Java(getTask());
               javaTask.setTaskName("verify");
               javaTask.setClassname(VERIFY);
               Commandline.Argument arguments = javaTask.createArg();
  
  
  
  1.18      +2 -2      ant/src/main/org/apache/tools/ant/taskdefs/optional/ejb/JonasDeploymentTool.java
  
  Index: JonasDeploymentTool.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/ejb/JonasDeploymentTool.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- JonasDeploymentTool.java	15 Nov 2004 14:52:27 -0000	1.17
  +++ JonasDeploymentTool.java	18 Feb 2005 23:27:59 -0000	1.18
  @@ -1,5 +1,5 @@
   /*
  - * Copyright  2002-2004 The Apache Software Foundation
  + * Copyright  2002-2005 The Apache Software Foundation
    *
    *  Licensed under the Apache License, Version 2.0 (the "License");
    *  you may not use this file except in compliance with the License.
  @@ -520,7 +520,7 @@
               return;
           }
   
  -        genicTask = (Java) getTask().getProject().createTask("java");
  +        genicTask = new Java(getTask());
           genicTask.setTaskName("genic");
           genicTask.setFork(true);
   
  
  
  
  1.30      +4 -4      ant/src/main/org/apache/tools/ant/taskdefs/optional/ejb/Ejbc.java
  
  Index: Ejbc.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/ejb/Ejbc.java,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- Ejbc.java	9 Mar 2004 16:48:20 -0000	1.29
  +++ Ejbc.java	18 Feb 2005 23:27:59 -0000	1.30
  @@ -1,5 +1,5 @@
   /*
  - * Copyright  2000,2002,2004 The Apache Software Foundation
  + * Copyright  2000,2002,2004-2005 The Apache Software Foundation
    *
    *  Licensed under the Apache License, Version 2.0 (the "License");
    *  you may not use this file except in compliance with the License.
  @@ -19,6 +19,7 @@
   import java.io.File;
   import org.apache.tools.ant.BuildException;
   import org.apache.tools.ant.DirectoryScanner;
  +import org.apache.tools.ant.Project;
   import org.apache.tools.ant.taskdefs.Java;
   import org.apache.tools.ant.taskdefs.MatchingTask;
   import org.apache.tools.ant.types.Commandline;
  @@ -93,15 +94,14 @@
   
           String systemClassPath = System.getProperty("java.class.path");
           String execClassPath
  -            = getProject().translatePath(systemClassPath + ":" + classpath
  +            = Project.translatePath(systemClassPath + ":" + classpath
                                            + ":" + generatedFilesDirectory);
           // get all the files in the descriptor directory
           DirectoryScanner ds = super.getDirectoryScanner(descriptorDirectory);
   
           String[] files = ds.getIncludedFiles();
   
  -        Java helperTask = (Java) getProject().createTask("java");
  -        helperTask.setTaskName(getTaskName());
  +        Java helperTask = new Java(this);
           helperTask.setFork(true);
           helperTask.setClassname("org.apache.tools.ant.taskdefs.optional.ejb.EjbcHelper");
           String args = "";
  
  
  
  1.32      +1 -1      ant/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WebsphereDeploymentTool.java
  
  Index: WebsphereDeploymentTool.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WebsphereDeploymentTool.java,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- WebsphereDeploymentTool.java	6 Jan 2005 12:05:09 -0000	1.31
  +++ WebsphereDeploymentTool.java	18 Feb 2005 23:27:59 -0000	1.32
  @@ -541,7 +541,7 @@
       private void buildWebsphereJar(File sourceJar, File destJar) {
           try {
               if (ejbdeploy) {
  -                Java javaTask = (Java) getTask().getProject().createTask("java");
  +                Java javaTask = new Java(getTask());
                   // Set the JvmArgs
                   javaTask.createJvmarg().setValue("-Xms64m");
                   javaTask.createJvmarg().setValue("-Xmx128m");
  
  
  
  1.25      +2 -2      ant/src/main/org/apache/tools/ant/taskdefs/optional/jsp/WLJspc.java
  
  Index: WLJspc.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/jsp/WLJspc.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- WLJspc.java	9 Mar 2004 16:48:30 -0000	1.24
  +++ WLJspc.java	18 Feb 2005 23:28:00 -0000	1.25
  @@ -1,5 +1,5 @@
   /*
  - * Copyright  2000,2002-2004 The Apache Software Foundation
  + * Copyright  2000,2002-2005 The Apache Software Foundation
    *
    *  Licensed under the Apache License, Version 2.0 (the "License");
    *  you may not use this file except in compliance with the License.
  @@ -132,7 +132,7 @@
           // Therefore, takes loads of time
           // Can pass directories at a time (*.jsp) but easily runs out of
           // memory on hefty dirs (even on  a Sun)
  -        Java helperTask = (Java) getProject().createTask("java");
  +        Java helperTask = new Java(this);
           helperTask.setFork(true);
           helperTask.setClassname("weblogic.jspc");
           helperTask.setTaskName(getTaskName());
  
  
  
  1.25      +2 -2      ant/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/JasperC.java
  
  Index: JasperC.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/JasperC.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- JasperC.java	22 Nov 2004 09:23:34 -0000	1.24
  +++ JasperC.java	18 Feb 2005 23:28:00 -0000	1.25
  @@ -1,5 +1,5 @@
   /*
  - * Copyright  2001-2004 The Apache Software Foundation
  + * Copyright  2001-2005 The Apache Software Foundation
    *
    *  Licensed under the Apache License, Version 2.0 (the "License");
    *  you may not use this file except in compliance with the License.
  @@ -56,7 +56,7 @@
           try {
               // Create an instance of the compiler, redirecting output to
               // the project log
  -            Java java = (Java) (getProject().createTask("java"));
  +            Java java = new Java(owner);
               Path p = getClasspath();
               if (getJspc().getClasspath() != null) {
                   getProject().log("using user supplied classpath: " + p,
  
  
  
  1.64      +2 -1      ant/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java
  
  Index: FTP.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java,v
  retrieving revision 1.63
  retrieving revision 1.64
  diff -u -r1.63 -r1.64
  --- FTP.java	6 Jan 2005 12:05:09 -0000	1.63
  +++ FTP.java	18 Feb 2005 23:28:00 -0000	1.64
  @@ -1504,7 +1504,8 @@
               }
               // delegate the deletion of the local temp file to the delete task
               // because of race conditions occuring on Windows
  -            Delete mydelete = (Delete) getProject().createTask("delete");
  +            Delete mydelete = new Delete();
  +            mydelete.bindToOwner(this);
               mydelete.setFile(tempFile.getCanonicalFile());
               mydelete.execute();
           } catch (Exception e) {
  
  
  

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


Re: cvs commit: ant/src/main/org/apache/tools/ant/taskdefs/optional/net FTP.java

Posted by Stefan Bodewig <bo...@apache.org>.
On 18 Feb 2005, <st...@apache.org> wrote:

>   I'm tempted to retrofit Task.bindToOwner back to the 1.6.x
>   codebase, for the benefit of third party tasks; same for the extra
>   constructors for exec and java. Thoughts?

If you only port bindToOwner and the new constructors, but not all the
points of invocation then you can't do much harm.

Stefan

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