Trying to write to a file using the <script> tag. The following snippet executes but my resultant output file is blank.
Everything config-wise for running script is set up correctly (js.jar et al)...
<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>
Anyone any idea? Much appreciated.
Alex Feseto
Everything config-wise for running script is set up correctly (js.jar et al)...
<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>
Anyone any idea? Much appreciated.
Alex Feseto