Introduction

cheap cialis pill certified cialis cheap viagra in canada cialis buy drug buy generic cialis viagra buy 25mg viagra cheap viagra without prescription buy cheapest viagra on line purchase viagra cialis 10mg buying generic viagra cialis pills viagra from india cheapest sildenafil citrate cheap cialis no rx viagra india cialis bangkok viagra for order buy sildenafil internet buy generic viagra online buying cialis online where to order cialis tablet cialis find cialis no prescription required viagra cheap drug order cialis cheap online online pharmacy cialis cialis no rx order generic cialis price of cialis viagra soft drug viagra cheap viagra from uk order cialis no prescription order cheap viagra viagra drug order cheap cialis cheap cialis pharmacy best price for viagra cheap viagra from usa cost cialis cialis overnight shipping cheapest generic cialis online generic viagra online online viagra viagra sales cheap cialis in canada compare cialis prices online cialis online drug viagra online purchase discount cialis without prescription no rx viagra cialis overnight viagra uk cialis order cheap cialis from usa buying cialis cialis overnight delivery cialis in bangkok buy and purchase sildenafil online impotence treatment cheap price viagra viagra sale cheap cialis tablet drug cialis generic cialis online cheap viagra pharmacy find discount cialis online viagra malaysia cialis without a prescription buy cialis online cheap viagra rx buy no rx viagra cialis 20mg viagra in malaysia discount viagra online buy sildenafil cheap buy viagra low price buy cialis cialis cheap price cialis cheap generic viagra cialis canada low cost viagra buy cheap viagra cialis vs viagra order cialis from us cialis tablets find no rx cialis buy generic cialis online buy viagra overnight delivery cheapest cialis price buy cheapest cialis on line order cialis in canada viagra tablet viagra no online prescription find cheap cialis online viagra price order viagra no prescription cheap generic cialis buy viagra online cheap cialis uk cialis without rx generic cialis cheap viagra vs cialis order cialis on internet viagra tablets viagra purchase impotence drugs buy cialis generic cialis tablet cialis cheapest price order viagra from canada viagra generic cheap viagra from canada order cialis compare viagra prices online find cheap cialis impotence cure pfizer viagra find discount cialis cheapest cialis buy cialis from india impotence buy cheapest viagra online cialis side effects viagra order discount cialis online cialis in malaysia cialis in uk viagra in uk cialis online without prescription cialis online pharmacy order viagra buy viagra online viagra side effects cialis sale discount cialis no rx cheapest viagra find cialis order cialis no rx buy cialis low price buy viagra cheap drug cialis online purchase order discount viagra online 50 mg viagra 100 mg viagra 10mg cialis cost of cialis cheapest cialis prices buy discount viagra online cialis sales 50mg viagra cialis price buy viagra on internet cialis pill cheapest cialis online purchase viagra overnight delivery cheap cialis from canada cheapest viagra price cialis 20 mg buy sildenafil low cost order viagra without prescription buy viagra lowest price no prescription cialis order viagra on internet discount cialis overnight delivery cialis cheap drug viagra approved viagra no rx required compare viagra prices no rx cialis cheap cialis on internet buy viagra from india buy discount cialis online viagra pharmacy online order viagra from us cialis free delivery cialis for order buy cialis from canada viagra without rx viagra online review 10 mg cialis cheap viagra no rx cheapest viagra prices viagra prices cialis pharmacy order no rx cialis buy cialis in us buy cialis no prescription required order cialis from canada lowest price cialis cheap cialis internet online pharmacy viagra cheapest generic cialis generic drugs cialis india find cialis without prescription best price cialis buy viagra without prescription cheap cialis in uk where to buy viagra 20 mg cialis cheap cialis from uk buy sildenafil canada cialis no rx required cialis in us buy cialis overnight delivery cialis cheap price order cheap viagra online 20mg cialis buy cheap viagra online viagra internet viagra without prescription free cialis buy cialis us cialis buy buy viagra in canada order viagra cheap online find viagra without prescription viagra pills cheap cialis no prescription viagra online without prescription order generic viagra cialis discount viagra cheapest price purchase viagra no rx viagra no rx viagra cheap discount viagra overnight delivery sale cialis cialis pharmacy online purchase cialis without prescription pharmacy online cialis medication discount viagra buy cheap cialis impotence medication viagra medication find cialis on internet impotence pills cialis prices discount viagra without prescription cialis online cheap cialis online review find cheap viagra online buy viagra us purchase cialis online certified viagra where to order viagra buy cheapest viagra buy cialis internet order cialis online buy sildenafil online buy cialis cheap cheap viagra purchase cialis find discount viagra buy cialis on internet cialis buy online buy sildenafil online without a prescription viagra buy online order cheap cialis online viagra information no prescription viagra cost of viagra buy cialis in canada buy cialis online buy viagra cheapest generic viagra cialis us cialis australia fda approved cialis lowest price for viagra viagra bangkok cialis prescription cialis cost buy no rx cialis buy viagra internet viagra discount order viagra overnight delivery generic cialis viagra australia 25 mg viagra order viagra online viagra overnight cialis rx order cialis in us order viagra no rx order discount cialis online viagra vendors order viagra in us buy sildenafil in uk viagra us buy generic viagra viagra canada viagra no prescription viagra cheap price cheap viagra tablet viagra free delivery overnight viagra purchase viagra online find cheap viagra cialis malaysia best price viagra cialis free sample find viagra on internet cialis generic buy sildenafil in canada order cialis no prescription required cheapest viagra online purchase cialis no rx viagra in us order discount cialis cheap viagra internet free viagra cialis approved best price for cialis cialis from india find no rx viagra generic viagra viagra from canada viagra online pharmacy buy viagra from canada cheapest generic viagra online buy cheapest cialis discount cialis viagra overnight delivery cialis without prescription 100mg viagra cialis in australia price of viagra order cialis overnight delivery cheap viagra in uk buying generic cialis viagra pill buy cialis on line low cost cialis find discount viagra online buying viagra cheap cialis overnight delivery pharmacy cialis cheap viagra pill viagra prescription find viagra online buy cialis lowest price discount viagra no rx online cialis viagra free sample cheap viagra in usa find viagra cheap viagra online buy viagra no rx generic viagra cheap buy cialis without prescription buy viagra in us cheap viagra overnight delivery cheap cialis in usa cheap cialis online viagra order no rx viagra viagra soft tab find cialis online lowest price viagra cialis drug cialis vendors viagra online stores erectile dysfunction order viagra in canada buy viagra on line viagra overnight shipping viagra online cheap lowest price for cialis approved viagra pharmacy cialis 10 mg cialis no online prescription cialis purchase cialis from canada order cialis without prescription viagra for sale viagra in australia approved cialis pharmacy buy viagra generic buy sildenafil in spain find viagra no prescription required cialis no prescription buy viagra from us order viagra no prescription required cost viagra purchase viagra without prescription buy cialis no rx cialis cheap cialis internet tablet viagra cheap viagra on internet viagra cost pharmacy viagra cialis soft tab cialis information buy cheap cialis internet purchase cialis overnight delivery cheap cialis without prescription buy viagra no prescription required compare cialis prices buy cheap cialis online overnight cialis where to buy cialis cheap cialis buy cheap viagra internet buy discount cialis viagra buy drug cheap viagra no prescription buy sildenafil citrate buying viagra online buy discount viagra fda approved viagra cialis online stores cheap cialis tablets buy cheapest cialis online cheap viagra tablets order discount viagra sale viagra viagra online cialis for sale cialis soft viagra pharmacy buy cialis from us viagra without a prescription viagra in bangkokWhat’s going on in the developer world?

