Bug 28990 - Extend <java> task to provide <apply>-like features
Summary: Extend <java> task to provide <apply>-like features
Status: NEW
Alias: None
Product: Ant
Classification: Unclassified
Component: Core tasks (show other bugs)
Version: 1.6.1
Hardware: Other other
: P3 enhancement with 1 vote (vote)
Target Milestone: ---
Assignee: Ant Notifications List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-14 21:16 UTC by Shankar Unni
Modified: 2008-11-24 03:58 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Shankar Unni 2004-05-14 21:16:08 UTC
This is similar in spirit to bug 8559, but instead of extending <arg>, it would
be really nice if <java> itself provided <apply>-like features, like supporting
source and dest directories, filesets, selectors and mappers, and being able to
pass the arguments that are selected to the java argument list as arguments.

It would greatly reduce the need to write tasks in Java for each java program I
want to invoke in this way (much of which is boilerplate).
Comment 1 Alexey Solofnenko 2004-05-14 21:17:40 UTC
I also would like to have it, but maybe it is better to be able to use <java> inside <apply>.
Comment 2 Shankar Unni 2004-05-14 22:07:52 UTC
> maybe it is better to be able to use <java> inside <apply>.

Yes, that's what I'm doing now, using executable="${java.home}/bin/java".
However, this basically forces you to fork, and is not entirely obvious. And
things like defining the classpath for it are a bit tedious.

<java> has the advantage that the java-specific options are nicely structured
into the task already, so we're mainly talking about grafting <apply>'s
argument-handling features onto <java>.
Comment 3 Alexey Solofnenko 2004-05-14 22:13:49 UTC
It is a matter of taste, but I think it is better to have tasks orthogonal. 
It would also help to avoid copy/paste code reuse. I think something like 
that would be better:

<apply>
  <java/>
<apply>