ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul, R. Chip" <>
Subject RE: Best means to create a Windows cmd file from ant
Date Thu, 05 Feb 2004 15:42:06 GMT
How about using a template file and having ant substitute parameters that
may change into the template?

See the <filter> and <copy> tasks in the ant docs.

Chip Paul
Sr Software Engineer
ComFrame Software Corporation

-----Original Message-----
From: coluf [] 
Sent: Wednesday, February 04, 2004 10:04 PM
Subject: Best means to create a Windows cmd file from ant

I wish to create a script file for Windows, that is, a .cmd file to start my
java project.  

It makes sense to create the file from within ant so any changes to the
class path are reflected in the script.

But what is the best way to create a Windows script file from within ant?
Using <echo> does not terminate the end-of-lines for Windows correctly (must
default for unix?).

An extract from my ant script...

   <target name="dist" depends="init, jar">
      <pathconvert targetos="windows" property="dist.libs"
      <echo file="${dist.bin}/${corename}.cmd">@echo off
         set classpath=${jar.filename};${dist.libs}
         java ${main.class} -cp %classpath%

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message