ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Mynsted" <MMYNS...@VHA.COM>
Subject Re: Call for patches
Date Tue, 23 May 2000 16:57:21 GMT
I hate to ask this here (I know this is the wrong place), but who do I talk with when the FAQ
registration process breaks down?  (I never received my "special" number so can not ask questions
in the FAQ.)  Yes, I registered with a valid email.  (mmynsted@vha.com) 


Sincerely yours;

Mark Mynsted



VHA Management Information Systems Client Services
mmynsted@vha.com
(972) 830 - 0592, Internal x1592

http://www.lotus.com

>>> "Eugene Bekker" <ebekker@powervision.com> 5/23/2000 11:01:45 AM >>>
I didn't notice the SCRIPT task, but that may be because I use an older
version of Ant that doesn't come with a lot of the recent optional tasks.

One thing to note, in my implementation I actually support script blocks in
terms of processing instructions (PI) instead of as <script> tags, because
it allows me to use the <, >, and & characters in the code without having
to escape them.  For example:

<?script
  var foo = 1;
  var bar = 2;
  var cond = (foo < bar) && (bar - foo > 0);
?>

instead of writing:

<script>
  var foo = 1;
  var bar = 2;
  var cond = (foo &lt; bar) &amp;&amp; (bar - foo &gt; 0);
</script>

To support the language attribute in your example, you could simply use a
composite PI tag like
  <?script:JavaScript  ... ?>

Finally, I exported into the JavaScript engine a couple of objects that
allows me to interface back and forth such as sysin, sysout, and syserr
which map to System.in, .out, and .err respectively, and sysprops which
maps to the Properties object from System.getProperties().  So something
similar can be done to interface to targets, tasks, and properties.


Stefan Bodewig wrote:
> 
> >>>>> "EB" == Eugene Bekker <ebekker@powervision.com> writes:
> 
>  EB> I notice there are more and more requests to beef up the logic
>  EB> support for tasks, like IFNOT and multiple IFs.  One thing to
>  EB> consider is to drop in an existing logic parser, that would allow
>  EB> nested and more complicated boolean statements, such as Mozilla's
>  EB> Rhino JavaScript engine.
> 
> Did you notice the optional script task? It uses BSF as its framework
> and Rhino amongst others is supported by it.
> 
> Probably using scripts would make a lot of the conditional compilation
> stuff easier. Let's assume that project properties, targets and tasks
> are exposed to the scripting language in some way, so you could write
> 
> <script language="JavaScript">
>     target["targetid"].setCondition(cond1 || (cond2 && !cond3));
> </script>
> 
> where cond1 may have been calculated by other tasks executed before
> this one or set by command line properties or ...
> 
> The drawback of this is that Ant would start to depend on BSF (or any
> other scripting framework for that matter).
> 
> Stefan

-- 
Eugene Bekker
Chief Architect
PowerVision Corporation
http://www.powervision.com 
tel://410/312.7243 cel://443/838.6330



Mime
View raw message