How to create a runtime-shared library artifact


Runtime-shared libraries are intended to reduce the size of your Flex applications. RSLs contain ActionScript bytecode which is shared amongst applications (and placed into the cache by the Adobe Flash Player runtime or the browser). Using an RSL is actually ask the compiler not to embed the library into the target application but load it at runtime. At compile-time, the linkage is done using a SWC artifact and providing one or more URL where the application will be able to find the corresponding bytecode.

When using the standard linkage to compile an application , both the application and libraries bytecodes are embedded into the final SWF artifact.

Standard SWC linkage

When using the "RSL linkage" to compile an application , only the application bytecode is embedded into the final SWF artifact. The RSL need to be deployed to a server so the application can retrieve it.

RSL linkage

Creating a RSL

To extract the bytecode from the SWC file you are compiling, set the makeRSL property of the configuration section to true .





The package goal will create an additional artifact named ${artifactId}-rsl-${version}-${classifier}.swf . When using install and deploy goals, not only the SWC artifact will be concerned: the RSL will also be installed or deployed to the repositories.

Creating a SHA-256 digest