Adobe Flex 3 Help

Compiling an AIR component or library with the acompc compiler

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:

  • You must specify which classes within the code base to include in the library or component.
  • acompc does not look for a local configuration file automatically. To use a project configuration file, you must use the -load-config option.

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.

Contents

Component compiler configuration 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.)

acompc examples

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