Menu

AS2LIB ant tasks "pack" option ?

2006-01-03
2013-04-17
  • Grant Davies

    Grant Davies - 2006-01-03

    Is the pack option available in the as2lib mtasc task?  I use it a lot for dynamic class loading, in my code I load classes that I may not have directly referenced in the code and the -pack option of mtasc forces the classes into the swf file.

    e.g -pack com/mycompany/myclasses

    would put all classes in the "myclasses" folder into the swf.  Right now I may have to go back to the exec useage of mtasc from ant which sucks as I really like the ant tasks you guys have created.

     
    • Simon Wacker

      Simon Wacker - 2006-01-04

      Hi Grant,

      the pack option is supported. If you have one "pack" you can specify the "package" attribute, if you need more than one "pack" you can specify "package" child nodes with "path" attributes. (as you do for classpaths)

      Greetings,
      Simon

       
    • Jos

      Jos - 2006-02-13

      Hurm. I tried to do this but i think i have the syntax incorrect. Here is how i've done it::

      <mtasc swf="build/classes.swf" header="1:1:30" classpath="${root.cp};src" trace="com.thirdplacegames.logging.Logger.log">
      ..<package path="com/thirdplacegames/games/butterflywings/view" />
      </mtasc>

      This generates an error. Is the 'package' attribute stuff in CVS or part of the beta release?

       
    • Jos

      Jos - 2006-02-13

      Ok, i've downloaded the CVS version of AS2ANT. However, the org.as2lib.ant directory only has .java files in it - it is missing, i assume, the .class files.

      How do i go about generating/getting these new files?

      Is it time for a new release of as2ant with the updated files? ;)

       
    • Simon Wacker

      Simon Wacker - 2006-02-13

      Hi Jos,

      the beta already has support for declaring package-elements. Doing something like: '<package path="myTest"/>' as you did in you example should work.

      The class-files are commited (I just checked this); they are in the src folder, together with the java-files. The compiled classes are also in the dist/as2ant.jar file.

      Yeah, it is about time to make a new release. I'll maybe make one this weekend.

      Greetings,
      Simon

       
    • Jos

      Jos - 2006-02-13

      Gaa - should have checked the src folder, thanks.

      I'll check tonight to see if i can get the <package> node to work properly.

      Thanks!

       
    • Jos

      Jos - 2006-02-14

      Ok, well, it "works", but not how i think it should. On the MTASC site, the doc's state that you should only include the _releative_ part of the path to the files you want to pack, and MTASC uses the classpath to find the files.

      As you have it now, it passes the full directory to the -path arg, which isn't what i want.

       
    • Simon Wacker

      Simon Wacker - 2006-02-14

      Hi Jos,

      I forgot to fix this for packages (I fixed it for classes in the beta release). I'll fix this.

      Sorry for the inconvenience!

      btw. there is a new sub-node you can add: 'argument'. It takes a 'name' and an optional 'value' attribute. You can use it for custom arguments as you need for Hacked MTASC.
      You may also use it to add a 'path' argument (if you do not wanna wait until I fixed it):
      <argument name="path" value="theRelativePath"/>

      Cheers,
      Simon

       
    • Jos

      Jos - 2006-02-14

      Excellent - i will check this out tonight or tomorrow.

      Thanks for all your work on these tools - they make flash dev much more enjoyable!

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.