Return-Path: X-Original-To: apmail-ant-user-archive@www.apache.org Delivered-To: apmail-ant-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 96E68B6B3 for ; Thu, 12 Jan 2012 16:09:48 +0000 (UTC) Received: (qmail 5765 invoked by uid 500); 12 Jan 2012 16:09:47 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 5281 invoked by uid 500); 12 Jan 2012 16:09:40 -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 5255 invoked by uid 99); 12 Jan 2012 16:09:39 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Jan 2012 16:09:39 +0000 X-ASF-Spam-Status: No, hits=0.7 required=5.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [88.84.128.168] (HELO samaflost.de) (88.84.128.168) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Jan 2012 16:09:31 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by samaflost.de (Postfix) with ESMTP id AC5BE289800B for ; Thu, 12 Jan 2012 17:09:10 +0100 (CET) Received: from samaflost.de ([127.0.0.1]) by localhost (v35516.1blu.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fWVqZRvYz8Dt for ; Thu, 12 Jan 2012 17:09:09 +0100 (CET) Received: by samaflost.de (Postfix, from userid 1000) id 5B7442898012; Thu, 12 Jan 2012 17:09:09 +0100 (CET) From: Stefan Bodewig To: user@ant.apache.org Subject: Re: One Ant buildfile calling its subdir buildfile, how to change the base dir? References: <1326312356056-5137885.post@n5.nabble.com> Date: Thu, 12 Jan 2012 17:09:09 +0100 In-Reply-To: <1326312356056-5137885.post@n5.nabble.com> (xsli2@yahoo.com's message of "Wed, 11 Jan 2012 12:05:56 -0800 (PST)") Message-ID: <87hb00rjh6.fsf@v35516.1blu.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Checked: Checked by ClamAV on apache.org On 2012-01-11, xsli2 wrote: > > > > > > > > > Inside MyTest.java, I added this print out: > final String currentDir = new File(".").getAbsolutePath(); > System.out.println("currentDir=" + currentDir); Ant's basedir and the running Java process' current working directory are not the same thing. When you use an task you only change the basedir but not the current working directory. To do that, you'd have to fork the Java/JUnit process so it is running in a fresh Java VM. Stefan --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org