ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Loughran <>
Subject Re: command line target available from inside build script?
Date Tue, 28 Feb 2006 15:47:56 GMT
Jakob Fix wrote:
> Hi Alex,
> On 2/28/06, schmaxelander <> wrote:
>> Hi Jakob,
>> what exactly is your question?
>> If the target is available from commandline, its available from within
>> the script, too. What is you error message? Did you really name your
>> script file ""?
> I'm not having problems, really :-).
> I was just curious whether I could use the name of the target as given
> on the command line in the script as a means of influencing the script
> execution.
> OK, an example.  I have one source, and three different build targets
> "cdrom", "intranet", "internet".  The differences between the targets
> are relatively minimal, for example: "disable any logs" for the cdrom
> target (the application runs from cdrom), or "display general
> conditions" unless the target is intranet, etc.
> Currently I have three build files (yes, they are called like this :-))
> -
> -
> -
> which take care of the above-mentioned specifics.  if possible, I'd
> like to have one file where I just supply the platform
> target, like this

Ant doesnt set the name of the target. What happens if there is more 
than one target on the command line? What if you are being called from 
an outer build file that has different names? It wouldn't scale.

use a property:

ant -f -Dtarget=cdrom

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message