You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Jonathan Hayward <jh...@teleformix.com> on 2000/10/23 16:17:13 UTC

Individual access to target components

Suppose I have something like the following build.xml:

<project name="foo" default="bar" basedir=".">
    <task name="bar">
        <javac .../>
        <rmic .../>
        <jar .../>
        <signjar .../>
    </task>
</project>

Is there any way to type something like "ant bar -subtask javac" to run
only the javac component of the bar task?


    -Jonathan


Re: Individual access to target components

Posted by Peter Donald <do...@locus.apache.org>.
At 09:17  23/10/00 -0500, you wrote:
>Suppose I have something like the following build.xml:
>
><project name="foo" default="bar" basedir=".">
>    <task name="bar">
>        <javac .../>
>        <rmic .../>
>        <jar .../>
>        <signjar .../>
>    </task>
></project>
>
>
>Is there any way to type something like "ant bar -subtask javac" to run
>only the javac component of the bar task?

Nope it kinda of goes against the philosophy of ant (tasks are meant to be
atomic bits of work). So to get what you want you would need to do

<project name="foo" default="bar" basedir=".">
    <task name="bar">
        <javac .../>
    </task>

    <task name="bar1" depends="bar">
        <rmic .../>
    </task>

    <task name="bar2" depends="bar1">
        <jar .../>
    </task>

    <task name="bar3" depends="bar2">
        <signjar .../>
    </task>
</project>

and then go "ant bar"


Cheers,

Pete

*------------------------------------------------------*
| "Nearly all men can stand adversity, but if you want |
| to test a man's character, give him power."          |
|       -Abraham Lincoln                               |
*------------------------------------------------------*