Sunday, March 5th, 2006 at 7:26 pm

As2ant 1.5: Specify Swfmill XML within Task

You can now specify the swfmill xml directly in the task. The advantages are that you have only one file to maintain (build.xml) and that you can use ant properties within the swfmill xml.

  1. <swf src="${src.dir}/com/simonwacker/ant/Sample.as" dest="${build.dir}/sample.swf">
  2.   <xml>
  3.     <![CDATA[
  4.       <movie width="300" height="100" framerate="31">
  5.         <background color=’#FF8A00′/>
  6.         <frame>
  7.           <library>
  8.             <clip id="simonwacker" import="${res}/simonwacker.jpg"/>
  9.             <font id="pixel" import="${res}/pixel.ttf"/>
  10.           </library>
  11.         </frame>
  12.       </movie>
  13.     ]]>
  14.   </xml>
  15. </swf>

Further enhancements are:

[+] org.as2lib.ant.Mtasc
Added special XML support for As2lib Bean Factory and Context.

[+] org.as2lib.ant.Swfmill / org.as2lib.ant.Swf
Added support for specifying the swfmill xml directly in the tasks.

[+] org.as2lib.ant.Swf
Added support for overriding font family names.

[+] org.as2lib.ant.Swfmill / org.as2lib.ant.Swf
Added support for extra verbose debugging output.

