ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul, R. Chip" <ROY.C.PAUL....@saic.com>
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
 
Listen.Understand.Innovate
www.comframe.com



-----Original Message-----
From: coluf [mailto:coluf@hotmail.com] 
Sent: Wednesday, February 04, 2004 10:04 PM
To: user@ant.apache.org
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"
refid="build.classpath"/>
      <echo file="${dist.bin}/${corename}.cmd">@echo off
         setlocal
         set classpath=${jar.filename};${dist.libs}
         java ${main.class} -cp %classpath%
      </echo>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message