You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Ilya Lipkind <il...@talaris.com> on 2002/05/07 01:10:41 UTC

Delete task does not take filelist

Hi all,

It seems strange to me but apparently <delete> task does not take filelist. Is there a good way to delete files
according to a filelist and not a fileset generated by a pattern

thanks,
- Ilya

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


Re: Taskdef warnings and ^C fix

Posted by Stefan Bodewig <bo...@apache.org>.
On Mon, 6 May 2002, Hal Hildebrand <Ha...@hellblazer.com>
wrote:

> In looking at the code, the problem is that the classes are being
> compared, and since the apparently come from different classloaders,
> the classes don't compare .equals(), thus the error message.

If they come from different class loaders, they may really be
different versions of the same class or simply just have access to
different classes - they are not the same.

The warning may be annoying for you, but in general, it is no false
alarm and something people should be made aware of IMHO.

> The fix we've been using is to use the shutdown hook of the VM to
> destroy the spawned processes on exit.  For example, in Exec.run(),
> 
>             // exec command on system runtime
>             Process proc = Runtime.getRuntime().exec(command);
> 
>             // kill me if Ctrl-C the process
>             ProcessKiller killer = new ProcessKiller(proc);
>             Runtime.getRuntime().addShutdownHook(killer);

<exec> is implemented by ExecTask which delegates the work to
Execute.  This uses a ProcessDestroyer and adds it as a shutdown hook
via reflection (so we can compile on JDK < 1.3).

The code is very similar to yours, so if the shutdown hook gets
triggered by ^Cing Ant - the spawned processes should be killed as
well.

Stefan

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


Taskdef warnings and ^C fix

Posted by "Hal Hildebrand (web)" <Ha...@hellblazer.com>.
Couple of things.  If this is the wrong emailing list for this, please
let me know.

First, in 1.5 beta1, if you try to re-define an Ant taskdef in another
project you will get an annoying warning in the log file.  Basically, I
have a situation where I define tasks in include files, so this means
that there's a number of the same tasks with the same class names being
defined.  In 1.4.1, this was ignored, although in verbose output it
would be logged.  In looking at the code, the problem is that the
classes are being compared, and since the apparently come from different
classloaders, the classes don't compare .equals(), thus the error
message.

Second problem is with the exec().  In JDK 1.4, I don't know what they
did, but when you ^C a java process, the exec'd processes (i.e. the
child processes) are no longer killed.  Thus if you use ant to start up
Java processes, they are no longer killed if you ^C the Ant process that
spawned them.

The fix we've been using is to use the shutdown hook of the VM to
destroy the spawned processes on exit.  For example, in Exec.run(),

            // exec command on system runtime
            Process proc = Runtime.getRuntime().exec(command);

            // kill me if Ctrl-C the process
            ProcessKiller killer = new ProcessKiller(proc);
            Runtime.getRuntime().addShutdownHook(killer);

Where ProcessKiller is simply:


    class ProcessKiller extends Thread {

        Process process;

        ProcessKiller(Process process) {
            this.process = process;
        }

        public void run() {
            process.destroy();
        }
    }


It's incredibly annoying on WinXP to have these processes constantly
lying about.  I think it's great that the JDK 1.4 doesn't kill the
spawned processes now, but the result is that ^C'ing Ant no longer kills
the processes.

Again, if this is the wrong list, just yell at me...

Cheers,

-Hal
______
science does not remove the terror of the gods
www.hellblazer.com


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


Re: Delete task does not take filelist

Posted by Diane Holt <ho...@yahoo.com>.
--- Ilya Lipkind <il...@talaris.com> wrote:
> It seems strange to me but apparently <delete> task does not take
> filelist. Is there a good way to delete files
> according to a filelist and not a fileset generated by a pattern

When you say "filelist", are you referring to the new <filelist> datatype,
or just a list of disparate, full-path filenames?

Diane

=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com

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