Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 52563 invoked from network); 31 Dec 2003 18:53:59 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 31 Dec 2003 18:53:59 -0000 Received: (qmail 29381 invoked by uid 500); 31 Dec 2003 18:53:38 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 29352 invoked by uid 500); 31 Dec 2003 18:53:38 -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 29324 invoked from network); 31 Dec 2003 18:53:37 -0000 Received: from unknown (HELO agamemnon.xo.com) (207.155.252.38) by daedalus.apache.org with SMTP; 31 Dec 2003 18:53:37 -0000 Received: from toshi (w107.z066088159.san-ca.dsl.cnc.net [66.88.159.107]) by agamemnon.xo.com id NAA26614; Wed, 31 Dec 2003 13:53:41 -0500 (EST) [ConcentricHost SMTP Relay 1.16] Errors-To: Reply-To: From: "didge" To: "Ant Users List" Subject: cygpath task Date: Wed, 31 Dec 2003 10:53:51 -0800 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) X-MIMEOLE: Produced By Microsoft MimeOLE V5.50.4927.1200 Importance: Normal 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 Folks, The $ANT_HOME/bin/ant shell script automatically converts a number of paths from cygwin to windows when executed in a cygwin shell, including JAVA_HOME, CLASSPATH, ANT_HOME, and CYGHOME. However, there are often paths defined in my cygwin shell that also need to be converted. To this end, I've written a task to convert cygwin paths to windows paths, but only when executed in a cygwin shell. Below is a detailed description and example. Is this something of general interest to ant users? It works like this: where [properties] is a comma separated list of properties containing simple or compound cygwin paths. The value of each property is converted in place. Here is an example that demonstrates the task with both a simple and a compound path: Here is the output after running it: Buildfile: build.xml cygpath: [echo] before cygpath: [echo] somepath0='/cygdrive/c/foo' [echo] somepath1='/cygdrive/c/bar:/cygdrive/c/oof' [echo] after cygpath: [echo] somepath0='c:\foo' [echo] somepath1='c:\bar;c:\oof' BUILD SUCCESSFUL A couple of other notes: - Cygpath modifies the value of the user properties given to it. - Cygpath only executes when run in a cygwin shell. If run from a dos shell or a non-cygwin unix shell, Cygpath does nothing. Detection of the cygwin shell is based on the property cygwin.user.home being defined by the $ANT_HOME/bin/ant script. If this property is not defined, then Cygpath is effectively a no-op. - Cygpath delegates the actual conversion to the cygpath executable, so cygpath must be in your PATH. --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org