Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 8691 invoked from network); 23 Feb 2004 19:47:24 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 23 Feb 2004 19:47:24 -0000 Received: (qmail 64734 invoked by uid 500); 23 Feb 2004 19:47:06 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 64693 invoked by uid 500); 23 Feb 2004 19:47:05 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 64674 invoked from network); 23 Feb 2004 19:47:05 -0000 Received: from unknown (HELO relay.t-online-com.de) (62.156.147.74) by daedalus.apache.org with SMTP; 23 Feb 2004 19:47:05 -0000 Received: from antbuild.com (internet-cafe-167.sapinternetcafe.de [155.56.24.167]) by relay.t-online-com.de (SMTPSVC(1.0.0.2)) with ESMTP id B016614CA71 for ; Mon, 23 Feb 2004 20:23:18 +0100 (CET) Message-ID: <403A5838.6090403@antbuild.com> Date: Mon, 23 Feb 2004 20:44:56 +0100 From: =?ISO-8859-1?Q?Antoine_L=E9vy-Lambert?= User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ant Users List Subject: Re: calling another build file, changing directory References: In-Reply-To: X-Enigmail-Version: 0.82.4.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Mark Lybarger wrote: >i have two ant scripts, one which calls the other. the problem is that in build.test.xml, it's using a property of basedir = ".". this doesn't work out so nicely if the user isn't "in" the folder the build.test.xml is in. is there a way to cd into a folder or somesuch with the ant call? > > > Hi Mark, The principle is that ant's default basedir is the directory where the build.xml file which you are executing resides. basedir="." is a way of explicitly confirming this default setting. *There is no cd task in ant.* To get a full path out of a relative path, if you need this, you can use the construct if you do this and the basedir of your build file is in /home/mark, then the foo.dir will be resolved to /home/mark/foo/bar Most of the file attributes, are declared in the Java source code of ant of type file and resolve relative to the base dir of the build file they are in. Unfortunately, the ant task has a String argument for the setAntfile method. Because of this, resolving with the location of your build file will help you. I wonder whether other committers would consider this behavior a bug, and would be willing to add a new method Ant#setAntfile(File antfile) to Ant.java. The effect would be to solve this issue for everyone, while leaving API users happy of still being able to call setAntfile(String file) Cheers, Antoine >build.xml >testing\build.test.xml > > > > > > > > > > > > > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org