Sanjay Bhatia <[EMAIL PROTECTED]> wrote:

> I have a target that creates and then includes a file into a jar.  I
> would like to be able to specify something on the command line that
> will either do this or not.

Not sure whether I understand your problem.  You have something like

<target name="to-run-or-not-to-run">
  <create-file />
  <add-file-to-jar />
</target>

If you want to do this, you can say

ant to-run-or-not-to-run my-other-targets

and if you don't want to run it:

ant my-other-targets

But maybe your situation is more complicated?  You have a target named
must-run that depends on to-run-or-not-to-run if this should run - and
you want to run must-run anyway?  Then you could do

<target name="to-run-or-not-to-run" if="run">
  ...
</target>

<target name="must-run" depends="to-run-or-not-to-run">
  ...
</target>

and use either "ant -Drun=1 must-run" or just "ant must-run".

Does this cover your problem?

Stefan

Reply via email to