Use the component compiler, acompc, to compile AIR libraries and independent components. The acompc component compiler behaves like the amxmlc compiler, with the following exceptions:
The acompc command invokes the standard Flex compc component compiler, but loads its configuration options from the air-config.xml file instead of the flex-config.xml file.
Use a local configuration file to avoid typing (and perhaps mistyping) the source path and class names on the command line. Add the -load-config option to the acompc command line to load the local configuration file.
The following example illustrates a configuration for building a library with two classes, ParticleManager and Particle, both in the package: com.adobe.samples.particles. The class files are located in the source/com/adobe/samples/particles folder.
<flex-config>
<compiler>
<source-path>
<path-element>source</path-element>
</source-path>
</compiler>
<include-classes>
<class>com.adobe.samples.particles.ParticleManager</class>
<class>com.adobe.samples.particles.Particle</class>
</include-classes>
</flex-config>
To compile the library using the configuration file, named ParticleLib-config.xml, type:
acompc -load-config ParticleLib-config.xml -output ParticleLib.swc
To run the same command entirely on the command line, type:
acompc -source-path source -include-classes com.adobe.samples.particles.Particle com.adobe.samples.particles.ParticleManager -output ParticleLib.swc
(Type the entire command on one line, or use the line continuation character for your command shell.)
These examples assume that you are using a configuration file named myLib-config.xml.
Compile an AIR component or library:
acompc -load-config myLib-config.xml -output lib/myLib.swc
Compile a runtime-shared library:
acompc -load-config myLib-config.xml -directory -output lib
(Note, the folder lib must exist and be empty before running the command.)
Reference a runtime-shared library:
acompc -load-config myLib-config.xml -output lib/myLib.swc