View unanswered posts | View active topics



Reply to topic  [ 218 posts ]  Go to page 1, 2, 3, 4, 5 ... 15  Next
Build SWC from FD! "ExportSWC" plugin [beta] 
Author Message
Member

Joined: Wed Mar 19, 2008 10:15 pm
Posts: 36
Location: Sydney, Australia
Hi, i've just finished a beta of a FD plugin which uses compc.exe to generate a SWC file.
This means we can now compile SWC ActionScript libraries from FlashDevelop! :D
This is something i've needed to do for a while, and one reason I kept having to use FlexBuilder.
Also, if you have not heard, someone has also recently developed debugging support for FD! FlexBuilder is starting to get very nervous.:wink:

http://sourceforge.net/projects/exportswc

Internal details
    * Uses all available project compiler options (available from project options>compiler options tab). This includes libraries, RSL's, and compiler settings used to generate existing SWF builds.
    * Currently only based on AS3Project (would like to beta test this first before adding AS2 support)
    * Creates obj\projectnameConfig.swc.xml config file to pass to compc.exe. You can examine this file after a build for debugging purposes.
    * Any other config file specified in projects compiler options (Load Config) is appended to compc.exe command line args along with builds config file (ie. supports additional -load-config argument).
    * Any other additional compiler arguments specified in projects compiler options are added to compc.exe command line arguments.
    * Process results traced to Output Panel.
    * No settings as of yet since all existing compiler options and sdk location details are used.
Installation
Install the dll into the plugins folder of your FD Application Files, and you'll see an extra toolstrip button added to the UI. The button is red with a small grey gear inside (tooltip = "Export SWC"). Load an AS3 project, make sure your project builds normally to ensure all class paths and library paths are defined, then launch the button. The Output Panel should dump info and a SWC file should appear in your bin folder. Explore the SWC file to ensure all relevant classes were compiled in.

Adding Existing SWC's to project
Best practice for adding/linking existing external SWC libraries to your project is to create a 'lib' folder in the project root, copy the swc file(s) there and right-click in FD project tree and select "Add To Library".

Note to FD Team
I suggest to the FD team that the trunk project templates be updated to include a 'lib' folder in the project root by default. This would encourage the "bundling" of required libraries as local project resources, and encourage the usage of the UI method of adding libraries rather than manually with the compiler options.

This plugin is a fresh beta so please test against existing AS3 flex sdk-based projects and report any issues so that the plugin can be made as stable and useful as possible for FD.

cheers - Ali.


Last edited by dragonworx on Fri Jul 02, 2010 10:50 pm, edited 4 times in total.



Sun May 04, 2008 9:23 am
Profile
Admin

Joined: Wed Aug 31, 2005 7:27 am
Posts: 11563
Location: Paris, France
Post 
This is very cool :)

Make sure you give your plugin a new unique GUID (in pluginmain).

PS: added the 'lib' folders in templates ;)

Beware: i just changed the settings classes ('Additional' is now an array) so your plugin is atm compatible with beta6/7 but not the latest SVN.


Sun May 04, 2008 12:23 pm
Profile WWW
Admin

Joined: Wed Aug 31, 2005 7:27 am
Posts: 11563
Location: Paris, France
Post 
About AS2 SWCs: they are a very different beast, I think it isn't worth trying to generate them.


Sun May 04, 2008 12:32 pm
Profile WWW
Member

Joined: Wed Mar 19, 2008 10:15 pm
Posts: 36
Location: Sydney, Australia
Post 
cheers Philippe, thanks for your help along the way too.

Quote:
Make sure you give your plugin a new unique GUID (in pluginmain).


It has one. I went to http://www.somacon.com/p113.php and created one, which went into PluginMain.

Quote:
About AS2 SWCs: they are a very different beast, I think it isn't worth trying to generate them.


Suits me! AS2 is soooo yesterday...:wink:

Quote:
Beware: i just changed the settings classes ('Additional' is now an array) so your plugin is atm compatible with beta6/7 but not the latest SVN.


No worries. Can you send me the trunk path and I can update a version for the latest?


Sun May 04, 2008 1:07 pm
Profile
Admin

Joined: Wed Aug 31, 2005 7:27 am
Posts: 11563
Location: Paris, France
Post 
dragonworx wrote:
No worries. Can you send me the trunk path and I can update a version for the latest?

I didn't change your plugin code.

I just mean "do not update from the SVN" if you want to keep a beta7-compatible plugin.
If you update the source you'll have to update your plugin and it won't be compatible with public releases anymore.


Sun May 04, 2008 1:20 pm
Profile WWW
Member

Joined: Sat Feb 23, 2008 10:01 am
Posts: 8
Post 
Thanks for this great plugin!

I put together a tutorial on how to create a simple SWC component in FlashDevelop. Read it here.


Wed May 07, 2008 12:32 pm
Profile
Member

Joined: Wed Mar 19, 2008 10:15 pm
Posts: 36
Location: Sydney, Australia
Post 
Hey thanks, awesome tutorial! :D


Mon May 12, 2008 1:20 am
Profile
Member

Joined: Mon Oct 16, 2006 12:02 am
Posts: 336
Location: Lviv, Ukraine
Post 
What about plugin version compatible with last SVN version of FD? :-)


Mon May 12, 2008 9:27 am
Profile WWW
Member

Joined: Wed Mar 19, 2008 10:15 pm
Posts: 36
Location: Sydney, Australia
Post 
Won't be long, just need to download the latest trunk and make a simple change. Will post back here soon...


