ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rebhan, Gilbert" <Gilbert.Reb...@huk-coburg.de>
Subject RE: Ant <script> tag query
Date Wed, 01 Dec 2004 16:47:46 GMT

Hi, how to talk to those properties that are already set
by default (user,os ... etc.) via script task ?

f.e. =

...

importPackage(java.io);
       var outfile = new PrintWriter(new FileWriter("test.txt"));
 	
	// here i want the user	
        outfile.println("${user}"); <- not working

...

Regards,
        Gilbert



-----Original Message-----
From: Jan.Materne@rzf.fin-nrw.de [mailto:Jan.Materne@rzf.fin-nrw.de]
Sent: Wednesday, December 01, 2004 1:04 PM
To: user@ant.apache.org
Subject: AW: Ant <script> tag query


write
   close()
instead of 
   close

Jan

> -----Urspr√ľngliche Nachricht-----
> Von: Alex Feseto [mailto:alex@smoothwall.net]
> Gesendet am: Mittwoch, 1. Dezember 2004 12:53
> An: user@ant.apache.org
> Betreff: Ant <script> tag query
> 
> Hi, I'm trying to write to a file using the <script> tag...
> 
> Everything config-wise is set up correctly (js.jar et al) and the 
> following snippet executes no problem.
> 
> However, the resultant "outfile" is blank.
> 
> 
> <project name="MyProject" basedir="." default="main">
>    <target name="main">
>      <script language="javascript"> <![CDATA[
> 
>        importPackage(java.io);
>        var outfile = new PrintWriter(new FileWriter("test.txt"));
> 		
>        outfile.println("Testing1");
>        outfile.println("Testing2");
>        outfile.close;
> 				
>      ]]></script>
>    </target>
> </project>
> 
> 
> Apologies if this is an obvious question, but I'm quite stuck!
> 
> Any help would be greatly appreciated.
> 
> 
> -- 
> Regards,
> 
> Alex Feseto
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 

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


Mime
View raw message