Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 88425 invoked from network); 26 May 2008 07:26:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 May 2008 07:26:51 -0000 Received: (qmail 10287 invoked by uid 500); 26 May 2008 07:26:50 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 10253 invoked by uid 500); 26 May 2008 07:26:50 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 10242 invoked by uid 99); 26 May 2008 07:26:50 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 May 2008 00:26:50 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [193.109.238.66] (HELO dnsinet.rzf-nrw.de) (193.109.238.66) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 May 2008 07:25:52 +0000 Received: from z011100.bk.fin.local (z011100.bk.fin.local [172.18.101.140]) by dnsinet.rzf-nrw.de (8.14.0/8.14.0) with ESMTP id m4Q7QEN1010897 for ; Mon, 26 May 2008 09:26:14 +0200 Received: from z011034.bk.fin.local ([130.11.7.34]) by z011100.bk.fin.local with Microsoft SMTPSVC(6.0.3790.1830); Mon, 26 May 2008 09:26:14 +0200 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-MimeOLE: Produced By Microsoft Exchange V6.5 Subject: AW: AW: antrc & ant.conf files Date: Mon, 26 May 2008 09:26:14 +0200 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: AW: antrc & ant.conf files Thread-Index: Aci7yT+bE5NjM33BTI6AsbcWbLf77ADOGQtw References: <20080519124408.rxzs8jr1c0sc8sk4@www.aandoconsultancy.ltd.uk> <73763B2E-45C2-4091-996F-D4FF5D3F0427@AandOConsultancy.ltd.uk> <5EBA5CCB-EF29-4D84-8AF8-03B4BB48E348@AandOConsultancy.ltd.uk> <5BC8F23E-57E5-422B-BF04-230837A514A1@AandOConsultancy.ltd.uk> From: To: X-OriginalArrivalTime: 26 May 2008 07:26:14.0630 (UTC) FILETIME=[C7B29060:01C8BF01] X-Virus-Checked: Checked by ClamAV on apache.org On Windows you would write call otherBatchfile.bat BAT+SH does have different syntax therefore you have to provide both. You cant include the Unix-Shellscript in the Windows-Batch and vice = versa. Jan > -----Urspr=FCngliche Nachricht----- > Von: David Weintraub [mailto:qazwart@gmail.com]=20 > Gesendet: Donnerstag, 22. Mai 2008 07:03 > An: Ant Users List > Betreff: Re: AW: antrc & ant.conf files >=20 > The file used in Windows is ant.bat. I don't have a copy of ant.bat, > but I don't believe you can "source" DOS batch files as you can > "source" Unix shell scripts. Sourcing means including one shell script > into another and that's what happens when you see: >=20 > . somefile.sh >=20 > in a shell script. You'd need to go to a Windows machine and take a > look at the "ant.bat" file and see what it says. >=20 > On Wed, May 21, 2008 at 12:19 PM, David J. B. Hollis > wrote: > > Hi, David > > > > Many thanks for the info! > > > > Is it possible to write these files for Windows & *nix? > > > > Thanks, > > David > > > > > >> It appears that the $HOME/.ant/ant.conf and $HOME/.antrc files are > >> just two different ways to do the same thing.=20 > $HOME/.ant/ant.conf is > >> executed firsrt, so if something is defined in both files, only the > >> one in $HOME/.antrc is used. However, this isn't a feature=20 > as much as > >> someone has to be executed first and someone last. > >> > >> Use either $HOME/.antrc or $HOME/.ant/ant.conf, but not both. > >> Standardize on one. Setting ANT_HOME in one of these files will set > >> ANT_HOME by the time it needs to be used in line 123 when=20 > ANT_LIB gets > >> set. > >> > >> Note that the shell script will assume ANT_HOME will be=20 > the location > >> of the shell script "ant" command if you don't have ANT_HOME set. > >> > >> You can use the following syntax to set ANT_HOME only if ANT_HOME > >> isn't already set: > >> > >> if [ -n "$ANT_HOME" ] > >> then > >> ANT_HOME=3D/usr/local/ant > >> fi > >> > >> You can pass unexported environment variables in ANT by using the > >> following: > >> > >> ant -Dmy.variable=3D$MY_VARIABLE > >> > >> This sets the ant property ${my.variable} to the value of the > >> environment variable $MY_VARIABLE > >> > >> > >> On Tue, May 20, 2008 at 2:06 PM, David J. B. Hollis > >> wrote: > >>> > >>> Hi, David > >>> > >>> Ironically, the one which ISN'T exported, DITA_HOME, IS=20 > used in the Ant > >>> builds. But it's passed as parameter dita.dir. Obviously=20 > anything on > >>> ANT_ARGS is passed, so ought not need exporting as well.=20 > I don't think > >>> the > >>> others are, but I know the builds pick up the environment. > >>> > >>> The DITA toolkit actually uses Ant to build documentation=20 > in various > >>> formats: html, help formats and PDF. So there's no=20 > software compiling at > >>> all. (This might also explain why I'm asking basic=20 > questions! ;-) ) > >>> > >>> Whilst pondering this, it begged the question about=20 > whether ANT_HOME > >>> ought > >>> to be in .antrc or ant.conf, or not. If you've modified=20 > the system path > >>> in > >>> some way, or used symlinks on *nix, so that Ant can be called from > >>> anywhere, > >>> then it's probably a good idea to define ANT_HOME in one=20 > or other of > >>> these > >>> files. > >>> > >>> However, if you're running a batch script which sets the=20 > path at run > >>> time, > >>> then that might set up ANT_HOME as part of the process of=20 > setting up the > >>> Ant > >>> environment before calling Ant. In which case, it would=20 > be superfluous! > >>> > >>> Many thanks, > >>> David > >>> > >>> > >>>> On Tue, May 20, 2008 at 3:05 AM, David J. B. Hollis > >>>> wrote: > >>>>> > >>>>> I've ended up with this in an ant.conf file: > >>>>> > >>>>> #!/bin/sh > >>>>> > >>>>> DITA_HOME=3D~/DITA-OT1.4.2.1 > >>>>> DITA_HOME=3D`cd "$DITA_HOME" && pwd` > >>>>> > >>>>> #export ANT_HOME=3D"$DITA_HOME"/tools/ant > >>>>> export ANT_HOME=3D/Developer/Java/Ant > >>>>> export ANT_OPTS=3D"-Xmx512m" > >>>>> export ANT_ARGS=3D"-lib $DITA_HOME/lib -Ddita.dir=3D$DITA_HOME" > >>>>>> > >>>>> Are you saying I don't need to export any of these? I=20 > can just define > >>>>> them? > >>>> > >>>> The ANT_HOME, DITA_HOME, ANT_OPTS, and ANT_ARGS will be available > >>>> throughout the whole /usr/bin/ant shell script where=20 > they are used to > >>>> start a Java process that executes Ant. If these=20 > variables are only > >>>> used for starting up Ant, they do not need to be exported. > >>>> > >>>> However, once that Java process starts up, these=20 > environment variables > >>>> won't be available. So, they will not be available in your Java > >>>> process NOR (more importantly) in your build.xml file.=20 > That also means > >>>> any environment variables that you're depending upon for=20 > your > >>>> or tasks will only be available if exported. > >>>> > >>>> -- > >>>> David Weintraub > >>>> qazwart@gmail.com > >>> > >>>=20 > --------------------------------------------------------------------- > >>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org > >>> For additional commands, e-mail: user-help@ant.apache.org > >>> > >>> > >> > >> > >> > >> -- > >> -- > >> David Weintraub > >> qazwart@gmail.com > >> > >>=20 > --------------------------------------------------------------------- > >> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org > >> For additional commands, e-mail: user-help@ant.apache.org > >> > > > > > >=20 > --------------------------------------------------------------------- > > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org > > For additional commands, e-mail: user-help@ant.apache.org > > > > >=20 >=20 >=20 > --=20 > -- > David Weintraub > qazwart@gmail.com >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org > For additional commands, e-mail: user-help@ant.apache.org >=20 >=20 --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org