Tue May 13, 2008 12:47 am
Profile
Member

Joined: Wed Jun 04, 2008 9:29 pm
Posts: 15
Post 
Just to let everyone know, dragonworx and myself are working on some new features for the SWC plugin; one of which is CS3 component export.

I'm also trying to get my head around the new MXP format, it isn't just a zip anymore - but I can tell so far, it does have semi-zlib headers and does decompress suitably.

If anyone has the time to get deeper into MXP - you might like to know;

Code:
// MXP (1.8) FORMAT
offset 0x00    byte 0x03
offset 0x01    byte 0x00 * 3
offset 0x04    byte 0x01
offset 0x05    byte 0x00 * 3
offset 0x08    byte 0xnn (filename length, probably works 4 bytes backwards 0x05..0x08 - although there is apparently a 30 ASCII character limit)
offset 0x09    filename ASCII terminated by 0xD3 or 0xD4 or 0xD6 (can't work out why yet, it isn't Adler32 or any CRC, because immediately following is the files date stamp)

// datestamp
offset 0x00    byte year (eg, 0x08 // 2008)
offset 0x01    byte month (eg, 0x06 // June)
offset 0x02    byte 0x00 (no idea, 256+ day months anyone?)
offset 0x03    byte date (eg, 0x06 // 6th)
offset 0x04    byte 0x00
offset 0x05    byte hour (eg, 0x0E // 14 or 2PM)
offset 0x06    byte 0x00
offset 0x07    byte minutes (eg, 0x02 // 14:02)
offset 0x08    byte 0x00
offset 0x09    byte seconds (eg, 0x1A // 14:02:26)
offset 0x0A    byte * 17 (NO IDEA YET?)
offset 0x1B    zlib? stream marker (0x78 0x9C)


That's as far as I got so far - the preamble isn't the same for each filename either. Any feedback would be great - I don't know much about compression formats so something might jump out at someone that I missed... forgive my naivety.

Thanks everyone!

Ben


Sun Jun 08, 2008 3:46 am
Profile
Member

Joined: Mon Jun 16, 2008 10:12 pm
Posts: 8
Post 
Hello there,

I can't get the icon in the toolbar :(.
I'm working on FD3.0 beta 7. Just copied the .dll file in the plugin folder and restarted FD.
But actually it seems I have a general problem with new plug-ins (I tried the debug plugin but it seems that nothing happens to my FD... :? )

Any one has an idea ?
I have .net 2 SP1 and .net 3 installed on my machine (windows XP).

Thanks.

_________________
http://afoucal.free.fr


Mon Jun 16, 2008 10:26 pm
Profile
Member

Joined: Wed Jun 04, 2008 9:29 pm
Posts: 15
Post 
Update:

http://curlyben.com/fd3/ExportSWCPlugins.zip

Extract the 2 DLL files to your plugin folder.

I used FD3 SVN build!

You will notice FD already has SharpZipLIb in the programs folder - do not replace it with this version, just keep this one in /plugins and leave the original The version already with FD doesn't support zip files pre-zip64 so it can't repack SWC.

This version is probably more alpha to the beta Ali released :-) - but still, it is mostly functional.

It adds two menu items to the project file manager context menu ( ignore from flex and ignore from flash )

New features include MXI creation and CS3 visible SWC.

Error checking/validation logic isn't up to scratch yet and TraceManager feedback leaves a lot to be desired.


Mon Jun 16, 2008 10:59 pm
Profile
Member

Joined: Wed Mar 19, 2008 10:15 pm
Posts: 36
Location: Sydney, Australia
Post 
Great work Ben! I will download and try your plugin soon. Having a Flash CS3 visible SWC is so valuable. Thank you!

Arnaud, did you have any previous versions of FD installed before installing beta 7? I had a plugin problem between versions once, I would get a series of error notifications upon startup. Is this what you are getting? I had to find the application files and delete them, then uninstall the older FD. It was some of the left over FD application files from the previous version that were messing with the new one. You can find the application files by going to the "Tools" menu and selecting "Application Files...". This ensures you have removed everything as well as uninstalling the older version.

Hope that fixes it for you.


Tue Jun 17, 2008 2:03 am
Profile
Member

Joined: Wed Jun 04, 2008 9:29 pm
Posts: 15
Post 
Hey Ali!

The source needs tidying up quite a bit. I'll try and get a version back to you soon. There is one particular routine that re-colours the labels in the project file view that needs a patch applying to the main FD trunk. As it is now it works perfectly, but it is a little unorthodox.

It generates intrinsics for the class path too, I don't know if people want or need that - I'm hoping there is a way to get them to load into CS3 code completion. I don't know how any of that works yet though.

When I used the code you sent me, there was an error in when I ran against the SVN build where one of the compiler variables was loaded as String, but the SVN was String[]... I can't remember exactly which one - but that would cause a problem if running the old version on the SVN build.

EDIT: All suggestions and critique welcome. :-)


Tue Jun 17, 2008 2:31 am
Profile
Admin

Joined: Wed Aug 31, 2005 7:27 am
Posts: 11563
Location: Paris, France
Post 
ourben wrote:
The version already with FD doesn't support zip files pre-zip64 so it can't repack SWC.

If this Zip DLL improves on (and is compatible with) current FD version then we could update it.


Tue Jun 17, 2008 7:37 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 218 posts ]  Go to page 1, 2, 3, 4, 5 ... 15  Next

Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.