You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bu...@apache.org on 2004/01/31 10:37:04 UTC

DO NOT REPLY [Bug 26563] - Scriptdef task doesn't handle the nested elements properly

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26563>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26563

Scriptdef task doesn't handle the nested elements properly

conor@cortexebusiness.com.au changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WORKSFORME



------- Additional Comments From conor@cortexebusiness.com.au  2004-01-31 09:37 -------
Ant always passes nested elements as an ArrayList regardless of the number of
actual elements. I tried with the latest beanshell and bsf and this can be
verified by printing the type of fs in your script. I added this line to your
script.

System.out.println("Type of fs = " + fs.getClass().getName());

Note, however, that your script has an error.

In the line 
System.out.println(incfile[i]);

the variable you refer to is incfile, but the array you have extracted is
incfiles. This does give an error about " Not an array", which is essentially
correct. Spare me from implicit declaration languages :-)

It can be hard to track down script errors since they are embedded in an ant
script and the line numbers are hard to interpret. When I corrected the error
above, I got the following output 

D:\development\apache\ant-bugs\26563>ant test1
Buildfile: build.xml

test1:
[scanandrunscript] Type of fs = java.util.ArrayList
[scanandrunscript] scripts\group1\test1.bsh

BUILD SUCCESSFUL
Total time: 1 second
D:\development\apache\ant-bugs\26563>ant test2
Buildfile: build.xml

test2:
[scanandrunscript] Type of fs = java.util.ArrayList
[scanandrunscript] scripts\group1\test1.bsh
[scanandrunscript] scripts\group2\test2.bsh

BUILD SUCCESSFUL
Total time: 2 seconds

Note that I had to change the script around since my dirs are not the same as
your's, of course. Note also that bsh may not find your scripts unless the names
are relative to current dir - i.e. I had to set my fileset's basedir to "."

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