ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan.Mate...@rzf.fin-nrw.de
Subject AW: Ant <script> tag query
Date Thu, 02 Dec 2004 09:17:53 GMT
Default properties are Ant simple properties, but only set
by Ant on start time. You can access all Ant properties via
Project class and getProperty(propname) method.

<script language="javascript">
  user = project.getProperty("user.name");
  java.lang.System.out.println(user);
</script>


Jan

> -----Urspr√ľngliche Nachricht-----
> Von: Ivan Ivanov [mailto:rambiusparkisanius@yahoo.com]
> Gesendet am: Mittwoch, 1. Dezember 2004 18:03
> An: Ant Users List
> Betreff: RE: Ant <script> tag query
> 
> <project name="MyProject" basedir="." default="main">
>    <target name="main">
>      <script language="javascript"> <![CDATA[
> 
>        importPackage(java.io);
>        importPackage(java.lang);
>        var outfile = new PrintWriter(new
> FileWriter("test.txt"));
> 
>        outfile.println("" +
> System.getProperty("user.name"));
>        outfile.println("" +
> project.getProperty("ant.version"));
>        outfile.close();
> 				
>      ]]></script>
>    </target>
> </project>
> 
> 
> --- "Rebhan, Gilbert" <Gilbert.Rebhan@huk-coburg.de>
> wrote:
> 
> > 
> > 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
> > 
> > 
> > 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message