Search code examples
actionscript-3flashantflash-builderswc

Building a swc in command line or ant


First off - I'm not super familiar with Flash Builder or ActionScript. I have an ActionScript project in Flash Builder. I know I can generate a swc file by doing Project > Build, and it will build a swc file from my ActionScript source code.

Is there a way to generate the swc in command line or ant? I'd like to be able to put this build process inside a build script so I don't need to go through Flash Builder to build the swc file everytime.

Thanks!


Solution

  • Yes, see compc.

    compc -source-path . -include-classes MyComponent -output MyComponent.swc
    

    MyComponent.as (source file for MyComponent) is in the current directory, which is why -source-path is set to ..

    If you have many classes for your library, you can use a manifest file with a namespace.

    See:

    http://livedocs.adobe.com/flex/3/html/help.html?content=compilers_22.html

    There's also the compc ant task.