Skip to content

Royale JS SWC directory structure

Josh Tynjala edited this page Mar 12, 2025 · 2 revisions

SWC libraries created with the Royale compiler are ZIP files with the .swc file extension. Certain files contained inside SWCs are required to exist, or the SWC file will be considered invalid. Some files and directories are considered to be optional, such as those intended for JavaScript only.

  • library.swf contains the ActionScript 3 bytecode generated by the compiler. This file is always required.

    Even when generating a SWC targeting JavaScript, this bytecode is used by the compiler and other tools for important tasks like type-checking. For instance, IDEs and text editors may use this bytecode to provide code intelligence about symbols like classes, interfaces, methods, and fields.

  • catalog.xml provides information about the contents of a SWC file. It includes the classes and other symbols compiled as bytecode in library.swf and all additional files included in the SWC, including all .js files.

  • js/ is the top-level directory for all content targeting JavaScript. This file required for SWCs that target JavaScript only.

    • js/out/ contains the .js files generated by the compiler as goog.provide() modules.

    • js/scripts/ contains .js files included with the -js-include-script compiler option.

      When a SWC with content in js/scripts is added to the library path of an application project, the compiler copies these files to the output directory and adds an appropriate <script> tag to the generated HTML.

    • js/css/ contains .css files included with the -js-include-css compiler option.

      When a SWC with content in js/css is added to the library path of an application project, the compiler copies these files to the output directory and adds an appropriate <link> tag to the generated HTML.

    • js/assets/ contains asset files included with the -js-include-asset compiler option.

      When a SWC with content in js/assets/ is added to the library path of an application project, the compiler copies these files to the output directory. These files may be loaded at run-time, or they may referenced by included scripts or CSS files.

Note: Some SWC files may contain additional files not listed above. For instance, the compiler provides an include-file option that allows additional files of any type to be distributed inside a SWC file.

Home

Developer Pages

RELEASE_NOTES Updates

Clone this wiki locally