ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Jan.Mate...@rzf.fin-nrw.de>
Subject AW: command line target available from inside build script?
Date Tue, 28 Feb 2006 15:46:45 GMT
Did you had a look at <macrodef>?

Jan 

>-----Urspr√ľngliche Nachricht-----
>Von: Jakob Fix [mailto:jakob.fix@gmail.com] 
>Gesendet: Dienstag, 28. Februar 2006 16:40
>An: Ant Users List
>Betreff: Re: command line target available from inside build script?
>
>Hi Alex,
>
>On 2/28/06, schmaxelander <Alexander.Hybel@t-systems.com> 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 "generic.build"?
>
>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 :-))
>- cdrom.build
>- intranet.build
>- internet.build
>
>which take care of the above-mentioned specifics.  if 
>possible, I'd like to have one generic.build file where I just 
>supply the platform target, like this ant -f generic.build 
>{cdrom|intranet|internet}
>
>inside the script a property will get assigned the target's 
>value, and I can then use this property to decide whether or 
>not I want to execute the "enable-log-mechanism" and 
>"disable-general-conditions", etc.
>
>mmh, if there are better ways I'm open for them.  thanks for 
>your reply.
>
>
>> Regards,
>> Alex Hybel
>>
>> --- In apache-ant@yahoogroups.com, "Jakob Fix" <jakob.fix@...> wrote:
>> >
>> > Hi,
>> >
>> > I was wondering whether the target given on the command line like 
>> > this
>> >
>> > ant -f generic.build server
>> >
>> > (i.e. "server" in this example) is available from within the ant 
>> > script, like ${target}.  apparently, it's not ${target} because 
>> > otherwise I wouldn't have asked, I tried that, and yes, the 
>> > documentation keeps shtum as well.
>> >
>> > thanks in advance.
>> >
>> >
>> > --
>> > cheers,
>> > Jakob.
>
>
>--
>cheers,
>Jakob.
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For 
>additional commands, e-mail: user-help@ant.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message