Command line params and 'if'
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Tuesday, October 9, 2001 10:12 AM

From the command line I want the user to specify which version of a product they would like to build. This way I can execute a specific target within my build.xml which corresponds to that particular product. Here is an example: From the command line: c:ant in>perl runant.pl -D{p1}= This will tell me that the user wants to build product 1. Now inside my build.xml I have the following target: This seems to allow for this target to be executed if the command line parameter was specified as '-D{p1}='. I have seen no documentation about this however, I came    More>>

From the command line I want the user
to specify which version of a
product they would like to build.
This way I can execute a specific
target within my build.xml
which corresponds to that
particular product. Here is an example:



From the command line:

c:ant in>perl runant.pl -D{p1}=



This will tell me that the user wants
to build product 1.


Now inside my build.xml I have the
following target:






This seems to allow for this target to
be executed if the command line
parameter was specified
as '-D{p1}='. I have seen no documentation
about this however, I came upon it while
trying things out (I'm still very new to Ant).



Is there a way to specify within the
build file whether or not to
execute a target using the 'if'
without using command line args?



Thanks,

-- George

   <<Less

Re: Command line params and 'if'

Posted By:   Erik_Hatcher  
Posted On:   Tuesday, October 9, 2001 05:45 PM

So why not just have your targets named how you want to call them? Then just have the user specify the target to run (which corresponds to the product version desired).


Alternatively you could likely do something with to specify a target based on a property (although I haven't tried this to see if it works).

About | Sitemap | Contact