Thank you!  This worked a treat.  Seems fairly obvious now ...


----Original Message Follows----
From: Diane Holt <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Re: basedir attrib of project tag unsettable with property set on 
command line.
Date: Fri, 31 Aug 2001 08:08:11 -0700 (PDT)
MIME-Version: 1.0
Received: from [64.125.133.20] by hotmail.com (3.2) with ESMTP id 
MHotMailBD58F394005F4004371F407D851413330; Fri, 31 Aug 2001 08:09:08 -0700
Received: (qmail 67610 invoked by uid 500); 31 Aug 2001 15:08:10 -0000
Received: (qmail 67578 invoked from network); 31 Aug 2001 15:08:09 -0000
>From ant-user-return-12100-gibgob_m Fri, 31 Aug 2001 08:09:39 -0700
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
Precedence: bulk
List-Post: <mailto:[EMAIL PROTECTED]>
List-Help: <mailto:[EMAIL PROTECTED]>
List-Unsubscribe: <mailto:[EMAIL PROTECTED]>
List-Subscribe: <mailto:[EMAIL PROTECTED]>
Delivered-To: mailing list [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
In-Reply-To: <[EMAIL PROTECTED]>
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N

In order to set "basedir" from the command-line, you need to not include
the attribute in the <project> tag -- ie:
   <project name="My Project" default="buildall">
then pass -Dbasedir=%MY_HOME%

Diane

--- Mark Gibson <[EMAIL PROTECTED]> wrote:
 > Can anyone help?
 >
 > I am trying to set the basedir project attribute with a property that is
 >
 > passed in on the command line.  The property is recognised from within
 > tasks
 > of this project, but does not get recognised within the <project> tag.
 >
 > Script (Make.bat) :
 >
 > SET MY_HOME=C:\MyHome
 > java -Dant.home="%ANT_HOME%" org.apache.tools.ant.Main -buildfile
 > %MY_HOME%\bin\build.xml -Dmy.home=%MY_HOME% %1 %2 %3 %4 %5 %6 %7 %8 %9
 >
 >
 > build.xml file :
 >
 > <project name="My Project" default="buildall" basedir="${my.home}">
 >   <property environment="env"/>
 >   <property name="classpath" value="${env.CLASSPATH}"/>
 >
 >   <target name="init">
 >     <echo message="basedir is ${basedir}"/>
 >     <echo message="my.home is ${my.home}"/>
 >   </target>
 > </project>
 >
 >
 > Output from running make file (make init) :
 >
 > Buildfile: c:\MyHome\bin\build.xml
 > init:
 >      [echo] basedir is C:\MyHome\bin\${my.home}
 >      [echo] my.home is c:\MyHome
 >
 >
 >
 > Is this exepected behaviour or a bug?  Is there a work around.  Any help
 > is
 > greatly appreciated.
 >
 > Mark
 >
 > _________________________________________________________________
 > Get your FREE download of MSN Explorer at
 > http://explorer.msn.com/intl.asp
 >


=====
([EMAIL PROTECTED])



__________________________________________________
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger
http://im.yahoo.com


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp

Reply via email to