ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim White <>
Subject Re: converting a file reference to a URL
Date Mon, 17 Sep 2001 01:43:28 GMT
At 08:15 PM 9/16/2001 -0400, David Jordan wrote:
>I have a file/directory in my build directory (or subdirectory)
>and I would like to convert this to a valid URL.
>I am running on Windows.
>Whenever you use a directory in Ant, it converts it to the
>underlying OS representation (which uses backslash).
>But I want to execute a Java program that expects a URL,
>which uses forward slashes between directory names.
>How do you do this in ant?

I've been using JavaScript (Rhino) to do that:

       <script language="javascript">
          var v = xdrive_setup.getProperty("dist");
          // Change '\' in path to '/' in case this is Windows.
          v = v.split("\\").join("/");
          xdrive_setup.setProperty("server-windows-url", "file:/" + v + 
          xdrive_setup.setProperty("server-unix-url", "file://" + v + 

Note that one of the cool things you can do is get a path from it's id:

      <script language="javascript">
          // Get the list of path elements as an array.
          var jarlist = 
          // Join the array strings with a comma seperator and set the 
          var jars = jarlist.join(',');
          // Change '\' in path to '/' in case this is Windows.
          var jars = jars.split("\\").join("/")
          xdrive_setup.setProperty("weblogic.ejb.deploy", jars);

>Is it possible to kick off several tasks or <java> commands
>in parallel? Just listing two <java> in a target runs them serially.

That is available in Ant 1.4 as the Parallel task


James P. White                 Netscape DevEdge Champion for IFC
IFC Exchange   *   Insanely great Java   * Pagesmiths' home is

View raw message