Download As2ant 1.5 from sourceforge.net
Download As2ant 1.5 from simonwacker.com

I hope you enjoy the new features!

23 Responses to “As2ant 1.5: Specify Swfmill XML within Task”

  1. Steve Webster

    Great work Simon. One question: is it necessary to wrap the swfmill XML in a CDATA tag as in your example above?

  2. Simon Wacker

    Hi Steve,

    wrapping the swfmill XML in a CDATA tag is sadly necessary, because the XML gets added to the task as String and we have to mark the XML data so that it is not interpreted.
    I may make a object-oriented representation of the simple swfmill XML format and construct the XML to pass to swfmill via this representation. But this is not worth the effort, and would demand an update if the swfmill XML format changes.

    Cheers,
    Simon

  3. Steve Webster

    Simon: I don’t know how Ant works (and I’ve never tried processing XML in Java) but could you not just define an object to handle the top-level movie element and use it to store the XML as a string?

  4. Simon Wacker

    Hi Steve,

    Ant works pretty simple. Every element- or attribute-name is interpreted as a create-, set- or add-method on the task, or on the object created by another nested element. This means that if you declare in the task, the createMovie method will be invoked. If there is a element inside the element, then the createBackground method will be invoked on the returned movie object and so on.
    I don’t think that this fundamental behaviour of Ant passing the build.xml can be changed. But I’ll try to talk to some Ant gurus to find a solution.
    Nevertheless, I’m curious to know why you don’t like the CDATA. Is it just because of the inconvenience of using it? ;)
    Greetings,
    Simon

  5. Sascha/FGPW

    Hi, wanna try as2ant but I don’t know where to copy the as2ant.jar file to have the tasks available in Eclipse (haven’t found any info on how to install as2ant anywhere which makes it a bit of a riddle for Ant non-pro’s).

  6. Simon Wacker

    Hi Sascha,

    as2ant does not need any installation. You just have to point to either the folder were the compiled sources reside on or to the jar in the taskdef in your build.xml file (the samples show the former usage).

    <taskdef name=”swf” classname=”org.as2lib.ant.Swf” classpath=”theRelativeOrAbsolutePathToTheJar.jar”/>

    You can then use the task like any other task.

    If you do not wanna make the taskdef in every build.xml the Eclipse Ant plugin offers the functionality to specify your own global tasks.
    Got to Window / Preferences / Ant / Runtime. Add an external jar in the Classpath tab. The open the Tasks tab and add the tasks you need: Specify a name, select the jar you added previously and select the task class file (Mtasc.class, Swf.class, …).
    You can then use the task without making a taskdef in the build.xml. (this is of course not as2ant specific, and is also explained in the eclipse ant plugin docu)

    I hope the above explanations help you to get the ant tasks to work.

    I’ll add explanations of how to set up everything with and without eclipse in the next release.

    Greetings,
    Simon

  7. Sascha/FGPW

    Thanks Simon! Got it working so far, just one thing is not clear … how do I tell where to find the tool executables (mtasc, swfmill)? Or would I have to define properties for them in the build file like I normally did before with my ‘own’ build files?

  8. Simon Wacker

    Hi Sascha,

    if you work with Windows you can add the folder where mtasc.exe and swfmill.exe reside in to the PATH environment variable (there is something similar in Linux).
    You can also set the paths to the *.exe files directly in the task.

    <swf … mtasc=”tool/mtasc.exe” swfmill=”tool/swfmill.exe”/>

    Greetings,
    Simon

  9. Sascha/FGPW

    Hi Simon,
    yes I’ve added the tools to the path (on windows btw) but I’m getting this error when trying to build…

    BUILD FAILED
    E:\Projects\Eclipse\as2ant\samples\mtasc\build.xml:19: Error running mtasc compiler.

    Any idea what could be the problem?

  10. Simon Wacker

    Hi Sascha,

    this error is thrown when trying to execute the mtasc.exe results in an IOException. As far as I know this is only the case when mtasc.exe could not be found.
    Try to specify the path to the mtasc.exe directly. If this does work, there must be some problem with your PATH environment variable, if not open Mtasc.java, go to line 1384 and add “e.printStackTrace()”, then compile the class (you can use the given build.xml to do so), run your build.xml again and show me what exact error occurs.

    Greetings,
    Simon

  11. Sascha/FGPW

    Thanks alot Simon,
    but somehow I’m still doing something wrong. I’ve added the as2ant tasks in Eclipse under Ant/RunTime but if I want to use the tasks in a buildfile and paste the typedef into it, it tells me an error (or rather a warning), taskdef class org.as2lib.ant cannot be found! Any idea why this happens?

  12. Sascha/FGPW

    PS: If I remove the classpath from the typedef, it doesn’t show a warning anymore. They are optional. Are the classpathes relevant?

  13. Simon Wacker

    Hi Sascha.

    If you add the classpath in Preferences/Ant/Runtime/Classpath you do not have to specify a classpath in your taskdef. If you Also added the task under Preferences/Ant/Runtime/Tasks you do not even have to make a taskdef in the build.xml.
    If you do neither of the above you must specify a taskdef in your build.xml with classname and classpath.
    If taskdef gives you a warning that there is no class with name org.as2lib.ant, you should specify a class name and not a package name. org.as2lib.ant is the package while org.as2lib.ant.Mtasc or .Swf or .Swfmill is the task you want to define.
    If you still get a warning then your classpath must be wrong; it must point to the jar or to the src directory of the as2ant distribution.
    If it still does not work, post the build.xml you use, please.

    Greetings,
    Simon

  14. Sascha/FGPW

    Thanks Simon! Got all working fine now! Thanks for the time and explanations! :)

  15. Sascha/FGPW

    Hi, me again |-)

    the as2ant tasks are quite nice now that true/false properties can be used directly in the arguments! However I found one small odd thing that happens with the mtasc task that I didn’t had before …

    I’m using two mtasc targets, one for a debug version that uses the arguments -pack to force inclusion of the debug class I’m using and -trace to load to my custom trace method. These are used with MTASC’s custom trace functionality.
    The other target for release doesn’t have these two arguments to filter out all occuring traces in the source code.
    My custom trace function supports more than one argument and it seems that the as2ant mtasc task doesn’t like this. If I have a trace in my sources that has more than one argument, mtasc complains and build fails. This somehow compromises the idea behind using MTASC’s custom trace to use a debug and a release target since I have to comment all these trace out manually.

    I was wondering if there is a workaround or if it could be changed in a future as2ant to support multiple trace arguments?

    Either way thanks for the great tool!

  16. Simon Wacker

    Hi Sascha,

    as2ant has nothing to do with the compilation of your classes (this is what Mtasc does), so this behaviour is not caused by the task (at least not directly). The task just acts as delegate for conveniently combining Ant and Mtasc.
    Is there any difference between the mtasc command you normally use and the one produced by the task? Or does Mtasc normally produce a warning if you use more than one paramter for trace?

    Greetings,
    Simon

  17. dougi

    hi,
    is there any way to add undefault arguments to mtasc call like those used in hamtasc. A generic arg parameter would be perfect.

    Thanks. very usefull tasks.

  18. Simon Wacker

    Hi Dougi,

    yes there is: <argument name=”-myargument” value=”myvalue”/>
    If it is a flag, just don’t specify a value.

    Greetings,
    Simon

  19. dougi

    sorry for my previous post, it’s already implemented.

  20. Ian Thomas

    Hi Simon,

    Firstly, congrats on as2ant - great stuff. Just got going for the first time on Swfmill, Ant and MTASC and it’s working out really well.

    Just a quick possible bug-report - when using the xsl option on the swfmill task, for example:

    The command line generated misses out the name of the xsl file - e.g. produces this:

    swfmill xslt test.xml test.swf

    rather than this:

    swfmill xslt test.xsl test.xml test.swf

    Which obviously means that swfmill chokes on it. :-)
    HTH,
    Ian

  21. Ian Thomas

    *sigh* Obviously that ate my example XML - let’s try again…

    Just a quick possible bug-report - when using the xsl option on the swfmill task, for example:

    <swfmill xsl=”config.xsl” src=”test.xml” dest=”test.swf”/>

    The command line generated misses out the name of the xsl file - e.g. produces this:

    swfmill xslt test.xml test.swf

    rather than this:

    swfmill xslt test.xsl test.xml test.swf

  22. Simon Wacker

    Hi Ian,

    thanks for the report, I’ll fix it. (I should have written Unit Tests; sorry for the inconvenience)

    Next release on Saturday next week.

    Greetings,
    Simon

  23. Ian Thomas

    Hi Simon,
    No problems - and no hurry. I can always get around it using an <exec> - I just prefer as2ant. :-)
    Cheers,
    Ian