You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Harry_ <ha...@gmail.com> on 2009/12/08 14:48:56 UTC

Script task not working

Hi,

I have created following Script task and it is not working on Ant version
1.6.5 but is working on 1.7.1. I added js.lib specified as library
dependency for this task on 1.6.5 but it is still not working. 

<script language="javascript">
                                    <![CDATA[
                                            var spikeID =
project.getProperty("spikeID");
                                            var threads =
project.getProperty("threads");
                                            var
numberOfThreadsForCurrentSpike = threads * Math.pow(2,spikeID-1);
                                           
project.setProperty("numberOfThreadsForCurrentSpike",
numberOfThreadsForCurrentSpike);
                                    ]]>
                                </script>

It is working fine on 1.7.1... Does ant support this task as core task by
default in 1.7.1 as I do not have js.jar on machine having 1.7.1.

I do not have access privilege to change ant on machine with version 1.6.5
but can add lib files. So can anyone help me with this. I am stuck.

Thanks and Regards
-- 
View this message in context: http://old.nabble.com/Script-task-not-working-tp26694129p26694129.html
Sent from the Ant - Users mailing list archive at Nabble.com.


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


Re: Script task not working

Posted by Harry_ <ha...@gmail.com>.
Thanks Stefen!


Stefan Bodewig wrote:
> 
> On 2009-12-08, Harry_ <ha...@gmail.com> wrote:
> 
>> It is working fine on 1.7.1... Does ant support this task as core task by
>> default in 1.7.1 as I do not have js.jar on machine having 1.7.1.
> 
> The script task in Ant 1.6.5 uses Apache BSF as its sole scripting
> engine, with Ant 1.7.x we added support for javax.script which ships
> with Java 1.6.
> 
> You are most probably running Java 6 which includes a version of rhino
> and thus have all external dependencies needed by your script task for
> Ant 1.7.1.  For Ant 1.6.5 you will need Apache BSF (2.x) in addition to
> js.jar.
> 
> Stefan
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Script-task-not-working-tp26694129p26711462.html
Sent from the Ant - Users mailing list archive at Nabble.com.


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


Re: Script task not working

Posted by Stefan Bodewig <bo...@apache.org>.
On 2009-12-08, Harry_ <ha...@gmail.com> wrote:

> It is working fine on 1.7.1... Does ant support this task as core task by
> default in 1.7.1 as I do not have js.jar on machine having 1.7.1.

The script task in Ant 1.6.5 uses Apache BSF as its sole scripting
engine, with Ant 1.7.x we added support for javax.script which ships
with Java 1.6.

You are most probably running Java 6 which includes a version of rhino
and thus have all external dependencies needed by your script task for
Ant 1.7.1.  For Ant 1.6.5 you will need Apache BSF (2.x) in addition to
js.jar.

Stefan

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