Just released As2ant 2.0 (Apache Ant Tasks for Flash). Best new feature is the unit test task. It executes a unit test swf and prints the result directly to the console (command line, eclipse console, …). As2lib Unit Test and AsUnit are directly supported, but you may plug-in any other unit testing framework. An As2lib sample is included in the distribution.
Complete list of changes:
[+] org.as2lib.ant.UnitTest
Added task to execute unit tests. As2lib Unit Test and AsUnit are directly supported.
[!] org.as2lib.ant.Mtasc
Detects and removes duplicate source files which are very likely when bean definition xml files are used as source files.
[+] org.as2lib.ant.Mtasc
Added new argument: ‘packset’. This argument can be used to include multiple packages based on name patterns (analogous to ’srcset’).
[+] org.as2lib.ant.Mtasc
Added support for wimp-flag (turns warnings for unused imports on)
[+] org.as2lib.ant.Mtasc
Added namespace support for xml source files (according to the As2lib Application Context specification)
Hope you enjoy this major release. ![]()

7 Responses to “As2ant 2.0 with Unit Test Task”
thank you Simon!!
A question: When will the new realease of as2lib be released?
We are currently working on support for proper internationalization (MessageFormat, NumberFormat, DateFormat). This will take at least three more weeks. The As2lib Chat sample of the last post contains a SVN snapshot (http://www.simonwacker.com/uploads/flash/as2lib/as2lib_chat_0.9.zip). You may also check-out the latest developments from the SVN repository (http://sourceforge.net/svn/?group_id=94206). It is not an official release but it is as stable as release 0.9.3.
Greetings,
Simon
Hi
AS2Ant is really cool and powerfull. But one question : I didn’t find the way to compile multiple file at the same time. How would you translate this mtasc command line in AS2Ant?
mtasc -header 20:20:20:999999 -swf test.swf -group Test.as Test2.as
What do I put for src in :
mtasc_task mtasc=”${mtasc}” src=”????????” swf=”${build.dir}/classes.swf” group=”true” header=”${width}:${height}:${framerate}:${bgcolor}”
Thanks
Oups… didn’t read the doc… I got it with “srcdir”.
Thanks again
Hi Rod,
as you have already found out, a glance at the class documentation of the used task does help in most cases. Every class documentation of a task contains a list of available arguments which are directly linked to the corresponding methods which explain the usage in more detail.
There are four arguments for specifying sources: src (one source only; mostly the class with the main method), srcdir (one or multiple source directories; subdirectories are also included), srcset (lets you include sources based on patterns with wildcards) and srcxml (includes classes that are read from As2lib Application Context bean definition xml files).
Greetings,
Simon
Hi Simon,
Today, I upgraded as2ant to 2.0, and try with an old project I must to retouch. I was having the following error when running MTASC task:
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
I try to isolate the error and this happens when I use the “trace” atribute (for example: trace=”no”).
Do you know if is something I’m missing or is a bug in the current 2.0?
Thanks :).
C.
Hi Carlos,
thanks for the report. I’ve fixed it in the SVN repository. So it will work again in the next release (this weekend).
I added a new feature that includes the class specified in the trace-argument as compile file (if not included already), and forgot that trace can also be “no”.
Greetings,
Simon