Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 4048 invoked from network); 22 May 2008 05:03:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 May 2008 05:03:52 -0000 Received: (qmail 63615 invoked by uid 500); 22 May 2008 05:03:50 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 63582 invoked by uid 500); 22 May 2008 05:03: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 63570 invoked by uid 99); 22 May 2008 05:03:50 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 May 2008 22:03: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 (athena.apache.org: domain of qazwart@gmail.com designates 72.14.220.157 as permitted sender) Received: from [72.14.220.157] (HELO fg-out-1718.google.com) (72.14.220.157) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 May 2008 05:03:00 +0000 Received: by fg-out-1718.google.com with SMTP id 16so2639345fgg.22 for ; Wed, 21 May 2008 22:03:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=JQR2mufTvNbtZHhGrLpkcfzYeUATHipR8v3sR3imIhU=; b=f2efoQjqV74JC2ubGkAwfapnlKgAjMHhTsqQlwfPccbVr80zDLch2Nvtpz9dZNYLU2hu7ucioO8LiyaYmYtf4FjJOl5SNSsNbj36Yk80dTAb6cJ8Es7h+Eh7EsEm3DIzAfTsUtdmLT2c5mYd3MoRUpF+kwwuGQbqW0S8iy2SpoU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=TchfLi3ixqbk0ztDmpXRr8kaqza3XW071FPglyYLhQ6rjTes5P7/Fqr4wt9i6fO74Jq2e1U9Q5obUmGwtruP2/m2k3BYaqts/FLD/9oWZmCEKocfP1GC4U4BBr3whp6QaiaxVJwcyhTjPbHTQG/6y5XL4j41JyQGSQgXyDDl328= Received: by 10.82.189.9 with SMTP id m9mr119105buf.25.1211432594766; Wed, 21 May 2008 22:03:14 -0700 (PDT) Received: by 10.82.176.9 with HTTP; Wed, 21 May 2008 22:03:14 -0700 (PDT) Message-ID: Date: Thu, 22 May 2008 01:03:14 -0400 From: "David Weintraub" To: "Ant Users List" Subject: Re: AW: antrc & ant.conf files In-Reply-To: <5BC8F23E-57E5-422B-BF04-230837A514A1@AandOConsultancy.ltd.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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> X-Virus-Checked: Checked by ClamAV on apache.org 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: . somefile.sh 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. 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. $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 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 ANT_LIB gets >> set. >> >> Note that the shell script will assume ANT_HOME will be 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=/usr/local/ant >> fi >> >> You can pass unexported environment variables in ANT by using the >> following: >> >> ant -Dmy.variable=$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 used in the Ant >>> builds. But it's passed as parameter dita.dir. Obviously anything on >>> ANT_ARGS is passed, so ought not need exporting as well. 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 in various >>> formats: html, help formats and PDF. So there's no software compiling at >>> all. (This might also explain why I'm asking basic questions! ;-) ) >>> >>> Whilst pondering this, it begged the question about whether ANT_HOME >>> ought >>> to be in .antrc or ant.conf, or not. If you've modified 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 or other of >>> these >>> files. >>> >>> However, if you're running a batch script which sets the path at run >>> time, >>> then that might set up ANT_HOME as part of the process of setting up the >>> Ant >>> environment before calling Ant. In which case, it would 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=~/DITA-OT1.4.2.1 >>>>> DITA_HOME=`cd "$DITA_HOME" && pwd` >>>>> >>>>> #export ANT_HOME="$DITA_HOME"/tools/ant >>>>> export ANT_HOME=/Developer/Java/Ant >>>>> export ANT_OPTS="-Xmx512m" >>>>> export ANT_ARGS="-lib $DITA_HOME/lib -Ddita.dir=$DITA_HOME" >>>>>> >>>>> Are you saying I don't need to export any of these? I 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 they are used to >>>> start a Java process that executes Ant. If these variables are only >>>> used for starting up Ant, they do not need to be exported. >>>> >>>> However, once that Java process starts up, these environment variables >>>> won't be available. So, they will not be available in your Java >>>> process NOR (more importantly) in your build.xml file. That also means >>>> any environment variables that you're depending upon for your >>>> or tasks will only be available if exported. >>>> >>>> -- >>>> David Weintraub >>>> qazwart@gmail.com >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org >>> For additional commands, e-mail: user-help@ant.apache.org >>> >>> >> >> >> >> -- >> -- >> David Weintraub >> qazwart@gmail.com >> >> --------------------------------------------------------------------- >> 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 > > -- -- David Weintraub qazwart@gmail.com --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org