Build SWCs with ASDoc for Flash Builder 4

You might already know that ASDoc support was added in Flash Builder 4. We show ASDoc content in code hints, hovers and in the new ASDoc view. We have built-in support for showing ASDoc content from:
  • Flex 4 SDK
  • playerglobal.swc and airglobal.swc
  • Referenced library projects in the current workspace
  • ASDoc content in your current project
However, what we don’t provide is a way to distribute SWCs that bundle ASDoc content without distributing your source code.
Gaurav wrote a great blog post going into detail on how the SDK uses Ant to include ASDoc using framework.swc as an example. You should be aware that te SDK bundles ASDoc a little differently in order to create local-specific resource bundles that contain local-specific ASDoc content. What that means for our users is that ASDoc content in Flash Builder is localized.
For most library developers that don’t require localizing their documentation, the process is a lot easier.

I’ve put together an example library project that you can download that contains a simple Ant script you can use for your own projects. Instead of creating a separate resource bundle, this script essentially runs the ASDoc tool, unzips your SWC, then bundles the ASDoc DITA files into the SWC.

Download: ExampleFatSWC.zip

In Flash Builder:
  1. File > Import, Flash Builder > Flash Builder Project
  2. Browse to the ZIP file
  3. Finish
  4. Right click on the build.xml file and choose Run As > Ant Build
  5. The “fat” SWC is in your /bin folder ready to be shared
When your users add the SWC to their project library path, they’ll see ASDoc content without any extra work.
Remember, to run Ant within Flash Builder, you’ll need to download the Eclipse Java Development Tools from the appropriate update site. For Eclipse 3.5 or Flash Builder Standalone users, use http://download.eclipse.org/releases/galileo and look for “Eclispe Java Development Tools”.
Share on Facebook