ANT Parameters

Discussion in 'Java' started by Rod, Jun 26, 2005.

  1. Rod

    Rod Guest

    I have an ant script which requires at least two targets
    to be specified.

    Is there a way with core ant tasks or ant-contrib tasks to validate the
    number of targets specified when the ant script is invoked ?

    Thanks.
     
    Rod, Jun 26, 2005
    #1
    1. Advertising

  2. Rod

    SMC Guest

    On Sun, 26 Jun 2005 13:28:56 +1000, Rod wrote:

    > I have an ant script which requires at least two targets to be
    > specified.
    >
    > Is there a way with core ant tasks or ant-contrib tasks to validate the
    > number of targets specified when the ant script is invoked ?
    >
    > Thanks.


    Without knowing clearly why you need to invoke two targets in this manner,
    would it not be better to have the 2nd one have a dependency on the 1st
    one? That way if someone invoked the 2nd without the first, you're
    covered anyway.

    <target name="1st">
    <echo message="1st target invoked"/>
    </target>

    <target name="2nd" depends="1st">
    <echo message="2nd target invoked"/>
    </target>

    [sean@se2 sean]$ ant
    Buildfile: build.xml

    1st:
    [echo] 1st target invoked

    2nd:
    [echo] 2nd target invoked


    But perhaps your build is more complicated than that. Using dependency is
    the ant style though.

    --
    Sean

    There's no place like 127.0.0.1
     
    SMC, Jun 28, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chris Bedford
    Replies:
    6
    Views:
    2,245
  2. john martin
    Replies:
    2
    Views:
    2,221
    john martin
    Apr 7, 2005
  3. Replies:
    1
    Views:
    510
    Larry
    Mar 7, 2006
  4. Replies:
    6
    Views:
    879
  5. David Portabella
    Replies:
    0
    Views:
    372
    David Portabella
    Jun 13, 2008
Loading...

Share This Page